JSim 2026.06.01-p(1)
Loading...
Searching...
No Matches
frcsim::DoubleDifferentialMechanism Class Reference

Kinematic mapping utility for a two-motor double differential turret mechanism. More...

#include <double_differential.hpp>

Classes

struct  Limits
 Optional soft limits applied to joint coordinates. More...
struct  Config
 Mapping coefficients and inversion thresholds. More...
struct  MotorState
 Input state for the two drive motors. More...
struct  JointState
 Output state for mechanism yaw/pitch joints. More...
struct  InverseResult
 Result from inverse kinematics solve. More...

Public Member Functions

 DoubleDifferentialMechanism ()=default
 DoubleDifferentialMechanism (const Config &config)
const Configconfig () const
 Returns current mapping configuration.
void setConfig (const Config &config)
 Replaces mapping configuration.
JointState forward (const MotorState &motor_state) const
 Computes joint state from motor state via forward mapping.
InverseResult inverse (const JointState &desired_joint_state) const
 Solves inverse mapping from desired joint state to motor state.
JointState clampedToLimits (const JointState &state) const
 Returns a copy of state clamped to configured joint limits.

Detailed Description

Kinematic mapping utility for a two-motor double differential turret mechanism.

The configured 2x2 matrix maps motor shaft states to yaw/pitch joint states.

Constructor & Destructor Documentation

◆ DoubleDifferentialMechanism() [1/2]

frcsim::DoubleDifferentialMechanism::DoubleDifferentialMechanism ( )
default

◆ DoubleDifferentialMechanism() [2/2]

frcsim::DoubleDifferentialMechanism::DoubleDifferentialMechanism ( const Config & config)
inlineexplicit

Member Function Documentation

◆ clampedToLimits()

JointState frcsim::DoubleDifferentialMechanism::clampedToLimits ( const JointState & state) const
inline

Returns a copy of state clamped to configured joint limits.

Parameters
stateInput joint state.
Returns
Clamped joint state.

◆ config()

const Config & frcsim::DoubleDifferentialMechanism::config ( ) const
inline

Returns current mapping configuration.

Returns
Immutable Config reference.

◆ forward()

JointState frcsim::DoubleDifferentialMechanism::forward ( const MotorState & motor_state) const
inline

Computes joint state from motor state via forward mapping.

Parameters
motor_stateMotor positions/velocities in mechanism motor space.
Returns
Joint state with configured limits applied.

◆ inverse()

InverseResult frcsim::DoubleDifferentialMechanism::inverse ( const JointState & desired_joint_state) const
inline

Solves inverse mapping from desired joint state to motor state.

Parameters
desired_joint_stateRequested joint angles/rates.
Returns
InverseResult with valid=false when configuration is singular.

◆ setConfig()

void frcsim::DoubleDifferentialMechanism::setConfig ( const Config & config)
inline

Replaces mapping configuration.

Parameters
configNew mapping configuration.

The documentation for this class was generated from the following file: