Skip to content

leehwasu96/Cheongju-University-LiDAR

Repository files navigation

Cheongju University LiDAR Lecture Notes

Author : Hwasu Lee

Affiliation : UNICON LAB (Incheon National University, South Korea)

Position : M.A. student

E-mail : [email protected] (or [email protected])

Course Duration

Date : 24.07.02 ~ 24.07.04

LiDAR Lecture Note Description

"LiDAR Lecture Notes (1).pdf is the LiDAR lecture notes."

"LiDAR Lecture Notes (2).pdf is the LiDAR lecture notes."

"LiDAR Lecture Homework.pdf is the LiDAR lecture homeworks."

SLAM(Simultaneous Localization And Mapping) practice


Note: This practice was conducted in an Ubuntu 20.04 LTS and ROS(Robot Operating System) 1 Noetic environment.


To set up the project, follow these steps:


1. Create catkin workspace and src folder

mkdir -p ~/catkin_ws/src



2. Change directory to the src folder within the catkin workspace

cd ~/catkin_ws/src



3. Initialize and set up the build environment for the catkin workspace

catkin_init_workspace



4. Build the catkin workspace

cd ~/catkin_ws && catkin_make



5. Add the ROS package path to the environment variables

source devel/setup.bash



6. Change directory to the src folder within the catkin workspace

cd ~/catkin_ws/src



7. Install the Turtlebot3-related packages

git clone –b noetic-devel https://github.com/ROBOTIS-GIT/turtlebot3.git
git clone –b noetic-devel https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git



8. Install the Turtlebot3-related packages and then build the catkin workspace

cd ~/catkin_ws && catkin_make



9. Define the Turtlebot3 model before running the Gazebo simulation

export TURTLEBOT3_MODEL=burger



10. Run the Turtlebot3 environment based on the Gazebo simulation

roslaunch turtlebot3_gazebo turtlebot3_world.launch

or

roslaunch turtlebot3_gazebo turtlebot3_house.launch



11. Run the code to control the Turtlebot3 model in a terminal different from the one where the Turtlebot3 world is running

export TURTLEBOT3_MODEL=burger
roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch



12. Run the code to perform SLAM(Gmapping) in a terminal different from the ones running the Turtlebot3 world and Turtlebot3 teleop_key

export TURTLEBOT3_MODEL=burger
roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=gmapping



13. Save the Occupancy Grid Map created based on SLAM(Gmapping) using the map_server

rosrun map_server map_saver -f ~/map



13-1. If the map_server package is not available, install it using the following command

sudo apt update
sudo apt install ros-noetic-map-server



ROS Navigation Stack practice


Note: This practice was conducted in an Ubuntu 20.04 LTS and ROS(Robot Operating System) 1 Noetic environment.


To set up the project, follow these steps:

1. Define the Turtlebot3 model before running the Gazebo simulation

export TURTLEBOT3_MODEL=burger



2. Run the Turtlebot3 environment based on the Gazebo simulation in the same terminal

roslaunch turtlebot3_gazebo turtlebot3_world.launch

or

roslaunch turtlebot3_gazebo turtlebot3_house.launch



3. In a different terminal, run the following code to practice the Navigation Stack for the Turtlebot3 model

export TURTLEBOT3_MODEL=burger
roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=/home/unicon3/map.yaml

In the above command, modify that path to the path where your map.yaml file is located.
/home/unicon3/map.yaml --> /home/{your map.yaml path}


4. In Rviz (ROS Visualization), set the initial position of the Turtlebot3 Burger model using the "2D Pose Estimate" button, then click "2D Nav Goal" to set the target position for the Turtlebot3 Burger model.


Homework :
Control the Turtlebot3 in the ROS Gazebo simulation environment


Note: This practice was conducted in an Ubuntu 20.04 LTS and ROS(Robot Operating System) 1 Noetic environment.


To set up the project, follow these steps:


1. Create the turtlebot3_control package and the scripts folder

cd ~/catkin_ws/src
catkin_create_pkg turtlebot3_control rospy std_msgs sensor_msgs geometry_msgs
cd ~/catkin_ws/src/turtlebot3_control
mkdir scripts
cd scripts



2. To control the Turtlebot3 model, fetch the "drive_and_stop.py" and "drive_and_turn_and_stop.py" file from the Homework directory in the Github repository and place it in the scripts folder.


3. Grant execute permissions to the Python file fetched from Github

chmod +x drive_and_stop.py drive_and_turn_and_stop.py 



4. Change directory to the "worlds" folder within the "turtlebot3_gazebo" package

roscd turtlebot3_gazebo/worlds



5. Fetch the "custom_world.world" file from the Homework folder in the Github repository and save it to the above path.


6. Change directory to the "launch" folder within the "turtlebot3_gazebo" package

roscd turtlebot3_gazebo/launch



7. Copy an existing launch file to run the "custom_world.world" file

cp turtlebot3_empty_world.launch turtlebot3_custom_world.launch



8. Modify the copied "turtlebot3_custom_world.launch" file

gedit turtlebot3_custom_world.launch

Modify from "empty_world.world" to "custom_world.world".
Once the modifications are complete, save and close the file using the 'ctrl+s' shortcut.


9. Build the catkin workspace and set the ROS environment variables

cd ~/catkin_ws && catkin_make
source devel/setup.bash && source /opt/ros/noetic/setup.bash



10. In the first terminal, define the Turtlebot3 model and run the Gazebo simulation environment

export TURTLEBOT3_MODEL=burger
roslaunch turtlebot3_gazebo turtlebot3_custom_world.launch



11. Run the First control practice code based on the Turtlebot3 Burger model and LiDAR sensor data

rosrun turtlebot3_control drive_and_stop.py

or

cd ~/catkin_ws/src/turtlebot3_control/scripts
python drive_and_stop.py



Turtlebot3 Control example video 1

turtlebot_simulation_homework1.mp4



12. Run the Second control practice code based on the Turtlebot3 Burger model and LiDAR sensor data

rosrun turtlebot3_control drive_and_turn_and_stop.py

or

cd ~/catkin_ws/src/turtlebot3_control/scripts
python drive_and_turn_and_stop.py



Turtlebot3 Control example video 2

turtlebot.simulation.homework.mp4



Releases

No releases published

Packages

No packages published

Languages