0
$\begingroup$

I'm trying to use slam_toolbox (2d LIDAR) in conjunction with robot_localization (IMU + Wheel Odom). So far my best idea for managing the frames is as shown in the pictures below. However, this results in the map frame in Rviz flickering a lot, and printing the frames shows that odomNew is bypassed. My goal transforms are odom (wheel encoders) <- odomNew (fused with IMU) <- map (slam'd with LIDAR readings). However, I may be approaching this wrong alltogether.

This is my config file for slam_toolbox

enter image description here

This is my config file for robot_localization

enter image description here

Here is my view_frame when I run it:

enter image description here

It basically ignores the odomNew frame alltogether. Is there a better way to do this? Both robot_localization and slam_toolbox work individually, but I can't run both at once properly. Any help is appreciated.

$\endgroup$
4
  • 1
    $\begingroup$ Could we get a screenshot of your frame-tree with rosrun tf view_frames, see here? Just to make sure your frames are actually connected as intended. $\endgroup$
    – Scoeerg
    Commented Jun 21 at 13:08
  • $\begingroup$ @Scoeerg just did. It looks like the odomNew frame isn't being made at all. $\endgroup$ Commented Jun 21 at 15:14
  • $\begingroup$ I'm starting to think that slam_toolbox doesn't care what you pass into odom_frame or map_frame, and just picks odom and map regardless. $\endgroup$ Commented Jun 21 at 15:20
  • $\begingroup$ Could we see the launch-file where you are starting the localisation package and pass the parameters? $\endgroup$
    – Scoeerg
    Commented Jun 21 at 16:38

2 Answers 2

0
$\begingroup$

Flickering is must probably caused since there are more than one nodes publishing to the odom (or odomNew) frame.

Generally speaking; there can be more than one odom source but only one node should publish the transformation to odom frame.

In your case both the robot_localization and slam_toolbox publishing the odom transformation, which is causing issues.

$\endgroup$
2
  • $\begingroup$ Why would slam_toolbox publish a transform to odom? I haven't mentioned the odom frame in its parameters? $\endgroup$ Commented Jun 21 at 15:15
  • $\begingroup$ On the odom_frame key you gave odomNew as the value. so slam_toolbox will make a transfrom between odom frame and map frame. It might be my mistake; name of your odom frame is odomNew on your parameters. I was referring to odomNew when i said odom frame $\endgroup$ Commented Jun 21 at 20:06
0
$\begingroup$

Turns out I had it right, but in ROS Humble, you need to pass the params file to the slam launch script as slam_param_file, not param_file like in previous vers.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.