Skip to content

Creating a Package for using the Navigation Stack

Michael Ruan edited this page Nov 20, 2019 · 4 revisions

The following steps illustrate the process in order to set up the nav_husky_gazebo package.

  1. Create the nav_husky_gazebo package with its dependencies:
$ catkin_create_pkg nav_husky_gazebo rospy move_base nav_msgs sensor_msgs std_msgs tf
  1. Create 4 .yaml configuration files in config/:
    • costmap common
    • local costmap
    • global costmap
    • local base planner
  1. Create launch file for Navigation Stack launch/move_base.launch.
  2. Run $ catkin_make to and then source slam-ws/devel/setup.bash. This will build the package and make it available to ROS. These two commands must be run anytime a new package is modified or added.

To run the Navigation Stack:

# [Terminal 1] Start up the Robot in simulation
$ roslaunch husky_gazebo husky_playpen.launch

# [Terminal 2] Start rviz
$ roslaunch husky_viz view_robot.launch
# In rviz, tick the "Navigation" tick box

# [Terminal 3] Start up the Navigation Stack
# NOTE: make sure you build the package first!
$ roslaunch nav_husky_gazebo move_base.launch

To get the robot to navigate, set a 2D Nav Goal in rviz. With the Navigation enabled, it should attempt to autonomously navigate to the goal (this may fail for difficult goals, but will succeed for easy to reach goals). You can also set a goal programmatically by following the instructions here.

  • NOTE: Difficult goals is another way of saying corner cases the Nav stack isn't configured to handle yet.