Convert Figma logo to code with AI

ros-navigation logonavigation2

ROS 2 Navigation Framework and System

2,461
1,244
2,461
80

Top Related Projects

Universal grid map library for mobile robotic mapping

ROS Navigation stack. Code for finding where the robot is and how it can get somewhere else.

1,669

:robot: The MoveIt motion planning framework

Quick Overview

Navigation2 (Nav2) is the next generation of the ROS Navigation Stack, designed for ROS 2. It provides a set of modules for robot navigation, including path planning, obstacle avoidance, and localization. Nav2 is highly configurable and extensible, making it suitable for a wide range of robotic applications.

Pros

  • Fully compatible with ROS 2, taking advantage of its improved performance and security features
  • Modular architecture allows for easy customization and extension of navigation capabilities
  • Supports various types of robots, including differential drive, omnidirectional, and legged robots
  • Includes advanced features like behavior trees for complex navigation tasks and 3D navigation support

Cons

  • Steeper learning curve compared to the original ROS Navigation Stack
  • Documentation, while improving, may still be lacking in some areas for advanced use cases
  • Requires more computational resources compared to the ROS 1 navigation stack
  • Some legacy ROS 1 navigation plugins may not be directly compatible and require porting

Code Examples

  1. Creating a basic navigation node:
from nav2_simple_commander.robot_navigator import BasicNavigator
import rclpy

rclpy.init()
navigator = BasicNavigator()

# Set initial pose
initial_pose = navigator.get_initial_pose()
navigator.setInitialPose(initial_pose)

# Wait for navigation to fully activate
navigator.waitUntilNav2Active()
  1. Sending a goal to the navigation stack:
from geometry_msgs.msg import PoseStamped

goal_pose = PoseStamped()
goal_pose.header.frame_id = 'map'
goal_pose.pose.position.x = 2.0
goal_pose.pose.position.y = 1.5
goal_pose.pose.orientation.w = 1.0

navigator.goToPose(goal_pose)
  1. Using behavior trees for complex navigation tasks:
from nav2_msgs.action import NavigateToPose
from nav2_simple_commander.robot_navigator import BasicNavigator

navigator = BasicNavigator()

# Load and use a behavior tree
navigator.loadBehaviorTree('navigate_w_replanning_and_recovery.xml')
goal = NavigateToPose.Goal()
goal.pose.header.frame_id = 'map'
goal.pose.pose.position.x = 1.0
goal.pose.pose.position.y = 1.0
goal.pose.pose.orientation.w = 1.0

navigator.goToPose(goal)

Getting Started

To get started with Navigation2:

  1. Install ROS 2 and the Nav2 stack:

    sudo apt install ros-<ros2-distro>-navigation2 ros-<ros2-distro>-nav2-bringup
    
  2. Create a new ROS 2 package for your robot:

    ros2 pkg create --build-type ament_cmake my_robot_nav
    
  3. Configure your robot's URDF, map, and Nav2 parameters.

  4. Launch Nav2 with your robot:

    ros2 launch nav2_bringup bringup_launch.py use_sim_time:=True map:=/path/to/map.yaml
    
  5. Use the BasicNavigator API or RViz2 to send navigation goals to your robot.

Competitor Comparisons

Universal grid map library for mobile robotic mapping

Pros of grid_map

  • Specialized for 2D grid map operations, offering efficient data structures and algorithms for map manipulation
  • Provides a wide range of map-specific functions, including interpolation, filtering, and geometric operations
  • Lightweight and focused, making it easier to integrate into existing robotics projects

Cons of grid_map

  • Limited scope compared to navigation2, focusing primarily on grid map operations rather than full navigation stack
  • May require additional packages or custom development for complete navigation solutions
  • Less active community and fewer contributors compared to the larger navigation2 project

Code Comparison

navigation2 (C++):

nav2_msgs::msg::Costmap costmap_msg;
nav2_costmap_2d::Costmap2D* costmap = costmap_ros_->getCostmap();
nav2_costmap_2d::Costmap2DPublisher::toMsg(*costmap, costmap_msg);

grid_map (C++):

grid_map::GridMap map;
map.setGeometry(grid_map::Length(1.0, 1.0), 0.01);
map.add("elevation");
map["elevation"].setConstant(0.0);

The code snippets demonstrate the different focus areas of the two projects. navigation2 deals with costmaps and navigation-specific data structures, while grid_map provides a more general-purpose grid map manipulation interface.

ROS Navigation stack. Code for finding where the robot is and how it can get somewhere else.

Pros of navigation

  • More mature and stable, with a longer history of development and use
  • Wider community support and extensive documentation
  • Compatible with older ROS 1 systems, beneficial for legacy projects

Cons of navigation

  • Limited to ROS 1, not compatible with ROS 2 without significant modifications
  • Less modular architecture, making it harder to extend or customize
  • Lacks some modern features and optimizations present in navigation2

Code Comparison

navigation (C++):

void DWAPlanner::calculateVelocities(...) {
  // Velocity calculation logic
}

navigation2 (C++):

void DWBLocalPlanner::computeVelocityCommands(...) {
  // More modular velocity computation
}

The navigation2 codebase generally demonstrates a more modular and flexible approach, with improved separation of concerns and easier extensibility compared to the original navigation stack.

1,669

:robot: The MoveIt motion planning framework

