0
$\begingroup$

Rosanswers logo

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>

Originally posted by Mondo on ROS Answers with karma: 1 on 2018-06-29

Post score: 0


Original comments

Comment by Tom Moore on 2018-07-02:
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.

Comment by Mondo on 2018-07-02:
Edited just right now.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by Tom Moore with karma: 13689 on 2018-07-05

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

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