0
$\begingroup$

Rosanswers logo

Hi guys,

I have the following problem: I wrote a launch file which launches my differential drive robot with 2 lidar sensors in gazebo and rviz. The odometry for my robot comes from the differential drive plugin and the transforms for my robot come from the nodes "robot_sate_publisher" and "joint_state_publisher". I have 3 fixed joints "base_link" to "chassis" and "chassis" to each of the lidars and 2 continuous joints "chassis" to "wheel" for each wheel. Now when I look at the rqt_tree I see that the transforms for all the fixed joints, there is no time_stamp for the transforms and also I cannot choose to see the Pointcloud data in the odom frame since rviz tells me that the message was removed, because it is too old.

My question: do I have to code now a separate node which broadcasts all these transforms with a time stamp? I thought that the robot_state_publisher and joint_state_publisher nodes that I launch in the launch-file are exactly for that: to publish all the transforms (whole transform tree) of my robot. But I only get stamped messages for the chassis to wheel tranforms and odom to base_footprint transforms but not for the fixed joints. (I already tried with static_transform nodes to publish static transforms, but still no timestamp)

Launch File:

<launch>

  <!--Robot Description from URDF-->
  <param name="robot_description" command="$(find xacro)/xacro $(find sim_1)/urdf/robot.xacro"/>  

  <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher"/>

  <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher"/>

  <!--node pkg="tf" type="static_transform_publisher" name="to_chassis" args="0 0 0.35 0 0 0 /base_footprint /chassis 50"/>

  <node pkg="tf" type="static_transform_publisher" name="to_laser_back" args="-0.45 -1 1.25 0 0 0 /chassis /sensor_laser_back  50"/>

  <node pkg="tf" type="static_transform_publisher" name="to_laser_front" args="0.45 1 1.25 0 0 0 /chassis /sensor_laser_front  50"/-->

  <!--RViz-->
  <node name="rviz" pkg="rviz" type="rviz" required="true"/>

  <!--Gazebo empty world launch file-->
  <include file="$(find gazebo_ros)/launch/empty_world.launch">
        <arg name="debug" value="false" />
        <arg name="gui" value="true" />
        <arg name="paused" value="false"/>
        <arg name="use_sim_time" value="false"/>
        <arg name="headless" value="false"/>
        <arg name="verbose" value="true"/>
  </include>

  <!--Gazebo Simulator-->
  <node name="spawn_model" pkg="gazebo_ros" type="spawn_model" args="-urdf -param robot_description -model robot" output="screen"/>
  
</launch>

Thank you very much in advance!image description


Originally posted by chillbird on ROS Answers with karma: 38 on 2019-10-21

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

so it seems to be normal to not get any timestamps when publishing fixed joint transforms via robot_state_publisher as can be seen in tf_tree here (sorry cannot upload image due to karma) and this issue also describes my original issue: #q307852.

But I wrongfully thought it has something to do with the transforms not being timestamped or are too old as indicated by rviz error message.


Originally posted by chillbird with karma: 38 on 2019-10-25

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by gvdhoorn on 2019-10-25:
I've just given you sufficient karma to attach your screenshot. Please do.

Comment by chillbird on 2019-10-25:
cool, thank you!

Comment by felipeduque on 2019-11-29:
I'm facing the same problem regarding timestamps from fixed transforms. Were you able to solve it? @chillbird

Comment by chillbird on 2019-12-11:
yes, set use_sim_time to true in your launch file when launching gazebo and it should solve your problem.

<arg name="use_sim_time" value="true"/>
$\endgroup$

Your Answer

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