You’re reading an older version of the Slamcore SDK documenation. The latest one is 23.01.
File helpers.cpp
Misc. helpers.
Functions
-
bool pointWithinMap(const Map2DInterface &map, const VectorInterface &pt)
Calculate if a point is within the map bounds.
- Parameters
map – Map to use.
pt – Point in the world coordinate frame.
- Returns
True if point is within the map, false otherwise.
-
CellCoordinates mapPointToCell(const Map2DInterface &map, const VectorInterface &pt)
Calculate the cell index for a point in the world coordinate frame.
- Parameters
map – Map to use.
pt – Point in the world coordinate frame.
- Returns
Cell coordinates.
-
Vector mapCellToPoint(const Map2DInterface &map, const CellCoordinates &cell)
Calculate the point (on the map plane) for a given cell index. Mid-point of a cell.
- Parameters
map – Map to use.
cell – Cell coordinates.
- Returns
Point on the map plane in world coordinate frame.
-
uint8_t mapGetOccupancyProbability(const Map2DInterface &map, const CellCoordinates &cell)
Get occupancy probability from the map for a given cell index.
- Parameters
map – Map to use.
cell – Cell coordinates.
- Returns
Occupancy probability value.
-
float mapGetHeight(const Map2DInterface &map, const CellCoordinates &cell)
Get height from the map for a given cell index.
- Parameters
map – Map to use.
cell – Cell coordinates.
- Returns
Height.
-
float mapGetHeightVariance(const Map2DInterface &map, const CellCoordinates &cell)
Get height variance from the map for a given cell index.
- Parameters
map – Map to use.
cell – Cell coordinates.
- Returns
Height variance.
-
void writeTrajectory(const slamcore::PoseListInterface<slamcore::camera_clock> &trajectory, const slamcore::TrackingStatusListInterface &trackingStatus, const std::string &filepath)
Write given trajectory to a file at filepath.
- Parameters
trajectory – Poses to write.
trackingStatus – Tracking status to write.
filepath – Where to write the trajectory.
-
namespace slamcore
Main namespace for the SLAMcore public API
Get information about the client library
Helper conversion methods
slamcore::ImageFormat \(\leftrightarrow\) BytesPerPixel
Functions
-
bool pointWithinMap(const Map2DInterface &map, const VectorInterface &pt)
Calculate if a point is within the map bounds.
- Parameters
map – Map to use.
pt – Point in the world coordinate frame.
- Returns
True if point is within the map, false otherwise.
-
CellCoordinates mapPointToCell(const Map2DInterface &map, const VectorInterface &pt)
Calculate the cell index for a point in the world coordinate frame.
- Parameters
map – Map to use.
pt – Point in the world coordinate frame.
- Returns
Cell coordinates.
-
Vector mapCellToPoint(const Map2DInterface &map, const CellCoordinates &cell)
Calculate the point (on the map plane) for a given cell index. Mid-point of a cell.
- Parameters
map – Map to use.
cell – Cell coordinates.
- Returns
Point on the map plane in world coordinate frame.
-
uint8_t mapGetOccupancyProbability(const Map2DInterface &map, const CellCoordinates &cell)
Get occupancy probability from the map for a given cell index.
- Parameters
map – Map to use.
cell – Cell coordinates.
- Returns
Occupancy probability value.
-
float mapGetHeight(const Map2DInterface &map, const CellCoordinates &cell)
Get height from the map for a given cell index.
- Parameters
map – Map to use.
cell – Cell coordinates.
- Returns
Height.
-
float mapGetHeightVariance(const Map2DInterface &map, const CellCoordinates &cell)
Get height variance from the map for a given cell index.
- Parameters
map – Map to use.
cell – Cell coordinates.
- Returns
Height variance.
-
void writeTrajectory(const slamcore::PoseListInterface<slamcore::camera_clock> &trajectory, const slamcore::TrackingStatusListInterface &trackingStatus, const std::string &filepath)
Write given trajectory to a file at filepath.
- Parameters
trajectory – Poses to write.
trackingStatus – Tracking status to write.
filepath – Where to write the trajectory.
-
bool pointWithinMap(const Map2DInterface &map, const VectorInterface &pt)