In this work title, I will show you how to set up a ROS-based multi-robot system and make it ready for use.
UBUNTU 18.04
ROS Melodic
Turtlebot3 or Turtlebot2 (Made using Turtlebot3)
🔻 Before starting make a work space:
mkdir -p filo_ws
cd filo_ws/
mkdir -p src
cd src/
🔻 Start downloading necessary files to the workspace:
git clone https://github.com/Hasan-atc/ROS_multi_robot.git
git clone https://github.com/ros-planning/navigation.git
git clone https://github.com/ros/geometry2.git
🔻 Let's compile the workspace:
cd .. # Directory is filo_ws
catkin_make
🔻 Edit '.bashrc' file
Type this code in terminal screen:
gedit ~/.bashrc
Paste the following into the opened txt file. Save and exit later :
source /opt/ros/melodic/setup.bash
export TURTLEBOT3_MODEL=waffle_pi
source ~/filo_ws/devel/setup.bash
export ROS_MASTER_URI=http://localhost:11311
export ROS_HOSTNAME=localhost
Type this code in terminal screen:
bash
✔️ First Terminal -- Initializing the Gazebo simulation environment:
roslaunch turtlebot3_gazebo multi_turtlebot3.launch
✔️ Secondary Terminal -- Initializing the RVİZ simulation environment:
roslaunch turtlebot3_navigation multi_nav_bringup.launch
❗ In order for the robot positions to come in this way, you must determine the positions of the robots with the help of 2D Pose Estimate.
❗ As described in the previous repo, mapping is required.
➡️ Movement through Rviz:
With the 2D Nav Goal button, the robot can be moved to the desired location.
➡️ Movement with Topics:
move = actionlib.SimpleActionClient("tb3_0/move_base", MoveBaseAction) # Different move_base topic is published for each robot
goal = MoveBaseGoal()
goal.target_pose.header.frame_id = "map" # Frame required to determine Target Points
goal.target_pose.pose.position.x = x # Target Points X coordinate
goal.target_pose.pose.position.y = y # Target Points Y coordinate
goal.target_pose.pose.position.w = 1.0 # Position angle of the robot
istemci.send_goal(hedef) # Sending target points to the robot
💡 With the buttons and information sections on the interface, you can decide which positions all the robots will go to:
cd filo_ws/src/code
chmod +x multi_robot.py & chmod +x robots.py
python multi_robot.py
❗ Make sure the multi_robot.py and robots.py files are in the same directory
🎉Congratulations, at the end of this study, you learned to move 3 different robots with interface connection autonomously on the map.
For more detailed information, I recommend you to review the links that I will reach in the resources section. Stay with the robots.:tada:
🔸 https://osrf.github.io/ros2multirobotbook/
🔸 http://wiki.ros.org/navigation
🔸 https://pypi.org/project/PyQt5/
🔸 https://emanual.robotis.com/docs/en/platform/turtlebot3/overview/
✅ I will open source Teknofest Autonomous Vehicle Competition codes