Ask Your Question
0

ROS2 foxy ros1_bridge

asked 2020-08-18 15:20:38 -0500

Lyubomyr gravatar image

I want to use ROS2 Foxy to spawn a Turtlebot in Gazebo which is in ROS1.

Inside ROS1 when I do rosservice list, I see the following

/gazebo/apply_body_wrench
/gazebo/apply_joint_effort
/gazebo/clear_body_wrenches
/gazebo/clear_joint_forces
/gazebo/delete_light
/gazebo/delete_model
/gazebo/get_joint_properties
/gazebo/get_light_properties
/gazebo/get_link_properties
/gazebo/get_link_state
/gazebo/get_loggers
/gazebo/get_model_properties
/gazebo/get_model_state
/gazebo/get_physics_properties
/gazebo/get_world_properties
/gazebo/pause_physics
/gazebo/reset_simulation
/gazebo/reset_world
/gazebo/set_joint_properties
/gazebo/set_light_properties
/gazebo/set_link_properties
/gazebo/set_link_state
/gazebo/set_logger_level
/gazebo/set_model_configuration
/gazebo/set_model_state
/gazebo/set_parameters
/gazebo/set_physics_properties
/gazebo/spawn_sdf_model
/gazebo/spawn_urdf_model
/gazebo/unpause_physics
/gazebo_gui/get_loggers
/gazebo_gui/set_logger_level
/gazebo_gui/set_parameters
/master_discovery/get_loggers
/master_discovery/list_masters
/master_discovery/refresh
/master_discovery/set_logger_level
/master_sync/get_loggers
/master_sync/get_sync_info
/master_sync/set_logger_level
/param_sync/get_loggers
/param_sync/set_logger_level
/rosout/get_loggers
/rosout/set_logger_level

However when I run ros2 run ros1_bridge dynamic_bridge --bridge-all-topics I see the following

Created 2 to 1 bridge for service /gazebo/pause_physics
Created 2 to 1 bridge for service /gazebo/reset_simulation
Created 2 to 1 bridge for service /gazebo/reset_world
Created 2 to 1 bridge for service /gazebo/unpause_physics
Created 2 to 1 bridge for service /master_discovery/refresh
created 1to2 bridge for topic '/rosout' with ROS 1 type 'rosgraph_msgs/Log' and ROS 2 type 'rcl_interfaces/msg/Log'
created 2to1 bridge for topic '/rosout' with ROS 2 type 'rcl_interfaces/msg/Log' and ROS 1 type 'rosgraph_msgs/Log'
[INFO] [1597772703.322525671] [ros_bridge]: Passing message from ROS 1 rosgraph_msgs/Log to ROS 2 rcl_interfaces/msg/Log (showing msg only once per type)
[INFO] [1597772703.322748003] [ros_bridge]: Passing message from ROS 2 rcl_interfaces/msg/Log to ROS 1 rosgraph_msgs/Log (showing msg only once per type)
[INFO] [1597772703.322769446] [ros_bridge]: Passing message from ROS 2 rcl_interfaces/msg/Log to ROS 1 rosgraph_msgs/Log (showing msg only once per type)
created 1to2 bridge for topic '/rosout' with ROS 1 type 'rosgraph_msgs/Log' and ROS 2 type 'rcl_interfaces/msg/Log'
[INFO] [1597772703.927974308] [ros_bridge]: Passing message from ROS 1 rosgraph_msgs/Log to ROS 2 rcl_interfaces/msg/Log (showing msg only once per type)
^C[MrTurtle] root@turtlebot_0:~/ws/src/robotic_order_fulfillment_robotic_turtle/scripts$ removed 1to2 bridge for topic '/rosout'

Which consequently leads to the following (after sourcing setup.bash)

$ ros2 service list
/gazebo/pause_physics
/gazebo/reset_simulation
/gazebo/reset_world
/gazebo/unpause_physics
/master_discovery/refresh
/ros_bridge/describe_parameters
/ros_bridge/get_parameter_types
/ros_bridge/get_parameters
/ros_bridge/list_parameters
/ros_bridge/set_parameters
/ros_bridge/set_parameters_atomically

As you can see, not all services are available in ROS2. However, when I try to access the services that are availeble (e.g. /gazebo/pause_physics ) it does what is expected from it.

What should I do to see all the services available in ROS1?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-08-18 23:39:05 -0500

Dirk Thomas gravatar image

The ros1_bridge is implemented in C++ and therefore only supports bridging types it knows about at compile time. You can get a list of supported types by invoking: ros2 run ros1_bridge dynamic_bridge --print-pairs.

From the services which are not being bridged many (if not all?) seem to be of a service type defined in the gazebo_msgspackage: https://github.com/ros-simulation/gaz...

But gazebo_msgs is not an explicitly declared dependency of the ros1_bridgepackage: https://github.com/ros2-gbp/ros1_brid...

As such you will need to build the ros1_bridge from source (with gazebo_msgsbeing present in the underlying ROS 1 and ROS 2 workspaces): https://github.com/ros2/ros1_bridge#b...

edit flag offensive delete link more

Comments

It worked perfectly, thank you!

Lyubomyr gravatar image Lyubomyr  ( 2020-08-19 10:52:08 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2020-08-18 15:20:38 -0500

Seen: 351 times

Last updated: Aug 18 '20