Skip to main content

RobotTorque

Trait RobotTorque 

Source
pub trait RobotTorque: RobotBasic {
    // Required method
    fn inverse_dynamics(
        &self,
        q: &[f64],
        dq: &[f64],
        ddq: &[f64],
        tau: &mut [f64],
    );
}
Expand description

Robot trait with inverse-dynamics capability.

This trait is mainly required when building COPP2/COPP3 problems with torque/dynamics constraints. For TOPP-only use cases, a direct Constraints workflow is usually enough.

A usize variable can serve as a trivial RobotTorque implementation representing a point-mass model, where tau = ddq. For physical robots, users should implement this trait with their own inverse dynamics.

Required Methods§

Source

fn inverse_dynamics(&self, q: &[f64], dq: &[f64], ddq: &[f64], tau: &mut [f64])

Evaluate inverse dynamics.

§Model

tau = M(q) * ddq + C(q, dq) * dq + g(q)

§Parameters
  • q: joint positions (dim).
  • dq: joint velocities (dim).
  • ddq: joint accelerations (dim).
  • tau: output required torques/forces (dim).

Implementations on Foreign Types§

Source§

impl RobotTorque for usize

Source§

fn inverse_dynamics( &self, _q: &[f64], _dq: &[f64], ddq: &[f64], tau: &mut [f64], )

Evaluate inverse dynamics for point-mass model.

Since tau = ddq, this function copies ddq directly into tau.

Implementors§