rby1_sdk.ComponentBasedCommandBuilder¶
- class ComponentBasedCommandBuilder¶
Bases:
pybind11_objectComponent-based command builder.
Provides a unified builder interface to compose commands for the robot’s main subsystems: mobility, body, and head. Each setter accepts either the corresponding CommandBuilder wrapper (e.g., MobilityCommandBuilder, BodyCommandBuilder, HeadCommandBuilder) or lower-level builders (e.g., JointVelocityCommandBuilder, JointPositionCommandBuilder), which are automatically cast into the appropriate wrapper.
Notes
This is typically used inside a RobotCommandBuilder to assemble subsystem-level commands into a single robot command.
Automatic casting removes the need to explicitly wrap builders, simplifying code.
Examples
>>> import numpy as np, rby1_sdk as rby >>> comp = rby.ComponentBasedCommandBuilder() >>> # Mobility: send SE2 velocity >>> comp.set_mobility_command( ... rby.SE2VelocityCommandBuilder().set_velocity(np.array([0.1, 0.0]), 0.2) ... ) >>> # Body: send a joint position command to the right arm >>> comp.set_body_command( ... rby.BodyComponentBasedCommandBuilder().set_right_arm_command( ... rby.JointPositionCommandBuilder().set_position(np.zeros(7)) ... ) ... ) >>> # Head: send a joint position command to head joints >>> comp.set_head_command( ... rby.JointPositionCommandBuilder().set_position(np.zeros(2)) ... ) >>> cmd = rby.RobotCommandBuilder().set_command(comp) >>> # robot.send_command(cmd, priority=1).get()
- __init__(self: rby1_sdk.ComponentBasedCommandBuilder) None¶
Construct a ComponentBasedCommandBuilder instance.
Methods
__init__(self)Construct a ComponentBasedCommandBuilder instance.
set_body_command(self, body_command_builder)Assign a body command.
set_head_command(self, head_command_builder)Assign a head command.
set_mobility_command(self, ...)Assign a mobility command.