You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# If already cloned and you need to checkout the submodules:
12
13
git submodule update --init --recursive
13
14
```
14
15
15
16
## Building the Package
16
17
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
+
18
26
19
27
You will also need to install GStreamer:
20
28
@@ -92,10 +100,12 @@ cargo run -- start
92
100
cargo run -- -vvv start
93
101
```
94
102
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.
98
105
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
+
99
109
Python with virtualenv is recommended to run the server. To install dependencies and create certificates on Ubuntu:
100
110
101
111
```bash
@@ -122,22 +132,43 @@ Once the CA has been added, run the signaling server:
122
132
python signaling_server.py
123
133
```
124
134
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:
126
136
127
137
```bash
128
138
python test_signaling_server.py
129
139
```
130
140
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:
132
152
133
153
```bash
134
154
# 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
+
136
161
# 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
138
163
```
139
164
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
141
172
142
173
If not running on a real robot, you can test the system using a Turtlebot simulation. Install the turtlebot simulator using:
The robot should then be driveable using the agent.
189
+
The robot should then be controllable using the agent.
159
190
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