Robotics Lab Week 08 - Laser Range Finder For Obstacle Avoidance (Updated)
Robotics Lab Week 08 - Laser Range Finder For Obstacle Avoidance (Updated)
• In this lab, we will turn our attention to the sensing aspect of robotics
• Specifically, the focus will be on the Laser Range Finder which is a proximity sensor
used widely for mapping, localization, obstacle avoidance and navigation purposes
• This lab will involve learning to use the laser data, then developing simple
implementations for wandering and wall following
Sensors
Sensors are devices used to get useful information from the environment
Kinect Sensor
It projects
“structured light”
Sonar Sensor Laser Range Finder on the scene
Laser Range Finder
• A Laser Range Finder measures the distance from
an object by firing numerous lasers and then
obtaining the reflected response
• Specular reflections: Sensor readings are missed when the fired rays bounce
off of objects at varied angles
• Ambient light: Some laser scanners fail to measure objects in the presence
of bright sunlight
• Transparent objects: Laser scans will give much larger distances if the fired
lasers pass through the object
Laser Modification
• To modify the laser in the
robot, the values in the
model.sdf file need to be
changed
• The sdf file contains XML code
for the geometry of the robot
and its individual parts
(including the laser)
• We will alter the values for the
samples, min_angle and
max_angle tags in the sdf file
Message Libraries
• The std_msgs library contains message types for standard messages:
o Int32
o Float32
o String
range_value = msg.ranges[index]
Laser Scan in ROS msg.ranges[2]
msg.ranges[1]
msg.ranges[3]
msg.ranges[4] msg.ranges[0]
For the 5 laser samples, we
can get the data by:
range_R = msg.ranges[0]
range_FR = msg.ranges[1]
range_F = msg.ranges[2]
range_FL = msg.ranges[3]
range_L = msg.ranges[4]
Laser Scan in ROS Inf
The 2 lasers that hit the
obstacles give out proper values Inf
for the distance
9.0349
For instance, if the max distance
is 10, then we can get the 10
ranges by:
8.8644
range_R = min(msg.ranges[0],10)
range_FR = min(msg.ranges[1],10)
range_F = min(msg.ranges[2],10)
range_FL = min(msg.ranges[3],10)
range_L = min(msg.ranges[4],10)
Laser Scan in ROS
In practical situations, we use a
large number of laser samples for
greater effectiveness and for
implementing more complex
algorithms
Laser Scan in ROS
The laser samples are divided into
regions. We can get region values by
using the minimum value of the
laser sample in that region