From 1e987b5693c416c7f5be0803c401decacf2c25cf Mon Sep 17 00:00:00 2001 From: benjaminwp18 <90342856+benjaminwp18@users.noreply.github.com> Date: Thu, 2 May 2024 16:03:15 -0400 Subject: [PATCH] Add usage instructions --- README.md | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1c4732a..58ee1ff 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ A ROS2 package for bridging between MQTT and ROS networks ## Installation -### Operating System -ROS2 is pretty tightly coupled to Ubuntu versions. `mqtt_ros_bridge` supports ROS2 Iron Irwini and Humble Hawksbill. Pick a [version](https://docs.ros.org/en/rolling/Releases.html) that works with your OS. +### Operating System and ROS2 +ROS2 is pretty tightly coupled to Ubuntu versions. `mqtt_ros_bridge` supports ROS2 Iron Irwini. Use [this guide](https://docs.ros.org/en/iron/Installation.html) to pick an OS and install Iron. ### MQTT Install an MQTT broker like [Mosquitto](https://mosquitto.org/). @@ -30,6 +30,41 @@ you@ubuntu:~ $ service mosquitto status └─5390 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf ``` +### Setting up a Workspace +Create a ROS workspace and clone the repo. + +```bash +mkdir -p workspace/src +cd workspace/src +git clone https://github.com/benjaminwp18/mqtt_ros_bridge.git +``` + +### Running the Bridge +Build and source the package from your workspace (`workspace`, not `workspace/src`). You may see `EasyInstallDeprecationWarning: easy_install command is deprecated`, but that can be ignored as long as the package doesn't say "failed". + +```bash +colcon build --symlink-install +. install/setup.sh +``` + +Now start the demo by running these commands in two separate terminals: +```bash +ros2 launch mqtt_ros_bridge demo_pub_launch.py +``` +```bash +ros2 launch mqtt_ros_bridge demo_sub_launch.py +``` + +Or launch the bridge in your own launch file with: +```python +config = os.path.join( + get_package_share_directory('mqtt_ros_bridge'), + 'config', + 'your_config_file.yaml' +) +``` + + ## TODO - ROS services - ROS actions