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_bridgepackage 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/srcsource ~/ros2_install/ros2-osx/setup.bash- this adjusts your environment for building ROS2 packages
colcon build --symlink-install- this generates
buildandinstallfolders 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_msgspackage for ROS1 - builds the
gateway_interfacespackage for ROS2 - builds the
ros1_gatewayfor ROS2 (which references the two above) - builds the
gateway_pub_subfor ROS1 (which references thegateway_msgspackage) - builds the
gateway_pub_subfor ROS2 (which references thegateway_interfacespackage)
- builds the
./test.sh- for
gateway_pub_subfor ROS1- runs a ROS1 container, including:
- the
roscoredaemon - the
some_request_to_some_response.pynode
- the
- runs the integration tests inside that container against that node
- runs a ROS1 container, including:
- for
gateway_pub_subfor ROS2- runs a ROS2 container, including:
- the
some_request_to_some_response.pynode
- the
- runs the integration tests inside that container against that node
- runs a ROS2 container, including:
- for
gateway_pub_subfor ROS1 (tested from ROS2 viaros1_bridge)- runs a ROS1 container, including:
- the
roscoredaemon - the
some_request_to_some_response.pynode
- the
- runs a ROS2 container, including:
- runs the integration tests inside that container against that node
- runs a ROS1 container, including:
- for
gateway_pub_subfor ROS2 (tested from ROS1 viaros1_bridge)- runs a ROS2 container, including:
- the
some_request_to_some_response.pynode
- the
- runs a ROS1 container, including:
- the
roscoredaemon - 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.msggateway_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 : SomeRequestand publishes tosome_response : SomeResponseper each subscription callbackgateway_pub_sub/tests/some_request_to_some_response_test.py- integration test usingrospyto 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.msggateway_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 : SomeRequestand publishes tosome_response : SomeResponseper each subscription callbackgateway_pub_sub/tests/some_request_to_some_response_test.py- integration test usingrclpyto 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/msgros2_ws/src/gateway_interfaces/msg
- you'll also need to update
CMakeLists.txtfor each package to reference the new messages files - finally you'll need to recompile the
ros1_gatewaypackage (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
roscorevia theROS_MASTER_URIenvironment variable (defaulthttp://localhost:11311)- if you want to do multi-container testing, you'll need to handle hostnames and adjust the
ROS_MASTER_URIenvironment 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