Template Class Env_PGM

Inheritance Relationships

Base Type

Class Documentation

template<int D>
class Env_PGM : public sdsl::Environment<D, double>

2D occupancy-grid environment loaded from a ROS2/SLAM PGM map.

The configuration space is 3-D: (x, y, θ), where (x, y) are world coordinates in metres and θ is the sensor yaw.

Template Parameters:

D – C-space dimension. D == 3 is the intended use-case.

Public Functions

Env_PGM() = default
inline Env_PGM(const nb::ndarray<uint8_t, nb::shape<-1, -1>> &grid, double resolution, double origin_x, double origin_y, double occupied_thresh = 0.65, bool negate = false)

Construct from a (height × width) uint8 occupancy grid plus metadata.

Pixel convention follows ROS2 map_saver:

  • negate == false (default): occupancy ∝ (255 − pixel) / 255 → 0 (black) = fully occupied, 255 (white) = fully free.

  • negate == true: occupancy ∝ pixel / 255 → 255 = fully occupied, 0 = fully free.

Parameters:
  • grid – (height, width) uint8 numpy array.

  • resolution – Metres per pixel.

  • origin_x – World x of the bottom-left corner of the map.

  • origin_y – World y of the bottom-left corner of the map.

  • occupied_thresh – Pixels with occupancy > this threshold are obstacles.

  • negate – Invert the pixel-to-occupancy mapping.

inline virtual bool intersects(Voxel<D, FT> v) override

Test whether a voxel intersects with the environment.

Parameters:

v

Returns:

True if v intersects with the environment.

inline virtual FT measureDistance(Configuration<D, FT> q) override

Measure the distance perceived from a configuration q.

Parameters:

q

Returns:

The measured distance.

inline virtual bool contains(Configuration<D, FT> q) override

Test whever a configuration is contained whithin the environment.

Parameters:

q

Returns:

True if q is contained in the environment.

inline virtual bool collisionDetection(Configuration<D, FT> q1, Configuration<D, FT> q2) override

Test whether the line between two configurations intersects with the environment.

Parameters:
  • q1

  • q2

Returns:

True if the line between q1 and q2 intersects with the environment.

inline Voxel<D, FT> boundingBox()
inline Voxel<D, FT> forward(FT d, Configuration<D, FT> g, Voxel<D, FT> v)