Public Member Functions | Private Types | Private Member Functions | Private Attributes
pose_graph::PoseGraphImpl Class Reference

#include <pose_graph_impl.h>

List of all members.

Public Member Functions

EdgeId addEdge (NodeId from, NodeId to, const PoseConstraint &constraint)
 Adds an edge.
void addEdge (NodeId from, NodeId to, const PoseConstraint &constraint, EdgeId id)
 Like addEdge, but with a given id.
NodeId addNode ()
 Adds a node.
void addNode (NodeId id)
 Adds a node with a given id.
set< EdgeIdallEdges () const
 Gets set of edge ids in graph.
set< NodeIdallNodes () const
 Gets set of node ids in graph.
void attachCloud (NodeId id, occupancy_grid_utils::LocalizedCloud::ConstPtr cloud)
void attachScan (NodeId id, sensor_msgs::LaserScan::ConstPtr cloud)
bool edgeIdExists (EdgeId id) const
 Checks if an edge id already exists.
double edgeLength (EdgeId id) const
 Gets length of an edge.
occupancy_grid_utils::LocalizedCloud::ConstPtr getCloud (NodeId id) const
 Get the point cloud attached to a node.
const PoseConstraintgetConstraint (EdgeId id) const
 Gets the constraint attached to an edge.
const geometry_msgs::PosegetInitialPoseEstimate (NodeId n) const
 Gets the initial pose estimate attached to this node.
sensor_msgs::LaserScanConstPtr getScan (NodeId id) const
 Get the scan attached to a node.
bool hasCloud (NodeId id) const
bool hasScan (NodeId id) const
set< EdgeIdincidentEdges (NodeId n) const
 gets adjacent edges to a node
pair< NodeId, NodeIdincidentNodes (EdgeId e) const
 gets incident nodes to an edge, in the order (tail, head).
set< NodeIdnearbyNodes (NodeId src, double radius) const
 Nodes within a given radius of current one.
std::set< NodeIdneighbors (NodeId n) const
 Gets neighboring nodes of a node.
bool nodeIdExists (NodeId id) const
 Checks if a node id already exists.
PoseGraphImploperator= (const PoseGraphImpl &g)
 Assignment operator.
NodeId otherNode (const NodeId n, const EdgeId e) const
 PoseGraphImpl ()
 Constructs an empty graph.
 PoseGraphImpl (const PoseGraphImpl &g)
 Copy constructor.
geometry_msgs::Pose relativePose (NodeId n, NodeId ref) const
 Get relative pose of n w.r.t ref.
void setInitialPoseEstimate (NodeId n, const geometry_msgs::Pose &pose)
 Sets the initial pose estimate attached to this node.
ShortestPathResult shortestPath (NodeId src, NodeId dest) const
 Computes shortest path using Dijkstra's algorithm.
PoseGraph subgraph (const std::set< NodeId > &nodes) const
 Get subgraph over a specific set of nodes.

Private Types

typedef pair< DistanceMap,
PredecessorMap
DijkstraResult
typedef map< PoseGraphVertex,
double > 
DistanceMap
typedef map< PoseGraphVertex,
PoseGraphVertex
PredecessorMap

Private Member Functions

DijkstraResult dijkstra (const PoseGraphVertex &src) const
PoseGraphEdge idEdge (EdgeId id) const
PoseGraphVertex idVertex (NodeId id) const
void initializeFrom (const PoseGraphImpl &g)
bool outsideRadius (NodeId n, double r, const DistanceMap &distances) const
EdgeId shortestEdgeBetween (NodeId n1, NodeId n2) const
 Return shortest edge between two nodes. Asserts if there's no edge between them.

Private Attributes

map< PoseGraphVertex,
occupancy_grid_utils::LocalizedCloud::ConstPtr
clouds_
PoseConstraintMap constraints_
map< EdgeId, PoseGraphEdgeedge_map_
PoseGraphAdjacencyList graph_
EdgeId next_edge_id_
NodeId next_node_id_
map< PoseGraphVertex,
sensor_msgs::LaserScan::ConstPtr > 
scans_
map< NodeId, PoseGraphVertexvertex_map_

