Recording

For clients to use the graph nav recording service

class bosdyn.client.recording.WaypointRegion(value)[source]

Bases: Enum

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

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

Bases: 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, require_fiducials=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.

  • require_fiducials – Boolean to show whether a fiducial is needed to start the recording.

Returns:

The status of the start recording request.

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

Same as start_recording() but returns a full response

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

Async version of start_recording().

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

Async version of start_recording_full().

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 environment.

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 an 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=None, waypoint_env=None, edge_env=None)[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=None, region=WaypointRegion.DEFAULT_REGION, dist_2d=None, client_metadata=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.

  • client_metadata – Info about the client which will be stored in the waypoints.

Returns:

The API Waypoint.Annotations protobuf message.

static make_client_metadata(session_name=None, client_username=None, client_software_version=None, client_id=None, client_type=None)[source]

Creates client metadata for recording.

Parameters:
  • session_name – User-provided name for this recording “session”. For example, the user may start and stop recording at various times and assign a name to a region that is being recorded. Usually, this will just be the map name.

  • client_username – If the application recording the map has a special user name, this is the name of that user.

  • client_software_version – Version string of any client software that generated this object.

  • client_id – Identifier of any client software that generated this object

  • client_type – Special tag for the client software which created this object. For example, “Tablet”, “Scout”, “Python SDK”, etc.

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 an 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: ResponseError

General class of errors for the GraphNav Recording Service.

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

Bases: RecordingServiceResponseError

Service could not create a waypoint.

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

Bases: RecordingServiceResponseError

The recording service has not been started.

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

Bases: RecordingServiceResponseError

The edge requested has a waypoint id that is unknown.

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

Bases: RecordingServiceResponseError

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

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

Bases: 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: RecordingServiceResponseError

Stop recording failed to localize to the last created waypoint.

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

Bases: RecordingServiceResponseError

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

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

Bases: RecordingServiceResponseError

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

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

Bases: RecordingServiceResponseError

The robot is too far from the existing map and cannot start recording.

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

Bases: RecordingServiceResponseError

Failed to start recording because a remote point cloud (e.g. a LIDAR) is not registered to the service directory.

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

Bases: RecordingServiceResponseError

Failed to start recording because a remote point cloud (e.g. a LIDAR) is not delivering data.

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

Bases: RecordingServiceResponseError

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

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

Bases: RecordingServiceResponseError

Map exceeds the size allowed by the license.

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

Bases: RecordingServiceResponseError

One or more required fiducials were not detected.

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

Bases: RecordingServiceResponseError

The pose of one or more required fiducials could not be determined accurately.

exception bosdyn.client.recording.RobotImpairedError(response, error_message)[source]

Bases: RecordingServiceResponseError

Failed to start recording because the robot is impaired.