devkit_ui.models
Classes
|
Represents a topo document. |
|
Represents an edge between two topo nodes. |
|
Represents a topo node. |
|
Represents a point's pose in 3D space. |
|
Contains a set of properties for a topo node. |
|
Represents a 2D vector. |
|
Represents a 3D vector. |
|
Represents a 4D vector. |
- class devkit_ui.models.TopoDoc(name: str, nodes: list[TopoNode] | list[dict] | None = None, metric_map: str | None = None, pointset: str | None = None, meta: dict | None = None, actions: dict | None = None, definitions: dict | None = None, transformation: dict | None = None)[source]
Bases:
objectRepresents a topo document.
- __init__(name: str, nodes: list[TopoNode] | list[dict] | None = None, metric_map: str | None = None, pointset: str | None = None, meta: dict | None = None, actions: dict | None = None, definitions: dict | None = None, transformation: dict | None = None) None[source]
Build a TopoDoc, indexing any provided nodes by name.
- property actions: dict
- clone_empty(map_name: str | None = None) TopoDoc[source]
Clones the document and returns a new document with no nodes. Retains metadata, actions, definitions, and transformation.
- property definitions: dict
- insert_node(node: TopoNode) None[source]
Add a node exactly as given, with no reverse-edge backfill.
Unlike add_node(), which assumes it’s dropping a single node onto an existing graph and back-fills the reverse edge on each neighbour, this is for callers that pass in nodes whose edges are already fully and correctly wired (in both directions, where that’s wanted) before the call — e.g. a batch of new nodes that reference each other. add_node() would KeyError on a sibling not yet inserted, and would silently add reverse edges the caller didn’t ask for onto pre-existing nodes.
- property name: str
- seed_actions(actions: dict, definitions: dict) None[source]
Backfill actions/definitions from a template doc (e.g. the installed mixed_actions_map.yaml) when this doc has none of its own. Used when clearing/re-seeding a map that was itself loaded from an actions-less authored source, so navigation2.py always gets a real NavigateToPose/limbic_row_follow action config instead of silently running with none.
- property transformation: dict
- class devkit_ui.models.TopoEdge(action: str, edge_id: str, node: str)[source]
Bases:
NamedTupleRepresents an edge between two topo nodes.
Note that these are not standalone, they are always part of a TopoNode in order to know what the two nodes are that are being connected.
- action: str
Alias for field number 0
- edge_id: str
Alias for field number 1
- node: str
Alias for field number 2
- class devkit_ui.models.TopoNode(name: str, pointset: str | None = None, nav_frame: str | None = None, edges: list[TopoEdge | str] | None = None, x: float | None = None, y: float | None = None, pose: TopoPose | None = None, properties: TopoProperties | None = None, verts: list[Vector2] | None = None, meta: dict | None = None)[source]
Bases:
objectRepresents a topo node.
- __init__(name: str, pointset: str | None = None, nav_frame: str | None = None, edges: list[TopoEdge | str] | None = None, x: float | None = None, y: float | None = None, pose: TopoPose | None = None, properties: TopoProperties | None = None, verts: list[Vector2] | None = None, meta: dict | None = None) None[source]
Constructs a new topo node.
For convenience you can pass in an x/y pair instead of a full pose.
- property meta: dict
- property name: str
- property x: float
- property y: float
- class devkit_ui.models.TopoPose(**kwargs)[source]
Bases:
objectRepresents a point’s pose in 3D space.
- class devkit_ui.models.TopoProperties(xy_goal_tolerance: float = 0.0, yaw_goal_tolerance: float = 0.0, dropped_by: str = '', timestamp: datetime | None = None, row_id: str = '', row_role: str = '', gps_lat: float = 0.0, gps_lon: float = 0.0, gps_fix_type: int = 0, gps_hdop: float | None = None)[source]
Bases:
NamedTupleContains a set of properties for a topo node.
- dropped_by: str
Alias for field number 2
- gps_fix_type: int
Alias for field number 8
- gps_hdop: float | None
Alias for field number 9
- gps_lat: float
Alias for field number 6
- gps_lon: float
Alias for field number 7
- row_id: str
Alias for field number 4
- row_role: str
Alias for field number 5
- timestamp: datetime | None
Alias for field number 3
- xy_goal_tolerance: float
Alias for field number 0
- yaw_goal_tolerance: float
Alias for field number 1
- class devkit_ui.models.Vector2(x: float, y: float)[source]
Bases:
NamedTupleRepresents a 2D vector.
- x: float
Alias for field number 0
- y: float
Alias for field number 1