Ask Your Question
0

Navsat node not publishing any data in a system that doesn't publish odometry

asked 2021-03-01 02:02:12 -0500

HELPme gravatar image

updated 2021-03-01 02:06:28 -0500

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 ...
(more)
edit retag flag offensive close merge delete

Comments

Can you add sample messages of your gps and imu?

xaru8145 gravatar image xaru8145  ( 2021-03-01 04:03:07 -0500 )edit

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.
HELPme gravatar image HELPme  ( 2021-03-01 04:23:01 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-03-01 04:34:52 -0500

xaru8145 gravatar image

updated 2021-03-01 04:53:23 -0500

The GPS message frame_id is wrong. As the warning suggests, your frame_id cannot start with a '/'. Change the header from /world to world.

On a side note, setting the GPS frame_id to world is a bad practice since it is a fix frame. And you are also providing a gps to chassis transform. I would then suggest to change the GPS frame to gps_link. Then change the transform:

<node name="bl_gps" pkg="tf2_ros" type="static_transform_publisher" args="0 0 0 0 0 0 1 chassis gps_link" />

Also, if you do not have any source that is publishing a transfrom between odom and world, you should do that at the beginning of the launch file:

<node pkg="tf2_ros" type="static_transform_publisher" name="map_odom" args="0 0 0 0 0 0 map odom" />

Let me know if that solves your problem.

NOTE: I would strongly advice you against having a 0 value covariance. The covariance measures how confident you are about a measurement. Set that to a small value e.g. 0.001 if you have a good IMU. The GPS covariance msg seems incomplete so I cannot speak for this one.

edit flag offensive delete link more

Comments

can u please specify how to change the frame for gps. I have changed the frameID. But still the message doesn't change

HELPme gravatar image HELPme  ( 2021-03-01 05:42:19 -0500 )edit

If you are using Gazebo, then I guess look where you are defining your model for the GPS you are also defining the frame_id of the sensor.

xaru8145 gravatar image xaru8145  ( 2021-03-01 06:03:48 -0500 )edit

thank you very much. But now i am having one more error

[ WARN] [1614607761.617343623, 73.450000000]: Failed to meet update rate! Took 0.38000000100000003167
[ WARN] [1614607763.756964125, 74.750000000]: Transform from chassis to odom was unavailable for the time requested. Using latest instead.

[ WARN] [1614607766.647844729, 76.750000000]: Transform from chassis to odom was unavailable for the time requested. Using latest instead.

[ WARN] [1614607769.624945507, 79.250000000]: Transform from chassis to odom was unavailable for the time requested. Using latest instead.

[ WARN] [1614607772.029804789, 80.910000000]: Failed to meet update rate! Took 0.22666673900000000597
[ WARN] [1614607772.051239817, 80.920000000]: Failed to meet update rate! Took 0.20333340600000002207
[ WARN] [1614607772.463841100, 81.250000000]: Transform from chassis to odom was unavailable for the time requested. Using latest instead.

[ WARN] [1614607775.641248285
HELPme gravatar image HELPme  ( 2021-03-01 08:14:12 -0500 )edit

This is is a WARNING not an ERROR. Check this post. Try setting in the robot localization pkg: <param name="predict_to_current_time" value="true"/>

Are you getting valid results?

xaru8145 gravatar image xaru8145  ( 2021-03-02 06:09:25 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2021-03-01 02:02:12 -0500

Seen: 74 times

Last updated: Mar 01