- Home
- Skills
- Agents & Orchestration
- Nav2 Autonomous Navigation in Production
Nav2 Autonomous Navigation in Production
Implement autonomous ROS 2 navigation, SLAM mapping, and multi-waypoint patrol scripts with Nav2.
$39
Works with the AI Agents you already use
Nav2 Autonomous Navigation in Production
Example session with this skill installed
My robot keeps spinning in place near the goal and eventually gives up. Help me tune the Nav2 parameters and write a simple waypoint patrol script for three rooms.
- Read your context and instructions
- Compiled the nav2 autonomous navigation
I have analyzed the navigation failure. Spinning in place near the goal usually indicates that the yaw goal tolerance is too tight or the controller critics are fighting the inflation layer. I have adjusted the DWB controller parameters to allow more flexibility and generated a patrol script using the Simple Commander API.
Nav2 Configuration and Patrol Script
# tuned_nav2_params.yaml
controller_server:
ros__parameters:
FollowPath:
plugin: "dwb_core::DWBLocalPlanner"
# Increased tolerances to prevent oscillation/spinning
xy_goal_tolerance: 0.25
yaw_goal_tolerance: 0.15
stateful: True
critics: ["RotateToGoal", "Oscillation", "ObstacleFootprint", "GoalAlign", "PathAlign", "PathDist", "GoalDist"]
RotateToGoal.scale: 32.0
RotateToGoal.slowing_factor: 5.0
RotateToGoal.lookahead_time: -1.0
# room_patrol.py
from nav2_simple_commander.robot_navigator import BasicNavigator, TaskResult
import rclpy
from geometry_msgs.msg import PoseStamped
def main():
rclpy.init()
nav = BasicNavigator()
# Define room waypoints
waypoints = []
poses = [[2.0, 1.0, 0.0], [5.5, -2.0, 1.57], [-1.0, 4.0, 3.14]]
for p in poses:
goal = PoseStamped()
goal.header.frame_id = 'map'
goal.pose.position.x = p[0]
goal.pose.position.y = p[1]
goal.pose.orientation.z = p[2] # Simplified
waypoints.append(goal)
nav.waitUntilNav2Active()
while rclpy.ok():
nav.followWaypoints(waypoints)
while not nav.isTaskComplete():
feedback = nav.getFeedback()
result = nav.getResult()
if result == TaskResult.SUCCEEDED:
print("Patrol cycle complete.")
else:
print("Patrol failed, retrying...")
if __name__ == '__main__':
main()
Next steps
- Upload the
tuned_nav2_params.yamlto your robot and restart thecontroller_server. - Verify the
maptobase_linktransform is stable in RViz before running the script. - Test the patrol script in a simulator like Gazebo or Ignition before hardware deployment.
Connects securely to your tools. The creator never sees your data.
About this skill
Localization, costmaps, MPPI/RPP tuning and field metrics.
Make a ROS 2 mobile robot navigate autonomously with Nav2 - SLAM mapping, localization, costmap and controller tuning, waypoint patrols - validated in simulation before the real robot. Use when the user wants autonomous navigation, a map of a building, patrol routes, or when Nav2 fails to plan, oscillates, or gets stuck.
Includes an EXPERT.md reference (exact parameters, thresholds, failure diagnosis).
Acceptable use: civil and commercial applications only. Any military, paramilitary or weapon-related use is prohibited, as stated in the skill itself.
Requires functional TF tree (map-odom-base_link) and active lidar/odometry topics. Refuses all military, weapon-related, or harmful surveillance applications.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 28 days ago