Rviz - Unknown reason for transform failure - but only when using config file
Hey, I have a weird error here which I can not figure out why it is happening. I am using the same launch file in two runs. In the first run I am setting up Rviz manually and add a Laserscan with the /scan topic, adding a TF and changing the fixed frame from /map to /odom and everything works perfectly fine. I then proceeded to store this Rviz configuration to not have to manually add the stuff mentioned before and added the config file to my launch file. Running the launch file now results in Rviz telling me the mentioned error in the title when looking at the Laserscan. The Laserscan receives 4 messages, then the error pops up for 1-2 seconds. This circle repeats infinitely. Does someone know why that is happening?
<launch>
<param name="/use_sim_time" value="false"/>
<node pkg="tf" type="static_transform_publisher" name="base_to_laser" args="0.0 0.0 0.0 0.0 0.0 0.0 base_link laser_link 40" />
<!-- Running next line the first time and the line after the second time -->
<node pkg="rviz" type="rviz" name="rviz" />
<!--node pkg="rviz" type="rviz" name="rviz" args="-d $(find test)/rviz_config/standard_cfg.rviz" /> -->
<!-- RPLidar starting and setup -->
<node name="rplidarNode" pkg="rplidar_ros" type="rplidarNode" output="screen">
<param name="serial_port" type="string" value="/dev/ttyUSB0"/>
<param name="serial_baudrate" type="int" value="115200"/><!--A1/A2 -->
<!--param name="serial_baudrate" type="int" value="256000"--><!--A3 -->
<param name="frame_id" type="string" value="laser_link"/>
<param name="inverted" type="bool" value="false"/>
<param name="angle_compensate" type="bool" value="true"/>
</node>
<node pkg="laser_scan_matcher" type="laser_scan_matcher_node"
name="laser_scan_matcher_node" output="screen">
<param name="fixed_frame" value = "odom"/>
<param name="use_alpha_beta" value="true"/>
<param name="max_iterations" value="10"/>
</node>
</launch>
EDIT:
The first time I run this launch file I use this line and add everything manually and everything works:
<node pkg="rviz" type="rviz" name="rviz" />
I then save the configuration I just made, close rviz and launch my file with this line instead of the one before:
<node pkg="rviz" type="rviz" name="rviz" args="-d $(find test)/rviz_config/standard_cfg.rviz" />
Everything loads up but the LaserScan tells me in 1-2sec intervals: Unknown reason for transform failure and then scans properly again. And that is happening in an infinite loop. I hope this helps you to understand my problem better.
Is rviz running on a different host than the lidar? If multiple hosts, is time-of-day clock synchronized on all of them?
I am not sure whether I understand you correctly because I am not too familiar with multiple hosts yet but everything is running on one PC from on terminal.
Is this simulated in gazebo, or are you using real hardware?
I am using real hardware. RPLidar A2.
I'm beginning to think this issue has nothing to do with rviz config file. According to the wiki, both
~use_imu
and~use_odom
default to true. Are you providing the information described on that page?Hey there and sorry that its been a while. I indeed had them set to true but setting them to false doesn't change the error from appearing. And to be honest I also don't understand why it should. I am still running the same launch file both times, so both times they have been set to true. The only difference is that when adding everything manually to rviz it works properly but loading this stored configuration the next time when launching leads to the error.