How to determine the map_frame, odom_frame name in ekf_localization node param?
I am trying to fuse GPS, wheel encoders and IMU by ekf_localization node and navsat_transform node to obtain a continuous GPS cordinates. I don't know how to set the name of map_frame, odom_frame, base_link and world_frame.
In my situation, the odometry of the robot based on steering and wheel encoder is published as nav_msgs/Odometry
, an example of the message is shown below
header:
seq: 139492
stamp:
secs: 1624546971
nsecs: 664460140
frame_id: "odom"
child_frame_id: "base_footprint"
pose:
pose:
position:
x: 2.29628372192
y: -0.845857441425
z: -0.0185550469905
orientation:
x: 0.0
y: 0.0
z: -0.00927739040598
w: 0.999956964088
covariance: [1e-09, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.001, 1e-09, 0.0, 0.0, 0.0, 0.0, 0.0, 1000000.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1000000.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1000000.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1e-09]
twist:
twist:
linear:
x: 0.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0
covariance: [1e-09, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.001, 1e-09, 0.0, 0.0, 0.0, 0.0, 0.0, 1000000.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1000000.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1000000.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1e-09]
The position and orientation will both start at 0 (origin), and they will change while the robot move. For the twist data, only linear.x and angular.z will change when the robot move. It gives me a sense that the "pose" part is based on a world-fixed frame and the "twist" part is based on base_link (for each moment, it can be considered that the robot is moving forward and spin at some angular speed).
The imu message is obtained by fusing the data from a magnetometer and an IMU (for the absolute magnetic yaw),
header:
seq: 1224098
stamp:
secs: 1624548289
nsecs: 123066569
frame_id: "zed2_imu_link"
orientation:
x: 0.0427877284036
y: 0.034255768402
z: -0.777748269705
w: 0.62618158836
orientation_covariance: [3.9960495123901654e-10, 1.4403037812088548e-10, 1.3029284540139172e-11, 1.4403042140962682e-10, 6.822403156756942e-09, -2.392345191045738e-10, 1.3029292115668907e-11, -2.392344671580842e-10, 3.812703338370221e-10]
angular_velocity:
x: 0.00144947073752
y: 0.000326921393291
z: -0.00101205717865
angular_velocity_covariance: [6.051611585720667e-10, 0.0, 0.0, 0.0, 6.40283703963316e-10, 0.0, 0.0, -0.0, 5.595412319287679e-10]
linear_acceleration:
x: -1.05810296535
y: 0.00360304606147
z: 9.70647716522
linear_acceleration_covariance: [0.01027271244674921, 0.0, 0.0, 0.0, 0.007378986105322838, 0.0, 0.0, -0.0, 0.007802933920174837]
The frame_id of GPS message is gps_link, the message is in sensor_msgs/NavSatFix
.
I am stuck at setting following parameters of ekf_localization node,
map_frame: map # Defaults to "map" if unspecified
odom_frame: odom # Defaults to "odom" if unspecified
base_link_frame: base_link # Defaults to ...