ControlInput & ControlState#

rb::ControlInput<T> and rb::ControlState<T> are the data structs passed through Robot::Control(). ControlState<T> carries the current measured state into the callback and ControlInput<T> carries the next control output back to the robot.

Header

Header

#include <rby1-sdk/robot.h>

Declaration

Namespace

rb

Kind

struct template family

Primary role

Carry measured state into the real-time callback and the generated command output back out.

Public Attributes

Struct

Main fields

Description

rb::ControlState<T>

t, position, velocity, current, torque, is_ready

Measured state snapshot passed into the real-time callback.

rb::ControlInput<T>

target, feedback_gain, feedforward_torque, mode, finish

Outgoing control command returned from the callback.

Units & Encodings

Field

Unit / encoding

Notes

ControlState::t

s

Real-time callback timestamp.

ControlState::position

rad

Measured joint positions in model order.

ControlState::velocity

rad/s

Measured joint velocities in model order.

ControlState::current

A

Measured joint currents.

ControlState::torque

Nm

Measured joint torques.

ControlInput::target

rad

Commanded joint targets returned from the callback.

ControlInput::feedback_gain

Dimensionless

Integer gain value per joint. The public C++ headers do not define a fixed range.

ControlInput::feedforward_torque

Nm

Joint feedforward torque term.

Detailed Reference

template<typename T>
struct ControlState#

Robot control state information.

Represents the current state of robot real-time control including position, velocity, and torque.

Template Parameters:

TRobot model type

Public Members

Eigen::Vector<double, T::kRobotDOF> current = {Eigen::Vector<double, T::kRobotDOF>::Zero()}#

Current joint currents [A].

Eigen::Vector<bool, T::kRobotDOF> is_ready = {Eigen::Vector<bool, T::kRobotDOF>::Constant(false)}#

Whether the joint is ready for control.

Eigen::Vector<double, T::kRobotDOF> position = {Eigen::Vector<double, T::kRobotDOF>::Zero()}#

Current joint positions [rad].

double t = {0.}#

Current time [s].

Eigen::Vector<double, T::kRobotDOF> torque = {Eigen::Vector<double, T::kRobotDOF>::Zero()}#

Current joint torques [Nm].

Eigen::Vector<double, T::kRobotDOF> velocity = {Eigen::Vector<double, T::kRobotDOF>::Zero()}#

Current joint velocities [rad/s].

template<typename T>
struct ControlInput#

Robot control input parameters.

Represents control input parameters for robot real-time control including mode, target, and gains.

Template Parameters:

TRobot model type

Public Members

Eigen::Vector<unsigned int, T::kRobotDOF> feedback_gain = {Eigen::Vector<unsigned int, T::kRobotDOF>::Zero()}#

Feedback gains for each joint.

Eigen::Vector<double, T::kRobotDOF> feedforward_torque = {Eigen::Vector<double, T::kRobotDOF>::Zero()}#

Feedforward torque for each joint [Nm].

bool finish = {false}#

Whether to finish the current control operation.

Eigen::Vector<bool, T::kRobotDOF> mode = {Eigen::Vector<bool, T::kRobotDOF>::Constant(false)}#

Control mode for each joint (boolean array).

Eigen::Vector<double, T::kRobotDOF> target = {Eigen::Vector<double, T::kRobotDOF>::Zero()}#

Target positions for each joint [rad].

Related Types

Examples

  • real_time_control_command.cpp is the canonical example for both structs.