Hi, I'm trying to use the navsat_transform_node as per the example provided in the robot_localization package. However, the output of the node always diverges (quite significantly) from the original GPS points (see image below - odom.csv is the odometry without GPS, odom_fused.csv incorporates the GPS, odom_gps.csv is the output of the navsat_transform_node, gps.csv is the input GPS points, and gps_filtered.csv is the filtered GPS output from navsat_transform_node). I used the Haversine formula to convert the GPS coordinates into the local odom frame (assuming that the first GPS point is the true start position of the robot). The odometry output (from ekf_se_odom) lines up nicely with the GPS data, so the heading information from the IMU seems to be correct. However, the output from navsat_transform is slightly rotated from the GPS data, and consequently the ekf_se_map output does not line up with the GPS data. Interestingly, the filtered GPS output is still quite close to the original GPS.
I'm pretty sure that the cause of the error is that the navsat_transform_node is using a heading that is slightly off to initialise itself. However, I have no idea how to go about fixing this. Any suggestions? I have uploaded the bagfile, launch and parameter files here - https://drive.google.com/drive/folders/0Bx8pkplHLcVUYVA1M2RGOWd6V2M?usp=sharing
Thanks in advance for your help!
EDIT:
Configuration data:
ekf_se_odom:
frequency: 30
sensor_timeout: 0.1
two_d_mode: true
transform_time_offset: 0.0
print_diagnostics: true
debug: false
map_frame: map
odom_frame: odom
base_link_frame: base_link
world_frame: odom
twist0: radar
twist0_config: [false, false, false,
false, false, false,
true, true, false,
false, false, false,
false, false, false]
twist0_queue_size: 10
twist0_nodelay: false
twist0_differential: false
twist0_relative: false
imu0: imu
imu0_config: [false, false, false,
false, false, true,
false, false, false,
false, false, true,
true, false, false]
imu0_nodelay: false
imu0_differential: false
imu0_relative: false
imu0_queue_size: 10
imu0_remove_gravitational_acceleration: true
use_control: false
process_noise_covariance: [1e-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1e-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1e-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0.3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0.3, 0, 0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, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.0]
ekf_se_map:
frequency: 30
sensor_timeout: 0.1
two_d_mode: true
transform_time_offset: 0.0
print_diagnostics: true
debug: false
map_frame: map
odom_frame: odom
base_link_frame: base_link
world_frame: map
twist0: radar
twist0_config: [false, false, false,
false, false, false,
true, true, false,
false, false, false,
false, false, false]
twist0_queue_size: 10
twist0_nodelay: false
twist0_differential: false
twist0_relative: false
imu0: imu
imu0_config: [false, false, false,
false, false, true,
false, false, false,
false, false, true,
true, false, false]
imu0_nodelay: false
imu0_differential: false
imu0_relative: false
imu0_queue_size: 10
imu0_remove_gravitational_acceleration: true
odom0: odometry/gps
odom0_config: [true, true, false,
false, false, false,
false, false, false,
false, false, false,
false, false, false]
odom0_queue_size: 10
odom0_nodelay: true
odom0_differential: false
odom0_relative: false
use_control: false
process_noise_covariance: [1.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1e-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0.3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0.3, 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, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0.1, 0, 0, 0, 0, 0, 0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0
magnetic_declination_radians: 0.0 # It is already incorporated by the imu/gps unit
yaw_offset: 0
zero_altitude: false
broadcast_utm_transform: true
publish_filtered_gps: true
use_odometry_yaw: false
wait_for_datum: false
Sample messages:
/radar:
header:
seq: 1074189
stamp:
secs: 1474298977
nsecs: 705579613
frame_id: base_link
twist:
twist:
linear:
x: 0.5234375
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0
covariance: [0.01234567901234568, 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.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, 0.0, 0.0, 0.0, 0.0]
/imu:
header:
seq: 23381
stamp:
secs: 1474298977
nsecs: 696676291
frame_id: base_link
orientation:
x: -0.00420055072755
y: -0.0023727978114
z: 0.983819246292
w: 0.179098829627
orientation_covariance: [2.7416e-05, 0.0, 0.0, 0.0, 2.7416e-05, 0.0, 0.0, 0.0, 0.000304607]
angular_velocity:
x: -0.00396632356569
y: -0.000390391069232
z: 0.0021740719676
angular_velocity_covariance: [3.046e-06, 0.0, 0.0, 0.0, 3.046e-06, 0.0, 0.0, 0.0, 3.046e-06]
linear_acceleration:
x: 0.268662780523
y: -0.0573329739273
z: 9.85708904266
linear_acceleration_covariance: [6.1591e-05, 0.0, 0.0, 0.0, 6.1591e-05, 0.0, 0.0, 0.0, 6.1591e-05]
/gps:
header:
seq: 22829
stamp:
secs: 1474298977
nsecs: 697491504
frame_id: base_link
status:
status: 0
service: 0
latitude: 52.6131248474
longitude: 12.8844614029
altitude: 0.0
position_covariance: [8.7025, 0.0, 0.0, 0.0, 8.7025, 0.0, 0.0, 0.0, 0.0]
position_covariance_type: 2
Originally posted by andrewpalmer on ROS Answers with karma: 13 on 2017-02-20
Post score: 1
Original comments
Comment by Tom Moore on 2017-02-21:
Can you please move your configuration data into the question, and post sample input messages for all inputs? Thanks.
Comment by Tom Moore on 2017-02-21:
Also, how are you comparing the GPS data to the odometry data? What is shown in the plot?
Comment by andrewpalmer on 2017-02-22:
Hi Tom, thanks for your quick response. I have put the configuration data and sample input message into the question. For comparing the GPS and odometry data, I convert the GPS into the local odom frame using the Haversine formula. I also added a small explanation of the graph in the question.
Comment by andrewpalmer on 2017-02-27:
@tom-moore Just wondering if you spotted anything obviously wrong with my setup?
Comment by Tom Moore on 2017-02-27:
Sorry for the delay! I'm in the middle of a rather busy period at work, but will investigate this as soon as I can. Thanks!
Comment by andrewpalmer on 2017-02-27:
No worries, thanks for looking into it.