This is a basic Turtlesim ROS package coded in both c++ and python to avoid the collision of turtle bot from the walls in turtlesim
-
Clone this github repositiory into your ros workspace/src folder (eg - catkin_ws/src/automate_turtlesim)
git clone https://github.com/Robo-Dude/Wall_collision_avoidance_in_turtlesim.git
-
Go back to catkin_ws folder open the terminal run catkin_make for building code in a catkin workspace.
catkin_make
-
Now Open three terminals and run:
for C++ Nodes on terminal
3.1 Terminal 1
roscore
3.2 Terminal 2
rosrun turtlesim turtlesim_node
3.3 Terminal 3
rosrun automate_turtlesim collision
for Python Nodes on terminal
Note - Don't forget to give executable permission to python nodes files
chmod +x filename.py
3.1 Terminal 1
roscore
3.2 Terminal 2
rosrun turtlesim turtlesim_node
3.3 Terminal 3
rosrun automate_turtlesim collision.py
Video -