0
$\begingroup$

I'm trying to make two robots work in ROS Galactic with no luck so far. As far as I know the approach is to use namespaces. In order to make this I have namespaced everything (nodes, frames, topics, etc) and these set of changes allowed me to launch a single robot without issues, that is: after namespacing, everything works just as before without namespaces.

  • Node graph: enter image description here

  • Transform tree: enter image description here

  • Topics:

/clicked_point
/diagnostics
/goal_pose
/gps/fix
/initialpose
/map
/map_metadata
/map_updates
/mir_1/initialpose
/mir_1/joint_states
/mir_1/odom
/mir_1/odometry/filtered
/mir_1/robot_description
/mir_1/scan
/mir_1/set_pose
/mir_1/slam_toolbox/feedback
/mir_1/slam_toolbox/update
/mir_1/tf
/mir_1/tf_static
/parameter_events
/rosout
/slam_toolbox/graph_visualization
/slam_toolbox/scan_visualization
  • Nodes:
/mir_1
/mir_1/ekf_filter_node
/mir_1/joint_state_publisher
/mir_1/nav2_lifecycle_manager
/mir_1/robot_state_publisher
/mir_1/rviz2
/mir_1/slam_toolbox
/mir_1/transform_listener_impl_55c2bb3d8570
/mir_1/transform_listener_impl_55c7b11add50
/mir_1/transform_listener_impl_561d5b4c89d0

From above I do believe that everything seems correct. Now when going from one robot to two robots my launch file basically launches everything duplicated (by duplicated I mean that the same launch process is repeated for the second robot and what only changes is the robot id which is 'mir_1' for the first robot and 'mir_2' for the second one). This "robot id" is passed in my launch file to custom functions as the namespace (so robot id and namespace hold the unique robot id).

Here's when things get strange. I do not see any errors, however when I do inspect the transform tree I see that I'm losing the transformations between mir_X/odom and mir_X/base_link frames so RViz is unable to render their initial locations.

These are the outputs that I do see when troubleshooting:

  • RViz: enter image description here enter image description here enter image description here

  • Node graph (looks ok): enter image description here

  • Transform tree (looks broken for both namespaces): enter image description here enter image description here

  • Topics (looks ok):

/diagnostics
/gps/fix
/map
/map_metadata
/mir_1/initialpose
/mir_1/joint_states
/mir_1/odom
/mir_1/odometry/filtered
/mir_1/robot_description
/mir_1/scan
/mir_1/set_pose
/mir_1/slam_toolbox/feedback
/mir_1/slam_toolbox/update
/mir_1/tf
/mir_1/tf_static
/mir_2/initialpose
/mir_2/joint_states
/mir_2/odom
/mir_2/odometry/filtered
/mir_2/robot_description
/mir_2/scan
/mir_2/set_pose
/mir_2/slam_toolbox/feedback
/mir_2/slam_toolbox/update
/mir_2/tf
/mir_2/tf_static
/parameter_events
/rosout
/slam_toolbox/graph_visualization
/slam_toolbox/scan_visualization
  • Nodes (looks ok):
/mir_1
/mir_1/ekf_filter_node
/mir_1/joint_state_publisher
/mir_1/nav2_lifecycle_manager
/mir_1/robot_state_publisher
/mir_1/slam_toolbox
/mir_1/transform_listener_impl_55a91c09f9d0
/mir_1/transform_listener_impl_55c459d0fde0
/mir_2
/mir_2/ekf_filter_node
/mir_2/joint_state_publisher
/mir_2/nav2_lifecycle_manager
/mir_2/robot_state_publisher
/mir_2/slam_toolbox
/mir_2/transform_listener_impl_558f8a6185f0
/mir_2/transform_listener_impl_55ba2a4aaca0

I'm unable to see why for a single namespaced robot everything is correct but for two namespaced robots the same setup does not work. I can't see how is it that I lose the transformations between odom and base_link frames for two robots but for one robot the transformation is indeed there as shown for a single robot setup.

I'm on ROS Galactic and using the following add-ons:

  • robot_localization
  • slam_toolbox
  • nav2_lifecycle_manager

Note: because I'm duplicating everything as mentioned above, I also launch two RViz instances, one for each robot. While this is not ideal, I'm doing this to get things working without much effort at this point. My final goal is obviously have a single RViz instance with a single map generated from both robots.

Any suggestions or ideas much appreciated!

$\endgroup$

1 Answer 1

0
$\begingroup$

I think you should check ekf_filter node config. This node provides Odom to base link tf frame.

$\endgroup$
1
  • $\begingroup$ Could you edit and expand upon your answer a little? $\endgroup$ Feb 17 at 19:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.