Skip to content

A ROS Noetic package for sensor-based collision prevention in mobile robots. Supports both 2D (STDR) and 3D (Gazebo) simulations with configurable safety layers to stop or adjust motion before impact.

Notifications You must be signed in to change notification settings

ilke-kas/sensor-based-collision-prevention-2d-and-3d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sensor-Based Collision Prev

This repository contains the robot_no_crash package developed. The package is designed to prevent the collision during robot movement. This functionality is developed in both 2D (the STDR) and 3D (Gazebo).


Note: This package is intended for ROS Noetic on Ubuntu Focal. It is recommended to have basic knowledge of ROS nodes, services, and tf transformations to use this package effectively.


Table of Contents

  1. Package Structure
  2. Installation of Required Packages
  3. Clone This Repository
  4. Launching the Package
  5. Video for Running Experiment
  6. Links and Resources

Package Structure

  robot_no_crash
  ├── CMakeLists.txt
  ├── package.xml
  ├── launch
  │    ├── robot_no_crash.launch # for 2D STDR 
  │    └── robot_no_crash_gazebo.launch # for 3D gazebo
  ├── config
  │    ├── safety.yaml # for 2D STDR 
  │    └── safety_gazebo.yaml # for 3D gazebo
  ├── scripts
  │   └──robot_no_crash.py
  ├── src
  └── README.md

Installation of Required Packages

To use this package, ensure the following dependencies are installed:

Retrieve and prepare the STDR for building. Make a catkin workspace and make it the current working directory.

mkdir ‐p ~/stdr_ws/src
cd ~/stdr_ws/src

Installation of ros-noetic-turtlebot-2d-world

Install the ros-noetic-turtlebot-2d-world package from the course repository. This package depends on a Turtlebot 2 simulation and a Yujin Kobuki mobile base simulation.

 wget -q https://cwru-ecse-376.github.io/cwru-ecse-376.asc -O - | sudo apt-key add -
 sudo apt update
 sudo apt install  ros-noetic-turtlebot-2d-world

Configure to use ROS manually

source /opt/ros/noetic/setup.bash

Ensure all the dependencies are installed.

rosdep install -‐from‐paths src ‐i ‐y ‐r

Build the packages

catkin_make

Add the newly built packages to the environment

source devel/setup.bash

To make sure it is installed search this in your computer you installed.

    dpkg -L ros-noetic-turtlebot-2d-world

To test it run the following launch. To make sure it is installed search it in your computer you installed.

     roslaunch turtlebot_2d_world turtlebot_stdr_gazebo.launch

I got the following error in my case. If you also got the same error, please do the following steps:

The error:

     ... logging to /home/ilkekas/.ros/log/fecffa60-daa5-11ef-98e7-554aad097450/roslaunch-ilke-kas-335806.log
        Checking log directory for disk usage. This may take a while.
        Press Ctrl-C to interrupt
        Done checking log file disk usage. Usage is <1GB.


        RLException: Invalid roslaunch XML syntax: not well-formed (invalid token): line 8, column 37
        The traceback for the exception was written to the log file

How to fix?

     sudo nano /opt/ros/noetic/share/turtlebot_2d_world/launch/turtlebot_stdr_gazebo.launch

Then change the "value-" to "value=" in the launch file and save it. Then rerun the following roslaunch command.

     roslaunch turtlebot_2d_world turtlebot_stdr_gazebo.launch

Installation of STDR repository from GitHub

Clone the STDR repository from GitHub (Noetic is the default branch).

git clone ‐b noetic-devel / https://github.com/cwru‐ecse‐376/stdr_simulator.git

Prepare to make the packages Change to the base of the catkin workspace.

cd ../

Configure to use ROS manually

source /opt/ros/noetic/setup.bash

Ensure all the dependencies are installed.

rosdep install -‐from‐paths src ‐i ‐y ‐r

Build the packages

catkin_make

Add the newly built packages to the environment

source devel/setup.bash

Start the STDR to test the installation.

roslaunch stdr_launchers server_with_map_and_gui_plus_robot

Clone This Repository

    git clone https://github.com/cwru-courses/csds_476_s25_ixk238_robot_no_crash.git
  • Compile the workspace
    catkin_make
  • Run workspace configuration to be used by ROS
    source devel/setup.bash

Launching the Package

You can launch the package in 2 different ways by using two different

  • Launch the robot_no_crash package with rqt_robot_steering by using robot_no_crash.launch :
 roslaunch robot_no_crash robot_no_crash.launch
  • Launch the robot_no_crash package with rqt_robot_steering by using robot_no_crash_gazebo.launch :
 roslaunch robot_no_crash robot_no_crash_gazebo.launch

After you run both of these launch files, one needs to manually change the position of the robot, you need to change the topic to "/des_vel".

Video for Running Experiment

With 2D STDR

stdr_no_crash.mp4

With 3D Gazebo

gazebo_no_crash.mp4

Links and Resources

About

A ROS Noetic package for sensor-based collision prevention in mobile robots. Supports both 2D (STDR) and 3D (Gazebo) simulations with configurable safety layers to stop or adjust motion before impact.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published