An application-wide obstacle map. More...
#include <Robots/LoBot/slam/LoMap.H>
Public Member Functions | |
Map () | |
Initialization: creates an empty map. | |
void | add_pose_hook (const PoseHook &) |
void | update (const OccGrid &) |
void | update (const Pose &) |
This method updates the pose. | |
Pose | current_pose () const |
This method returns the robot's current pose w.r.t. to the map. | |
std::vector< unsigned char > | submap (int w) const |
| |
typedef void(* | PoseCB )(const Pose &, unsigned long client_data) |
typedef std::pair< PoseCB, unsigned long > | PoseHook |
An application-wide obstacle map.
This class implements an occupancy grid that is used to keep track of where obstacles are. The occupancy grid's cells hold probability values rather than simple 0/1 flags to indicate the absence or presence of an obstacle. The probabilities are bytes in the [0,255] range rather than floats in the [0,1] range. Furthermore, high values indicate free space while low ones denote the presence of obstacles.
In addition to holding the occupancy map, this class also keeps track of the robot's current pose, which is specified using an (x, y, theta) triple.
Definition at line 92 of file LoMap.H.
typedef void(* lobot::Map::PoseCB)(const Pose &, unsigned long client_data) |
Many behaviours/modules may be interested in hearing about pose updates. Therefore, the map maintains a list of callback functions to inform interested parties about pose updates.
NOTE: Clients should take care that the pose update hooks not perform lengthy operations so as to not hold up the thread that originated the pose update.
Map::Map | ( | ) |
Initialization: creates an empty map.
Definition at line 180 of file LoMap.C.
References lobot::Drawable::border_color(), lobot::Drawable::m_border, lobot::Drawable::m_border_color, and lobot::SlamParams::map_width().
void Map::add_pose_hook | ( | const PoseHook & | H | ) |
Pose Map::current_pose | ( | ) | const |
std::vector< unsigned char > Map::submap | ( | int | w | ) | const |
This method returns a square subportion of the occupancy map centered at the robot's current position. The size of the submap will 2*w+1, where w is supplied by the client.
Definition at line 263 of file LoMap.C.
References current_pose(), lobot::SlamParams::map_width(), lobot::Pose::x(), and Y.
void Map::update | ( | const Pose & | p | ) |
void Map::update | ( | const OccGrid & | g | ) |
This method updates this map object using the data from the supplied log-odds occupancy grid.
Definition at line 218 of file LoMap.C.
References lobot::OccGrid::begin(), and transform().