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.
: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
- 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()
- 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)
- 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:
-
Install ROS 2 and the Nav2 stack:
sudo apt install ros-<ros2-distro>-navigation2 ros-<ros2-distro>-nav2-bringup
-
Create a new ROS 2 package for your robot:
ros2 pkg create --build-type ament_cmake my_robot_nav
-
Configure your robot's URDF, map, and Nav2 parameters.
-
Launch Nav2 with your robot:
ros2 launch nav2_bringup bringup_launch.py use_sim_time:=True map:=/path/to/map.yaml
-
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.
: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 designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Nav2
For detailed instructions on how to:
- Getting Started
- Concepts
- Build
- Install
- General Tutorials and Algorithm Developer Tutorials
- Configure
- Navigation Plugins
- Migration Guides
- Container Images for Building Nav2
- Contribute
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!
- S. Macenski, F. MartÃn, R. White, J. Clavero. The Marathon 2: A Navigation System. IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2020.
@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!
- S. Macenski, T. Moore, DV Lu, A. Merzlyakov, M. Ferguson, From the desks of ROS maintainers: A survey of modern & capable mobile robotics algorithms in the robot operating system 2, Robotics and Autonomous Systems, 2023.
@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!
- S. Macenski, M. Booker, J. Wallace, Open-Source, Cost-Aware Kinematically Feasible Planning for Mobile and Surface Robotics. 2024.
@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!
- S. Macenski, S. Singh, F. Martin, J. Gines, Regulated Pure Pursuit for Robot Path Tracking. Autonomous Robots, 2023.
@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:
- A. Merzlyakov, S. Macenski. A Comparison of Modern General-Purpose Visual SLAM Approaches. IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2021.
@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
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.
:robot: The MoveIt motion planning framework
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot