A custom costmap layer for ROS that simulates stair detection for Turtlebot3. This package adds a costmap layer that creates obstacles in front of the robot based on sensor input.
- Custom costmap layer that integrates with Turtlebot3's navigation stack
- Creates obstacle markings in front of the robot when stairs are detected
- Maintains obstacle positions until navigation goal is completed or aborted
- Includes a mock sensor node for testing purposes
- ROS Noetic
- Turtlebot3 packages
- Ubuntu 20.04
# Install Turtlebot3 packages
sudo apt-get install ros-noetic-turtlebot3
sudo apt-get install ros-noetic-turtlebot3-simulations
- Clone this repository into your catkin workspace:
cd ~/catkin_ws/src
git clone https://github.com/AlpMercan/stair_costmap.git
git clone https://github.com/ros-planning/navigation.git
add the navigations position of ros planing to your stari_costmaps cmakelist
- Build the package:
cd ~/catkin_ws
catkin_make
- Source your workspace:
source ~/catkin_ws/devel/setup.bash
- Launch Turtlebot3 simulation:
roslaunch turtlebot3_gazebo turtlebot3_house.launch
- Launch navigation stack:
roslaunch turtlebot3_navigation turtlebot3_navigation.launch
- Run the mock sensor node for testing:
rosrun stair mock_sensor.py
The mock sensor node publishes a sequence of values [10, 10, 10, 60, 10, 10, 10] to simulate stair detection:
- Values below threshold (50.0): Safe to navigate
- Values above threshold (50.0): Stairs detected
The costmap layer can be configured with the following parameters:
threshold
(default: 50.0): Detection thresholdcostmap_value
(default: 254): Cost value for detected obstaclesregion_size
(default: 0.3m): Size of the marked regionforward_distance
(default: 0.5m): Distance in front of robot to mark obstacles
- None directly (modifies costmap)
/stair_detection
(std_msgs/Float32): Sensor input Its mocked for this case/move_base/status
(actionlib_msgs/GoalStatusArray): Navigation status
The package consists of two main components:
- StairLayer: Custom costmap layer that integrates with move_base
- Mock Sensor: Python node that simulates sensor data for testing
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
ALP MERCAN