Skip to main content

RobotState

Struct RobotState 

Source
pub struct RobotState {
Show 49 fields pub O_T_EE: [f64; 16], pub O_T_EE_d: [f64; 16], pub F_T_EE: [f64; 16], pub F_T_NE: [f64; 16], pub NE_T_EE: [f64; 16], pub EE_T_K: [f64; 16], pub m_ee: f64, pub I_ee: [f64; 9], pub F_x_Cee: [f64; 3], pub m_load: f64, pub I_load: [f64; 9], pub F_x_Cload: [f64; 3], pub m_total: f64, pub I_total: [f64; 9], pub F_x_Ctotal: [f64; 3], pub elbow: [f64; 2], pub elbow_d: [f64; 2], pub elbow_c: [f64; 2], pub delbow_c: [f64; 2], pub ddelbow_c: [f64; 2], pub tau_J: [f64; 7], pub tau_J_d: [f64; 7], pub dtau_J: [f64; 7], pub q: [f64; 7], pub q_d: [f64; 7], pub dq: [f64; 7], pub dq_d: [f64; 7], pub ddq_d: [f64; 7], pub joint_contact: [f64; 7], pub cartesian_contact: [f64; 6], pub joint_collision: [f64; 7], pub cartesian_collision: [f64; 6], pub tau_ext_hat_filtered: [f64; 7], pub O_F_ext_hat_K: [f64; 6], pub K_F_ext_hat_K: [f64; 6], pub O_dP_EE_d: [f64; 6], pub O_ddP_O: [f64; 3], pub O_T_EE_c: [f64; 16], pub O_dP_EE_c: [f64; 6], pub O_ddP_EE_c: [f64; 6], pub theta: [f64; 7], pub dtheta: [f64; 7], pub accelerometer_top: [[f64; 3]; 6], pub accelerometer_bottom: [[f64; 3]; 6], pub current_errors: Errors, pub last_motion_errors: Errors, pub control_command_success_rate: f64, pub robot_mode: RobotMode, pub time: Duration,
}
Expand description

Describes the robot state (field names and semantics identical to franka::RobotState; see libfranka’s robot_state.h for the documentation of every field).

With the serde feature the state serialises field by field under these names, the arrays as arrays, time as milliseconds and the two Errors as lists of names.

Fields§

§O_T_EE: [f64; 16]

Measured end-effector pose in base frame, column-major 4x4 homogeneous transform (translation in m).

§O_T_EE_d: [f64; 16]

Last desired end-effector pose in base frame, column-major 4x4 (m). Not for motion control – see libfranka’s warning.

§F_T_EE: [f64; 16]

Flange-to-end-effector transform, column-major 4x4 (m); the product of F_T_NE and NE_T_EE.

§F_T_NE: [f64; 16]

Flange-to-nominal-end-effector transform as configured in Desk, column-major 4x4 (m).

§NE_T_EE: [f64; 16]

Nominal-end-effector-to-end-effector transform set with crate::Robot::set_ee, column-major 4x4 (m).

§EE_T_K: [f64; 16]

End-effector-to-stiffness-frame transform set with crate::Robot::set_k, column-major 4x4 (m).

§m_ee: f64

Mass of the end effector, in kg.

§I_ee: [f64; 9]

Inertia matrix of the end effector about its centre of mass, column-major 3x3, in kg*m^2.

§F_x_Cee: [f64; 3]

Centre of mass of the end effector in flange frame, in m.

§m_load: f64

Mass of the external load, in kg.

§I_load: [f64; 9]

Inertia matrix of the external load about its centre of mass, column-major 3x3, in kg*m^2.

§F_x_Cload: [f64; 3]

Centre of mass of the external load in flange frame, in m.

§m_total: f64

Combined mass of end effector and load, in kg.

§I_total: [f64; 9]

Combined inertia matrix of end effector and load, column-major 3x3, in kg*m^2.

§F_x_Ctotal: [f64; 3]

Combined centre of mass of end effector and load in flange frame, in m.

§elbow: [f64; 2]

Measured elbow configuration: joint-3 position in rad and the sign (+1/-1) of joint 4.

§elbow_d: [f64; 2]

Desired elbow configuration, same layout as RobotState::elbow.

§elbow_c: [f64; 2]

Commanded elbow configuration, same layout as RobotState::elbow.

§delbow_c: [f64; 2]

Commanded elbow velocity: joint-3 velocity in rad/s and 0 for the joint-4 sign.

§ddelbow_c: [f64; 2]

Commanded elbow acceleration: joint-3 acceleration in rad/s^2 and 0 for the joint-4 sign.

§tau_J: [f64; 7]

Measured link-side joint torques, in Nm.

