diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 0000000..84483e8 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,6 @@ +{ + "MD033": false, + "MD013": { + "line_length": 100 + } +} diff --git a/README.md b/README.md index 9e675fd..76c375e 100644 --- a/README.md +++ b/README.md @@ -2,21 +2,26 @@ ## Description -This repository contains useful packages and tools to work with the [vda5050_connector](https://github.com/inorbit-ai/ros_amr_interop/tree/galactic-devel/vda5050_connector) package. These resources provide a starting point to implement your own VDA5050 Adapter. +This repository contains useful packages and tools to work with the [vda5050_connector](https://github.com/inorbit-ai/ros_amr_interop/tree/galactic-devel/vda5050_connector) +package. These resources provide a starting point to implement your own VDA5050 Adapter. ## Examples ### Docker -The **docker** directory contains a build / deployment configuration to easily work and test the vda5050_connector package, your custom adapter and their dependencies. Check its [README](/docker/README.md) for more details. +The **docker** directory contains a build / deployment configuration to easily work and test the +`vda5050_connector` package, your custom adapter and their dependencies. Check its [README](/docker/README.md) +for more details. ### VDA5050 TB3 Adapter -The **vda5050_tb3_adapter** is a ROS2 package with a python implementation of the adapter. Check its [README](/vda5050_tb3_adapter/README.md) for more details. +The **vda5050_tb3_adapter** is a ROS2 package with a python implementation of the adapter. Check its +[README](/vda5050_tb3_adapter/README.md) for more details. ### VDA5050 Template package (C++) -The **vda5050_template_package** is a ROS2 package with a C++ template to implement a custom VDA5050 adapter. Check its [README](/vda5050_template_package/README.md) for more details. +The **vda5050_template_package** is a ROS2 package with a C++ template to implement a custom VDA5050 +adapter. Check its [README](/vda5050_template_package/README.md) for more details. ## Contributing @@ -24,4 +29,4 @@ Please see the [CONTRIBUTING](CONTRIBUTING.md) document. ## License -[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](LICENSE) \ No newline at end of file +[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](LICENSE) diff --git a/docker/README.md b/docker/README.md index 597d29c..f8078b0 100644 --- a/docker/README.md +++ b/docker/README.md @@ -4,12 +4,13 @@ This directory contains two Dockerfiles: - **development**: useful to compile, run and test the connector package with its adapter. -- **simulation**: launches a TB3 Gazebo simulation to test navigation commands and VDA actions using the adapter. +- **simulation**: launches a TB3 Gazebo simulation to test navigation commands and VDA actions + using the adapter. These docker images can be built and run using the **docker-compose** file. The compose allows: - Manipulating the execution of three containers: _development_, _simulation_ and _mosquitto_ (MQTT broker). -- DISPLAY capabilities. +- `DISPLAY` capabilities. - Creating a shared network between the containers. - Mounting the example adapter packages. @@ -27,10 +28,15 @@ To work with it, there are two bash scripts that launch, attach and stop the con ./setup-sim.sh # Run the three containers. ``` -These scripts automatically attach to the _development_ container. To attach another terminal to a given container (`development`, `simulation` or `mosquitto`) use: + **Note**: the simulation logs will be flooded with `discarding message because the queue is full` + messages. This is expected, and they will go away after setting simulated robot initial pose. + +These scripts automatically attach to the _development_ container. To attach another terminal to a +given container (`development`, `simulation` or `mosquitto`) use: ```sh cd deployment && docker compose exec bash ``` -Inside the _development_ container, you can directly compile the ROS2 code (`colcon build`) under the `dev_ws` folder, open tools like `rqt` or even send a message via MQTT. +Inside the _development_ container, you can directly compile the ROS2 code (`colcon build`) under +the `dev_ws` folder, open tools like `rqt` or even send a message via MQTT. diff --git a/docker/deployment/docker-compose.yml b/docker/deployment/docker-compose.yml index b5d7ef1..6230b8e 100644 --- a/docker/deployment/docker-compose.yml +++ b/docker/deployment/docker-compose.yml @@ -8,6 +8,7 @@ services: context: ../build dockerfile: ../build/simulation.Dockerfile user: docker + ipc: host environment: - DISPLAY - QT_X11_NO_MITSHM=1 diff --git a/vda5050_tb3_adapter/README.md b/vda5050_tb3_adapter/README.md index 4403317..dd513d8 100644 --- a/vda5050_tb3_adapter/README.md +++ b/vda5050_tb3_adapter/README.md @@ -1,9 +1,15 @@ # VDA5050 TB3 Adapter -ROS2 package with a Python implementation of the adapter for a [Turtlebot 3](https://github.com/ROBOTIS-GIT/turtlebot3/tree/galactic-devel). It contains the following directories: +ROS2 package with a Python implementation of the adapter for a +[Turtlebot 3](https://github.com/ROBOTIS-GIT/turtlebot3/tree/galactic-devel). +It contains the following directories: -- **config**: provides a _connector_tb3.yaml_ file to configure the MQTT bridge, controller and adapter parameters. -- **launch**: provides two `.launch.py` files, one for running the `tb3_adapter` node alone and the other to run the whole connector (`mqtt_bridge` and `controller` nodes from the `vda5050_connector` package, as well as the `tb3_adapter` node). +- **config**: provides a _connector_tb3.yaml_ file to configure the MQTT bridge, + controller and adapter parameters. +- **launch**: provides two `.launch.py` files, one for running the `tb3_adapter` + node alone and the other to run the whole connector (`mqtt_bridge` and + `controller` nodes from the `vda5050_connector` package, as well as the + `tb3_adapter` node). ## Running the TB3 adapter @@ -17,13 +23,29 @@ To test the TB3 adapter sample, follow these steps: # Build workspace packages colcon build && source install/setup.bash # Set gazebo simulated `tb3` initial pose - ros2 topic pub -1 --qos-reliability reliable /initialpose geometry_msgs/PoseWithCovarianceStamped \ - "{header: {frame_id: map}, pose: {pose: {position: {x: -2.1, y: -0.5, z: 0.0}, orientation: {x: 0.0, y: 0.0, z: 0, w: 1.0000000}}, covariance: [0.25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.06853891945200942]}}" + ros2 topic pub -1 --qos-reliability reliable \ + /initialpose geometry_msgs/PoseWithCovarianceStamped \ + "{ + header: {frame_id: map}, + pose: { + pose: { + position: {x: -2.1, y: -0.5, z: 0.0}, + orientation: {x: 0.0, y: 0.0, z: 0, w: 1.0000000} + }, + covariance: [ + 0.25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.25, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.06853891945200942 + ] + } + }" # Launch the TB3 VDA5050 connector ros2 launch vda5050_tb3_adapter connector_tb3.launch.py ``` -- Attach a new terminal to the _development_ container by running `docker compose exec development bash` inside the `docker/deployment/` folder (see [docker environment](../docker/README.md)). Send any of the following samples. +- Attach a new terminal to the _development_ container by running + `docker compose exec development bash` inside the `docker/deployment/` folder + (see [docker environment](../docker/README.md)). Send any of the following samples.
4 nodes order @@ -134,6 +156,7 @@ To test the TB3 adapter sample, follow these steps: ] }' ``` +
@@ -277,6 +300,7 @@ To test the TB3 adapter sample, follow these steps: ] }' ``` +
@@ -315,4 +339,189 @@ To test the TB3 adapter sample, follow these steps: ] }' ``` + +
+ +
+ 2 nodes order and subsequent stitch order with 2 extra nodes + + ```sh + RANDOM_ORDER_ID=$(cat /proc/sys/kernel/random/uuid) + STITCH_NODE_ACTION_ID=$(cat /proc/sys/kernel/random/uuid) + # Publish initial order + echo "Publishing order $RANDOM_ORDER_ID" + mosquitto_pub -h mosquitto -p 1883 -t uagv/v1/OSRF/TB3_1/order -m ' + { + "orderId": "'$RANDOM_ORDER_ID'", + "orderUpdateId": 0, + "version": "2.0.0", + "manufacturer": "OSRF", + "serialNumber": "TB3_1", + "nodes": [ + { + "nodeId": "node1", + "released": true, + "sequenceId": 0, + "nodePosition": { + "x": 2.0, + "y": 0.95, + "theta": -0.66, + "mapId": "map" + }, + "actions": [] + }, + { + "nodeId": "node2", + "released": true, + "sequenceId": 2, + "nodePosition": { + "x": 1.18, + "y": -1.76, + "theta": 0.0, + "mapId": "map" + }, + "actions": [ + { + "actionType": "beep", + "actionId": "'$(cat /proc/sys/kernel/random/uuid)'", + "actionDescription": "Make a beep noise on node", + "blockingType": "NONE", + "actionParameters": [] + } + ] + }, + { + "nodeId": "node3", + "released": true, + "sequenceId": 4, + "nodePosition": { + "x": -0.38, + "y": 1.89, + "theta": 0.0, + "mapId": "map" + }, + "actions": [ + { + "actionType": "beep", + "actionId": "'$STITCH_NODE_ACTION_ID'", + "actionDescription": "Make a beep noise on node", + "blockingType": "NONE", + "actionParameters": [] + } + ] + } + ], + "edges": [ + { + "edgeId": "edge1", + "released": true, + "sequenceId": 1, + "startNodeId": "node1", + "endNodeId": "node2", + "actions": [] + }, + { + "edgeId": "edge2", + "released": true, + "sequenceId": 3, + "startNodeId": "node2", + "endNodeId": "node3", + "actions": [] + } + ] + }' + # Wait 3 seconds before publishing stitch order + sleep 3 + # Publish stitch order + echo "Publishing stitch order $RANDOM_ORDER_ID" + mosquitto_pub -h mosquitto -p 1883 -t uagv/v1/OSRF/TB3_1/order -m ' + { + "orderId": "'$RANDOM_ORDER_ID'", + "orderUpdateId": 1, + "version": "2.0.0", + "manufacturer": "OSRF", + "serialNumber": "TB3_1", + "nodes": [ + { + "nodeId": "node3", + "released": true, + "sequenceId": 4, + "nodePosition": { + "x": -0.38, + "y": 1.89, + "theta": 0.0, + "mapId": "map" + }, + "actions": [ + { + "actionType": "beep", + "actionId": "'$STITCH_NODE_ACTION_ID'", + "actionDescription": "Make a beep noise on node", + "blockingType": "NONE", + "actionParameters": [] + } + ] + }, + { + "nodeId": "node4", + "released": true, + "sequenceId": 6, + "nodePosition": { + "x": -0.17, + "y": 1.74, + "theta": -2.6, + "mapId": "map" + }, + "actions": [ + { + "actionType": "beep", + "actionId": "'$(cat /proc/sys/kernel/random/uuid)'", + "actionDescription": "Make a beep noise on node", + "blockingType": "NONE", + "actionParameters": [] + } + ] + }, + { + "nodeId": "node1", + "released": true, + "sequenceId": 8, + "nodePosition": { + "x": 2.0, + "y": 0.95, + "theta": -0.66, + "mapId": "map" + }, + "actions": [ + { + "actionType": "beep", + "actionId": "'$(cat /proc/sys/kernel/random/uuid)'", + "actionDescription": "Make a beep noise on node", + "blockingType": "NONE", + "actionParameters": [] + } + ] + } + ], + "edges": [ + { + "edgeId": "edge3", + "released": true, + "sequenceId": 5, + "startNodeId": "node3", + "endNodeId": "node4", + "actions": [] + }, + { + "edgeId": "edge4", + "released": true, + "sequenceId": 7, + "startNodeId": "node4", + "endNodeId": "node1", + "actions": [] + } + ] + }' + ``` +