Detailed Description

Definition at line 110 of file pose_graph_impl.h.


Member Typedef Documentation

Definition at line 296 of file pose_graph_impl.h.

Definition at line 294 of file pose_graph_impl.h.

Definition at line 295 of file pose_graph_impl.h.


Constructor & Destructor Documentation

Constructs an empty graph.

Definition at line 144 of file pose_graph.cpp.

Copy constructor.

Definition at line 149 of file pose_graph.cpp.


Member Function Documentation

EdgeId pose_graph::PoseGraphImpl::addEdge ( NodeId  from,
NodeId  to,
const PoseConstraint constraint 
)

Adds an edge.

Parameters:
fromtail of new edge
tohead of new edge
constraintPoseConstraint expressing head pose in frame of tail pose
Returns:
EdgeId of new edge
Exceptions:
UnknownNodeIdExceptionif either id is not known

Definition at line 242 of file pose_graph.cpp.

void pose_graph::PoseGraphImpl::addEdge ( NodeId  from,
NodeId  to,
const PoseConstraint constraint,
EdgeId  id 
)

Like addEdge, but with a given id.

Parameters:
fromtail of new edge
tohead of new edge
constraintPoseConstraint expressing head pose in frame of tail pose
idDesired id for new edge
Exceptions:
UnknownNodeIdExceptionif either id is not known
DuplicateEdgeIdExceptionif already exists

Definition at line 252 of file pose_graph.cpp.

Adds a node.

Returns:
NodeId of new node
Postcondition:
The new node's initial pose estimate is the identity pose.

Definition at line 210 of file pose_graph.cpp.

Adds a node with a given id.

Exceptions:
DuplicateNodeIdExceptionif already exists
Postcondition:
The new node's initial pose estimate is the identity pose.

Definition at line 220 of file pose_graph.cpp.

Gets set of edge ids in graph.

Definition at line 291 of file pose_graph.cpp.

Gets set of node ids in graph.

Definition at line 282 of file pose_graph.cpp.

Attach a point cloud to a node.

Exceptions:
UnknownNodeIdException

Definition at line 521 of file pose_graph.cpp.

void pose_graph::PoseGraphImpl::attachScan ( NodeId  id,
sensor_msgs::LaserScan::ConstPtr  cloud 
)

Attach a laser scan to a node. The pointed-to scan should not change in future.

Exceptions:
UnknownNodeIdException
Parameters:
Thereference frame of the scan is the node frame