§tau_J_d: [f64; 7]

Desired link-side joint torques without gravity, in Nm. Rate-limit torque commands against this.

§dtau_J: [f64; 7]

Derivative of the measured joint torques, in Nm/s.

§q: [f64; 7]

Measured joint positions, in rad.

§q_d: [f64; 7]

Desired joint positions, in rad.

§dq: [f64; 7]

Measured joint velocities, in rad/s.

§dq_d: [f64; 7]

Desired joint velocities, in rad/s.

§ddq_d: [f64; 7]

Desired joint accelerations, in rad/s^2.

§joint_contact: [f64; 7]

Per-joint contact indicator: 1.0 where a contact was detected, else 0.0.

§cartesian_contact: [f64; 6]

Cartesian contact indicator in the stiffness frame (x, y, z, roll, pitch, yaw): 1.0 or 0.0.

§joint_collision: [f64; 7]

Per-joint collision indicator: 1.0 where a collision was detected, else 0.0.

§cartesian_collision: [f64; 6]

Cartesian collision indicator in the stiffness frame (x, y, z, roll, pitch, yaw): 1.0 or 0.0.

§tau_ext_hat_filtered: [f64; 7]

Filtered external torque estimate, in Nm.

§O_F_ext_hat_K: [f64; 6]

Estimated external wrench on the stiffness frame, expressed in base frame: forces in N, torques in Nm.

§K_F_ext_hat_K: [f64; 6]

Estimated external wrench on the stiffness frame, expressed in the stiffness frame: forces in N, torques in Nm.

§O_dP_EE_d: [f64; 6]

Desired end-effector twist in base frame: linear m/s then angular rad/s.

§O_ddP_O: [f64; 3]

Gravity vector in base frame, in m/s^2 (the robot’s own measurement of which way is down).

§O_T_EE_c: [f64; 16]

Last commanded end-effector pose in base frame, column-major 4x4 (m).

§O_dP_EE_c: [f64; 6]

Last commanded end-effector twist in base frame: linear m/s then angular rad/s.

§O_ddP_EE_c: [f64; 6]

Last commanded end-effector acceleration in base frame: linear m/s^2 then angular rad/s^2.

§theta: [f64; 7]

Motor-side joint positions, in rad.

§dtheta: [f64; 7]

Motor-side joint velocities, in rad/s.

§accelerometer_top: [[f64; 3]; 6]

Raw readings of the six top accelerometers, in m/s^2 (FCI v10 only; zero on an FER).

§accelerometer_bottom: [[f64; 3]; 6]

Raw readings of the six bottom accelerometers, in m/s^2 (FCI v10 only; zero on an FER).

§current_errors: Errors

Errors currently active on the robot.

§last_motion_errors: Errors

Errors that aborted the last motion (reflex_reason).

§control_command_success_rate: f64

Fraction of the last 100 cycles whose command the robot accepted, in [0, 1].

§robot_mode: RobotMode

Current robot mode.

§time: Duration

Strictly monotonic robot timestamp of this state.

Implementations§

Source§

impl RobotState

Source

pub fn from_wire(w: &RobotState) -> RobotState

Widens a wire state to the public f64 state.

Port of franka::convertRobotState (src/robot_impl.cpp, libfranka 0.21.2): every float becomes a double, m_total/F_x_Ctotal/I_total are derived from the end effector and load properties, time is the message_id read as milliseconds, and the state’s errors/reflex_reason become current_errors/last_motion_errors. An unknown robot_mode byte maps to RobotMode::Other, matching the C++ switch whose result is pre-initialised to kOther.

Source

pub fn from_wire_v5(w: &RobotState) -> RobotState

Widens an FCI v5 wire state to the public state.

Port of franka::convertRobotState (src/robot_impl.cpp, libfranka 0.9.2). The FER streams double already, so nothing is widened; m_total/F_x_Ctotal/I_total are combined exactly as on FCI v10, and time is the message_id read as milliseconds.

FCI v5 has no accelerometer arrays in its state (rbk_types.h:38-85, libfranka 0.9.2), so accelerometer_top and accelerometer_bottom are zero. An unknown robot_mode byte maps to RobotMode::Other, matching the C++ switch whose result is pre-initialised to kOther.

Trait Implementations§

Source§

impl Clone for RobotState

Source§

fn clone(&self) -> RobotState

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for RobotState

Source§

impl Debug for RobotState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RobotState

Source§

fn default() -> Self

Identity transforms, zero everything else, robot_mode = Other, gravity along -z in O_ddP_O as the robot reports it.

Source§

impl PartialEq for RobotState

Source§

fn eq(&self, other: &RobotState) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for RobotState

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.