This repo demonstrates the following:
- a custom ROS2 interfaces package
ros2_ws/src/gateway_interfaces
- a custom ROS1 interfaces package
ros1_ws/src/gateway_msgs
- building a custom
ros1_bridge
package referencing the above two packages - some tests
- MacOS
- CLion
- ROS2 already installed
- in a terminal, before you've opened CLion
- (change directory to the root of this repo)
cd ros2_ws/src
source ~/ros2_install/ros2-osx/setup.bash
- this adjusts your environment for building ROS2 packages
colcon build --symlink-install
- this generates
build
andinstall
folders with headers / libraries etc for the messages
- this generates
source install/setup.bash
- this adjusts your environment for this ROS2 workspace
/Applications/CLion.app/Contents/MacOS/clion
- open this repo, point at the base
CMakeLists.txt
- open this repo, point at the base
- you should now have header / library code completion
./build.sh
- builds the
gateway_msgs
package for ROS1 - builds the
gateway_interfaces
package for ROS2 - builds the
ros1_gateway
for ROS2 (which references the two above) - builds the
gateway_pub_sub
for ROS1 (which references thegateway_msgs
package) - builds the
gateway_pub_sub
for ROS2 (which references thegateway_interfaces
package)
- builds the
./test.sh
- for
gateway_pub_sub
for ROS1- runs a ROS1 container, including:
- the
roscore
daemon - the
some_request_to_some_response.py
node
- the
- runs the integration tests inside that container against that node
- runs a ROS1 container, including:
- for
gateway_pub_sub
for ROS2- runs a ROS2 container, including:
- the
some_request_to_some_response.py
node
- the
- runs the integration tests inside that container against that node
- runs a ROS2 container, including:
- for
gateway_pub_sub
for ROS1 (tested from ROS2 viaros1_bridge
)- runs a ROS1 container, including:
- the
roscore
daemon - the
some_request_to_some_response.py
node
- the
- runs a ROS2 container, including:
- runs the integration tests inside that container against that node
- runs a ROS1 container, including:
- for
gateway_pub_sub
for ROS2 (tested from ROS1 viaros1_bridge
)- runs a ROS2 container, including:
- the
some_request_to_some_response.py
node
- the
- runs a ROS1 container, including:
- the
roscore
daemon - runs the integration tests inside that container against that node
- the
- runs a ROS2 container, including:
- for
ros1_ws
- ROS1 workspace forgateway_msgs
(ROS1 interface package) andgateway_pub_sub
(example ROS1 implementation)- notable files for
gateway_msgs
:gateway_msgs/package.xml
- package definition for catalogue purposesgateway_msgs/CMakeLists.xml
- package definition for build purposesgateway_msgs/msg/SomeRequest.msg
gateway_msgs/msg/SomeRequest.msg
- notable files for
gateway_pub_sub
:gateway_pub_sub/package.xml
- package definition for catalogue purposesgateway_pub_sub/CMakeLists.xml
- package definition for build purposesgateway_pub_sub/scripts/some_request_to_some_response.py
- ROS node that subscribes tosome_request : SomeRequest
and publishes tosome_response : SomeResponse
per each subscription callbackgateway_pub_sub/tests/some_request_to_some_response_test.py
- integration test usingrospy
to communicate with the node above (assumes it's already running)
- notable files for
ros2_ws
- ROS1 workspace forgateway_interfaces
(ROS2 interface package) andgateway_pub_sub
(example ROS1 implementation)- notable files for
gateway_interfaces
:gateway_interfaces/package.xml
- package definition for catalogue purposesgateway_interfaces/CMakeLists.xml
- package definition for build purposesgateway_interfaces/msg/SomeRequest.msg
gateway_interfaces/msg/SomeRequest.msg
- notable files for
gateway_pub_sub
:gateway_pub_sub/package.xml
- package definition for catalogue purposesgateway_pub_sub/CMakeLists.xml
- package definition for build purposesgateway_pub_sub/scripts/some_request_to_some_response.py
- ROS node that subscribes tosome_request : SomeRequest
and publishes tosome_response : SomeResponse
per each subscription callbackgateway_pub_sub/tests/some_request_to_some_response_test.py
- integration test usingrclpy
to communicate with the node above (assumes it's already running)
- notable files for
- if you want to generate messages externally...
- you'll need to generate them in both ROS1 and ROS2 formats and place them in the following locations:
ros1_ws/src/gateway_msg/msg
ros2_ws/src/gateway_interfaces/msg
- you'll also need to update
CMakeLists.txt
for each package to reference the new messages files - finally you'll need to recompile the
ros1_gateway
package (so just re-runbuild.sh
)
- you'll need to generate them in both ROS1 and ROS2 formats and place them in the following locations:
- adjacent ROS1 nodes need to be made aware of a
roscore
via theROS_MASTER_URI
environment variable (defaulthttp://localhost:11311
)- if you want to do multi-container testing, you'll need to handle hostnames and adjust the
ROS_MASTER_URI
environment variable as applicable
- if you want to do multi-container testing, you'll need to handle hostnames and adjust the
- there aren't any reliable methods to wait for a Publisher to be ready (so a sleep is used in the tests)
- there are some unknowns about how ROS2's QoS maps to ROS1's