Project for the course Robot Programming 🤖, "Sapienza" University of Rome.
Obstacle Avoidance : Build a node that computes a repulsive field from the local laser scans and modulates the /cmd_vel so that the robot does not clash to the wall if instructed to do so. It is written in C++.
- Clone this repository into your ros workspace
- Every time you open a new terminal:
source devel/setup.bash
- From your workspace build with
catkin_make
- Start the roscore:
roscore
- In a different window:
rosrun project project
- In another window: I used a map of the DIAG departament. There are 3 cubes:
rosrun stage_ros stageros cappero_laser_odom_diag_obstacle_2020-05-06-16-26-03.world
🟩 is the robot that is controlled;
!:red_square: :purple_square: are the two obstacles.
It is possible to set the dimension and the initial position in the.world
file. - In a different window give the velocity command: where the components are
rostopic pub /cmd_vel geometry_msgs/Twist -r 1 -- '[0.4, 0.0, 0.0]' '[0.0, 0.0, 0.0]'
[linear.x, linear.y, linear.z]
and[angular.x, angular.y, angular.z]
For any doubt or clarification send me an email