This ROS2 package demonstrates autonomous navigation using Turtlesim. The turtle navigates to random waypoints and avoids obstacles represented by additional turtles in the environment.
- Autonomous waypoint navigation
- Dynamic speed control using ROS2 parameters
- Obstacle avoidance with real-time feedback
- Modular design with separate navigation and obstacle management
-
Clone this repository into your ROS2 workspace:
cd ~/ros2_ws/src git clone https://github.com/SuperGops7/turtle_navigator.git
-
Build the package:
cd ~/ros2_ws colcon build
-
Source the workspace:
source install/setup.bash
-
Start the Turtlesim node:
ros2 run turtlesim turtlesim_node
-
Run the
move_turtlenode:ros2 run turtle_navigator move_turtle
-
Adjust turtle speed:
ros2 param set /move_turtle linear_speed 1.0 ros2 param set /move_turtle angular_speed 2.0
-
Add obstacles in
turtle_obstacle_manager.pyby defining additional turtles:self.obstacles = [ {'name': 'turtle2', 'position': [1.0, 7.0]}, {'name': 'turtle3', 'position': [7.0, 2.0]} ]
MoveTurtle: Manages turtle navigation and obstacle avoidance.TurtleObstacleManager: Handles spawning and tracking of obstacle turtles.
- Add dynamic obstacles or implement path planning for smarter navigation.