I am trying to use a gps and imu for localization of a gazebo simulated robot. For this I am using navsat and ekf nodes. But my navsat node is always publishing zero.
The error message I am receiving is
Warning: Invalid argument "/world" passed to canTransform argument source_frame in tf2 frame_ids cannot start with a '/' like:
at line 134 in /tmp/binarydeb/ros-melodic-tf2-0.6.5/src/buffer_core.cpp
[ WARN] [1614584451.566137626, 316.190000000]: Could not obtain transform from /world to chassis. Error was Invalid argument "/world" passed to lookupTransform argument source_frame in tf2 frame_ids cannot start with a '/' like:
[ WARN] [1614584451.566646918, 316.190000000]: Unable to obtain chassis->/world transform. Will assume navsat device is mounted at robot's origin
[ INFO] [1614584451.567084449, 316.190000000]: Corrected for magnetic declination of 0.368788, user-specified offset of 0.000000 and meridian convergence of -0.001334. Transform heading factor is now 3.493143
[ INFO] [1614584451.567666613, 316.190000000]: Transform world frame pose is: Origin: (0 0 0)
Rotation (RPY): (0, 0, -0.015900924710489677816)
[ INFO] [1614584451.567958639, 316.190000000]: World frame->cartesian transform is Origin: (2445618.4779923087917 4981487.1742727346718 -0.44221211776894475687)
Rotation (RPY): (0, -0, 2.7741413272136945523)
Warning: Invalid argument "/world" passed to canTransform argument source_frame in tf2 frame_ids cannot start with a '/' like:
at line 134 in /tmp/binarydeb/ros-melodic-tf2-0.6.5/src/buffer_core.cpp
[ WARN] [1614584451.804221307, 316.290000000]: Could not obtain chassis->/world transform. Will not remove offset of navsat device from robot's origin.
Warning: Invalid argument "/world" passed to canTransform argument source_frame in tf2 frame_ids cannot start with a '/' like:
at line 134 in /tmp/binarydeb/ros-melodic-tf2-0.6.5/src/buffer_core.cpp
Warning: Invalid argument "/world" passed to canTransform argument source_frame in tf2 frame_ids cannot start with a '/' like:
at line 134 in /tmp/binarydeb/ros-melodic-tf2-0.6.5/src/buffer_core.cpp
my navsat node code is
<launch>
<node name="bl_gps" pkg="tf2_ros" type="static_transform_publisher" args="0 0 0 0 0 0 1 chassis gps" />
<node name="bl_m" pkg="tf2_ros" type="static_transform_publisher" args="0 0 0 3.1416 -1.5708 0 chassis 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.36878808"/>
<param name="zero_altitude" value="false"/>
<param name="publish_filtered_gps" value="true"/>
<param name="broadcast_cartesian_transform" value="true"/>
<param name="wait_for_datum" value="false"/>
<remap from="/gps/fix" to="/fix"/>
<remap from="/imu/data" to="/imu"/>
</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"/>
<param name="frequency" value="30"/>
<param name="sensor_timeout" value="2"/>
<param name="two_d_mode" value="true"/>
<param name="map_frame" value="map"/>
<param name="odom_frame" value="odom"/>
<param name="base_link_frame" value="chassis"/>
<param name="world_frame" value="odom"/>
<rosparam param="imu0_config">[false, false, false,
false, false, true,
false, false, false,
false, false, true,
true, false, false]</rosparam>
<param name="imu0_differential" value="false"/>
<param name="imu0_remove_gravitational_acceleration" value="true"/>
<rosparam param="odom0_config">[true, true, false,
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)/adroit_files/debug_ekf_localization.txt"/>
</node>
</launch>
can someone help me with this. I have seen ros answers post. They are linked below. https://answers.ros.org/question/332905/robot_localization-navsat-transform-node-does-not-publish/ https://answers.ros.org/question/200071/how-to-fuse-imu-gps-using-robot_localization/?answer=200087#post-id-200087 https://answers.ros.org/question/236588/imu-and-gps-fusion-without-odom-robot_localization/?answer=237043#post-id-237043
I am a bit confused about how the whole thing works. I have also read REP 105
Originally posted by HELPme on ROS Answers with karma: 7 on 2021-03-01
Post score: 0
Original comments
Comment by xaru8145 on 2021-03-01:
Can you add sample messages of your gps and imu?
Comment by HELPme on 2021-03-01:
the imu message is
header:
seq: 214
stamp:
secs: 21
nsecs: 780000000
frame_id: "imu_link"
orientation:
x: -3.57496048755e-06
y: 2.76906236663e-05
z: -0.000219465066084
w: 0.999999975528
orientation_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
angular_velocity:
x: 3.08407873507e-06
y: 0.0109527869533
z: -3.9952695321e-06
angular_velocity_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
linear_acceleration:
x: 0.635660503637
y: -8.76429508382e-05
z: 9.79947574441
linear_acceleration_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
---
the gps message is
header:
seq: 443
stamp:
secs: 111
nsecs: 0
frame_id: "/world"
status:
status: 0
service: 0
latitude: 49.9000287128
longitude: 8.89997284201
altitude: -8.94856210614
position_covariance: [25.