Skip to content

manavsikkas/ros2_wall_follower

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ros2_wall_follower

LiDAR-based reactive wall-following robot for ROS2 Jazzy. The robot follows the left wall by monitoring laser scan regions and adjusting velocity — no Nav2 or SLAM required.

How It Works

The node divides the LiDAR scan into three regions:

            Front (-15° to 15°)
                  ┌───┐
                  │   │
Front-Left ──────▶│ R │
(30° to 60°)      │   │
                  │   │
Left  ───────────▶│   │
(80° to 100°)     └───┘

Decision logic:

  1. Wall ahead (front < threshold) → slow down, turn right
  2. Too far from wall (left > target × 1.5) → turn left to approach
  3. Too close to wall (left < target × 0.7) → turn right to move away
  4. Tracking → proportional control using front-left distance error

Dependencies

  • ROS2 Jazzy
  • TurtleBot3 Gazebo (ros-jazzy-turtlebot3-gazebo)

Installation

cd ~/ros2_ws/src
git clone https://github.com/manavsikkas/ros2_wall_follower.git
cd ..
colcon build --packages-select ros2_wall_follower
source install/setup.bash

Usage

export TURTLEBOT3_MODEL=waffle
ros2 launch ros2_wall_follower wall_follower.launch.py

With Gazebo GUI:

ros2 launch ros2_wall_follower wall_follower.launch.py gui:=true

Parameters

Parameter Default Description
target_distance 0.5 Desired distance from the wall (meters)
max_linear_speed 0.2 Maximum forward speed (m/s)
max_angular_speed 1.5 Maximum turn rate (rad/s)
front_threshold 0.6 Distance to trigger front-wall avoidance (meters)
use_stamped_cmd_vel true Publish TwistStamped (Gazebo Harmonic) vs Twist

Topics

Topic Type Direction Description
/scan LaserScan Subscribe LiDAR scan data
/cmd_vel TwistStamped Publish Velocity commands

License

MIT

About

LiDAR-based reactive wall following controller for TurtleBot3 on ROS2 Jazzy

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages