ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

navsat_transform_node not publishing robot/odometry/gps

asked 2021-07-06 08:33:02 -0500

lxg gravatar image

updated 2021-09-08 04:11:46 -0500

hi all. I am trying to use robot_localization_node to fuse GPS and IMU data. I only have simulated sensor data and no odometry. the localization node published my_robot/odometry/filtered fine but the navsat_transform_node does not publish anything at the /my_robot/odometry/gps. When I do a rostopic list, the topic is listed but no messages are published. I can not set use_sim_time parameter to false because my ros_control needs it. I am have cross-checked and indeed the /clock topic publishes clock information. What should I do. below is my launch file configuration. what could I be missing or doing wrong? thanks in advance.

...

<!-- Launch EKF here -->
    <!-- End EKF here -->
    <node pkg="robot_localization" type="ekf_localization_node" name="ekf_se" clear_params="true">
      <param name="frequency" value="10"/>
      <param name="sensor_timeout" value="2.0"/>
      <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="base_link"/>
      <param name="world_frame" value="odom"/> 
      <!-- <param name="print_diagnostics" value="true"/> -->
      <param name="publish_acceleration" value="true"/>
      <param name="publish_tf" value="true"/>
      <param name="imu0" value="/my_robot/hector_imu"/>
      <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="true"/>   <!-- was false -->
      <param name="imu0_remove_gravitational_acceleration" value="true"/>

      <param name="odom0" value="/my_robot/odometry/gps"/>
      <!-- fuse X and Y position, yaw, X˙, and yaw˙. -->
      <!-- <rosparam param="odom0_config">[true,  true,  true,
                                    false, false, false,
                                    false, false, false,
                                    false, false, false,
                                    false, false, false]</rosparam> -->
      <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="true"/>  <!-- was false -->

  </node>
    <node pkg="robot_localization" type="navsat_transform_node"
      name="navsat_transform_node1" respawn="true" output="screen">
    <param name="magnetic_declination_radians" value="0"/>
    <param name="broadcast_cartesian_transform" value="true"/>
    <param name="wait_for_datum" value="false"/>
    <!-- <rosparam param="datum">[37, 0, 0.0]</rosparam> -->

    <remap from="/odometry/gps" to="/my_robot/odometry/gps"/>

    <!-- Inputs -->
    <remap from="imu/data" to="my_robot/hector_imu"/>
    <remap from="gps/fix" to="my_robot/fix"/>
    <remap from="/odometry/filtered" to="/my_robot/odometry/filtered" />   </node>

....

SAMPLE SENSOR MESSAGES:

GPS:
header: 
  seq: 87
  stamp: 
    secs: 465
    nsecs:         0
  frame_id: "/world"
status: 
  status: 0
  service: 0
latitude: 0.000331608598298
longitude: -1.08803283551e-11
altitude: -0.0124077017948
position_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
position_covariance_type: 2
---
header: 
  seq: 88
  stamp: 
    secs: 465
    nsecs: 250000000
  frame_id: "/world"
status: 
  status: 0
  service: 0
latitude: 0.000331608598252
longitude: -1.08834852741e-11
altitude: -0.0124077017946
position_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
position_covariance_type: 2

IMU:
header: 
  seq: 2216
  stamp: 
    secs: 465
    nsecs: 220000000
  frame_id: "base_link"
orientation: 
  x: 5.4428451508e-08
  y: 1.1871741604e-05
  z ...
(more)
edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted
1

answered 2023-07-25 12:08:07 -0500

Iftahnaf gravatar image

updated 2023-07-25 12:10:38 -0500

For anyone to whom this might be relevant, I confirm that I used this launch file, and it works.

<launch>    
<node pkg="robot_localization" type="ekf_localization_node" name="ekf_se" clear_params="true">
  <param name="frequency" value="10"/>
  <param name="sensor_timeout" value="2.0"/>
  <param name="two_d_mode" value="false"/>  
  <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="print_diagnostics" value="true"/>
  <param name="debug" value="false"/>
  <param name="debug_out_file" value="/tmp/debug.txt"/>
  <!-- <param name="publish_acceleration" value="true"/>
  <param name="publish_tf" value="true"/> -->
  <param name="imu0" value="/imu/data"/>
  <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"/>   <!-- was false -->
  <param name="imu0_remove_gravitational_acceleration" value="true"/>

  <param name="odom0" value="/my_robot/odometry/gps"/>
  <!-- fuse X and Y position, yaw, X˙, and yaw˙. -->
  <rosparam param="odom0_config">[true,  true,  true,
                                false, false, false,
                                false, false, false,
                                false, false, false,
                                false, false, false]</rosparam>

  <param name="odom0_differential" value="false"/>  <!-- was false -->

</node>

<node pkg="robot_localization" type="navsat_transform_node" name="navsat_transform_node" respawn="true" output="screen">
    <param name="magnetic_declination_radians" value="0"/>
    <param name="broadcast_cartesian_transform" value="true"/>
    <param name="wait_for_datum" value="true"/>
    <param name="publish_filtered_gps" value="true"/>
    <remap from="/gps/fix" to="/fix"/>
    <remap from="/odometry/gps" to="/my_robot/odometry/gps"/>
    <rosparam param="datum">[LAT, LONG, ALT]</rosparam>

</node>
</launch>
edit flag offensive delete link more
0

answered 2022-02-08 07:30:46 -0500

Laghbani gravatar image

I have the same problem

edit flag offensive delete link more
0

answered 2021-07-13 05:08:43 -0500

xaru8145 gravatar image

You need to add a remap in navsat transform:

<remap from="/odometry/gps" to="/my_robot/odometry/gps"/>

Navsat is publishing /odometry/gps not /my_robot/odometry/gps.

edit flag offensive delete link more

Comments

hello. that does not help. IStill no change. I have updated the launch file to show the changes. I added it right before the inputs comment. Thanks for the reply, though.

lxg gravatar image lxg  ( 2021-07-18 12:34:16 -0500 )edit

I think that there may be a problem with your gps data.It may be that the status of the gps is -1, etc.

joeray gravatar image joeray  ( 2021-07-31 02:39:42 -0500 )edit

how can I confirm the status of the GPS data? I don't think that's the issue. but its worth checking.

lxg gravatar image lxg  ( 2021-08-01 10:51:13 -0500 )edit

Can you add sample messages of each sensor that goes int o the EKF regardeless it is real or simulated?

xaru8145 gravatar image xaru8145  ( 2021-08-04 04:32:48 -0500 )edit

@xaru8145 I added sample sensor messages at the end of the launch file. It is all simulated.

lxg gravatar image lxg  ( 2021-08-05 10:38:47 -0500 )edit

is your IMU publishing heading? Navsat won't run until it get's a heading.

billy gravatar image billy  ( 2021-08-05 16:03:49 -0500 )edit

I think this is still the problem of the original data of the input sensor.Try to change the frame_id of gps to the frame_id of your robot chassis. I hope this can help you.

joeray gravatar image joeray  ( 2021-08-05 21:08:26 -0500 )edit

Hello billy, if by heading you mean the orientation, yes it does. I attached the IMU sensor sample data to the post above. Right below the original launch file.

lxg gravatar image lxg  ( 2021-08-06 03:40:16 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2021-07-06 08:33:02 -0500

Seen: 606 times

Last updated: Jul 25 '23