1 #ifndef __LASER_SCAN_OBSERVER_H 2 #define __LASER_SCAN_OBSERVER_H 5 #include <sensor_msgs/LaserScan.h> 6 #include <boost/shared_ptr.hpp> 8 #include "../core/sensor_data.h" 40 double angle = msg->angle_min;
42 for (
const auto &range : msg->ranges) {
44 angle += msg->angle_increment;
46 if (sp.
range < msg->range_min) {
48 }
else if (msg->range_max <= sp.
range) {
50 sp.
range = msg->range_max;
55 laser_scan.points.push_back(sp);
58 laser_scan.d_x = new_x -
_prev_x;
59 laser_scan.d_y = new_y -
_prev_y;
61 _prev_x = new_x, _prev_y = new_y, _prev_yaw = new_yaw;
static double getYaw(const Quaternion &bt_q)
virtual void handle_laser_scan(TransformedLaserScan &)=0
TFSIMD_FORCE_INLINE const tfScalar & getY() const
Class responsibilities: observes laser scans and odometry; converts ROS structures to internal repres...
Contains a point in polar coordinates and a state whether it is occupied.
TFSIMD_FORCE_INLINE tfScalar angle(const Quaternion &q1, const Quaternion &q2)
double range
The range of point in polar.
The base class which subclasses convert laser scan and odometry data ROS structures to internal data ...
LaserScanObserver(bool skip_max_vals=false)
TFSIMD_FORCE_INLINE const tfScalar & getX() const
virtual void handle_transformed_msg(const ScanPtr msg, const tf::StampedTransform &t)
Converts ROS-specific structures that hold sensor data to internal framework's structures; Laser scan...
bool is_occupied
True, if this point is occupied and False otherwise.