YAMS
Yet Another Mechanism System
Loading...
Searching...
No Matches
Classes | Enumerations | Functions
yams::mechanisms::config Namespace Reference

Classes

class  ArmConfig
 
class  ElevatorConfig
 
class  FlyWheelConfig
 
class  MechanismPositionConfig
 
class  PivotConfig
 
class  SimSensorConfig
 
class  SwerveModuleConfig
 

Enumerations

enum class  GyroAxis { ROLL , PITCH , YAW }
 

Functions

wpi::math::Rotation3d ToRobotAttitude (GyroAxis axis, const wpi::math::Rotation3d &gyroAttitude)
 

Enumeration Type Documentation

◆ GyroAxis

The gyro axis that points up through the robot, for a gyro that is not mounted flat.

A swerve drive needs the robot's heading, which is rotation about the axis pointing up through the robot. A gyro mounted flat reports that as its yaw. A gyro mounted on its side reports it as its roll or its pitch instead.

Enumerator
ROLL 

The gyro's X axis points up. The gyro's Y axis is taken to point to the robot's left.

PITCH 

The gyro's Y axis points up. The gyro's X axis is taken to point to the robot's front.

YAW 

The gyro's Z axis points up: the gyro is mounted flat. This is the default.

Function Documentation

◆ ToRobotAttitude()

wpi::math::Rotation3d yams::mechanisms::config::ToRobotAttitude ( GyroAxis  axis,
const wpi::math::Rotation3d &  gyroAttitude 
)
inline

Rotate a gyro's attitude into the robot's frame, so the yaw of the result is the robot's heading and its roll and pitch are the robot's tilt, whichever way the gyro is mounted.

Parameters
axisThe gyro axis that points up through the robot.
gyroAttitudeThe attitude the gyro reports.
Returns
The robot's attitude.