ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

ros2_control and gazebo mobile manipulator - no transform from arm to odom

asked 2022-02-18 09:47:40 -0500

dobid gravatar image

updated 2022-02-18 16:36:58 -0500

Hello ROS people,

[ROS2 Foxy - Ubuntu 20.04].

I'm somewhat a beginner in ROS-ROS2.

I'm currently trying to implement a robot consisting of a mobile base (it's a mecanum robot) and a simple "arm". For simplicity in gazebo simulation, I made the 4 wheels with no contact frictions and I control the mobile base with a custom made gazebo plugin. This custom plugin applies force and torque to the mobile base according to a Twist /cmd_vel message and publish its odometry to an /odom topic and publishes a tf too. On top of that, I have a very simple "arm" consisting of a vertical axis (the red one) and a moving scanner (the green thing). I'm using ros2_control and the gazebo_ros2_control plugin for controlling the moving scanner.

When I launch Gazebo and Rviz, I can effectively control the moving scanner and I see the scanner moving up and down. Now the problem is that when I change the fixed frame from base_footprint to odom, the mobile scanner disappears leaving an unmoving white shadow of the scanner, and RViz notifies me with this message "no transform from [support_thermo] (the mobile scanner) to [odom]". I checked /joint_states and /tf topics and it seems like there's nothing wrong to me : there's a rail_thermo_to_ support_thermo msg being published on /joint_states and there's both base_footprint to odom and support_thermo to rail_thermo transforms in /tf.

Here are two screens of my RViz window :

As suggested by @tfoote, there's also the result of tf2_tools view_frames : (sorry if posting links isn't the way to share files and screenshots but I didn't find anything else since I don't have enough karma to upload files directy into my post).

Don't hesitate to ask for additional info, terminal/topics dumps or code, I thought keeping the first message as short and clear as I could was a good thing.

Thanks in advance !

edit retag flag offensive close merge delete


Please update this to add a view from tf2_toolsview_frames to understand what you transform tree looks like. The presence of frames in the tf data-structure does not verify that there's full connectivity.

tfoote gravatar image tfoote  ( 2022-02-18 15:44:17 -0500 )edit

I voted up your question so you should have enough Karma to upload files. The links are good as a starter. It looks like your tree is complete. One dyanmic link and everything else static. My next guess is that you have inconsistent timestamps in your system. Some things are on simulated time and some are on system time. Can you make sure that you have /use_sim_timeTrue for all your nodes and that all timestamps you see in your system are on the order of the length of time you've been running, and not system time which will be several billion seconds. Static transforms work at all times so if you're only traversing the static regions of the tree it will always render even if there's a huge time difference.

tfoote gravatar image tfoote  ( 2022-02-18 17:01:49 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2022-02-21 03:18:00 -0500

dobid gravatar image

updated 2022-02-21 03:19:33 -0500

Got it, thanks @tfoote ! I found out here : that I can set a "use_sim_time" param to True. I've done that, removed joint_state_publisher and joint_state_publisher_gui from the launch file and everything works fine !

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2022-02-18 09:47:40 -0500

Seen: 656 times

Last updated: Feb 21 '22