0
$\begingroup$

Rosanswers logo

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 : https://imgur.com/a/7G6zm84

As suggested by @tfoote, there's also the result of tf2_tools view_frames : https://www.scribd.com/document/559819247/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 !


Originally posted by dobid on ROS Answers with karma: 11 on 2022-02-18

Post score: 1


Original comments

Comment by tfoote on 2022-02-18:
Please update this to add a view from tf2_tools view_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.

Comment by tfoote on 2022-02-18:
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_time True 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.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Got it, thanks @tfoote ! I found out here : https://github.com/ros-controls/ros2_control/issues/325 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 !


Originally posted by dobid with karma: 11 on 2022-02-21

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

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