Pros of MoveIt

  • Specialized for robotic arm manipulation and motion planning
  • Extensive inverse kinematics solvers and collision checking capabilities
  • Rich ecosystem of plugins and tools for various robotic applications

Cons of MoveIt

  • Steeper learning curve for beginners compared to Navigation2
  • Less focused on mobile robot navigation and SLAM
  • Can be resource-intensive for simpler navigation tasks

Code Comparison

MoveIt (C++):

#include <moveit/move_group_interface/move_group_interface.h>

moveit::planning_interface::MoveGroupInterface move_group("arm");
geometry_msgs::Pose target_pose;
move_group.setPoseTarget(target_pose);
move_group.move();

Navigation2 (Python):

from nav2_simple_commander.robot_navigator import BasicNavigator

navigator = BasicNavigator()
goal_pose = PoseStamped()
navigator.goToPose(goal_pose)

MoveIt focuses on arm manipulation with detailed control over joint movements, while Navigation2 emphasizes mobile robot navigation with a simpler interface for goal-oriented movement. MoveIt's code involves more setup for specific robot configurations, whereas Navigation2 provides a more straightforward approach to navigation tasks.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Nav2

GitHub Workflow Status codecov Build Status

For detailed instructions on how to:

Please visit our documentation site. Please visit our community Slack here (if this link does not work, please contact maintainers to reactivate).

⚠️ If you need professional services related to Nav2, please contact Open Navigation at info@opennav.org.

Our Sponsors

Please thank our amazing sponsors for their generous support of Nav2 on behalf of the community to allow the project to continue to be professionally maintained, developed, and supported for the long-haul! Open Navigation LLC provides project leadership, maintenance, development, and support services to the Nav2 & ROS community.

Dexory develops robotics and AI logistics solutions to drive better business decisions using a digital twin of warehouses to provide inventory insights.

Nvidia develops GPU and AI technologies that power modern robotics, autonomous driving, data centers, gaming, and more.

Polymath Robotics creates safety-critical navigation systems for industrial vehicles that are radically simple to enable and deploy.

Stereolabs produces the high-quality ZED stereo cameras with a complete vision pipeline from neural depth to SLAM, 3D object tracking, AI and more.

Confidential is just happy to support Nav2's mission!

Citation

If you use the navigation framework, an algorithm from this repository, or ideas from it please cite this work in your papers!

@InProceedings{macenski2020marathon2,
  title = {The Marathon 2: A Navigation System},
  author = {Macenski, Steve and Martín, Francisco and White, Ruffin and Ginés Clavero, Jonatan},
  year = {2020},
  booktitle = {2020 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)},
  url = {https://github.com/ros-planning/navigation2},
  pdf = {https://arxiv.org/abs/2003.00368}
}

If you use any of the algorithms in Nav2 or the analysis of the algorithms in your work, please cite this work in your papers!

  @article{macenski2023survey,
        title={From the desks of ROS maintainers: A survey of modern & capable mobile robotics algorithms in the robot operating system 2}, 
        author={S. Macenski, T. Moore, DV Lu, A. Merzlyakov, M. Ferguson},
        year={2023},
        journal = {Robotics and Autonomous Systems}
  }

If you use the Smac Planner (Hybrid A*, State Lattice, 2D), please cite this work in your papers!

@article{macenski2024smac,
      title={Open-Source, Cost-Aware Kinematically Feasible Planning for Mobile and Surface Robotics}, 
      author={Steve Macenski and Matthew Booker and Josh Wallace},
      year={2024},
      journal = {Arxiv}
}

If you use the Regulated Pure Pursuit Controller algorithm or software from this repository, please cite this work in your papers!

@article{macenski2023regulated,
      title={Regulated Pure Pursuit for Robot Path Tracking}, 
      author={Steve Macenski and Shrijit Singh and Francisco Martin and Jonatan Gines},
      year={2023},
      journal = {Autonomous Robots}
}

If you use our work on VSLAM and formal comparisons for service robot needs, please cite the paper:

@InProceedings{vslamComparison2021,
  title = {A Comparison of Modern General-Purpose Visual SLAM Approaches},
  author = {Merzlyakov, Alexey and Macenski, Steven},
  year = {2021},
  booktitle = {2021 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)},
  pdf = {https://arxiv.org/abs/2107.07589}
}

Build Status

Packagehumble Sourcehumble Debianiron Sourceiron Debianjazzy Sourcejazzy Debian
navigation2Build StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_amclBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_behavior_treeBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_behaviorsBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_bringupBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_bt_navigatorBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_collision_monitorBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_commonBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_constrained_smootherBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_controllerBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_coreBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_costmap_2dBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_dockingBuild StatusBuild StatusN/AN/ABuild StatusBuild Status
nav2_dwb_controllerBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_graceful_controllerBuild StatusBuild StatusN/AN/ABuild StatusBuild Status
nav2_lifecycle_managerBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_map_serverBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_mppi_controllerBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_msgsBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_navfn_plannerBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_plannerBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_regulated_pure_pursuitBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_rotation_shim_controllerBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_rviz_pluginsBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_simple_commanderBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_smac_plannerBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_smootherBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_system_testsBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_theta_star_plannerBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_utilBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_velocity_smootherBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_voxel_gridBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status
nav2_waypoint_followerBuild StatusBuild StatusBuild StatusBuild StatusBuild StatusBuild Status