0
$\begingroup$

Rosanswers logo

I am trying to use robot_localization to fuse data from a 9DOF IMU & a GPS, via one instance of ukf_localization_node & an instance of navsat_transform_node. I think my setup is more or less working, except that the messages published by the navsat_transform_node on /gps/filtered have a non zero altitude value. Altitude is not important for my application & having the altitude as 0 in these messages would make integration/debugging much easier for me.

The NMEA data from my GPS receiver includes altitude, so the messages on /fix contain this information & I can watch it fluctuate up & down as the receiver sits on my desk. The messages on /odometry/gps have a 0 altitude & the messages on /odometry/filtered have an almost 0 altitude (it fluctuates, but is always on the magnitude of E-14 or E-15). The altitude value in the /gps/filtered messages is fixed at what is presumably an old value from /fix (right now it is 48.4) & does not fluctuate at all as I move the IMU or as the altitude seen in /fix changes.

I have ~zero_altitude set to true in the navsat_transform_node & I have ~two_d_mode set to true in the ukf_localization_node. I have tried setting ~initial_state to specify Z as 0 but this had no effect.

Is this simply because ~zero_altitude only affects the Odometry messages on /odometry/gps & not the NavSatFix messages on /gps/filtered? Is there a solution?

<launch>

  <!-- ======= ======= ======= ======= ======= ======= =======  -->

  <!-- Specify the transform between the 'imu' frame (that IMU data are published on) & the base_link frame (that is rigidly affixed to the robot) -->
  <node pkg="tf2_ros" type="static_transform_publisher" name="bl_imu" args="0 0 0 0 0 0 1 base_link imu" />

  <!-- Specify the transform between the 'gps_link' frame (that GPS data are published on) & the base_link frame (that is rigidly affixed to the robot) -->
  <node pkg="tf2_ros" type="static_transform_publisher" name="bl_gps" args="0 0 0 0 0 0 1 base_link gps_link" />

  <!-- ======= ======= ======= ======= ======= ======= =======  -->

  <!-- subscribes to /nmea_sentence which is raw NMEA data from Arduino/node.js, converts to sensor_msgs/NavSatFix format & publishes on /fix  -->
  <node pkg="nmea_navsat_driver" type="nmea_topic_driver" name="nmea_topic_driver" respawn="true">

  </node>

  <!-- ======= ======= ======= ======= ======= ======= =======  -->

  <!-- subscribes to /odometry/gps (GPS data as odometry from navsat_transform_node) & /imu/data (IMU data from Arduino/node) & publishes on /odometry/filtered -->
  <node pkg="robot_localization" type="ukf_localization_node" name="ukf_localization_node" respawn="true" clear_params="true">

    <param name="map_frame" value="map"/>
    <param name="odom_frame" value="odom"/>
    <param name="base_link_frame" value="base_link"/>
    <param name="world_frame" value="odom"/>

    <param name="imu0" value="/imu/data" />

    <!-- specifies what values the IMU data provides (order is position [F], orientation [T], velocity [F], angular velocity [T], linear acceleration [T] )  -->
    <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="odom0" value="/odometry/gps" />

    <!-- specifies what values the odometry data provies (order is position [T], orientation [F]. velocity [F], angular velocity [F], linear acceleration [F] ) -->
    <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="frequency" value="20" />
    <param name="sensor_timeout" value="2" />
    <param name="two_d_mode" value="true" />

    <param name="dynamic_process_noise_covariance" value="true" />

    <rosparam param="process_noise_covariance">
      [0.05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
      0.0, 0.05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
      0.0, 0.0, 0.06, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
      0.0, 0.0, 0.0, 0.03, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
      0.0, 0.0, 0.0, 0.0, 0.03, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
      0.0, 0.0, 0.0, 0.0, 0.00, 0.06, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
      0.0, 0.0, 0.0, 0.0, 0.00, 0.0, 0.025, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
      0.0, 0.0, 0.0, 0.0, 0.00, 0.0, 0.0, 0.025, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
      0.0, 0.0, 0.0, 0.0, 0.00, 0.0, 0.0, 0.0, 0.04, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
      0.0, 0.0, 0.0, 0.0, 0.00, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0,
      0.0, 0.0, 0.0, 0.0, 0.00, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.0,
      0.0, 0.0, 0.0, 0.0, 0.00, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.02, 0.0, 0.0, 0.0,
      0.0, 0.0, 0.0, 0.0, 0.00, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0,
      0.0, 0.0, 0.0, 0.0, 0.00, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0,
      0.0, 0.0, 0.0, 0.0, 0.00, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.015]
    </rosparam>

  </node>

  <!-- ======= ======= ======= ======= ======= ======= =======  -->

  <!-- subscribes to /imu/data (sensor_msgs/Imu), /odometry/filtered (nav_msgs/Odometry) & /gps/fix (sensor_msgs/NavSatFix)
        publishes to /odometry/gps (nav_msgs/Odometry) & /gps/filtered (sensor_msgs/NavSatFix) -->
  <node pkg="robot_localization" type="navsat_transform_node" name="navsat_transform_node" respawn="true">

    <remap from="/gps/fix" to="/fix" />

    <param name="magnetic_declination_radians" value="0.038106" />
    <param name="publish_filtered_gps" value="true" />
    <param name="broadcast_utm_transform" value="true" />
    <param name="wait_for_datum" value="false" />
    <param name="frequency" value="10" />
    <param name="yaw_offset" value="1.5707963" />
    <param name="use_odometry_yaw" value="false" />
    <param name="zero_altitude" value="true"/>

  </node>

  <!-- ======= ======= ======= ======= ======= ======= =======  -->

</launch>

Originally posted by CJ Davies on ROS Answers with karma: 1 on 2017-10-20

Post score: 0


Original comments

Comment by gvdhoorn on 2017-10-20:\

I tried pasting my launch file here, but no matter what I did (removing comments etc.) half of the tags would cause the lines to get ignored

please add your launch file again, but this time after pasting, select all lines and press the Preformatted Text button (the one with 101010 on it).

Comment by CJ Davies on 2017-10-20:
Thankyou, my mistake was pressing the Preformatted Text button first & then pasting where it said 'enter code here'.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Is this simply because ~zero_altitude only affects the Odometry messages on /odometry/gps & not the NavSatFix messages on /gps/filtered?

In my understanding, Yes, that's true!

From the package documentation and precisely the part talking about the navsat_transform node

~zero_altitude

If this is true, the nav_msgs/Odometry message produced by this node has its pose Z value set to 0.

Regarding the ~two_d_mode parameter,

It should be set to true if your robot is moving on a planar environment or to ignore the subtle effects of variations in the ground plane that might be reported from IMUs if it's not.

/gps/filtered is an optional topic where filtered NavSatFix messages generated from the output of the gps odometry are published in case this data is needed (sort of a reverse navsat transform).

A NavSatFix message with 0 altitude does not make sense, if we don't need altitude we can simply ignore it.


Originally posted by Jasmin with karma: 188 on 2017-10-20

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.