A set of ROS 2 drivers for transport-layer protocols. This repository currently utilizes the stand-alone ASIO library for most transport-layer functionality.
Note (Fork notice)
This repository is a fork ofros-drivers/transport_drivers.
- Upstream (original): https://github.com/ros-drivers/transport_drivers
- This fork: https://github.com/agbread/transport_drivers
If you are looking for the official upstream project, please refer to the upstream link above.
This project is distributed under the Apache-2.0 license.
License notices and attributions from the upstream project are retained in this fork.
A package which encapsulates basic receiving and sending of UDP data.
Provided within this package are the following executables:
udp_receiver_str_node_exe: can receive UDP data and publish ROS2 string topicudp_sender_str_node_exe: can receive ROS2 string topic and send UDP data asynchronouslyudp_bridge_str_node_exe: combines both receiver and sender nodes into one
This package also provides a udp_driver library without ROS 2 dependencies, which can be used elsewhere.
A package which encapsulates basic receiving and sending of serial data.
Provided within this package is the following executable:
serial_bridge: combines both receiver and sender nodes into one
This package also provides a serial_driver library without ROS 2 dependencies, which can be used elsewhere.
A library to write synchronous and asynchronous networking applications.
Clone this fork into your workspace (typically workspace/src/<clone-repo-here>):
mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/agbread/transport_drivers.gitInstall dependencies using rosdep from your top-level workspace directory:
cd ..
rosdep install --from-paths src --ignore-src -r -y
Once you have the repository cloned and dependencies installed, you can now go ahead and compile:
colcon build
After successful compilation, you should be able to source your newly built packages:
source install/setup.bash
...and now you should be able to run your newly built executables. Here is how you would launch the udp_driver bridge node:
ros2 run udp_driver udp_bridge_node_exe --ros-args --params-file ./src/transport_drivers/udp_driver/params/example_udp_params.yaml
This fork includes bridge executables that convert between:
- ROS 2
std_msgs/msg/Stringtopics and UDP packets - UDP packets and ROS 2
std_msgs/msg/Stringtopics
- Input (ROS 2 topic):
/udp_write_string(std_msgs/msg/String) - Output: UDP packets sent to the configured IP/port
ros2 run udp_driver udp_senderstr_bridge_node_exe --ros-args --params-file /home/home/ros2_ws/src/transport_drivers/udp_driver/params/udp_sender_params.yml- Input: UDP packets received on the configured IP/port
- Output (ROS 2 topic):
/udp_read_string(std_msgs/msg/String)
ros2 run udp_driver udp_receiverstr_bridge_node_exe --ros-args --params-file /home/home/ros2_ws/src/transport_drivers/udp_driver/params/udp_receiver_params.ymlros2 run udp_driver udp_bridge_str_node_exe --ros-args --params-file /home/home/ros2_ws/src/transport_drivers/udp_driver/params/example_udp_params.yamlComprehensive unit tests have been written for every package within this repository.
To run them yourself, use the normal command from your top-level workspace directory:
colcon test