LaserScanner¶
- class mobrob_behcon.connectors.laserscanner.LaserScanner(ros_topic, visu)[source]¶
The class LaserScanner
Represents a connector to the laserscanner topics of the robot. Provides a function to get the latest laserscan from the laserscanner on the robot.
Methods
__init__
(ros_topic, visu)constructor
calc_dist
(x, y)Calculate distance from origin to given point
callback
(msg)callback function for topics of type sensor_msgs/LaserScan
check_box
(x1, y1, x2, y2)Check if some obstacle is in given box.
Draw all laser scanpoints to visualisation
extract_points
(ranges)Extract points from a list of distances
filter_points
(list, x_min, x_max, y_min, y_max)Filter given list of points (x, y) with the given bounderies
Get current time in milliseconds
Get current laserscan as a list of points
get_x
(radius, angle)Get x-coordinate of given point in polar coordinates
get_y
(radius, angle)Get y-coordinate of given point in polar coordinates
Details
- __init__(ros_topic, visu)[source]¶
constructor
- Parameters
ros_topic (string) – topic of the LaserScan data
- callback(msg)[source]¶
callback function for topics of type sensor_msgs/LaserScan
- Parameters
msg – receiving message
- check_box(x1, y1, x2, y2)[source]¶
Check if some obstacle is in given box. Returns distance.
- Parameters
- Returns
distance to nearest point in this box, if no obstacle in box returns 0
- Return type
- static filter_points(list, x_min, x_max, y_min, y_max)[source]¶
Filter given list of points (x, y) with the given bounderies