Ask Your Question
0

Unable to use navsat_transform_node

asked 2018-06-29 13:12:10 -0600

Mondo gravatar image

updated 2018-07-02 07:02:57 -0600

Hi everybody,

I would ask for help to use properly the navsat_transform_node. I've a robot which publishes only:

  1. a GPS message topic (sensor_msgs/NavSatFix message)

  2. a IMU message topic ( sensor_msgs/Imu )

My aim is to simply convert the latitude/longitude/altitude in the relative x/y/z position without running any other node in the robot (rviz, ekf/ukf,...). Is it possibile in your opinion? Can I reach my purpose even without any odometry source? I've already tried to use 'wait_for_datum' flag, as explained in documentation, but the node doesn't seem to work. It doesn't print any ROS_INFO on the terminal even if seems to be launched correctly (I can see with 'rostopic list' the odometry/gps topic, but it is not published...).

Thanks in advance for any advice.


EDIT 02/07

Here the detailed messages and node setup: (Please note that as I said before I don't have any EKF node and so /initialpose in the final node launch file doesn't exists).

sensor_msgs/NavSatFix message:

---
header: 
  seq: 3051
  stamp: 
    secs: 1530531889
    nsecs: 957255545
  frame_id: gps
status: 
  status: 0
  service: 0
latitude: 22.542813
longitude: 113.958894172
altitude: 2.9022295475
position_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
position_covariance_type: 0
---

sensor_msgs/Imu message:

    ---
    header: 
      seq: 11138
      stamp: 
        secs: 1530531940
        nsecs: 302707371
      frame_id: body_FLU
    orientation: 
      x: -0.224501576947
      y: -0.140455550098
      z: 0.889119624209
      w: -0.373279485428
    orientation_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
    angular_velocity: 
      x: 0.17925876379
      y: -0.00353165809065
      z: 0.0794828385115
    angular_velocity_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
    linear_acceleration: 
      x: 37.4513301294
      y: 4.78760564071
      z: -22.280056494
    linear_acceleration_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
    ---

Node launch file:

<launch>
  <node pkg="robot_localization" type="navsat_transform_node" name="navsat_transform_node" clear_params="true">
    <!-- <rosparam command="load" file="$(find robot_localization)/params/navsat_transform_template.yaml" /> -->
    <param name="yaw_offset" value="0.00"/>
    <param name="zero_altitude" value="false"/>
    <param name="publish_filtered_gps" value="false"/>
    <param name="broadcast_utm_transform" value="true"/>
    <param name="use_odometry_yaw" value="false"/>

    <param name="wait_for_datum" value="true"/>
    <rosparam param="datum">[1.543533,4.5234534534,1.022411,map,base_link]</rosparam>

    <!-- Placeholders for input remapping. Set your topic names as the "to" values.-->
    <remap from="imu/data" to="/dji_sdk/imu"/>
    <remap from="odometry/filtered" to="/initialpose"/>
    <remap from="gps/fix" to="/dji_sdk/gps_position"/>


  </node>
</launch>
edit retag flag offensive close merge delete

Comments

Please post your full configuration for the EKF and navsat_transform_node. Also, please post one sample input message from every sensor input. IMU + GPS-only state estimation usually doesn't work very well, but I can't say more without more information.

Tom Moore gravatar imageTom Moore ( 2018-07-02 03:48:10 -0600 )edit

Edited just right now.

Mondo gravatar imageMondo ( 2018-07-02 07:28:47 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-07-05 04:36:52 -0600

Tom Moore gravatar image

I see what you're trying to do. You shouldn't need the datum parameter; that's really there to force the GPS origin to a given point, rather than letting the first GPS reading be the GPS origin.

The problem is that navsat_transform_node was written to handle this situation:

  1. Robot starts driving indoors and generating nav_msgs/Odometry messages with its current pose. No GPS signal is available.
  2. Robot drives outside and gets a GPS fix.

In that situation, we need to invert our robot's pose in the nav_msgs/Odometry message, append that to the GPS reading, and use that point as our GPS origin.

In your case, I think you should be able to just publish a nav_msgs/Odometry message to /initialpose that has a 0 position and an identity quaternion. You need to make sure that you set the frame_id and child_frame_id appropriately in the /initialpose message (in your case, it appears that you want map and base_link, respectively). Also, your IMU data is in the body_FLU frame. Are you providing a transform from that frame to base_link? You'll need to.

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2018-06-29 13:12:10 -0600

Seen: 350 times

Last updated: Jul 05 '18