A ROS package that enables multiple robots to communicate and move toward each other's positions.
Prerequisite • Compile • Execute • Use • Screenshots
- ROS - An open-source, meta-operating system for your robots. The repository has been tested using ROS Kinetic.
-
Move this package folder (
exploration
) to thesrc
directory of your ROS workspace, for example~/catkin_ws/src/
. -
Open a terminal window and navigate to your ROS workspace directory, e.g.:
cd ~/catkin_ws/
-
Build the package using the
catkin_make
command:catkin_make
This will compile the package and generate the necessary files for running the ROS nodes.
-
Open a terminal window.
-
Navigate to your ROS workspace directory.
-
Launch the package using the following command:
roslaunch exploration move_turtle.launch
-
Launch another terminal window.
-
Navigate to your ROS workspace directory.
-
Launch the package using the following command:
roslaunch exploration exploration.launch
This will launch the ROS nodes required to run the package.
- Adjust the
x
,y
, andtheta
variables inconsensus.launch
(starting from line 13) to set the initial positions of the additional robots (the first robot is spawned at the center of the workspace). Ensure thatNUM_TURTLES
inconsensus.cpp
andROBOT_NUMBER
inmoveTurtle.cpp
are updated to reflect the total number of robots, including the first robot and any additional robots. - Each robot will communicate its position with the others.
- Then, they will start moving toward the positions of the consecutive robot.
- Step 3 will be repeated until each robot has visited all other robots' positions.
- Finally, they will return to their initial positions.
- Throughout the process, various types of information will be printed on the terminal. Wait until the exploration node is shut down or press
ESC
to exit the program at any time.
- Initial positions:
- Turtles in motion:
- Returning to their initial positions (after exploring all other positions):