Lab 5: LIDAR¶
So far, we have primarily used the car’s camera to view the world in front of the car Unfortunately, the camera cannot see to the side or rear of the car, which makes other tasks such as wall following more difficult.
In this lab, we will use the LIDAR to gain a 360 degree view around the car and use this expanded field of view to solve new problems such as wall following.
Use the LIDAR to increase the car’s field of view and use this to complete new navigational tasks.
We wil use RVIZ to perform LIDAR SLAM.
- If not already running, start the lidar using the command
roslaunch ydlidar_ros X4.launch.
- Make sure that you have the
DISPLAYcorrectly set to use the car screen for the visualization.
- Using the screen on the car (with mouse and keyboard), you will see an RVIZ window will open.
- You will see immediately on the screen scan continuously updating.
- If you want to see the SLAM map click the
Addbutton in the lower left.
- You will see a long list of options, scroll until you find
LaserScan. Once added, select the topic as
- Now the points from the Lidar are converted into a SLAM map.
- Try navigating the car around the room, to see if you can create a usable SLAM map!
- Save the final image you have before closing out of the RVIZ window.
Warm Up: Safety Stop (Revisited)¶
In the warm up for ref:lab_3, you implemented a safety stop which prevents the car from driving forward into an object. Replace the
TODO: (warm up) comment with a new safety stop that works in both directions by also preventing the car from driving backward into an object.
Main Challenge: Wall Following¶
To navigate a hallway or maze, the car can drive forward along a wall. The car will need to stay within 0.5 to 1 meter away from the wall to its right and turn when the wall reaches a corner.
TODO: (main challenge) comment with code to follow a wall as described above.