rby1_sdk.HeadCommandBuilder#

class HeadCommandBuilder#

Bases: pybind11_object

Head command builder.

Wraps commands for the robot head. Currently, it supports JointPositionCommandBuilder to control the head joints.

Notes

  • You can pass a JointPositionCommandBuilder directly into set_head_command(...) without explicitly wrapping it in a HeadCommandBuilder, since implicit casting is provided.

  • Explicit construction is only needed if you want to be verbose; otherwise, set_head_command(JointPositionCommandBuilder(...)) is sufficient.

Examples

>>> import numpy as np, rby1_sdk as rby
>>> # Example 1: Explicit HeadCommandBuilder
>>> jp = rby.JointPositionCommandBuilder().set_position(np.zeros(2))  # assume 2 DOF head
>>> head = rby.HeadCommandBuilder(jp)
>>> comp = rby.ComponentBasedCommandBuilder().set_head_command(head)
>>> rc = rby.RobotCommandBuilder().set_command(comp)
>>> # robot.send_command(rc, priority=1).get()
>>>
>>> # Example 2: Implicit wrapping (preferred)
>>> comp = rby.ComponentBasedCommandBuilder().set_head_command(
...     rby.JointPositionCommandBuilder().set_position(np.zeros(2))
... )
>>> rc = rby.RobotCommandBuilder().set_command(comp)
__init__(*args, **kwargs)#

Overloaded function.

  1. __init__(self: rby1_sdk.HeadCommandBuilder) -> None

Construct a HeadCommandBuilder instance.

  1. __init__(self: rby1_sdk.HeadCommandBuilder, joint_position_command_builder: rby1_sdk.JointPositionCommandBuilder) -> None

Construct a HeadCommandBuilder from a joint position command.

Parameters:

joint_position_command_builder (JointPositionCommandBuilder) – Command specifying target joint positions for the head.

Methods

__init__(*args, **kwargs)

Overloaded function.

set_command(self, joint_position_command_builder)

Assign a joint position command to the head.

set_command(self: rby1_sdk.HeadCommandBuilder, joint_position_command_builder: rby1_sdk.JointPositionCommandBuilder) rby1_sdk.HeadCommandBuilder#

Assign a joint position command to the head.

Parameters:

joint_position_command_builder (JointPositionCommandBuilder) – Joint position command for the head.

Returns:

Self reference for method chaining.

Return type:

HeadCommandBuilder