graphslam.vertex module
A Vertex
class.
- class graphslam.vertex.Vertex(vertex_id, pose, fixed=False)[source]
Bases:
object
A class for representing a vertex in Graph SLAM.
- Parameters:
vertex_id (int) – The vertex’s unique ID
pose (graphslam.pose.base_pose.BasePose) – The pose associated with the vertex
fixed (bool) – Whether this vertex should be fixed
- gradient_index
The index of the first entry in the gradient vector to which this vertex corresponds (and similarly for the Hessian matrix)
- Type:
int, None
- id
The vertex’s unique ID
- Type:
int
- pose
The pose associated with the vertex
- fixed
Whether this vertex should be fixed
- Type:
bool
- equals(other, tol=1e-06)[source]
Check whether two vertices are equal.
- Parameters:
other (Vertex) – The vertex to which we are comparing
tol (float) – The tolerance
- Returns:
Whether the two vertices are equal
- Return type:
bool
- classmethod from_g2o(line)[source]
Load a vertex from a line in a .g2o file.
- Parameters:
line (str) – The line from the .g2o file
- Returns:
The instantiated vertex object, or
None
ifline
does not correspond to a vertex- Return type:
Vertex, None