Skip to content

Commit

Permalink
Merge pull request #18 from small-thinking/send-request-to-receiver
Browse files Browse the repository at this point in the history
Send request to receiver
  • Loading branch information
yxjiang authored Feb 19, 2024
2 parents f5dd189 + 383415e commit 10cd8f6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
2 changes: 2 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ services:
- DISPLAY=novnc:0.0
- ROS_DOMAIN_ID=55
- --privileged=true
ports:
- "5678:5678"
networks:
- x11
stdin_open: true
Expand Down
2 changes: 1 addition & 1 deletion mnlm/client/gpt_control/assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def start_conversation(
nudge_user = True
use_voice_input = True # Set to True to enable voice input. In docker container, it's not possible.
use_voice_output = True # Set to True to enable voice output. In docker container, it's not possible.
use_dummy_robot_arm_server = True # Set to True to use the simulation mode
use_dummy_robot_arm_server = False # Set to True to use the simulation mode
logger = Logger(__name__)
start_conversation(
verbose=verbose,
Expand Down
2 changes: 1 addition & 1 deletion mnlm/client/gpt_control/robot_arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ class RobotArmControlClient(RobotArmControl):
Real control for a robotic arm, sending operations as HTTP requests.
"""

def __init__(self, endpoint_url: str = "http://192.168.0.238:5000/execute"):
def __init__(self, endpoint_url: str = "http://0.0.0.0:5678/robot_command"):
self.endpoint_url = endpoint_url

def _execute_operations(self, operations: List[Dict[str, Any]]) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

def generate_launch_description():
# The node to receive the http request externally for robot control.
# command_receiver_node = Node(
# package="robot_arm",
# executable="command_receiver_node",
# name="command_receiver_node",
# )
command_receiver_node = Node(
package="robot_arm",
executable="command_receiver_node",
name="command_receiver_node",
)
# # WIP. The node to dispatch the received command to topics.
# command_dispatcher_node = Node(
# package="robot_arm",
Expand Down Expand Up @@ -109,6 +109,6 @@ def generate_launch_description():
robot_state_publisher_node,
joint_state_broadcaster_node,
robot_controller_spawner_node,
# command_receiver_node,
command_receiver_node,
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def publish_json_command(self, command):
def create_app(ros_node):
app = Flask(__name__)

@app.route("/command", methods=["POST"])
@app.route("/robot_command", methods=["POST"])
def json_example():
if request.is_json:
content = request.get_json()
Expand All @@ -42,7 +42,7 @@ def main(args=None):

# Running Flask in a separate thread
threading.Thread(
target=lambda: app.run(host="0.0.0.0", port=5000), daemon=True
target=lambda: app.run(host="0.0.0.0", port=5678), daemon=True
).start()

rclpy.spin(ros_node)
Expand Down

0 comments on commit 10cd8f6

Please sign in to comment.