Skip to content

Commit ea8129a

Browse files
authored
Revised README
Updated README to clarify installation and usage instructions.
1 parent ee697ed commit ea8129a

File tree

1 file changed

+42
-11
lines changed

1 file changed

+42
-11
lines changed

README.md

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,21 @@ Use the following command to clone the package:
88

99
```bash
1010
git clone --recurse-submodules https://github.com/ModulrCloud/modulr-agent
11+
1112
# If already cloned and you need to checkout the submodules:
1213
git submodule update --init --recursive
1314
```
1415

1516
## Building the Package
1617

17-
This package has only been tested on Ubuntu systems. To build the package, you will need to install Rust: https://rustup.rs/
18+
This package has only been tested on Ubuntu systems.
19+
20+
To build the package, you will need to install Rust: https://rustup.rs/
21+
22+
```bash
23+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
24+
```
25+
1826

1927
You will also need to install GStreamer:
2028

@@ -92,10 +100,12 @@ cargo run -- start
92100
cargo run -- -vvv start
93101
```
94102

95-
## Developer Signaling Server
96-
97-
In addition to running the Robot Teleapp webapp at https://github.com/ModulrCloud/robot-teleop-webapp, the `scripts` folder provides a local signaling server for testing robot connections. Note that this doesn't expose the server to the internet (without further user configuration), so only robots on the same LAN will be able to access it.
103+
## Running Locally (for development)
104+
To control your robot on a LAN, run the Modulr webapp locally following the instructions at https://github.com/ModulrCloud/robot-teleop-webapp.
98105

106+
Additionally, the `modulr-agent/scripts` folder contains a local signaling server script.
107+
Note that this doesn't expose the server to the internet (without further user configuration), so only robots on the same LAN will be able to access it.
108+
99109
Python with virtualenv is recommended to run the server. To install dependencies and create certificates on Ubuntu:
100110

101111
```bash
@@ -122,22 +132,43 @@ Once the CA has been added, run the signaling server:
122132
python signaling_server.py
123133
```
124134

125-
You can test a connection by sourcing the virtual environment in another terminal and running:
135+
From another terminal, confirm that a robot with ID robot1 connects and disconnects:
126136

127137
```bash
128138
python test_signaling_server.py
129139
```
130140

131-
Check the logs of the signaling server to see that a robot with ID robot1 has connected and disconnected. If this is successful, use your local IP address as the signaling server for both your robot and the teleop webapp. The address is `wss://<your ip>:8765`, e.g. `wss://192.168.0.200:8765`. The argument `--allow-skip-cert-check` will also need to be passed to the robot. For example:
141+
Then you can configure both your robot and the webapp to communicate with the local signaling server.
142+
143+
In the webapp, edit `src/config/signaling.ts` and point it to your server address, for example, ws://192.168.0.200:8765. No need to rebuild, just relaunch the webapp.
144+
145+
```bash
146+
if (window.location.hostname === 'localhost') {
147+
return 'ws://192.168.0.200:8765';
148+
}
149+
```
150+
151+
In the robot, generate a local configuration file by passing the robot id and server address, for example:
132152
133153
```bash
134154
# Set the new signaling server URL to a test config
135-
cargo run -- initial-setup --config-override ./test_config.json --robot-id testrobot --signaling-url wss://192.168.0.200:8765
155+
cargo run -- initial-setup --config-override ./local_config.json --robot-id robot1 --signaling-url ws://192.168.0.200:8765
156+
```
157+
158+
Then run the agent with `--allow-skip-cert-check`, for example:
159+
```bash
160+
136161
# Run the agent, skipping the security checks
137-
cargo run -- -vvv start --config-override ./test_config.json --allow-skip-cert-check
162+
cargo run -- -vvv start --config-override ./local_config.json --allow-skip-cert-check
138163
```
139164
140-
## Running in Simulation
165+
*Note 1: In a local deployment, ensure all websocket addresses start with ws://*
166+
167+
*Note 2: At present, ROS topics are hard-coded and the webapp supports movement control and video feedback. Ensure your robot is producing images on `/camera/image_raw` and the wheels are controllable on `/cmd/vel`, or alternatively edit `modulr-agent/ros_bridge` as required*
168+
169+
170+
171+
## Running in simulation
141172
142173
If not running on a real robot, you can test the system using a Turtlebot simulation. Install the turtlebot simulator using:
143174
@@ -155,6 +186,6 @@ roslaunch turtlebot3_gazebo turtlebot3_world.launch
155186
ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py
156187
```
157188
158-
The robot should then be driveable using the agent.
189+
The robot should then be controllable using the agent.
159190
160-
*Note that at present, all topics are hard-coded. You may need to check that the simulation is producing images on `/camera/image_raw` and adjust the source code if not. Similarly, the simulation may use Twist or TwistStamped messages for velocity commands, so if movement is not working, double-check the message type.*
191+
*Note The simulation may use Twist or TwistStamped messages for velocity commands, so if movement is not working, double-check the message type.*

0 commit comments

Comments
 (0)