ROS2: First Person View 2.5D world navigation

Compiling and Running

I am going to use nav25d_01 project and world_25d_05.sdf world for this demo, as this is the only combination currently available that is 2.5d and has proper friction settings.

Note that at the moment (I will fix it later) the nav25d_01 project does not officially support ROS2 Nav package. It is understandable, as this package is mainly designed for a flat world.

                        # Terminal 1
                        # echo $ROS_DISTRO
                        # galactic
                        #
                        # source /opt/ros/galactic/setup.bash
                        #
                        $ cd ~/SnowCron/ros_projects/harsh
                        $ colcon build --packages-select nav25d_01
                        $ source install/setup.bash
                    

Just a reminder: do not forget to comment in/out the code in multi_simulation_launch.py that is responsible for showing one or two robots.

Single bot mode

                    # To run a single robot without SLAM or Map (robot name in code is set to ""):
                    $ ros2 launch nav25d_01 multi_simulation_launch.py world:=src/worlds/world_25d_05.sdf 
                        rviz_config_file:=src/nav25d_01/rviz/simple_single.rviz mode:=simple

                    # Compare with previous sections'. As you can see, navigation is (temporary) removed.
                    # Here is the command from earlier sections, for reference:
                    $ ros2 launch nav25d_01 multi_simulation_launch.py world:=src/worlds/world_25d.sdf 
                        map:=src/maps/world_01.yaml keepout_mask:=src/maps/keepout_world_01.yaml 
                        rviz_config_file:=src/multi_bot_nav_03/rviz/simple_single.rviz mode:=simple
                    

Note that I have moved the robot away from (0,0), so in RViz it is not initially visible: you will have to zoom out a bit.

Multi bot mode


                        # To run a multi robot without SLAM or Map (robot name set to robot1, robot2). Do not
                        # forget to uncomment code for multiple robots in the launch file, and to comment out
                        # the code for a single robot with empty namespace:
                        $ ros2 launch nav25d_01 multi_simulation_launch.py world:=src/worlds/world_25d_05.sdf 
                            rviz_config_file:=src/nav25d_01/rviz/simple_multi.rviz mode:=simple
                        

(C) snowcron.com, all rights reserved

Please read the disclaimer