Skip to content

Commit 62f9f19

Browse files
authored
Merge pull request #272 from Sarvesh-Mishra1981/humble-devel_issue_201
Fix dummy client to align with current backend API
2 parents 75868bb + 848ea31 commit 62f9f19

3 files changed

Lines changed: 24 additions & 17 deletions

File tree

docs/creating_new_RAM_launcher.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
This guide outlines the steps involved in creating a new RAM launcher.
44

5-
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`.
5+
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`.
66

7-
To create a new RAM launcher for the `prepare_visualization` transition, follow these steps:
7+
To create a new RAM launcher for the `prepare_tools` transition, follow these steps:
88

99
1. Define the New Visualization Configuration
1010

11-
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`.
11+
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`.
1212

1313
```python
1414
visualization = {

docs/dummy_RAM_client_guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Dummy RAM Client Guide
22

3-
The dummy client can be used for developing and debugging new RAM launchers. It executes the transitions `connect`, `launch_world`, and `prepare_visualization`.
3+
The dummy client can be used for developing and debugging new RAM launchers. It executes the transitions `connect`, `launch_world`, and `prepare_tools`.
44

55
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.
66

7-
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).
7+
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).
88

99
## Using the Dummy Client
1010

test/dummyclient.py

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
import os
44

55
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
6-
from manager.comms.consumer_message import ManagerConsumerMessage
7-
from manager.libs.launch_world_model import ConfigurationModel
6+
from robotics_application_manager.comms.consumer_message import ManagerConsumerMessage
87

98

109
class ConnectCmd(ManagerConsumerMessage):
@@ -15,24 +14,32 @@ class ConnectCmd(ManagerConsumerMessage):
1514
class LaunchWorldCmd(ManagerConsumerMessage):
1615
id: str = "2"
1716
command: str = "launch_world"
18-
data: ConfigurationModel = ConfigurationModel(
19-
world="gazebo",
20-
launch_file_path="/opt/jderobot/Launchers/simple_circuit_followingcam.launch.py",
21-
)
22-
23-
24-
class LaunchPrepareViz(ManagerConsumerMessage):
17+
data: dict = {
18+
"world": {
19+
"type": "gazebo",
20+
"launch_file_path": "/opt/jderobot/Launchers/simple_circuit_followingcam.launch.py",
21+
},
22+
"robot": {
23+
"type": None,
24+
},
25+
}
26+
27+
28+
class LaunchPrepareTools(ManagerConsumerMessage):
2529
id: str = "3"
26-
command: str = "prepare_visualization"
27-
data: str = "gazebo_rae"
30+
command: str = "prepare_tools"
31+
data: dict = {
32+
"tools": ["console", "simulator"],
33+
"config": {},
34+
}
2835

2936

3037
websocket.enableTrace(True)
3138
ws = websocket.create_connection("ws://localhost:7163")
3239

3340
ws.send(ConnectCmd().json())
3441
ws.send(LaunchWorldCmd().json())
35-
ws.send(LaunchPrepareViz().json())
42+
ws.send(LaunchPrepareTools().json())
3643

3744

3845
while True:

0 commit comments

Comments
 (0)