Note that the robot might have been moving while the scan was taken, so the data may not be valid in any given fixed frame (due to the LaserScan type's assumption of a constant angular increment). So it's preferable to transform the scan to a point cloud for most cases. The scan option is provided for compatibility with Karto.

Definition at line 569 of file pose_graph.cpp.

Definition at line 397 of file pose_graph.cpp.

Checks if an edge id already exists.

Definition at line 84 of file pose_graph.cpp.

Gets length of an edge.

Exceptions:
UnknownEdgeIdException

Definition at line 349 of file pose_graph.cpp.

Get the point cloud attached to a node.

Exceptions:
UnknownNodeIdException
PoseGraphException(if no cloud found for this node)

Definition at line 528 of file pose_graph.cpp.

Gets the constraint attached to an edge.

Return values:
Areference that is valid so long as edge is in graph.
Exceptions:
UnknownEdgeIdException

Definition at line 331 of file pose_graph.cpp.

Gets the initial pose estimate attached to this node.

Exceptions:
UnknownNodeIdException
Return values:
Areference valid as long as the node exists

Definition at line 342 of file pose_graph.cpp.

LaserScan::ConstPtr pose_graph::PoseGraphImpl::getScan ( NodeId  id) const

Get the scan attached to a node.

Return values:
Apointer whose pointed-to scan is guaranteed stable
Exceptions:
UnknownNodeIdException
PoseGraphException(if no scan found for this node)

See comments for attachScan

Definition at line 576 of file pose_graph.cpp.

Return true iff the node has an attached cloud

Exceptions:
UnknownNodeIdException

Definition at line 538 of file pose_graph.cpp.

Return true iff the node has an attached scan

Exceptions:
UnknownNodeIdException

Definition at line 585 of file pose_graph.cpp.

Definition at line 97 of file pose_graph.cpp.

Definition at line 89 of file pose_graph.cpp.

gets adjacent edges to a node

Exceptions:
UnknownNodeIdException

Definition at line 308 of file pose_graph.cpp.

gets incident nodes to an edge, in the order (tail, head).

Exceptions:
UnknownEdgeIdException

Definition at line 300 of file pose_graph.cpp.

Clear out data associated with the old graph

Definition at line 162 of file pose_graph.cpp.

NodeIdSet pose_graph::PoseGraphImpl::nearbyNodes ( NodeId  src,
double  radius 
) const

Nodes within a given radius of current one.

Parameters:
srcSource node
radius
Exceptions:
UnknownNodeIdException
Return values:
Setof nodes, including src, whose shortest path distance from src is <= radius

Definition at line 500 of file pose_graph.cpp.

Gets neighboring nodes of a node.

Exceptions:
UnknownNodeIdException

Definition at line 321 of file pose_graph.cpp.

Checks if a node id already exists.

Definition at line 79 of file pose_graph.cpp.

PoseGraphImpl & pose_graph::PoseGraphImpl::operator= ( const PoseGraphImpl g)

Assignment operator.

Definition at line 154 of file pose_graph.cpp.

NodeId pose_graph::PoseGraphImpl::otherNode ( const NodeId  n,
const EdgeId  e 
) const
Precondition:
n is one of the nodes incident to edge e \ retval Node The other incident node

Definition at line 126 of file pose_graph.cpp.

bool pose_graph::PoseGraphImpl::outsideRadius ( NodeId  n,
double  r,
const DistanceMap distances 
) const [private]

Definition at line 493 of file pose_graph.cpp.

Get relative pose of n w.r.t ref.

Exceptions:
DisconnectedNodesExceptionif there's no path between n and ref
UnknownNodeIdExceptionIf there are multiple paths from ref to n, just use the shortest one

Definition at line 361 of file pose_graph.cpp.

Sets the initial pose estimate attached to this node.

Exceptions:
UnknownNodeIdException

Definition at line 230 of file pose_graph.cpp.

Return shortest edge between two nodes. Asserts if there's no edge between them.

Definition at line 439 of file pose_graph.cpp.

Computes shortest path using Dijkstra's algorithm.

Parameters:
srcSource node id
destDestination node id
Exceptions:
UnknownNodeIdException

Definition at line 457 of file pose_graph.cpp.

Get subgraph over a specific set of nodes.

The returned graph consists of the given nodes, with the same ids and all edges between them. It does not share any structure with the original graph.

Definition at line 544 of file pose_graph.cpp.


Member Data Documentation

Definition at line 344 of file pose_graph_impl.h.

Definition at line 341 of file pose_graph_impl.h.

Definition at line 338 of file pose_graph_impl.h.

Definition at line 326 of file pose_graph_impl.h.

Definition at line 332 of file pose_graph_impl.h.

Definition at line 329 of file pose_graph_impl.h.

map<PoseGraphVertex, sensor_msgs::LaserScan::ConstPtr> pose_graph::PoseGraphImpl::scans_ [private]

Definition at line 347 of file pose_graph_impl.h.

Definition at line 335 of file pose_graph_impl.h.


The documentation for this class was generated from the following files:


pose_graph
Author(s): Bhaskara Marthi
autogenerated on Tue Jan 7 2014 11:17:16