diff --git a/docs/creating_new_RAM_launcher.md b/docs/creating_new_RAM_launcher.md index d759d3b..d996b14 100644 --- a/docs/creating_new_RAM_launcher.md +++ b/docs/creating_new_RAM_launcher.md @@ -2,13 +2,13 @@ This guide outlines the steps involved in creating a new RAM launcher. -For the `launch_world` transition, which transitions the application from the connected state to the world_ready state, the file executed is `launcher_world.py`, and for the `prepare_visualization` transition, the file executed is `launcher_visualization.py`. +For the `launch_world` transition, which transitions the application from the connected state to the world_ready state, the file executed is `launcher_world.py`, and for the `prepare_tools` transition, the file executed is `launcher_tools.py`. -To create a new RAM launcher for the `prepare_visualization` transition, follow these steps: +To create a new RAM launcher for the `prepare_tools` transition, follow these steps: 1. Define the New Visualization Configuration -First, add a new entry to the `visualization` dictionary in `launcher_visualization.py`. Let's call this new entry `custom_visualization` and assume it uses two modules: `abc_module` and `xyz_module`. +First, add a new entry to the `visualization` dictionary in `launcher_tools.py`. Let's call this new entry `custom_visualization` and assume it uses two modules: `abc_module` and `xyz_module`. ```python visualization = { diff --git a/docs/dummy_RAM_client_guide.md b/docs/dummy_RAM_client_guide.md index 9316272..f20d2f4 100644 --- a/docs/dummy_RAM_client_guide.md +++ b/docs/dummy_RAM_client_guide.md @@ -1,10 +1,10 @@ # Dummy RAM Client Guide -The dummy client can be used for developing and debugging new RAM launchers. It executes the transitions `connect`, `launch_world`, and `prepare_visualization`. +The dummy client can be used for developing and debugging new RAM launchers. It executes the transitions `connect`, `launch_world`, and `prepare_tools`. Contributors can test their new launchers by replacing the code in the files executed during these transitions with their own code. This allows for testing to ensure everything functions correctly before creating new launchers. -During the `launch_world` step of the dummy client, the file executed is `simple_circuit_followingcam.launch.py`, and during the `prepare_visualization` transition, it is `launcher_gazebo_view.py`. The exercise simulation can be viewed via a VNC display at [http://127.0.0.1:6080/vnc.html](http://127.0.0.1:6080/vnc.html). +During the `launch_world` step of the dummy client, the file executed is `simple_circuit_followingcam.launch.py`, and during the `prepare_tools` transition, it is `launcher_gazebo_view.py`. The exercise simulation can be viewed via a VNC display at [http://127.0.0.1:6080/vnc.html](http://127.0.0.1:6080/vnc.html). ## Using the Dummy Client diff --git a/test/dummyclient.py b/test/dummyclient.py index 1f58524..274ffce 100755 --- a/test/dummyclient.py +++ b/test/dummyclient.py @@ -3,8 +3,7 @@ import os sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -from manager.comms.consumer_message import ManagerConsumerMessage -from manager.libs.launch_world_model import ConfigurationModel +from robotics_application_manager.comms.consumer_message import ManagerConsumerMessage class ConnectCmd(ManagerConsumerMessage): @@ -15,16 +14,24 @@ class ConnectCmd(ManagerConsumerMessage): class LaunchWorldCmd(ManagerConsumerMessage): id: str = "2" command: str = "launch_world" - data: ConfigurationModel = ConfigurationModel( - world="gazebo", - launch_file_path="/opt/jderobot/Launchers/simple_circuit_followingcam.launch.py", - ) - - -class LaunchPrepareViz(ManagerConsumerMessage): + data: dict = { + "world": { + "type": "gazebo", + "launch_file_path": "/opt/jderobot/Launchers/simple_circuit_followingcam.launch.py", + }, + "robot": { + "type": None, + }, + } + + +class LaunchPrepareTools(ManagerConsumerMessage): id: str = "3" - command: str = "prepare_visualization" - data: str = "gazebo_rae" + command: str = "prepare_tools" + data: dict = { + "tools": ["console", "simulator"], + "config": {}, + } websocket.enableTrace(True) @@ -32,7 +39,7 @@ class LaunchPrepareViz(ManagerConsumerMessage): ws.send(ConnectCmd().json()) ws.send(LaunchWorldCmd().json()) -ws.send(LaunchPrepareViz().json()) +ws.send(LaunchPrepareTools().json()) while True: