robot_localization and navsat_transform_node provide wrong pose
Hi to all,
I'm trying to get a correct pose for my skid-steering vehicle by using IMU and RTK-GPS (from ublox).
I use navsat_transform_node
to generate the /odometry/filtered by using /ublox_gps/fix
combined with the /imu_data/
and then the ekf_localization_node as second instance.
The problem is that I'm not getting correct information under RVIZ. If I set odom frame as fixed frame in RVIZ, I can see nothing drawn by /odometry/filtered and /odometry/gps topics.
Should I have a map to make the robot_localization work? Do I need to publish a tf from map to odom frame?
The /odometry/filtered
topic is generated by robot_localization, but I can't understand if it's correct and however I cannot plot it in RVIZ.
I cannot understand why I'm not able to see the path in RVIZ.
<launch>
<node name="bl_gps" pkg="tf2_ros" type="static_transform_publisher" args="0 0 0 0 0 0 1 base_link gps" />
<node name="bl_imu" pkg="tf2_ros" type="static_transform_publisher" args="0 0 0 0 0 0 1 base_link imu_link" />
<node pkg="robot_localization" type="navsat_transform_node" name="navsat_transform_node" respawn="true" output="screen">
<param name="magnetic_declination_radians" value="0"/>
<param name="zero_altitude" value="false"/>
<param name="publish_filtered_gps" value="false"/>
<param name="broadcast_utm_transform" value="true"/>
<param name="wait_for_datum" value="true"/>
<rosparam param="datum">[18.33294909563789, 40.06012014572104, 0.0, odom, base_link]</rosparam>
<remap from="/gps/fix" to="/ublox_gps/fix"/>
<remap from="/odometry/filtered" to="/odometry/filtered"/>
<remap from="/imu/data" to="/imu_data"/>
</node>
<node pkg="robot_localization" type="ekf_localization_node" name="ekf_odom" clear_params="true">
<param name="odom0" value="/odometry/gps"/>
<param name="imu0" value="/imu_data"/>
<param name="frequency" value="10"/>
<param name="sensor_timeout" value="0.1"/>
<param name="two_d_mode" value="false"/>
<param name="odom_frame" value="odom"/>
<param name="base_link_frame" value="base_link"/>
<param name="world_frame" value="odom"/>
<rosparam param="imu0_config">[false, false, false,
true, true, true,
false, false, false,
true, true, true,
true, true, true]
</rosparam>
<param name="imu0_differential" value="false"/>
<param name="imu0_remove_gravitational_acceleration" value="false"/>
<rosparam param="odom0_config">[true, true, true,
false, false, false,
false, false, false,
false, false, false,
false, false, false]
</rosparam>
<param name="odom0_differential" value="false"/>
<param name="print_diagnostics" value="true"/>
<param name="debug" value="false"/>
<param name="debug_out_file" value="$(env HOME)/debug_ekf_localization.txt"/>
</node>
This is the output of /odometry/filtered:
rostopic echo /odometry/filtered
header:
seq: 1286
stamp:
secs: 1623059374
nsecs: 659658909
frame_id: "odom"
child_frame_id: "base_link"
pose:
pose:
position:
x: -325589.188922
y: 2412419.0677
z: 62.2733933113
orientation:
x: 0.0109867434586
y: 0.517231872535
z: -0.0260019721528
w: 0.855379669472
covariance: [3.6044557794876098, -0.015878677513247248, 0.1368625236632224, 8.633587369403668e-11, -8.861249973655481e-10, -3.216145652088185e-11, -0.015878677513247248, 3.3048011011806797, -0.007119917916770026, 1.8472131111753644e-09, 6.326607301682415e-11, -8.108363233884301e-10, 0.13686252366322227, -0.00711991791677001, 2.268879609198499, -2.3844925176785617e-11, 1.621572947146949e-09, 1.6267748949876525e-16, 8.633587369403666e-11, 1.8472131111753646e-09, -2.3844925176785614e-11, 9.99667020457038e-07, 3.6771290652079676e-20, 2.2731193331381272e-15, -8.861249973655484e-10 ...
Are you trying to localise your bot in the
map
frame? If yes, you would also need a node to publish themap -> odom
transform.No, I didn't try because I have no map. I can't understand how to fix it. I tried to publish a static transform:
rosrun tf static_transform_publisher 0.0 0.0 0.0 0.0 0.0 0.0 1.0 odom map 1000
but obviously it didn't solved the problem. How can I properly setup the map frame? I use no encoders, just the GPS and the IMU.Did you have a look at the gmapping package?
gmapping works with laser, I have no laser installed on my robot.
Try setting the map to odom propperly. <node pkg="tf2_ros" type="static_transform_publisher" name="map_odom" args="0 0 0 0 0 0 map odom"/>