Ray Cast

Client implementation of the RayCast service.

exception bosdyn.client.ray_cast.RayCastResponseError(response, error_message=None)[source]

Bases: ResponseError

General class of errors for ray cast service.

exception bosdyn.client.ray_cast.InvalidRequestError(response, error_message=None)[source]

Bases: RayCastResponseError

Request was invalid / malformed in some way.

exception bosdyn.client.ray_cast.InvalidIntersectionTypeError(response, error_message=None)[source]

Bases: RayCastResponseError

Requested source not valid for current robot configuration.

exception bosdyn.client.ray_cast.UnknownFrameError(response, error_message=None)[source]

Bases: RayCastResponseError

The frame_name for a command was not a known frame.

class bosdyn.client.ray_cast.RayCastClient[source]

Bases: BaseClient

A client that allows arbitrary rays to be queried against the robot.

default_authority = 'ray-cast.spot.robot'
default_service_name = 'ray-cast'
service_type = 'bosdyn.api.RayCastService'
raycast(ray_origin, ray_direction, raycast_types, min_distance=0, frame_name=None, **kwargs)[source]

Requests robot to intersect ray against the environment it built up.

Parameters:
  • ray_origin – (x, y, z) position of the ray in the specified frame.

  • ray_direction – (x, y, z) vector denoting the direction of the ray in the specified frame.

  • raycast_types – array of 0 or more raycast types. 0 will cast into all sources.

  • min_distance – a positive real value denoting how far (meters) behind a ray an intersection can occur.

  • frame_name – the frame the ray is in.

Returns:

RaycastResponse

raycast_async(ray_origin, ray_direction, raycast_types, min_distance=0, frame_name=None, **kwargs)[source]

Async version of raycast().