Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[xslocobot_nav] SLAM and Nav2 functionalities #35

Draft
wants to merge 15 commits into
base: humble
Choose a base branch
from

Conversation

stephenadhi
Copy link

@stephenadhi stephenadhi commented Feb 24, 2023

Hi,

I'm further improving nav2 functionalities, hoping to make both RTABMAP and slam_toolbox work as well as adding localizazion mode using nav2_amcl given a map yaml file.

Changes

  1. Added sample map interbotix_map.pgm based on the SLAM result using the interbotix.world in gazebo.
  2. Fixed nav2 functionalities
    • Static layer receiving data from map_server. Transformation from map to odom published by amcl.
    • Able to produce global plan given a goal pose.
    • add missing use_sim_time in param file. This has to be explicitly written in the yaml file, so the launch file can substitute the value based on the given launch argument. Otherwise it produces an error due to different time.
  3. Added standard AMCL parameter and launch argument option.
  4. Minor bug in param file and in launch file regarding lifecycle nodes.
  5. Added more RviZ visualization i.e. for global/local plan, amcl particle_cloud.

The nav2 parameters are by default configured for the real robot.
For testing in simulation, we need to either change the parameters or adjust the odom and cmd_vel topic remappings inside the urdf file to reproduce the same result.

Testing

  1. Launching simulator
    ros2 launch interbotix_xslocobot_sim xslocobot_gz_classic.launch.py robot_model:=locobot_base robot_name:=locobot use_lidar:=true

  2. Mapping mode: Launching SLAM using slam_toolbox
    ros2 launch interbotix_xslocobot_nav xslocobot_slam_toolbox.launch.py launch_driver:=false slam_mode:=online_async use_sim_time:=true cmd_vel_topic:=/locobot/diffdrive_controller/cmd_vel_unstamped

  3. Localization mode: launching nav2 + map from yaml and using amcl localization
    *Note: replace map filepath to your interbotix_ros_rovers folder location
    ros2 launch interbotix_xslocobot_nav xslocobot_nav2_bringup.launch.py slam_mode:=localization robot_name:=locobot map:=/workspaces/locobot/src/interbotix_ws/interbotix_ros_rovers/interbotix_ros_xslocobots/interbotix_xslocobot_nav/maps/interbotix_map.yaml use_sim_time:=true cmd_vel_topic:=/locobot/diffdrive_controller/cmd_vel_unstamped

image

 amcl, map_server, use_sim_time parameter substitution, behavior server in humble, static costmap layer
@stephenadhi stephenadhi changed the base branch from main to humble February 24, 2023 16:03
 Renaming slam_mode launch argument to slam_toolbox_mode so it will not interfere when launching rtabmap. Log level info.
@stephenadhi stephenadhi marked this pull request as draft March 3, 2023 19:32
@lukeschmitt-tr
Copy link
Member

@stephenadhi what is left to do before this is ready to be reviewed?

@stephenadhi stephenadhi marked this pull request as ready for review May 10, 2023 18:55
@stephenadhi
Copy link
Author

Hi, you can review and test whether the localization with AMCL is working.

@stephenadhi what is left to do before this is ready to be reviewed?

@stephenadhi stephenadhi reopened this May 10, 2023
@stephenadhi
Copy link
Author

stephenadhi commented May 23, 2023

@LSinterbotix UPDATE 23/05/2023:
Since xslocobot_nav2_bringup.launch.py is used by both slam_toolbox and RTABMAP, the launch argument slam_toolbox_mode is only exclusive for the slam_toolbox launch file. I reverted the slam_toolbox_mode in nav2_bringup launch back to slam_mode and the options are only supposed to be between 'localization' and 'mapping'.

So if anyone ever wants to use AMCL, they should just launch the xslocobot_nav2_bringup.launch.py directly with the launch argument slam_mode:=localization (PR description updated). This is exactly how it is done in Nav2 bringup , support for using localization with slam toolbox is then out of scope.

For me the simulation seems to be a bit problematic with the robot odometry, both in mapping and localization mode (Its more prone to shifts compared to in real life). So far I have been mapping using the slam toolbox in the real robot hardware without problem, performance is really good. I did not have the time to test this AMCL localization yet.

Also specific to the humble distro branch:
Added use composition launch and fixed param namings

Fix bug Waiting for service map_server/get_state
Adjust launch file to accomodate both rtabmap and slam_toolbox
@stephenadhi stephenadhi changed the title [xslocobot_nav] Add sample map and AMCL [xslocobot_nav] SLAM and Nav2 functionalities Jun 20, 2023
@stephenadhi stephenadhi marked this pull request as draft June 20, 2023 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants