controllers¶
controllers
¶
Modules:
| Name | Description |
|---|---|
abstract |
|
base_pose |
|
g1_wbc |
G1's whole-body PD/ONNX low-level controller: the reference stack's |
joint_pos |
|
joint_rel_pos |
|
joint_vel |
|
torso_height |
|
Classes:
| Name | Description |
|---|---|
AbstractPositionController |
Base class for (absolute or relative) position controllers. |
BasePoseController |
Abstract pose controller class for a simple 2D pose controller for a robot base. |
Controller |
Implementation of a simple, non-blocking controller for the MolmoSpaces environments. |
DiffDriveBasePoseController |
|
JointPosController |
Generic joint position controller for a robot. |
JointRelPosController |
Generic joint position controller for a robot. |
JointVelController |
Generic joint velocity controller for a robot. |
SwerveBasePoseController |
|
TorsoHeightJointPosController |
Controls the RBY1 torso via a single height scalar. |
__all__
module-attribute
¶
__all__ = ['AbstractPositionController', 'Controller', 'BasePoseController', 'DiffDriveBasePoseController', 'JointPosController', 'JointRelPosController', 'JointVelController', 'SwerveBasePoseController', 'TorsoHeightJointPosController']
AbstractPositionController
¶
AbstractPositionController(robot_move_group: MoveGroup)
Bases: Controller
Base class for (absolute or relative) position controllers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
robot_move_group
|
MoveGroup
|
The move group of the robot to be controlled |
required |
Methods:
| Name | Description |
|---|---|
compute_ctrl_inputs |
Compute the control inputs based on the current state and the target set by the user. |
reset |
Reset the controller to its initial state, clearing any internal state or targets. |
set_target |
Set the target state of the controller. |
set_to_stationary |
This method sets the robot to stationary mode and computes the targets to hold the |
Attributes:
| Name | Type | Description |
|---|---|---|
robot_move_group |
|
|
stationary |
bool
|
Whether the controller is set to hold the robot stationary, for e.g. |
target |
ndarray
|
The target state of the controller, set by the user of the controller. |
target_pos |
ndarray
|
The target absolute position of the controller, set by the user of the controller. |
Source code in molmo_spaces/controllers/abstract.py
stationary
abstractmethod
property
¶
Whether the controller is set to hold the robot stationary, for e.g. when the robot has to be stopped at a certain position and not drift.
target
abstractmethod
property
¶
The target state of the controller, set by the user of the controller.
target_pos
abstractmethod
property
¶
The target absolute position of the controller, set by the user of the controller.
compute_ctrl_inputs
abstractmethod
¶
Compute the control inputs based on the current state and the target set by the user.
Returns:
| Type | Description |
|---|---|
ndarray
|
The control inputs to be applied to the robot actuators, eg. positions, torques etc. |
Source code in molmo_spaces/controllers/abstract.py
reset
abstractmethod
¶
set_target
abstractmethod
¶
Set the target state of the controller.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target
|
ndarray
|
The target state to be set, e.g. a joint position, base velocity, or any other state. |
required |
set_to_stationary
¶
This method sets the robot to stationary mode and computes the targets to hold the robot stationary. This is useful when the robot needs to be stopped at a certain position and not drift. NOTE: If the controller is already stationary, it does not change the target.
Source code in molmo_spaces/controllers/abstract.py
BasePoseController
¶
BasePoseController(robot_move_group: RobotBaseGroup)
Bases: Controller, ABC
Abstract pose controller class for a simple 2D pose controller for a robot base. Computes velocities for the robot base's actuators based on target pose, and clips to control limits. NOTE: Assumes base actuators (eg. wheels) use velocity inputs.
This class cannot be instantiated directly and must be subclassed with an implementation of the "compute_base_velocities" method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
robot_move_group
|
MoveGroup
|
The move group of the robot to be controlled |
required |
Methods:
| Name | Description |
|---|---|
compute_base_velocities |
Abstract method to compute base velocities to achieve the target pose. |
compute_ctrl_inputs |
Compute the control inputs based on the current state and the target set by the user. |
reset |
Reset the controller to its initial state, clearing any internal state or targets. |
set_target |
Set the target pose for the controller |
set_to_stationary |
This method sets the robot to stationary mode and computes the targets to hold the |
Attributes:
| Name | Type | Description |
|---|---|---|
ctrl_dim |
|
|
ctrl_range |
|
|
robot_move_group |
|
|
stationary |
bool
|
Whether the controller is set to hold the robot stationary, for e.g. |
target |
The target pose for the controller |
Source code in molmo_spaces/controllers/base_pose.py
stationary
property
¶
Whether the controller is set to hold the robot stationary, for e.g. when the robot has to be stopped at a certain position and not drift.
compute_base_velocities
abstractmethod
¶
Abstract method to compute base velocities to achieve the target pose. Must be implemented by subclasses. Methods could include: Differential-drive, Ackermann steering, Omni-wheel control etc.
Source code in molmo_spaces/controllers/base_pose.py
compute_ctrl_inputs
¶
Compute the control inputs based on the current state and the target set by the user.
Returns:
| Type | Description |
|---|---|
|
The control inputs to be applied to the robot actuators, in this case: positions |
Source code in molmo_spaces/controllers/base_pose.py
reset
¶
set_target
¶
set_to_stationary
¶
This method sets the robot to stationary mode and computes the targets to hold the robot stationary. This is useful when the robot needs to be stopped at a certain position and not drift.
Source code in molmo_spaces/controllers/base_pose.py
Controller
¶
Controller(robot_move_group: MoveGroup)
Implementation of a simple, non-blocking controller for the MolmoSpaces environments. This controller is meant to be simple, provide a control law based on stateful targets set by the user, and return the control inputs needed to achieve those targets.
The controller DOES NOT step the simulation, it only computes the control inputs based on the current state and the targets set by the user.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
robot_move_group
|
MoveGroup
|
The move group of the robot to be controlled |
required |
Methods:
| Name | Description |
|---|---|
compute_ctrl_inputs |
Compute the control inputs based on the current state and the target set by the user. |
reset |
Reset the controller to its initial state, clearing any internal state or targets. |
set_target |
Set the target state of the controller. |
set_to_stationary |
This method sets the robot to stationary mode and computes the targets to hold the |
Attributes:
| Name | Type | Description |
|---|---|---|
robot_move_group |
|
|
stationary |
bool
|
Whether the controller is set to hold the robot stationary, for e.g. |
target |
ndarray
|
The target state of the controller, set by the user of the controller. |
Source code in molmo_spaces/controllers/abstract.py
stationary
abstractmethod
property
¶
Whether the controller is set to hold the robot stationary, for e.g. when the robot has to be stopped at a certain position and not drift.
target
abstractmethod
property
¶
The target state of the controller, set by the user of the controller.
compute_ctrl_inputs
abstractmethod
¶
Compute the control inputs based on the current state and the target set by the user.
Returns:
| Type | Description |
|---|---|
ndarray
|
The control inputs to be applied to the robot actuators, eg. positions, torques etc. |
Source code in molmo_spaces/controllers/abstract.py
reset
abstractmethod
¶
set_target
abstractmethod
¶
Set the target state of the controller.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target
|
ndarray
|
The target state to be set, e.g. a joint position, base velocity, or any other state. |
required |
set_to_stationary
¶
This method sets the robot to stationary mode and computes the targets to hold the robot stationary. This is useful when the robot needs to be stopped at a certain position and not drift. NOTE: If the controller is already stationary, it does not change the target.
Source code in molmo_spaces/controllers/abstract.py
DiffDriveBasePoseController
¶
DiffDriveBasePoseController(robot_config, robot_move_group: RobotBaseGroup)
Bases: BasePoseController
Differential drive base pose controller.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
robot_config
|
The configuration of the robot, containing special information about the control |
required | |
robot_move_group
|
RobotBaseGroup
|
The move group of the robot base to be controlled |
required |
Methods:
| Name | Description |
|---|---|
compute_base_velocities |
Compute wheel velocities to drive the robot base to the target pose using a simple proportional controller. |
compute_ctrl_inputs |
Compute the control inputs based on the current state and the target set by the user. |
reset |
Reset the controller to its initial state, clearing any internal state or targets. |
set_target |
Set the target pose for the controller |
set_to_stationary |
This method sets the robot to stationary mode and computes the targets to hold the |
Attributes:
| Name | Type | Description |
|---|---|---|
ctrl_dim |
|
|
ctrl_range |
|
|
robot_config |
|
|
robot_move_group |
|
|
stationary |
bool
|
Whether the controller is set to hold the robot stationary, for e.g. |
target |
The target pose for the controller |
|
wheel_base |
|
|
wheel_radius |
|
Source code in molmo_spaces/controllers/base_pose.py
stationary
property
¶
Whether the controller is set to hold the robot stationary, for e.g. when the robot has to be stopped at a certain position and not drift.
compute_base_velocities
¶
Compute wheel velocities to drive the robot base to the target pose using a simple proportional controller.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target_base_pose
|
Target [x, y, theta] pose in world frame. |
required |
Returns:
| Type | Description |
|---|---|
|
np.ndarray: [left_wheel_velocity, right_wheel_velocity] |
Source code in molmo_spaces/controllers/base_pose.py
compute_ctrl_inputs
¶
Compute the control inputs based on the current state and the target set by the user.
Returns:
| Type | Description |
|---|---|
|
The control inputs to be applied to the robot actuators, in this case: positions |
Source code in molmo_spaces/controllers/base_pose.py
reset
¶
set_target
¶
set_to_stationary
¶
This method sets the robot to stationary mode and computes the targets to hold the robot stationary. This is useful when the robot needs to be stopped at a certain position and not drift.
Source code in molmo_spaces/controllers/base_pose.py
JointPosController
¶
JointPosController(robot_move_group: MoveGroup)
Bases: AbstractPositionController
Generic joint position controller for a robot. Computes joint position targets for the joint's actuators, and clips to control limits. NOTE: Assumes joint actuators use position inputs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
robot_move_group
|
MoveGroup
|
The move group of the robot to be controlled |
required |
Methods:
| Name | Description |
|---|---|
compute_ctrl_inputs |
Compute the control inputs based on the current state and the target set by the user. |
reset |
Reset the controller to its initial state, clearing any internal state or targets |
set_target |
Set the target state of the controller. |
set_to_stationary |
This method sets the robot to stationary mode and computes the targets to hold the |
Attributes:
| Name | Type | Description |
|---|---|---|
ctrl_dim |
|
|
ctrl_range |
|
|
robot_move_group |
|
|
stationary |
bool
|
Whether the controller is set to hold the robot stationary, for e.g. |
target |
The target state of the controller, set by the user of the controller. |
|
target_pos |
ndarray
|
The target absolute position of the controller, set by the user of the controller. |
Source code in molmo_spaces/controllers/joint_pos.py
stationary
property
¶
Whether the controller is set to hold the robot stationary, for e.g. when the robot has to be stopped at a certain position and not drift.
target
property
writable
¶
The target state of the controller, set by the user of the controller.
target_pos
property
¶
The target absolute position of the controller, set by the user of the controller.
compute_ctrl_inputs
¶
Compute the control inputs based on the current state and the target set by the user.
Returns:
| Type | Description |
|---|---|
|
The control inputs to be applied to the robot actuators, in this case: positions |
Source code in molmo_spaces/controllers/joint_pos.py
reset
¶
Reset the controller to its initial state, clearing any internal state or targets
set_target
¶
Set the target state of the controller.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target
|
ndarray
|
The target state to be set, e.g. a joint position, base velocity, or any other state. |
required |
set_to_stationary
¶
This method sets the robot to stationary mode and computes the targets to hold the robot stationary. This is useful when the robot needs to be stopped at a certain position and not drift.
Source code in molmo_spaces/controllers/joint_pos.py
JointRelPosController
¶
JointRelPosController(robot_move_group: MoveGroup)
Bases: AbstractPositionController
Generic joint position controller for a robot. Computes delta joint position targets for the joint's actuators, and clips to control limits.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
robot_move_group
|
MoveGroup
|
The move group of the robot to be controlled |
required |
Methods:
| Name | Description |
|---|---|
compute_ctrl_inputs |
Compute the control inputs based on the current state and the target set by the user. |
reset |
Reset the controller to its initial state, clearing any internal state or targets |
set_target |
Set the target joint positions for the controller. |
set_to_stationary |
This method sets the robot to stationary mode and computes the targets to hold the |
Attributes:
| Name | Type | Description |
|---|---|---|
ctrl_dim |
|
|
ctrl_range |
|
|
desired_joint_positions |
|
|
robot_move_group |
|
|
stationary |
Returns whether the controller is in stationary mode |
|
target |
The target state of the controller, set by the user of the controller. |
|
target_pos |
ndarray
|
The target absolute position of the controller, set by the user of the controller. |
Source code in molmo_spaces/controllers/joint_rel_pos.py
desired_joint_positions
instance-attribute
¶
target
property
writable
¶
The target state of the controller, set by the user of the controller.
target_pos
property
¶
The target absolute position of the controller, set by the user of the controller.
compute_ctrl_inputs
¶
Compute the control inputs based on the current state and the target set by the user.
Returns:
| Type | Description |
|---|---|
|
The control inputs to be applied to the robot actuators, in this case: positions |
Source code in molmo_spaces/controllers/joint_rel_pos.py
reset
¶
Reset the controller to its initial state, clearing any internal state or targets
set_target
¶
Set the target joint positions for the controller. NOTE: For this controller we assume that the controller will be set to stationary every time before the relative target has to be computed
Source code in molmo_spaces/controllers/joint_rel_pos.py
set_to_stationary
¶
This method sets the robot to stationary mode and computes the targets to hold the robot stationary. This is useful when the robot needs to be stopped at a certain position and not drift.
Source code in molmo_spaces/controllers/joint_rel_pos.py
JointVelController
¶
JointVelController(robot_config, robot_move_group: MoveGroup)
Bases: Controller
Generic joint velocity controller for a robot. Computes joint position targets for the joint's actuators after euler integration, and clips to control limits. NOTE: Assumes joint actuators use position inputs.
robot_config: The configuration of the robot, containing special information about the control, e.g., delta_t for integration (if applicable) etc. robot_move_group: The move group of the robot to be controlled
Methods:
| Name | Description |
|---|---|
compute_ctrl_inputs |
Compute the control inputs based on the current state and the target set by the user. |
reset |
Reset the controller to its initial state, clearing any internal state or targets. |
set_target |
Set the target state of the controller. |
set_to_stationary |
This method sets the robot to stationary mode and computes the targets to hold the |
Attributes:
| Name | Type | Description |
|---|---|---|
ctrl_dim |
|
|
ctrl_range |
|
|
euler_dt |
|
|
robot_config |
|
|
robot_move_group |
|
|
stationary |
bool
|
Returns whether the controller is in stationary mode |
target |
ndarray
|
Returns the current target joint velocities |
Source code in molmo_spaces/controllers/joint_vel.py
compute_ctrl_inputs
¶
Compute the control inputs based on the current state and the target set by the user.
Returns:
| Type | Description |
|---|---|
ndarray
|
The control inputs to be applied to the robot actuators, in this case: positions |
Source code in molmo_spaces/controllers/joint_vel.py
reset
¶
set_target
¶
Set the target state of the controller.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target
|
ndarray
|
The target state to be set, e.g. a joint position, base velocity, or any other state. |
required |
set_to_stationary
¶
This method sets the robot to stationary mode and computes the targets to hold the robot stationary. This is useful when the robot needs to be stopped at a certain position and not drift.
Source code in molmo_spaces/controllers/joint_vel.py
SwerveBasePoseController
¶
SwerveBasePoseController(robot_config, robot_move_group: RobotBaseGroup)
Bases: BasePoseController
Swerve drive base pose controller.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
robot_config
|
The configuration of the robot, containing special information about the control |
required | |
robot_move_group
|
RobotBaseGroup
|
The move group of the robot base to be controlled |
required |
Methods:
| Name | Description |
|---|---|
compute_base_velocities |
Compute wheel velocities and steer angles to drive the robot base to the target pose using a simple proportional controller. |
compute_ctrl_inputs |
Compute the control inputs based on the current state and the target set by the user. |
reset |
Reset the controller to its initial state, clearing any internal state or targets. |
set_target |
Set the target pose for the controller |
set_to_stationary |
This method sets the robot to stationary mode and computes the targets to hold the |
Attributes:
| Name | Type | Description |
|---|---|---|
ctrl_dim |
|
|
ctrl_range |
|
|
current_steer_angles |
|
|
max_wheel_speed |
|
|
robot_config |
|
|
robot_move_group |
|
|
stationary |
bool
|
Whether the controller is set to hold the robot stationary, for e.g. |
steer_angle_range |
|
|
steer_track |
|
|
target |
The target pose for the controller |
|
wheel_base |
|
|
wheel_radius |
|
Source code in molmo_spaces/controllers/base_pose.py
stationary
property
¶
Whether the controller is set to hold the robot stationary, for e.g. when the robot has to be stopped at a certain position and not drift.
compute_base_velocities
¶
Compute wheel velocities and steer angles to drive the robot base to the target pose using a simple proportional controller.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target_base_pose
|
Target [x, y, theta] pose in world frame. |
required |
Returns:
| Type | Description |
|---|---|
|
np.ndarray: [front_left_steer_angle, front_right_steer_angle, back_left_steer_angle, back_right_steer_angle, front_left_wheel_velocity, front_right_wheel_velocity, back_left_wheel_velocity, back_right_wheel_velocity] |
Assert local frame defination:
↑ x
|
fl | fr
o------|------o
| | |
| | |
| | |
| | |
y <----------o |
| |
| |
| |
| |
o-------------o
rl rr
Source code in molmo_spaces/controllers/base_pose.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | |
compute_ctrl_inputs
¶
Compute the control inputs based on the current state and the target set by the user.
Returns:
| Type | Description |
|---|---|
|
The control inputs to be applied to the robot actuators, in this case: positions |
Source code in molmo_spaces/controllers/base_pose.py
reset
¶
set_target
¶
set_to_stationary
¶
This method sets the robot to stationary mode and computes the targets to hold the robot stationary. This is useful when the robot needs to be stopped at a certain position and not drift.
Source code in molmo_spaces/controllers/base_pose.py
TorsoHeightJointPosController
¶
TorsoHeightJointPosController(robot_move_group: MoveGroup, max_height: float = 0.738)
Bases: AbstractPositionController
Controls the RBY1 torso via a single height scalar.
Accepts a 1-element command [h]; compute_ctrl_inputs() returns the
full 6-DOF joint position array produced by the constraint
torso_1 = torso_3 = h, torso_2 = -2*h.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
robot_move_group
|
MoveGroup
|
The move group of the robot to be controlled |
required |
Methods:
| Name | Description |
|---|---|
compute_ctrl_inputs |
Return the 6-DOF torso joint positions for the current target height. |
height_to_joints |
Return the 6-DOF torso joint positions for a given height scalar. |
hold_at_height |
Set the controller to hold at a specific height without reading current joints. |
joints_to_height |
Recover the height scalar from a 6-DOF torso joint position array. |
reset |
Reset the controller to its initial state, clearing any internal state or targets. |
set_target |
Set the target state of the controller. |
set_to_stationary |
This method sets the robot to stationary mode and computes the targets to hold the |
Attributes:
| Name | Type | Description |
|---|---|---|
max_height |
|
|
robot_move_group |
|
|
stationary |
bool
|
Whether the controller is set to hold the robot stationary, for e.g. |
target |
ndarray
|
The target state of the controller, set by the user of the controller. |
target_pos |
ndarray
|
The target absolute position of the controller, set by the user of the controller. |
Source code in molmo_spaces/controllers/torso_height.py
stationary
property
¶
Whether the controller is set to hold the robot stationary, for e.g. when the robot has to be stopped at a certain position and not drift.
target
property
¶
The target state of the controller, set by the user of the controller.
target_pos
property
¶
The target absolute position of the controller, set by the user of the controller.
compute_ctrl_inputs
¶
Return the 6-DOF torso joint positions for the current target height.
height_to_joints
staticmethod
¶
Return the 6-DOF torso joint positions for a given height scalar.
torso[1] = height, torso[2] = -2*height, torso[3] = height. Indices 0, 4, 5 are left at zero.
Source code in molmo_spaces/controllers/torso_height.py
hold_at_height
¶
Set the controller to hold at a specific height without reading current joints.
Use this to lock the torso at a desired target after a height adjustment is complete, so that subsequent steps without an explicit torso command will maintain this height rather than drifting to the current joint position.
Source code in molmo_spaces/controllers/torso_height.py
joints_to_height
staticmethod
¶
reset
¶
set_target
¶
Set the target state of the controller.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target
|
ndarray
|
The target state to be set, e.g. a joint position, base velocity, or any other state. |
required |
set_to_stationary
¶
This method sets the robot to stationary mode and computes the targets to hold the robot stationary. This is useful when the robot needs to be stopped at a certain position and not drift. NOTE: If the controller is already stationary, it does not change the target.
abstract
¶
Classes:
| Name | Description |
|---|---|
AbstractPositionController |
Base class for (absolute or relative) position controllers. |
Controller |
Implementation of a simple, non-blocking controller for the MolmoSpaces environments. |
AbstractPositionController
¶
AbstractPositionController(robot_move_group: MoveGroup)
Bases: Controller
Base class for (absolute or relative) position controllers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
robot_move_group
|
MoveGroup
|
The move group of the robot to be controlled |
required |
Methods:
| Name | Description |
|---|---|
compute_ctrl_inputs |
Compute the control inputs based on the current state and the target set by the user. |
reset |
Reset the controller to its initial state, clearing any internal state or targets. |
set_target |
Set the target state of the controller. |
set_to_stationary |
This method sets the robot to stationary mode and computes the targets to hold the |
Attributes:
| Name | Type | Description |
|---|---|---|
robot_move_group |
|
|
stationary |
bool
|
Whether the controller is set to hold the robot stationary, for e.g. |
target |
ndarray
|
The target state of the controller, set by the user of the controller. |
target_pos |
ndarray
|
The target absolute position of the controller, set by the user of the controller. |
Source code in molmo_spaces/controllers/abstract.py
stationary
abstractmethod
property
¶
Whether the controller is set to hold the robot stationary, for e.g. when the robot has to be stopped at a certain position and not drift.
target
abstractmethod
property
¶
The target state of the controller, set by the user of the controller.
target_pos
abstractmethod
property
¶
The target absolute position of the controller, set by the user of the controller.
compute_ctrl_inputs
abstractmethod
¶
Compute the control inputs based on the current state and the target set by the user.
Returns:
| Type | Description |
|---|---|
ndarray
|
The control inputs to be applied to the robot actuators, eg. positions, torques etc. |
Source code in molmo_spaces/controllers/abstract.py
reset
abstractmethod
¶
set_target
abstractmethod
¶
Set the target state of the controller.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target
|
ndarray
|
The target state to be set, e.g. a joint position, base velocity, or any other state. |
required |
set_to_stationary
¶
This method sets the robot to stationary mode and computes the targets to hold the robot stationary. This is useful when the robot needs to be stopped at a certain position and not drift. NOTE: If the controller is already stationary, it does not change the target.
Source code in molmo_spaces/controllers/abstract.py
Controller
¶
Controller(robot_move_group: MoveGroup)
Implementation of a simple, non-blocking controller for the MolmoSpaces environments. This controller is meant to be simple, provide a control law based on stateful targets set by the user, and return the control inputs needed to achieve those targets.
The controller DOES NOT step the simulation, it only computes the control inputs based on the current state and the targets set by the user.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
robot_move_group
|
MoveGroup
|
The move group of the robot to be controlled |
required |
Methods:
| Name | Description |
|---|---|
compute_ctrl_inputs |
Compute the control inputs based on the current state and the target set by the user. |
reset |
Reset the controller to its initial state, clearing any internal state or targets. |
set_target |
Set the target state of the controller. |
set_to_stationary |
This method sets the robot to stationary mode and computes the targets to hold the |
Attributes:
| Name | Type | Description |
|---|---|---|
robot_move_group |
|
|
stationary |
bool
|
Whether the controller is set to hold the robot stationary, for e.g. |
target |
ndarray
|
The target state of the controller, set by the user of the controller. |
Source code in molmo_spaces/controllers/abstract.py
stationary
abstractmethod
property
¶
Whether the controller is set to hold the robot stationary, for e.g. when the robot has to be stopped at a certain position and not drift.
target
abstractmethod
property
¶
The target state of the controller, set by the user of the controller.
compute_ctrl_inputs
abstractmethod
¶
Compute the control inputs based on the current state and the target set by the user.
Returns:
| Type | Description |
|---|---|
ndarray
|
The control inputs to be applied to the robot actuators, eg. positions, torques etc. |
Source code in molmo_spaces/controllers/abstract.py
reset
abstractmethod
¶
set_target
abstractmethod
¶
Set the target state of the controller.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target
|
ndarray
|
The target state to be set, e.g. a joint position, base velocity, or any other state. |
required |
set_to_stationary
¶
This method sets the robot to stationary mode and computes the targets to hold the robot stationary. This is useful when the robot needs to be stopped at a certain position and not drift. NOTE: If the controller is already stationary, it does not change the target.
Source code in molmo_spaces/controllers/abstract.py
base_pose
¶
Classes:
| Name | Description |
|---|---|
BasePoseController |
Abstract pose controller class for a simple 2D pose controller for a robot base. |
DiffDriveBasePoseController |
|
SwerveBasePoseController |
|
BasePoseController
¶
BasePoseController(robot_move_group: RobotBaseGroup)
Bases: Controller, ABC
Abstract pose controller class for a simple 2D pose controller for a robot base. Computes velocities for the robot base's actuators based on target pose, and clips to control limits. NOTE: Assumes base actuators (eg. wheels) use velocity inputs.
This class cannot be instantiated directly and must be subclassed with an implementation of the "compute_base_velocities" method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
robot_move_group
|
MoveGroup
|
The move group of the robot to be controlled |
required |
Methods:
| Name | Description |
|---|---|
compute_base_velocities |
Abstract method to compute base velocities to achieve the target pose. |
compute_ctrl_inputs |
Compute the control inputs based on the current state and the target set by the user. |
reset |
Reset the controller to its initial state, clearing any internal state or targets. |
set_target |
Set the target pose for the controller |
set_to_stationary |
This method sets the robot to stationary mode and computes the targets to hold the |
Attributes:
| Name | Type | Description |
|---|---|---|
ctrl_dim |
|
|
ctrl_range |
|
|
robot_move_group |
|
|
stationary |
bool
|
Whether the controller is set to hold the robot stationary, for e.g. |
target |
The target pose for the controller |
Source code in molmo_spaces/controllers/base_pose.py
stationary
property
¶
Whether the controller is set to hold the robot stationary, for e.g. when the robot has to be stopped at a certain position and not drift.
compute_base_velocities
abstractmethod
¶
Abstract method to compute base velocities to achieve the target pose. Must be implemented by subclasses. Methods could include: Differential-drive, Ackermann steering, Omni-wheel control etc.
Source code in molmo_spaces/controllers/base_pose.py
compute_ctrl_inputs
¶
Compute the control inputs based on the current state and the target set by the user.
Returns:
| Type | Description |
|---|---|
|
The control inputs to be applied to the robot actuators, in this case: positions |
Source code in molmo_spaces/controllers/base_pose.py
reset
¶
set_target
¶
set_to_stationary
¶
This method sets the robot to stationary mode and computes the targets to hold the robot stationary. This is useful when the robot needs to be stopped at a certain position and not drift.
Source code in molmo_spaces/controllers/base_pose.py
DiffDriveBasePoseController
¶
DiffDriveBasePoseController(robot_config, robot_move_group: RobotBaseGroup)
Bases: BasePoseController
Differential drive base pose controller.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
robot_config
|
The configuration of the robot, containing special information about the control |
required | |
robot_move_group
|
RobotBaseGroup
|
The move group of the robot base to be controlled |
required |
Methods:
| Name | Description |
|---|---|
compute_base_velocities |
Compute wheel velocities to drive the robot base to the target pose using a simple proportional controller. |
compute_ctrl_inputs |
Compute the control inputs based on the current state and the target set by the user. |
reset |
Reset the controller to its initial state, clearing any internal state or targets. |
set_target |
Set the target pose for the controller |
set_to_stationary |
This method sets the robot to stationary mode and computes the targets to hold the |
Attributes:
| Name | Type | Description |
|---|---|---|
ctrl_dim |
|
|
ctrl_range |
|
|
robot_config |
|
|
robot_move_group |
|
|
stationary |
bool
|
Whether the controller is set to hold the robot stationary, for e.g. |
target |
The target pose for the controller |
|
wheel_base |
|
|
wheel_radius |
|
Source code in molmo_spaces/controllers/base_pose.py
stationary
property
¶
Whether the controller is set to hold the robot stationary, for e.g. when the robot has to be stopped at a certain position and not drift.
compute_base_velocities
¶
Compute wheel velocities to drive the robot base to the target pose using a simple proportional controller.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target_base_pose
|
Target [x, y, theta] pose in world frame. |
required |
Returns:
| Type | Description |
|---|---|
|
np.ndarray: [left_wheel_velocity, right_wheel_velocity] |
Source code in molmo_spaces/controllers/base_pose.py
compute_ctrl_inputs
¶
Compute the control inputs based on the current state and the target set by the user.
Returns:
| Type | Description |
|---|---|
|
The control inputs to be applied to the robot actuators, in this case: positions |
Source code in molmo_spaces/controllers/base_pose.py
reset
¶
set_target
¶
set_to_stationary
¶
This method sets the robot to stationary mode and computes the targets to hold the robot stationary. This is useful when the robot needs to be stopped at a certain position and not drift.
Source code in molmo_spaces/controllers/base_pose.py
SwerveBasePoseController
¶
SwerveBasePoseController(robot_config, robot_move_group: RobotBaseGroup)
Bases: BasePoseController
Swerve drive base pose controller.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
robot_config
|
The configuration of the robot, containing special information about the control |
required | |
robot_move_group
|
RobotBaseGroup
|
The move group of the robot base to be controlled |
required |
Methods:
| Name | Description |
|---|---|
compute_base_velocities |
Compute wheel velocities and steer angles to drive the robot base to the target pose using a simple proportional controller. |
compute_ctrl_inputs |
Compute the control inputs based on the current state and the target set by the user. |
reset |
Reset the controller to its initial state, clearing any internal state or targets. |
set_target |
Set the target pose for the controller |
set_to_stationary |
This method sets the robot to stationary mode and computes the targets to hold the |
Attributes:
| Name | Type | Description |
|---|---|---|
ctrl_dim |
|
|
ctrl_range |
|
|
current_steer_angles |
|
|
max_wheel_speed |
|
|
robot_config |
|
|
robot_move_group |
|
|
stationary |
bool
|
Whether the controller is set to hold the robot stationary, for e.g. |
steer_angle_range |
|
|
steer_track |
|
|
target |
The target pose for the controller |
|
wheel_base |
|
|
wheel_radius |
|
Source code in molmo_spaces/controllers/base_pose.py
stationary
property
¶
Whether the controller is set to hold the robot stationary, for e.g. when the robot has to be stopped at a certain position and not drift.
compute_base_velocities
¶
Compute wheel velocities and steer angles to drive the robot base to the target pose using a simple proportional controller.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target_base_pose
|
Target [x, y, theta] pose in world frame. |
required |
Returns:
| Type | Description |
|---|---|
|
np.ndarray: [front_left_steer_angle, front_right_steer_angle, back_left_steer_angle, back_right_steer_angle, front_left_wheel_velocity, front_right_wheel_velocity, back_left_wheel_velocity, back_right_wheel_velocity] |
Assert local frame defination:
↑ x
|
fl | fr
o------|------o
| | |
| | |
| | |
| | |
y <----------o |
| |
| |
| |
| |
o-------------o
rl rr
Source code in molmo_spaces/controllers/base_pose.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | |
compute_ctrl_inputs
¶
Compute the control inputs based on the current state and the target set by the user.
Returns:
| Type | Description |
|---|---|
|
The control inputs to be applied to the robot actuators, in this case: positions |
Source code in molmo_spaces/controllers/base_pose.py
reset
¶
set_target
¶
set_to_stationary
¶
This method sets the robot to stationary mode and computes the targets to hold the robot stationary. This is useful when the robot needs to be stopped at a certain position and not drift.
Source code in molmo_spaces/controllers/base_pose.py
g1_wbc
¶
G1's whole-body PD/ONNX low-level controller: the reference stack's
G1Controller, renamed here but behaviour unchanged. WbcJointGroup/
MoveGroupController are its own minimal joint-group and control-law holders,
one per move group, not robot_views' MoveGroup or controllers/abstract.py's
Controller; converging them is still open.
Classes:
| Name | Description |
|---|---|
G1WholeBodyController |
|
LeftArmController |
Left arm: zero-gain actuators (falls under gravity, per |
LegsWaistController |
15-dof legs+waist PD law plus the ONNX WBC residual (one coupled law, |
MoveGroupController |
The control law for one WbcJointGroup ( |
RightArmController |
Right arm: plain position-actuator passthrough (PD gains baked into |
RightGripperController |
Right gripper: single tendon position-actuator passthrough. |
WbcJointGroup |
Raw qpos/qvel/ctrl I/O for a named subset of G1's actuated DOFs; the |
Functions:
| Name | Description |
|---|---|
flat15_to_move_groups |
gold's flat-15 action (ACT_* slices) -> molmo_spaces' move-group dict. |
Attributes:
| Name | Type | Description |
|---|---|---|
ACTION_DIM |
|
|
ACT_ARM |
|
|
ACT_CMD |
|
|
ACT_GRIP |
|
|
ACT_HEIGHT |
|
|
ACT_UPPER |
|
|
ACT_WAIST |
|
|
NUM_LEGS_WAIST_TARGET_DIMS |
|
G1WholeBodyController
¶
Methods:
| Name | Description |
|---|---|
execute_action |
Parse the flat 15-dim action, set_target on each controller, then |
set_env |
|
setup |
|
Source code in molmo_spaces/controllers/g1_wbc.py
execute_action
¶
Parse the flat 15-dim action, set_target on each controller, then compute and write ctrl in gold's order: legs_waist torque from the previous call's _target_lower first, then the WBC inference that updates it. That ordering is load-bearing.
Source code in molmo_spaces/controllers/g1_wbc.py
set_env
¶
Source code in molmo_spaces/controllers/g1_wbc.py
setup
¶
Source code in molmo_spaces/controllers/g1_wbc.py
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 | |
LeftArmController
¶
Bases: MoveGroupController
Left arm: zero-gain actuators (falls under gravity, per G1WholeBodyController.setup's actuator_gainprm[aid,0]=0.0). Target is always 0 -- execute_action never sets a left-arm target, matching gold exactly.
Methods:
| Name | Description |
|---|---|
compute_ctrl_inputs |
|
reset |
|
set_target |
|
set_to_stationary |
|
Attributes:
| Name | Type | Description |
|---|---|---|
move_group |
|
|
stationary |
bool
|
|
target |
|
Source code in molmo_spaces/controllers/g1_wbc.py
LegsWaistController
¶
Bases: MoveGroupController
15-dof legs+waist PD law plus the ONNX WBC residual (one coupled law,
hence one move group). Its state (_cmd, _height_cmd, _target_lower,
_step_counter, ...) lives on the owning G1WholeBodyController, which the pick
policy reads and writes directly; this class owns only the math.
Methods:
| Name | Description |
|---|---|
compute_ctrl_inputs |
|
reset |
|
set_target |
|
set_to_stationary |
|
Attributes:
| Name | Type | Description |
|---|---|---|
move_group |
|
|
stationary |
bool
|
|
target |
|
Source code in molmo_spaces/controllers/g1_wbc.py
compute_ctrl_inputs
¶
Source code in molmo_spaces/controllers/g1_wbc.py
reset
¶
Source code in molmo_spaces/controllers/g1_wbc.py
set_target
¶
Source code in molmo_spaces/controllers/g1_wbc.py
MoveGroupController
¶
The control law for one WbcJointGroup (set_target +
compute_ctrl_inputs); G1WholeBodyController.execute_action dispatches.
Methods:
| Name | Description |
|---|---|
compute_ctrl_inputs |
|
reset |
|
set_target |
|
set_to_stationary |
|
Attributes:
| Name | Type | Description |
|---|---|---|
move_group |
|
|
stationary |
bool
|
|
target |
|
Source code in molmo_spaces/controllers/g1_wbc.py
RightArmController
¶
Bases: MoveGroupController
Right arm: plain position-actuator passthrough (PD gains baked into the MJCF actuator, kp=2000/kd=60 -- see G1WholeBodyController.setup).
Methods:
| Name | Description |
|---|---|
compute_ctrl_inputs |
|
reset |
|
set_target |
|
set_to_stationary |
|
Attributes:
| Name | Type | Description |
|---|---|---|
move_group |
|
|
stationary |
bool
|
|
target |
|
Source code in molmo_spaces/controllers/g1_wbc.py
RightGripperController
¶
Bases: MoveGroupController
Right gripper: single tendon position-actuator passthrough.
Methods:
| Name | Description |
|---|---|
compute_ctrl_inputs |
|
reset |
|
set_target |
|
set_to_stationary |
|
Attributes:
| Name | Type | Description |
|---|---|---|
move_group |
|
|
stationary |
bool
|
|
target |
|
Source code in molmo_spaces/controllers/g1_wbc.py
WbcJointGroup
¶
Raw qpos/qvel/ctrl I/O for a named subset of G1's actuated DOFs; the index arrays are G1WholeBodyController.setup()'s.
Methods:
| Name | Description |
|---|---|
joint_pos |
|
joint_vel |
|
set_ctrl |
|
Attributes:
| Name | Type | Description |
|---|---|---|
act_ids |
|
|
jdof |
|
|
jqpos |
|
|
name |
|
Source code in molmo_spaces/controllers/g1_wbc.py
flat15_to_move_groups
¶
gold's flat-15 action (ACT_* slices) -> molmo_spaces' move-group dict.
Source code in molmo_spaces/controllers/g1_wbc.py
joint_pos
¶
Classes:
| Name | Description |
|---|---|
JointPosController |
Generic joint position controller for a robot. |
JointPosController
¶
JointPosController(robot_move_group: MoveGroup)
Bases: AbstractPositionController
Generic joint position controller for a robot. Computes joint position targets for the joint's actuators, and clips to control limits. NOTE: Assumes joint actuators use position inputs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
robot_move_group
|
MoveGroup
|
The move group of the robot to be controlled |
required |
Methods:
| Name | Description |
|---|---|
compute_ctrl_inputs |
Compute the control inputs based on the current state and the target set by the user. |
reset |
Reset the controller to its initial state, clearing any internal state or targets |
set_target |
Set the target state of the controller. |
set_to_stationary |
This method sets the robot to stationary mode and computes the targets to hold the |
Attributes:
| Name | Type | Description |
|---|---|---|
ctrl_dim |
|
|
ctrl_range |
|
|
robot_move_group |
|
|
stationary |
bool
|
Whether the controller is set to hold the robot stationary, for e.g. |
target |
The target state of the controller, set by the user of the controller. |
|
target_pos |
ndarray
|
The target absolute position of the controller, set by the user of the controller. |
Source code in molmo_spaces/controllers/joint_pos.py
stationary
property
¶
Whether the controller is set to hold the robot stationary, for e.g. when the robot has to be stopped at a certain position and not drift.
target
property
writable
¶
The target state of the controller, set by the user of the controller.
target_pos
property
¶
The target absolute position of the controller, set by the user of the controller.
compute_ctrl_inputs
¶
Compute the control inputs based on the current state and the target set by the user.
Returns:
| Type | Description |
|---|---|
|
The control inputs to be applied to the robot actuators, in this case: positions |
Source code in molmo_spaces/controllers/joint_pos.py
reset
¶
Reset the controller to its initial state, clearing any internal state or targets
set_target
¶
Set the target state of the controller.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target
|
ndarray
|
The target state to be set, e.g. a joint position, base velocity, or any other state. |
required |
set_to_stationary
¶
This method sets the robot to stationary mode and computes the targets to hold the robot stationary. This is useful when the robot needs to be stopped at a certain position and not drift.
Source code in molmo_spaces/controllers/joint_pos.py
joint_rel_pos
¶
Classes:
| Name | Description |
|---|---|
JointRelPosController |
Generic joint position controller for a robot. |
JointRelPosController
¶
JointRelPosController(robot_move_group: MoveGroup)
Bases: AbstractPositionController
Generic joint position controller for a robot. Computes delta joint position targets for the joint's actuators, and clips to control limits.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
robot_move_group
|
MoveGroup
|
The move group of the robot to be controlled |
required |
Methods:
| Name | Description |
|---|---|
compute_ctrl_inputs |
Compute the control inputs based on the current state and the target set by the user. |
reset |
Reset the controller to its initial state, clearing any internal state or targets |
set_target |
Set the target joint positions for the controller. |
set_to_stationary |
This method sets the robot to stationary mode and computes the targets to hold the |
Attributes:
| Name | Type | Description |
|---|---|---|
ctrl_dim |
|
|
ctrl_range |
|
|
desired_joint_positions |
|
|
robot_move_group |
|
|
stationary |
Returns whether the controller is in stationary mode |
|
target |
The target state of the controller, set by the user of the controller. |
|
target_pos |
ndarray
|
The target absolute position of the controller, set by the user of the controller. |
Source code in molmo_spaces/controllers/joint_rel_pos.py
desired_joint_positions
instance-attribute
¶
target
property
writable
¶
The target state of the controller, set by the user of the controller.
target_pos
property
¶
The target absolute position of the controller, set by the user of the controller.
compute_ctrl_inputs
¶
Compute the control inputs based on the current state and the target set by the user.
Returns:
| Type | Description |
|---|---|
|
The control inputs to be applied to the robot actuators, in this case: positions |
Source code in molmo_spaces/controllers/joint_rel_pos.py
reset
¶
Reset the controller to its initial state, clearing any internal state or targets
set_target
¶
Set the target joint positions for the controller. NOTE: For this controller we assume that the controller will be set to stationary every time before the relative target has to be computed
Source code in molmo_spaces/controllers/joint_rel_pos.py
set_to_stationary
¶
This method sets the robot to stationary mode and computes the targets to hold the robot stationary. This is useful when the robot needs to be stopped at a certain position and not drift.
Source code in molmo_spaces/controllers/joint_rel_pos.py
joint_vel
¶
Classes:
| Name | Description |
|---|---|
JointVelController |
Generic joint velocity controller for a robot. |
JointVelController
¶
JointVelController(robot_config, robot_move_group: MoveGroup)
Bases: Controller
Generic joint velocity controller for a robot. Computes joint position targets for the joint's actuators after euler integration, and clips to control limits. NOTE: Assumes joint actuators use position inputs.
robot_config: The configuration of the robot, containing special information about the control, e.g., delta_t for integration (if applicable) etc. robot_move_group: The move group of the robot to be controlled
Methods:
| Name | Description |
|---|---|
compute_ctrl_inputs |
Compute the control inputs based on the current state and the target set by the user. |
reset |
Reset the controller to its initial state, clearing any internal state or targets. |
set_target |
Set the target state of the controller. |
set_to_stationary |
This method sets the robot to stationary mode and computes the targets to hold the |
Attributes:
| Name | Type | Description |
|---|---|---|
ctrl_dim |
|
|
ctrl_range |
|
|
euler_dt |
|
|
robot_config |
|
|
robot_move_group |
|
|
stationary |
bool
|
Returns whether the controller is in stationary mode |
target |
ndarray
|
Returns the current target joint velocities |
Source code in molmo_spaces/controllers/joint_vel.py
compute_ctrl_inputs
¶
Compute the control inputs based on the current state and the target set by the user.
Returns:
| Type | Description |
|---|---|
ndarray
|
The control inputs to be applied to the robot actuators, in this case: positions |
Source code in molmo_spaces/controllers/joint_vel.py
reset
¶
set_target
¶
Set the target state of the controller.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target
|
ndarray
|
The target state to be set, e.g. a joint position, base velocity, or any other state. |
required |
set_to_stationary
¶
This method sets the robot to stationary mode and computes the targets to hold the robot stationary. This is useful when the robot needs to be stopped at a certain position and not drift.
Source code in molmo_spaces/controllers/joint_vel.py
torso_height
¶
Classes:
| Name | Description |
|---|---|
TorsoHeightJointPosController |
Controls the RBY1 torso via a single height scalar. |
TorsoHeightJointPosController
¶
TorsoHeightJointPosController(robot_move_group: MoveGroup, max_height: float = 0.738)
Bases: AbstractPositionController
Controls the RBY1 torso via a single height scalar.
Accepts a 1-element command [h]; compute_ctrl_inputs() returns the
full 6-DOF joint position array produced by the constraint
torso_1 = torso_3 = h, torso_2 = -2*h.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
robot_move_group
|
MoveGroup
|
The move group of the robot to be controlled |
required |
Methods:
| Name | Description |
|---|---|
compute_ctrl_inputs |
Return the 6-DOF torso joint positions for the current target height. |
height_to_joints |
Return the 6-DOF torso joint positions for a given height scalar. |
hold_at_height |
Set the controller to hold at a specific height without reading current joints. |
joints_to_height |
Recover the height scalar from a 6-DOF torso joint position array. |
reset |
Reset the controller to its initial state, clearing any internal state or targets. |
set_target |
Set the target state of the controller. |
set_to_stationary |
This method sets the robot to stationary mode and computes the targets to hold the |
Attributes:
| Name | Type | Description |
|---|---|---|
max_height |
|
|
robot_move_group |
|
|
stationary |
bool
|
Whether the controller is set to hold the robot stationary, for e.g. |
target |
ndarray
|
The target state of the controller, set by the user of the controller. |
target_pos |
ndarray
|
The target absolute position of the controller, set by the user of the controller. |
Source code in molmo_spaces/controllers/torso_height.py
stationary
property
¶
Whether the controller is set to hold the robot stationary, for e.g. when the robot has to be stopped at a certain position and not drift.
target
property
¶
The target state of the controller, set by the user of the controller.
target_pos
property
¶
The target absolute position of the controller, set by the user of the controller.
compute_ctrl_inputs
¶
Return the 6-DOF torso joint positions for the current target height.
height_to_joints
staticmethod
¶
Return the 6-DOF torso joint positions for a given height scalar.
torso[1] = height, torso[2] = -2*height, torso[3] = height. Indices 0, 4, 5 are left at zero.
Source code in molmo_spaces/controllers/torso_height.py
hold_at_height
¶
Set the controller to hold at a specific height without reading current joints.
Use this to lock the torso at a desired target after a height adjustment is complete, so that subsequent steps without an explicit torso command will maintain this height rather than drifting to the current joint position.
Source code in molmo_spaces/controllers/torso_height.py
joints_to_height
staticmethod
¶
reset
¶
set_target
¶
Set the target state of the controller.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target
|
ndarray
|
The target state to be set, e.g. a joint position, base velocity, or any other state. |
required |
set_to_stationary
¶
This method sets the robot to stationary mode and computes the targets to hold the robot stationary. This is useful when the robot needs to be stopped at a certain position and not drift. NOTE: If the controller is already stationary, it does not change the target.