Before you can run the node, make sure you have the following installed:
NOTE: We are using ROS Noetic
-
Make workspace (e.g. catkin_ws)
cd ~ mkdir catkin_ws cd catkin_ws/
-
Clone the Repository
git clone <repository-url>
-
Build the Package
Ensure you are in the workspace root directory (e.g.,
catkin_ws
).catkin init catkin build
-
Sourcing and setting the environment variables:
Type " nano ~/.bashrc " in terminal and add following lines at the end:
source /opt/ros/noetic/setup.bash export TURTLEBOT3_MODEL=burger source ~/catkin_ws/devel/setup.bash
Save the file and open terminal:
source ~/.bashrc
To run the node, use the following command:
rosrun main_launch map_making.py
This will start 4 terminals:
- Rosmaster
- Gazebo world simulation with turtlebot3
- SLAM with gmapping
- Teleoperation node
Run the teleoperation node and make a map of the world. When the map is created successfully, open a new terminal and save the map.
rosrun map_server map_saver -f ~/map
We saved at home directory (you can choose another location also)
To run the node, use the following command:
rosrun main_launch python_start_launches.py
This will start 4 terminals:
- Rosmaster
- Gazebo world simulation with turtlebot3
- RVIZ
- Teleoperation node
- Click the 2D Pose Estimate button in the RViz menu.
- Click on the map where the actual robot is located and drag the large green arrow toward the direction where the robot is facing.
- Repeat step 1 and 2 until the LDS sensor data is overlayed on the saved map.
- Use keyboard teleoperation node to precisely locate the robot on the map.
- Move the robot back and forth a bit to collect the surrounding environment information and narrow down the estimated location of the TurtleBot3 on the map which is displayed with tiny green arrows.
- Terminate the keyboard teleoperation node by entering Ctrl + C to the teleop node terminal in order to prevent different cmd_vel values are published from multiple nodes during Navigation.
- Click the 2D Nav Goal button in the RViz menu.
- Click on the map to set the destination of the robot and drag the green arrow toward the direction where the robot will be facing. . This green arrow is a marker that can specify the destination of the robot. . The root of the arrow is x, y coordinate of the destination, and the angle θ is determined by the orientation of the arrow. . As soon as x, y, θ are set, TurtleBot3 will start moving to the destination immediately.