navsat_transform_node not publishing robot/odometry/gps
hi all. I am trying to use robotlocalizationnode 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: 2.89693306053e-07
w: 0.999999999929
orientation_covariance: [1.0412328196584755e-18, 0.0, 0.0, 0.0, 1.0412328196584755e-18, 0.0, 0.0, 0.0, 0.0]
angular_velocity:
x: 1.88095888593e-08
y: 1.39558225461e-08
z: -4.78642604517e-09
angular_velocity_covariance: [1.0000000000000001e-16, 0.0, 0.0, 0.0, 1.0000000000000001e-16, 0.0, 0.0, 0.0, 1.0000000000000001e-16]
linear_acceleration:
x: -0.000232673878101
y: 1.06067981684e-06
z: 9.80000000735
linear_acceleration_covariance: [1.0000000000000001e-16, 0.0, 0.0, 0.0, 1.0000000000000001e-16, 0.0, 0.0, 0.0, 1.0000000000000001e-16]
<plugin name="gps_controller" filename="libhector_gazebo_ros_gps.so">
<alwayson>true</alwayson>
<updaterate>10.0</updaterate>
<bodyname>base_link</bodyname>
<frameId>base_link</frameId>
<topicname>/fix</topicname>
<status>2</status>
<velocitytopicname>/fix_velocity</velocitytopicname>
<!-- <drift>5.0 5.0 5.0</drift> -->
<drift>0.0 0.0 0.0</drift>
<!-- <gaussiannoise>0.1 0.1 0.1</gaussiannoise> -->
<gaussiannoise>6.0 6.0 6.0</gaussiannoise>
<velocitydrift>0 0 0</velocitydrift>
<referenceLatitude>0.0</referenceLatitude>
<referenceLongitude>0.0</referenceLongitude>
<velocitygaussiannoise>1.0 1.0 1.0</velocitygaussiannoise>
</plugin>
The error message i get when i try to access /my_robot/odometry/gps
is
WARNING: no messages received and simulated time is active.
Is /clock being published?
am using ros melodic, ubuntu 18.04.
Asked by lxg on 2021-07-06 08:33:02 UTC
Answers
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.
Asked by xaru8145 on 2021-07-13 05:08:43 UTC
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.
Asked by lxg on 2021-07-18 12:34:16 UTC
I think that there may be a problem with your gps data.It may be that the status of the gps is -1, etc.
Asked by joeray on 2021-07-31 02:39:42 UTC
how can I confirm the status of the GPS data? I don't think that's the issue. but its worth checking.
Asked by lxg on 2021-08-01 10:51:13 UTC
Can you add sample messages of each sensor that goes int o the EKF regardeless it is real or simulated?
Asked by xaru8145 on 2021-08-04 04:32:48 UTC
@xaru8145 I added sample sensor messages at the end of the launch file. It is all simulated.
Asked by lxg on 2021-08-05 10:38:47 UTC
is your IMU publishing heading? Navsat won't run until it get's a heading.
Asked by billy on 2021-08-05 16:03:49 UTC
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.
Asked by joeray on 2021-08-05 21:08:26 UTC
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.
Asked by lxg on 2021-08-06 03:40:16 UTC
@joeray, tried manually setting the GPS status to 1 or 2 as well, still no change. Its currently 0.
Asked by lxg on 2021-08-06 04:52:21 UTC
@joeray, I have attached my GPS configuration
Asked by lxg on 2021-08-06 05:00:15 UTC
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>
Asked by Iftahnaf on 2023-07-25 12:08:07 UTC
Comments