Help needed to get simple IMU localization working
I am having trouble getting a simple imu robot localization going. I am interested in observing the imu drift and am not using an odometer. A method to correct the drift will be added later. The imu is the BN0055 and it is serviced by the rtimulib_ros package.
Problem 1: The rosout topic puts out the following every 2 seconds:
name: "/ekf_se"
msg: "Could not obtain transform from map to base_link. Error was \"base_link\" passed\
\ to lookupTransform argument target_frame does not exist. \n"
file: "/tmp/binarydeb/ros-kinetic-robot-localization-2.4.3/src/ros_filter_utilities.cpp"
function: "RosFilterUtilities::lookupTransformSafe"
line: 135
Problem 2: No position estimate comes out any of the topics. I'm assuming the package will double integrate the imu accelerations to calculate a position estimate. Which topic should I get the position?
rostopic list:
/cmd_vel # no activity
/diagnostics # "The robot_localization state estimation node appears to be functioning properly."
/example/another_odom # no activity
/example/odom # no activity
/example/pose # no activity
/example/twist # no activity
/imu # correct imu data is streaming
/odometry/filtered # no activity
/rosout # The map transform error message
/rosout_agg # The map transform error message
/set_pose # no activity
/tf # transform messages streaming, example below
/tf_static # no activity
typical tf message:
transforms:
header:
seq: 0
stamp:
secs: 1526568019
nsecs: 523587724
frame_id: "link1_parent"
child_frame_id: "link1"
transform:
translation:
x: 1.0
y: 0.0
z: 0.0
rotation:
x: 0.0
y: 0.0
z: 0.0
w: 1.0
typical imu message:
header:
seq: 93788
stamp:
secs: 1526572296
nsecs: 264639593
frame_id: "map"
orientation:
x: -0.0779868140817
y: 0.0903641656041
z: 0.0258044376969
w: 0.992515265942
orientation_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
angular_velocity:
x: 0.00111111113802
y: -0.0
z: -0.0
angular_velocity_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
linear_acceleration:
x: -0.186000004411
y: -0.142000004649
z: 0.972000002861
linear_acceleration_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
robot_localization launch file:
<launch>
<node pkg="robot_localization" type="ekf_localization_node" name="ekf_se" clear_params="true">
<rosparam command="load" file="$(find robot_localization)/params/translate_ekf.yaml" />
</node>
I have inserted the following code from FrozenCh here. Was using regular TF. Still get same error msg
<node pkg="tf2_ros" type="static_transform_publisher" name="tf2_imu_broadcaster" args="0 0 0 0 0 0 imu_frame base_link"/>
</launch>
translate_ekf.yaml:
frequency: 30
sensor_timeout: 0.1
two_d_mode: false
transform_time_offset: 0.0
transform_timeout: 0.0
print_diagnostics: true
debug: false
debug_out_file: /path/to/debug/file.txt
publish_tf: true
publish_acceleration: false
map_frame: map
odom_frame: odom
base_link_frame: base_link
world_frame: odom
odom0: example/odom
odom0_config: [true, true, false,
false, false, false,
false, false, false,
false, false, true,
false, false, false]
odom0_queue_size: 2
odom0_nodelay: false
odom0_differential: false
odom0_relative: false
odom0_pose_rejection_threshold: 5
odom0_twist_rejection_threshold: 1
odom1: example/another_odom
odom1_config: [false, false, true,
false, false, false,
false, false, false,
false, false, true,
false, false, false]
odom1_differential: false
odom1_relative: true
odom1_queue_size: 2
odom1_pose_rejection_threshold: 2
odom1_twist_rejection_threshold: 0.2
odom1_nodelay: false
pose0: example ...
If you provide more details on how you're launching
robot_localization
(i.e., the specific launch file / configs) it will be easier to understand what you're doing and help.My question was rather ill defined. I'll post another question with the launch file and configs.
Couldn't you just edit this one?
try this in your launch to link base_link and imu_frame in tf.
in which, the zeros means "x y z yaw pitch roll"
@FrozenCh I am using the tf, instead of the tf2_ros. That should work right?
I have edited the question to include more details.
@FrozenCh I have put your code into the launch file, but still get the same results