Members
number
# constant DEFAULT_MAX_MESSAGE_LENGTH
Set default max message length for sending and receiving to 100MB. This value is used when
creating channels in the Robot class.
Methods
# async _power_command(power_client, request, timeout_msecopt, update_frequencyopt, expect_grpc_timeoutopt, argsopt) → {Promise.<void>}
Helper function to issue command to power client.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
power_client |
PowerClient
|
Client for calling power service. | ||
request |
PowerCommandRequest
|
Request to make to power service. | ||
timeout_msec |
number
|
<optional> |
30000 | Max time this function will block for (in milliseconds). |
update_frequency |
number
|
<optional> |
1.0 | The frequency with which the robot should check if the command has succeeded. |
expect_grpc_timeout |
boolean
|
<optional> |
false | Expect API comms to drop on a success. |
args |
Object
|
<optional> |
Extra arguments for controlling RPC details. |
Problem communicating with the robot
RpcError
Promise.<void>
# add_edge_to_tree(frame_tree_snapshot, parent_tform_child, parent_frame_name, child_frame_name) → {geometry_pb.FrameTreeSnapshot}
Appends a child/parent and the transform to the FrameTreeSnapshot.
Parameters:
| Name | Type | Description |
|---|---|---|
frame_tree_snapshot |
geometry_pb.FrameTreeSnapshot
|
Object representing the child_to_parent_edge_map |
parent_tform_child |
math_helpers.SE3Pose
|
The SE3Pose to add to the frame_tree_snapshot |
parent_frame_name |
string
|
The parent name. |
child_frame_name |
string
|
The child name. |
geometry_pb.FrameTreeSnapshot
# async block_for_trajectory_cmd(command_client, cmd_id, trajectory_end_statuses, body_movement_statuses, feedback_interval_secs, timeout_sec, logger) → {Promise.<boolean>}
Helper that blocks until a trajectory command reaches a desired goal state or a timeout is reached.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
command_client |
RobotCommandClient
|
the client used to request feedback | |
cmd_id |
number
|
command ID returned by the robot when the trajectory command was sent | |
trajectory_end_statuses |
Array.<basic_command_pb.SE2TrajectoryCommand.Feedback.Status>
|
Array.<number>
|
the feedback must have a status which is included in this set of statuses to be considered successfully complete. By default, this includes only the "STATUS_AT_GOAL" end condition. | |
body_movement_statuses |
Array.<basic_command_pb.SE2TrajectoryCommand.Feedback.BodyMovementStatus>
|
null | the body movement status must be one of these statuses to be considered successfully complete. By default, this is null, which means any body movement status will be accepted. |
feedback_interval_secs |
number
|
100 | The time (in seconds) to wait before each feedback request checking if the trajectory is complete. Defaults to checking at 10 Hz (requests every 0.1 seconds || 100 milliseconds). |
timeout_sec |
number
|
null | optional number of seconds after which we'll return no matter what the robot's state is. |
logger |
any
|
null | The logger print debug statements with. If null, no debug printouts will be sent. |
True if reaches STATUS_AT_GOAL, false otherwise.
Promise.<boolean>
# async block_until_arm_arrives(command_client, cmd_id, timeout_secopt) → {Promise.<boolean>}
Helper that blocks until the arm achieves a finishing state for the specific arm command.
This helper will block and check the feedback for ArmCartesianCommand, GazeCommand,
ArmJointMoveCommand, and NamedArmPositionsCommand.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
command_client |
RobotCommandClient
|
Robot command client, used to request feedback | ||
cmd_id |
number
|
Timeout for the command in seconds. | ||
timeout_sec |
number
|
<optional> |
null | optional number of seconds after which we'll return no matter what the robot's state is. |
Command feedback from robot is not STATUS_PROCESSING.
CommandFailedError
Command took longer than provided timeout.
CommandTimedOutError
true if successfully got to the end of the trajectory, false if the arm stalled or
the move was canceled (the arm failed to reach the goal).
Promise.<boolean>
# async blocking_selfright(command_client, timeout_secopt, update_frequencyopt) → {Promise.<void>}
Helper function which uses the RobotCommandService to self-right.
Blocks until self-right has completed, or raises an exception if the command times out or fails.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
command_client |
RobotCommandClient
|
RobotCommand client. | ||
timeout_sec |
number
|
<optional> |
30_000 | Timeout for the command in seconds. |
update_frequency |
number
|
<optional> |
1.0 | Update frequency for the command in Hz. |
Command feedback from robot is not STATUS_PROCESSING.
CommandFailedError
Command took longer than provided timeout.
CommandTimedOutError
Promise.<void>
# async blocking_sit(command_client, timeout_secopt, update_frequencyopt) → {Promise.<void>}
Helper function which uses the RobotCommandService to sit.
Blocks until robot is sitting, or raises an exception if the command times out or fails.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
command_client |
RobotCommandClient
|
RobotCommand client. | ||
timeout_sec |
number
|
<optional> |
10_000 | Timeout for the command in seconds. |
update_frequency |
number
|
<optional> |
1.0 | Update frequency for the command in Hz. |
Command feedback from robot is not STATUS_PROCESSING.
CommandFailedError
Command took longer than provided timeout.
CommandTimedOutError
Promise.<void>
# async blocking_stand(command_client, timeout_secopt, update_frequencyopt, paramsopt) → {Promise.<void>}
Helper function which uses the RobotCommandService to stand.
Blocks until robot is standing, or raises an exception if the command times out or fails.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
command_client |
RobotCommandClient
|
RobotCommand client. | ||
timeout_sec |
number
|
<optional> |
10_000 | Timeout for the command in seconds. |
update_frequency |
number
|
<optional> |
1.0 | Update frequency for the command in Hz. |
params |
MobilityParams
|
<optional> |
null | Spot specific parameters for mobility commands to optionally set say body_height |
Command feedback from robot is not STATUS_PROCESSING.
CommandFailedError
Command took longer than provided timeout.
CommandTimedOutError
Promise.<void>
# build_pc_request(point_cloud_source_name) → {point_cloud_protos.PointCloudRequest}
Helper function which builds an PointCloudRequest from an point cloud source name.
Parameters:
| Name | Type | Description |
|---|---|---|
point_cloud_source_name |
string
|
The point cloud source to query. |
The PointCloudRequest protobuf message for the given parameters.
point_cloud_protos.PointCloudRequest
# create_insecure_channel(address, port, authority, optionsopt) → {grpc.Channel}
Create an insecure channel to given host and port.
This method is only used for testing purposes. Applications must use secure channels to
communicate with services running on Spot.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
address |
string
|
Connection host address. | ||
port |
string
|
number
|
Connection port. | ||
authority |
Object
|
null | Authority option for the channel. | |
options |
Object
|
<optional> |
{} | A list of additional parameters for the GRPC channel. |
A secure channel.
grpc.Channel
# create_secure_channel(address, port, creds, authority, optionsopt) → {grpc.Channel}
Create a secure channel to given host:port.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
address |
string
|
Connection host address. | ||
port |
string
|
number
|
Connection port. | ||
creds |
Object
|
A ChannelCredentials instance. | ||
authority |
Object
|
Authority option for the channel. | ||
options |
Object
|
<optional> |
{} | A list of additional parameters for the GRPC channel. |
A secure channel.
grpc.Channel
# create_secure_channel_creds(cert, token_cb, add_app_token) → {Object}
Returns credentials for establishing a secure channel. Uses previously set values on the linked Sdk and this.
Parameters:
| Name | Type | Description |
|---|---|---|
cert |
string
|
Buffer
|
The certificate to create channel credentials. |
token_cb |
function
|
Callable that returns an Object |
add_app_token |
boolean
|
Whether to include an app token in the metadata. This is necessary for compatibility with old robot software. |
Object
# create_standard_sdk(client_name_prefix, service_clientsopt, nullable, cert_resource_globopt, nullable) → {Sdk}
Return an Sdk with the most common configuration.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
client_name_prefix |
string
|
Prefix to pass to generate_client_name() | ||
service_clients |
Array
|
<optional> <nullable> |
null | List of service client classes to register in addition to the defaults. |
cert_resource_glob |
string
|
<optional> <nullable> |
Glob expression matching robot certificate(s). Default null to use distributed certificate. |
Robot cert could not be loaded.
RangeError
sdk
# decode_token(token) → {Object}
Decodes a JWT token without verification.
Parameters:
| Name | Type | Description |
|---|---|---|
token |
string
|
A string representing a token. |
- Deprecated:
- since v3.0.1
val Object containing information about the token.
Empty object if failed to load token.
Object
# express_se2_velocity_in_new_frame(frame_tree_snapshot, frame_b, frame_c, vel_of_a_in_b, validateopt) → {math_helpers.SE2Velocity|null}
Convert the SE2 Velocity in frame b to a SE2 Velocity in frame c using
the frame tree snapshot.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
frame_tree_snapshot |
Object
|
object representing the child_to_parent_edge_map | ||
frame_b |
string
|
The first frame representation | ||
frame_c |
string
|
The second frame representation | ||
vel_of_a_in_b |
math_helpers.SE2Velocity
|
SE2 Velocity in frame_b | ||
validate |
boolean
|
<optional> |
true | If the FrameTreeSnapshot should be checked for a valid tree structure |
math_helpers.SE2Velocity
|
null
# express_se3_velocity_in_new_frame(frame_tree_snapshot, frame_b, frame_c, vel_of_a_in_b, validateopt) → {math_helpers.SE3Velocity|null}
Convert the SE(3) Velocity in frame b to an SE(3) Velocity in frame c using
the frame tree snapshot.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
frame_tree_snapshot |
Object
|
object representing the child_to_parent_edge_map | ||
frame_b |
string
|
The first frame representation | ||
frame_c |
string
|
The second frame representation | ||
vel_of_a_in_b |
math_helpers.SE3Velocity
|
SE3 Velocity in frame_b | ||
validate |
boolean
|
<optional> |
true | If the FrameTreeSnapshot should be checked for a valid tree structure |
math_helpers.SE3Velocity
|
null
# generate_channel_options(max_send_message_lengthopt, nullable, max_receive_message_lengthopt, nullable) → {Object}
Generate the array of options to specify in the creation of a client channel or server.
The list contains the values for max allowed message length for both sending and
receiving. If no values are provided, the default values of 100 MB are used.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
max_send_message_length |
number
|
<optional> <nullable> |
104857600 | Max message length allowed for message to send. |
max_receive_message_length |
number
|
<optional> <nullable> |
104857600 | Max message length allowed for message to receive. |
Object with values for channel options.
Object
# get_a_tform_b(frame_tree_snapshot, frame_a, frame_b, validateopt) → {math_helpers.SE3Pose|null}
Get the SE(3) pose representing the transform between frame_a and frame_b.
Using frame_tree_snapshot, find the math_helpers.SE3Pose to transform geometry from
frame_a's representation to frame_b's.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
frame_tree_snapshot |
geometry_pb.FrameTreeSnapshot
|
object representing the child_to_parent_edge_map | ||
frame_a |
string
|
The first frame to check in. | ||
frame_b |
string
|
The second frame to check in. | ||
validate |
boolean
|
<optional> |
true | If the FrameTreeSnapshot should be checked for a valid tree structure |
math_helpers.SE3Pose
|
null
# get_frame_names(frame_tree_snapshot) → {Array}
Returns an array of all known child or parent frames in the FrameTreeSnapshot
Parameters:
| Name | Type | Description |
|---|---|---|
frame_tree_snapshot |
geometry_pb.FrameTreeSnapshot
|
Object representing the child_to_parent_edge_map |
Array
# get_odom_tform_body(frame_tree_snapshot) → {number}
Get the transformation between "odom" frame and "body" frame from the FrameTreeSnapshot.
Parameters:
| Name | Type | Description |
|---|---|---|
frame_tree_snapshot |
Object
|
object representing the child_to_parent_edge_map |
number
# get_se2_a_tform_b(frame_tree_snapshot, frame_a, frame_b, validateopt) → {math_helpers.SE2Pose|null}
Get the SE(2) pose representing the transform between frame_a and frame_b.
Using frame_tree_snapshot, find the math_helpers.SE2Pose to transform geometry from
frame_a's representation to frame_b's.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
frame_tree_snapshot |
Object
|
object representing the child_to_parent_edge_map | ||
frame_a |
string
|
The first frame representation | ||
frame_b |
string
|
The second frame representation | ||
validate |
boolean
|
<optional> |
true | If the FrameTreeSnapshot should be checked for a valid tree structure |
math_helpers.SE2Pose
|
null
# get_vision_tform_body(frame_tree_snapshot) → {number}
Get the transformation between "vision" frame and "body" frame from the FrameTreeSnapshot.
Parameters:
| Name | Type | Description |
|---|---|---|
frame_tree_snapshot |
Object
|
object representing the child_to_parent_edge_map |
number
# async has_arm(state_client, timeoutnullable) → {boolean}
Convenience function which first requests a robots hardware configuration followed by
requests to get link models for all robot links.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
state_client |
RobotStateClient
|
RobotStateClient to query for robot state. | ||
timeout |
number
|
<nullable> |
null | Timeout for the command in milliseconds. |
Returns true if robot has an arm, false otherwise.
boolean
# is_gravity_aligned_frame_name(frame_name) → {boolean}
Checks if the string frame name is a known gravity aligned frame.
Parameters:
| Name | Type | Description |
|---|---|---|
frame_name |
string
|
The frame name to check in. |
boolean
# async is_powered_on(state_client, argsopt) → {Promise.<boolean>}
Returns true if robot is powered on, false otherwise.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
state_client |
RobotStateClient
|
Robot state client instance. | |
args |
Object
|
<optional> |
Extra arguments for controlling RPC details. |
Problem communicating with the robot
RpcError
Promise.<boolean>
# log_token_time_remaining(token)
Log the time remaining until app token expires.
Parameters:
| Name | Type | Description |
|---|---|---|
token |
string
|
A jwt token |
- Deprecated:
- since v3.0.1
# make_add_world_object_req(world_obj) → {world_object_pb.MutateWorldObjectRequest}
Add a world object to the scene.
Parameters:
| Name | Type | Description |
|---|---|---|
world_obj |
world_object_pb.WorldObject
|
The world object to be added into the robot's perception scene. |
A MutateWorldObjectRequest where the action is to
"add" the object to the scene.
world_object_pb.MutateWorldObjectRequest
# make_change_world_object_req(world_obj) → {world_object_pb.MutateWorldObjectRequest}
Change/update an existing world object in the scene.
Parameters:
| Name | Type | Description |
|---|---|---|
world_obj |
world_object_pb.WorldObject
|
The world object to be changed/updated in the robot's perception scene. The object must be a client-added object and have the correct world object id returned by the service after adding the object. |
A MutateWorldObjectRequest where the action is to
"change" the object to the scene.
world_object_pb.MutateWorldObjectRequest
# make_delete_world_object_req(world_obj) → {world_object_pb.MutateWorldObjectRequest}
Delete a world object from the scene.
Parameters:
| Name | Type | Description |
|---|---|---|
world_obj |
world_object_pb.WorldObject
|
The world object to be delete in the robot's perception scene. The object must be a client-added object and have the correct world object id returned by the service after adding the object. |
A MutateWorldObjectRequest where the action is to
"delete" the object to the scene.
world_object_pb.MutateWorldObjectRequest
# async power_cycle_robot(power_client, timeout_msecopt, update_frequencyopt, argsopt) → {Promise.<void>}
Power cycle the robot. Power cycling the robot will stop API comms.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
power_client |
PowerClient
|
Client for calling power service. | ||
timeout_msec |
number
|
<optional> |
30000 | Max time this function will block for. |
update_frequency |
number
|
<optional> |
1.0 | The frequency with which the robot should check if the command has succeeded. |
args |
Object
|
<optional> |
Extra arguments for controlling RPC details. |
Problem communicating with the robot.
RpcError
Did not power off within timeout_msec.
CommandTimedOutError
Something went wrong during the power off sequence.
PowerResponseError
Promise.<void>
# async power_off_motors(power_client, timeout_msecopt, update_frequencyopt, argsopt) → {Promise.<void>}
Power off the robot motors.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
power_client |
PowerClient
|
Client for calling power service. | ||
timeout_msec |
number
|
<optional> |
30000 | Max time this function will block for. |
update_frequency |
number
|
<optional> |
1.0 | The frequency with which the robot should check if the command has succeeded. |
args |
Object
|
<optional> |
Extra arguments for controlling RPC details. |
Problem communicating with the robot.
RpcError
Did not power off within timeout_msec.
CommandTimedOutError
Something went wrong during the power off sequence.
PowerResponseError
Promise.<void>
# async power_off_payload_ports(power_client, timeout_msecopt, update_frequencyopt, argsopt) → {Promise.<void>}
Power off the robot payload ports.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
power_client |
PowerClient
|
Client for calling power service. | ||
timeout_msec |
number
|
<optional> |
30000 | Max time this function will block for. |
update_frequency |
number
|
<optional> |
1.0 | The frequency with which the robot should check if the command has succeeded. |
args |
Object
|
<optional> |
Extra arguments for controlling RPC details. |
Problem communicating with the robot.
RpcError
Did not power off within timeout_msec.
CommandTimedOutError
Something went wrong during the power off sequence.
PowerResponseError
Promise.<void>
# async power_off_robot(power_client, timeout_msecopt, update_frequencyopt, argsopt) → {Promise.<void>}
Fully power off the robot. Powering off the robot will stop API comms.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
power_client |
PowerClient
|
Client for calling power service. | ||
timeout_msec |
number
|
<optional> |
30000 | Max time this function will block for. |
update_frequency |
number
|
<optional> |
1.0 | The frequency with which the robot should check if the command has succeeded. |
args |
Object
|
<optional> |
Extra arguments for controlling RPC details. |
Problem communicating with the robot.
RpcError
Did not power off within timeout_msec.
CommandTimedOutError
Something went wrong during the power off sequence.
PowerResponseError
Promise.<void>
# async power_off_wifi_radio(power_client, timeout_msecopt, update_frequencyopt, argsopt) → {Promise.<void>}
Power off the robot Wi-Fi radio.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
power_client |
PowerClient
|
Client for calling power service. | ||
timeout_msec |
number
|
<optional> |
30000 | Max time this function will block for. |
update_frequency |
number
|
<optional> |
1.0 | The frequency with which the robot should check if the command has succeeded. |
args |
Object
|
<optional> |
Extra arguments for controlling RPC details. |
Problem communicating with the robot.
RpcError
Did not power off within timeout_msec.
CommandTimedOutError
Something went wrong during the power off sequence.
PowerResponseError
Promise.<void>
# async power_on_motors(power_client, timeout_msecopt, update_frequencyopt, argsopt) → {Promise.<void>}
Power on the robot motors. This function blocks until the command returns success.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
power_client |
PowerClient
|
Client for calling power service. | ||
timeout_msec |
number
|
<optional> |
30000 | Max time this function will block for. |
update_frequency |
number
|
<optional> |
1.0 | The frequency with which the robot should check if the command has succeeded. |
args |
Object
|
<optional> |
Extra arguments for controlling RPC details. |
Problem communicating with the robot.
RpcError
Did not power off within timeout_msec.
CommandTimedOutError
Something went wrong during the power off sequence.
PowerResponseError
Promise.<void>
# async power_on_payload_ports(power_client, timeout_msecopt, update_frequencyopt, argsopt) → {Promise.<void>}
Power on the robot payload ports.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
power_client |
PowerClient
|
Client for calling power service. | ||
timeout_msec |
number
|
<optional> |
30000 | Max time this function will block for. |
update_frequency |
number
|
<optional> |
1.0 | The frequency with which the robot should check if the command has succeeded. |
args |
Object
|
<optional> |
Extra arguments for controlling RPC details. |
Problem communicating with the robot.
RpcError
Did not power off within timeout_msec.
CommandTimedOutError
Something went wrong during the power off sequence.
PowerResponseError
Promise.<void>
# async power_on_wifi_radio(power_client, timeout_msecopt, update_frequencyopt, argsopt) → {Promise.<void>}
Power on the robot Wi-Fi radio.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
power_client |
PowerClient
|
Client for calling power service. | ||
timeout_msec |
number
|
<optional> |
30000 | Max time this function will block for. |
update_frequency |
number
|
<optional> |
1.0 | The frequency with which the robot should check if the command has succeeded. |
args |
Object
|
<optional> |
Extra arguments for controlling RPC details. |
Problem communicating with the robot.
RpcError
Did not power off within timeout_msec.
CommandTimedOutError
Something went wrong during the power off sequence.
PowerResponseError
Promise.<void>
# RefreshingAccessTokenAuthMetadataPlugin(token_cb, add_app_token) → {function}
Plugin to refresh access token.
Parameters:
| Name | Type | Description |
|---|---|---|
token_cb |
function
|
Callable that returns an Object |
add_app_token |
boolean
|
Whether to include an app token in the metadata. This is necessary for compatibility with old robot software. |
function
# register(viewer, orderopt) → {void}
Register an image viewer. If order < 0 the viewer is used in first place.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
viewer |
class
|
function
|
Image class's viewer. | ||
order |
number
|
<optional> |
1 | The order to put the viewer. |
void
# ResponseContext(response, request, rpc_loggeropt) → {void}
Helper to log gRPC request and response message to the data buffer for a service.
It should be called using a "with" statement each time an RPC is received such that
the request and response proto messages can be passed in. It will automatically log
the request and response to the data buffer, and mutates the headers to add additional
information before logging.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
response |
protobuf
|
Any gRPC response message with a bosdyn.api.ResponseHeader proto. | ||
request |
protobuf
|
Any gRPC request message with a bosdyn.api.RequestHeader proto. | ||
rpc_logger |
DataBufferClient
|
<optional> |
null | Optional data buffer client to log the messages; if not provided, only the headers will be mutated and nothing will be logged. |
void
# async safe_power_off(command_client, state_client, timeout_msecopt, update_frequencyopt, argsopt) → {Promise.<void>}
Power off robot motors safely. This function blocks until robot safely powers off. This
means the robot will attempt to sit before powering motors off.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
command_client |
RobotCommandClient
|
Client for calling RobotCommandService safe power off. | ||
state_client |
RobotStateClient
|
Client for monitoring power state. | ||
timeout_msec |
number
|
<optional> |
30000 | Max time this function will block for. |
update_frequency |
number
|
<optional> |
1.0 | The frequency with which the robot should check if the command has succeeded. |
args |
Object
|
<optional> |
Extra arguments for controlling RPC details. |
Problem communicating with the robot.
RpcError
Did not power off within timeout_sec.
CommandTimedOutError
Something went wrong during the power off sequence.
RobotCommandResponseError
Promise.<void>
# save(image, name) → {Promise.<sharp>}
Save image to path. (Convert any type of image into .png | .jpg | ...)
Parameters:
| Name | Type | Description |
|---|---|---|
image |
Buffer
|
Array
|
string
|
The data of the image. |
name |
string
|
The name of the image. |
Promise.<sharp>
# shift_pan_angle(pan) → {number}
Shift the pan angle (degrees) so that it is in the [0,360] range.
Parameters:
| Name | Type | Description |
|---|---|---|
pan |
number
|
The angle in degrees to be shift. |
number
# async show(image, options) → {Promise.<boolean>}
Display image with default image viewer.
Parameters:
| Name | Type | Description |
|---|---|---|
image |
Buffer
|
Array
|
string
|
The data of the image. |
options |
Object
|
The options of the image. |
title |
string
|
The title of the image. |
Promise.<boolean>
# translate_exception(rpc_error) → {Error}
Translated a GRPC error into an SDK RpcError.
Parameters:
| Name | Type | Description |
|---|---|---|
rpc_error |
Object
|
Error
|
RPC error to translate. |
Specific sub-type of RpcError.
Error
# validate_frame_tree_snapshot(frame_tree_snapshot) → {boolean}
Validates that a FrameTreeSnapshot is well-formed.
A FrameTreeSnapshot is expected to be a single tree, but poorly written
services can misuse the syntax to construct other data structures. The
syntax prevents DAGs from forming, but the data structure could
Valid FrameTrees must be a single rooted tree. However, the general format of
repeated edges may not actually be valid - there could be cycles, disjoint
trees, or missing edges in the actual data structure.
Parameters:
| Name | Type | Description |
|---|---|---|
frame_tree_snapshot |
geometry_pb.FrameTreeSnapshot
|
A snapshot of the data. |
ValidateFrameTreeError in a number of cases:
Empty tree, invalid frame names in the tree, missing transforms
relating the two nodes, cycles in the tree, the tree is actually a DAG, and disconnected trees.
ValidateFrameTreeError
True if valid
boolean