Modular 2D Simultaneous Localization and Mapping (SLAM) system with flexible map, IMU, and exploration integration.
More...
#include <LocalizationAndMapping2D.h>
|
|
| LocalizationAndMapping2D (IMap< T > &map, IFrontierExplorer< T > &explorer, Frame2D &world, Frame2D &base, Frame2D &lidar, IMotionState2D &imu) |
| |
|
bool | begin () |
| | Initialize SLAM system (IMU and range sensor)
|
| |
|
void | end () |
| |
|
void | addRangeMeasurement (Distance dist, Angle angle, CellState state) |
| | Register Range Measurement from Lidar.
|
| |
|
void | addRangeMeasurement (float distanceM, float angleDeg, CellState state) |
| | Register Range Measurement from Lidar.
|
| |
| bool | getNextFrontier (Coordinate< float > &result) const |
| | Find the next frontier cell (boundary between known free and unknown space).
|
| |
|
void | subscribe (MessageHandler &handler) |
| | Subscribe to imu and range sensor messages.
|
| |
|
void | unsubscribeAll () |
| |
|
IMap< T > & | getMap () |
| | Access to map.
|
| |
|
IMotionState2D & | getIMU () |
| | Access to IMU state.
|
| |
|
IFrontierExplorer< T > & | getFrontierExplorer () |
| |
| void | subscribe (MessageHandler &handler, MessageOrigin origin=MessageOrigin::Undefined, MessageContent content=MessageContent::Undefined) |
| | Subscribe a message handler to this source, with optional filtering.
|
| |
|
void | unsubscribeAll () |
| | Remove all registered message handlers.
|
| |
| void | sendMessage (Message< float > &msg) |
| | Publish a message to all registered handlers.
|
| |
| void | sendMessage (const Message< Coordinate< float > > &msg) |
| | Publish a message to all registered handlers.
|
| |
| void | sendMessage (const Message< GPSCoordinate > &msg) |
| | Publish a message to all registered handlers.
|
| |
|
void | sendMessage (const Message< MotionState3D > &msg) |
| | Overload for MotionState3D messages.
|
| |
|
| void | markRay (const Coordinate< float > &sensor, const Coordinate< float > &obstacle, CellState state) |
| | Mark all cells between the sensor and the obstacle as FREE, and the obstacle cell as OCCUPIED.
|
| |
|
|
static bool | onIMUPublished (const Message< float > &msg, void *ref) |
| |
template<typename T>
class tinyrobotics::LocalizationAndMapping2D< T >
Modular 2D Simultaneous Localization and Mapping (SLAM) system with flexible map, IMU, and exploration integration.
This class implements a highly modular and extensible 2D SLAM system for occupancy grid mapping, pose estimation, sensor fusion, and autonomous exploration.
Features
- Template Parameters:
- Occupancy Grid Mapping: Maintains a 2D grid map for the environment, supporting any compatible map type via IMap<T>.
- Pose Estimation: Integrates IMU/odometry for robot pose tracking and frame transforms (IMotionState2D).
- Sensor Fusion: Supports range sensors (e.g., Lidar) for obstacle detection and map updates.
- Frontier-Based Exploration: Integrates a flexible frontier explorer for autonomous navigation.
- Frame Management: Uses Frame2D and FrameMgr2D for coordinate transforms between world, base, and sensor frames.
- Flexible Integration: All major components (map, IMU, explorer) are passed by reference for easy swapping and testing.
- Message Bus: Inherits from MessageSource for integration with message-based architectures.
Template Parameters
- Template Parameters
-
Ownership & Lifetime
- All major components (map, IMU, explorer) are passed by reference and must outlive the LocalizationAndMapping2D instance.
Usage Example
slam.begin();
Generic exploration and frontier-based SLAM utility for grid or occupancy maps.
Definition: FrontierExplorer.h:35
A grid map using two bit vectors to represent CellState efficiently.
Definition: GridBitMap.h:30
Basic 2D IMU dead-reckoning class.
Definition: IMU2D.h:47
Modular 2D Simultaneous Localization and Mapping (SLAM) system with flexible map, IMU,...
Definition: LocalizationAndMapping2D.h:61
Represents a 2D coordinate frame in a hierarchical frame tree.
Definition: FrameMgr2D.h:130
◆ getNextFrontier()
| bool getNextFrontier |
( |
Coordinate< float > & |
result | ) |
const |
|
inline |
Find the next frontier cell (boundary between known free and unknown space).
- Returns
- World coordinates of the next frontier cell, or (0,0) if none found.
◆ markRay()
Mark all cells between the sensor and the obstacle as FREE, and the obstacle cell as OCCUPIED.
- Parameters
-
| sensor_world | World coordinates of the sensor |
| obs_world | World coordinates of the obstacle |
The documentation for this class was generated from the following file: