Robot Localization Package: Transform was unavailable for the time requested. Using latest instead.
Hello, I am using an ArduPilot board with an internal IMU connected to an external GPS+Compass module.
I wanted to localize a frame base_link
in relation to odom_combined
. This base link is connected to other frames, so I have created a simple URDF file:
<link name="base_link">
<origin xyz="0 0 0"/>
</link>
<link name="laser_base">
</link>
<joint name="laser_down" type="fixed">
<origin xyz="0 0 1" rpy="0 0 1.57079632679"/>
<parent link="base_link"/>
<child link="laser_base"/>
</joint>
So, I went outside and with the sensors, moved around making a rectangle (moving forwards + turn right + forwards ...). This the trajectory I did:
If I plot the latitude and longitude from the NavsatFix data, I have the following:
(I recorded the data from two GPS modules, but the External Module is the one I am talking about).
Everything seems fine, but if I try to use the robot_localization_package
with the navsat_transform_node
to estimate IMU which will then be the input to the ekf_localization_node, it shows the error:
[ WARN] Transform from base_link to odom_combined was unavailable for the time requested. Using latest instead.
And the frame in RViz does not seems fine at all, with very aggressive discrete jumps. Based on another question I did, I set the predict_to_current_time
parameter to true, but it did not solve the problem.
Also, the gps/filtered
output (shown below) from navsat_transform_node
is very different from the original gps data:
Yet, the gps output from navsat_transform_node
that will be the input from ekf_localization_node
is correct (makes a perfect rectangle). This means that the problem is related to the IMU, right?
I really do not know how I can solve this problem because, the information from the sensors seems correct. The IMU frequency is around 2Hz. I know that it is too low, but I can not figure why (the mavros launch is commented below).
Also, here is the result of $ rosrun tf view_frames
:
Here is the bag recorded in the parking lot (containing the IMU and NavSat/fix data). Also, I have created a another bag which, not only contains the IMU+Navsat information, but also, the topics associated with the robot_localization_package
, when running navsat_transform_node
and ekf_localization_node
.
<launch>
<node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen">
</node>
<node pkg="joint_state_publisher" type="joint_state_publisher" name="joint_state_publisher"/>
<param name="robot_description" textfile="$(find obstacle_detection)/description/tripod.urdf" />
<node name="modelvisualization" pkg="rviz" type="rviz" output="screen"/>
<!-- VR Brain Parameters -->
<!-- <arg name="fcu_url" default="/dev/ttyUSB0:57600" />
<arg name="gcs_url" default="" />
<arg name="tgt_system" default="1" />
<arg name="tgt_component" default="1" />
<arg name="log_output" default="screen" />
<arg name="fcu_protocol" default="v2.0" />
<arg name="respawn_mavros" default="false" /> -->
<!-- Launch VR Brain -->
<!-- <include file="$(find mavros)/launch/node.launch">
<arg name="pluginlists_yaml" value="$(find obstacle_detection)/params/apm_pluginlists.yaml" /> -->
<!-- <arg name="config_yaml" value="$(find obstacle_detection)/params/apm_config.yaml" /> -->
<!-- <arg name="fcu_url" value="$(arg fcu_url)" />
<arg name="gcs_url" value="$(arg gcs_url)" />
<arg name="tgt_system" value="$(arg tgt_system)" />
<arg name="tgt_component" value="$(arg tgt_component)" />
<arg name="log_output" value="$(arg log_output)" />
<arg name="fcu_protocol" value ...