Nav2 navigation while mapping setup
Hi, I've been trying to setup Nav2 stack for my custom robot, but I have some trouble with how it works.
About the setup:
I am using ROS2 Foxy with Navigation installed from debs, I have my own custom workspace with gazebo simulation containing robot and somewhat randomized world. The robot has diff drive plugin and some sensors (for example lidar) from gazebo_ros_pkgs
enabled. I can publish on the /cmd_vel
topic and use keyboard_teleop
to move the robot just fine.
The problem occurs when I want to run Navigation stack in a similar way to https://navigation.ros.org/tutorials/... (so starting with a blank map, and then moving robot around). In my launch file I use cartographer_ros
package to provide slam, and I include Nav2 bringup:
IncludeLaunchDescription(
PythonLaunchDescriptionSource(os.path.join(launch_dir, 'navigation_launch.py')),
launch_arguments={'namespace': '',
'use_sim_time': use_sim_time,
'autostart': 'true',
'params_file': params_file,
'use_lifecycle_mgr': 'false',
'map_subscribe_transient_local': 'true'}.items()),
where params file is taken from https://github.com/ros-planning/navig...
I know that the parameters were made for the Turtlebot robot, but I wanted to try a baseline. The Nav2 stack launches just fine (I think), and I have ability to set up robot pose and send a goal. But there are some things that don't work:
Firstly, AMCL particle swarm doesn't seem to be published in rviz.
Secondly, when I send Nav2 goal, robot moves around a little bit like it is confused about what to do (see gif attached). The question is, how can I fix/improve this? I can provide more information (maybe rosbags?), but I'm not sure what would be relevant in this case.