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
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.
29
29
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:
31
31
32
32
```bash
33
33
sudo apt install ros-$ROS_DISTRO-rosbridge-suite
@@ -44,24 +44,52 @@ cargo build
44
44
cargo build --release
45
45
```
46
46
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:
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
+
56
87
You can then run the agent using the following:
57
88
58
89
```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:
The robot should then be driveable using the agent.
86
114
87
115
*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.*
0 commit comments