Open cmurray3 opened 1 year ago
Some code from today's class:
def getIndex(angle_desired, incr, min_angle, max_angle, is_cw):
returns the index for a given angle
def f(angle_desired, ranges, incr, min_angle, max_angle, is_cw):
'''
This function returns the distance (in meters) at an angle of `angle_desired`.
INPUTS:
- angle_desired.
- ranges. List of distances. See LaserScan.ranges for example
OUTPUT:
'''
myIndex = getIndex(angle_desired, incr, min_angle, max_angle, is_cw)
return ranges[myIndex]
def g(angle_start, angle_end, ranges, incr, min_angle, max_angle, is_cw):
myStartIndex = getIndex(angle_start, incr, min_angle, max_angle, is_cw)
myEndIndex = getIndex(angle_end, incr, min_angle, max_angle, is_cw)
return ranges[myStartIndex : myEndIndex + 1]
Use this link to submit your assignment: https://classroom.github.com/a/QKnftk6K
Your assignment is to write 3 Python functions that will use Lidar data in the format
sensor_msgs/LaserScan
.x
meters ahead.Assumptions
Some sample code