Skip to content

Commit 363d681

Browse files
committed
Add missing documentation for CLI update
1 parent 513e7d6 commit 363d681

File tree

1 file changed

+39
-12
lines changed

1 file changed

+39
-12
lines changed

README.md

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ sudo apt install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
2727

2828
Finally, ROS is required. ROS 1 and ROS 2 are both supported. For ROS1, install Noetic as per [these installation instructions](https://wiki.ros.org/noetic/Installation/Ubuntu). For ROS2, we recommend using Kilted as the latest release ([installation instructions](https://docs.ros.org/en/kilted/Installation/Ubuntu-Install-Debs.html)), but earlier distros should also work.
2929

30-
In addition to base ROS, a websocket bridge server is required:
30+
In addition to base ROS, a websocket bridge server is required for ROS 2 only:
3131

3232
```bash
3333
sudo apt install ros-$ROS_DISTRO-rosbridge-suite
@@ -44,24 +44,52 @@ cargo build
4444
cargo build --release
4545
```
4646

47-
The agent relies on rosbridge to relay ROS traffic. Run rosbridge as follows:
47+
## Running the Agent
48+
49+
### Dependencies
50+
51+
The agent for ROS 2 relies on rosbridge to relay ROS traffic. Run rosbridge as follows:
4852

4953
```bash
50-
# ROS 1
51-
roslaunch rosbridge_server rosbridge_websocket.launch
52-
# ROS 2
5354
ros2 launch rosbridge_server rosbridge_websocket_launch.xml
5455
```
5556

57+
### Commands
58+
59+
For all `cargo run` commands, you can add `--release` for release mode (debug mode is default), and use `--` before passing arguments to ensure that all arguments are passed into the agent, rather than the cargo process. For example, use `cargo run --release -- --help` for the help command.
60+
61+
The following commands are available:
62+
63+
```bash
64+
Usage: modulr_agent [OPTIONS] <COMMAND>
65+
66+
Commands:
67+
initial-setup First-time setup. Discovers ROS installation and topics, and initialises token exchange mechanism with Modulr services
68+
start Starts the main agent running
69+
config-path Prints out the default config path for this application
70+
help Print this message or the help of the given subcommand(s)
71+
72+
Options:
73+
-v... Set logging verbosity level. 1 = WARN, 2 = INFO, 3 = DEBUG, 4 = TRACE e.g. `agent run -vvvv config-path` sets the verbosity level to TRACE
74+
-h, --help Print help
75+
-V, --version Print version
76+
```
77+
78+
For first-time setup, use the initial-setup command:
79+
80+
```bash
81+
# Replace ROBOT_ID and SIGNALING_URL with your chosen values
82+
cargo run -- initial-setup --robot-id ROBOT_ID --signaling-url SIGNALING_URL
83+
```
84+
85+
This will perform first-time setup and save required values into a config file. You can override this file path or leave it as the default (`cargo run -- config-path` will get the default file path).
86+
5687
You can then run the agent using the following:
5788

5889
```bash
59-
# For debug mode:
60-
cargo run
61-
# For release mode:
62-
cargo run --release
63-
# To enable logging, set the following to your desired log level:
64-
RUST_LOG=modulr_agent=debug cargo run # --release
90+
cargo run -- start
91+
# To enable logging, use the verbosity flags, e.g. for debug logging:
92+
cargo run -- -vvv start
6593
```
6694

6795
## Running in Simulation
@@ -85,4 +113,3 @@ ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py
85113
The robot should then be driveable using the agent.
86114

87115
*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.*
88-

0 commit comments

Comments
 (0)