1 #ifndef SLAM_CTOR_CORE_SENSOR_DATA_H 2 #define SLAM_CTOR_CORE_SENSOR_DATA_H 12 #include "../geometry_utils.h" 40 assert(0 &&
"Unknown point type");
84 std::shared_ptr<TrigonometryProvider> tp)
const {
91 std::shared_ptr<TrigonometryProvider> tp)
const {
100 return Point2D{patched.
x() + d_x, patched.y() + d_y};
112 patched.is_occupied()};
117 x() + d_x,
y() + d_y,
120 patched.is_occupied()};
140 osm <<
"ScanPoint2D{ r: " << sp.
range() <<
"; a: " << sp.
angle() <<
" <-> ";
141 return osm <<
"x: " << sp.
x() <<
", y: " << sp.
y() <<
"}";
150 return const_cast<Points&
>(
156 cartsn_scan.
points().reserve(_points.size());
160 for (
auto &sp : _points) {
161 auto cartesian_sp = sp.to_cartesian(cartsn_scan.
trig_provider);
162 cartsn_scan.
points().push_back(cartesian_sp);
static ScanPoint2D make_polar(double range, double angle, bool is_occ)
ScanPoint2D to_cartesian(double d_angle=0, double d_range=0) const
ScanPoint2D(double range=0, double ang=0, bool is_occ=true)
Point2D move_origin(double d_x, double d_y, double d_angle) const
ScanPoint2D(PointType type, double x_or_range, double y_or_angle, bool is_occ)
LaserScan2D to_cartesian(double angle) const
ScanPoint2D to_cartesian(std::shared_ptr< TrigonometryProvider > tp) const
Point2D move_origin(double d_x, double d_y, std::shared_ptr< TrigonometryProvider > tp) const
ScanPoint2D & set_factor(double factor)
struct ScanPoint2D::PointData::PolarPoint polar
Point2D move_origin(const Point2D &p, std::shared_ptr< TrigonometryProvider > tp) const
static ScanPoint2D make_cartesian(const Point2D &p, bool is_occ)
ScanPoint2D to_polar(double d_x=0, double d_y=0) const
const Points & points() const
Point2D move_origin(double d_x, double d_y) const
std::shared_ptr< TrigonometryProvider > trig_provider
std::vector< ScanPoint2D > Points
std::ostream & operator<<(std::ostream &osm, const ScanPoint2D &sp)