Recording

For clients to use the graph nav recording service

class bosdyn.client.recording.WaypointRegion[source]

Bases: enum.Enum

Helper enum to descibe the localization region type for a waypoint.

DEFAULT_REGION = 1
EMPTY_REGION = 2
CIRCLE_REGION = 3
class bosdyn.client.recording.GraphNavRecordingServiceClient[source]

Bases: bosdyn.client.common.BaseClient

Client for the GraphNav recording service.

default_service_name = 'recording-service'
service_type = 'bosdyn.api.graph_nav.GraphNavRecordingService'
start_recording(lease=None, recording_environment=None, **kwargs)[source]

Start the recording service to create/update a map.

Parameters
  • lease – Leases to show ownership of necessary resources. Will use the client’s leases by default.

  • recording_environment – RecordingEnvironment protobuf to be used for the initial waypoint created at start.

Returns

The status of the start recording request.

start_recording_async(lease=None, recording_environment=None, **kwargs)[source]

Async version of start_recording().

stop_recording(lease=None, **kwargs)[source]

Stop the recording service.

Parameters

lease – Leases to show ownership of necessary resources. Will use the client’s leases by default.

Returns

The status of the start recording request.

stop_recording_async(lease=None, **kwargs)[source]

Async version of stop_recording().

get_record_status(**kwargs)[source]

Get the status of the recording service.

Returns

The record service status, which indicates the current persistent environment and if it’s recording a map.

get_record_status_async(**kwargs)[source]

Async version of get_record_status().

set_recording_environment(lease=None, recording_environment=None, **kwargs)[source]

Set the persistent recording enviornment.

Parameters
  • lease – Leases to show ownership of necessary resources. Will use the client’s leases by default.

  • recording_environment – RecordingEnvironment protobuf to be set as the persistent environment.

Returns

Nothing unless an error occurs.

set_recording_environment_async(lease=None, recording_environment=None, **kwargs)[source]

Async version of set_recording_environment().

create_waypoint(lease=None, waypoint_name=None, recording_environment=None, **kwargs)[source]

Create a waypoint in the map at the current robot state.

Parameters
  • lease – Leases to show ownership of necessary resources. Will use the client’s leases by default.

  • waypoint_name – Human readable string for the waypoint name.

  • recording_environment – RecordingEnvironment protobuf to be used for the waypoint (will overwrite and merge with any persistent env).

Returns

The response, which includes the created waypoint and any associated edges created.

create_waypoint_async(lease=None, waypoint_name=None, recording_environment=None, **kwargs)[source]

Async version of create_waypoint().

create_edge(lease=None, edge=None, **kwargs)[source]

Create a edge in the map between two existing waypoints.

Parameters
  • lease – Leases to show ownership of necessary resources. Will use the client’s leases by default.

  • edge – An edge protobuf, which must include valid from/to waypoint id’s and a from_T_to transform.

Returns

The response status.

create_edge_async(lease=None, edge=None, **kwargs)[source]

Async version of create_edge().

static make_recording_environment(name, waypoint_env, edge_env)[source]

Construct a complete recording environment from the waypoint and edge environments.

Parameters
  • name – A string name prefix which will prefix waypoint names (human-readable).

  • waypoint_env – Waypoint.Annotations protobuf which includes information for the waypoint environment.

  • edge_env – Edge.Annotations protobuf which includes information for the edge environment.

Returns

The API RecordingEnvironment protobuf message.

static make_waypoint_environment(name, region=<WaypointRegion.DEFAULT_REGION: 1>, dist_2d=None, **kwargs)[source]

Create a waypoint environment.

Parameters
  • name – A string name for the waypoint (human-readable).

  • region – A WaypointRegion enum representing the region in which we are localizing in. This can be either a default region, an empty region (don’t localize to this waypoint), or a circular region.

  • dist_2d – If the region is circular, then this is set as a distance (meters) representing the number of meters away we can be from the waypoint before scan matching.

Returns

The API Waypoint.Annotations protobuf message.

static make_edge_environment(vel_limit=None, direction_constraint=4, require_alignment=False, flat_ground=False, ground_mu_hint=0.8, grated_floor=False)[source]

Create a edge environment.

Parameters
  • vel_limit – A SE2VelocityLimit to use while traversing the edge. Note this is not a target speed, just a max/min.

  • direction_constraint – A direction constraints on the robot’s orientation when traversing the edge.

  • require_alignment – Boolean where if true, the robot must be aligned with the edge in yaw before traversing it.

  • flat_ground – Boolean where if true, the edge crosses flat ground and the robot shouldn’t try to climb over obstacles.

  • ground_mu_hint – Terrain coefficient of friction user hint. Suggested values lie between [.4, .8].

  • grated_floor – Boolean where if true, the edge crosses over grated metal.

Returns

The API Edge.Annotations protobuf message.

static make_edge(from_waypoint_id, to_waypoint_id, from_tform_to, edge_environment=None)[source]

Create an edge between two waypoint ids.

Parameters
  • from_waypoint_id – A waypoint string id for the from waypoint.

  • to_waypoint_id – A waypoint string id for the to waypoint.

  • from_tform_to – An SE3Pose representing the transform of from_waypoint to to_waypoint.

  • edge_environment – Any edge environment to be associated with the created edge.

Returns

The API Edge protobuf message.

exception bosdyn.client.recording.RecordingServiceResponseError(response, error_message=None)[source]

Bases: bosdyn.client.exceptions.ResponseError

General class of errors for the GraphNav Recording Service.

exception bosdyn.client.recording.CouldNotCreateWaypointError(response, error_message=None)[source]

Bases: bosdyn.client.recording.RecordingServiceResponseError

Service could not create a waypoint.

exception bosdyn.client.recording.NotRecordingError(response, error_message=None)[source]

Bases: bosdyn.client.recording.RecordingServiceResponseError

The recording service has not been started.

exception bosdyn.client.recording.UnknownWaypointError(response, error_message=None)[source]

Bases: bosdyn.client.recording.RecordingServiceResponseError

The edge requested has a waypoint id that is unknown.

exception bosdyn.client.recording.EdgeExistsError(response, error_message=None)[source]

Bases: bosdyn.client.recording.RecordingServiceResponseError

The edge requested with the given ID already exists in the map.

exception bosdyn.client.recording.EdgeMissingTransformError(response, error_message=None)[source]

Bases: bosdyn.client.recording.RecordingServiceResponseError

The edge requested is missing the from_T_to transform in the edge.

exception bosdyn.client.recording.NotLocalizedToEndError(response, error_message=None)[source]

Bases: bosdyn.client.recording.RecordingServiceResponseError

Stop recording failed to localize to the last created waypoint.

exception bosdyn.client.recording.FollowingRouteError(response, error_message=None)[source]

Bases: bosdyn.client.recording.RecordingServiceResponseError

Cannot start recording while the robot is already following a route.

exception bosdyn.client.recording.NotLocalizedToExistingMapError(response, error_message=None)[source]

Bases: bosdyn.client.recording.RecordingServiceResponseError

The robot is not localized to the existing map and cannot start recording.

exception bosdyn.client.recording.NotReadyYetError(response, error_message=None)[source]

Bases: bosdyn.client.recording.RecordingServiceResponseError

The service is processing the map at it’s current position. Try again in 1-2 seconds.