YAMS
Yet Another Mechanism System
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
yams::mechanisms::velocity::SmartVelocityMechanism Class Referenceabstract

#include <SmartVelocityMechanism.hpp>

Inheritance diagram for yams::mechanisms::velocity::SmartVelocityMechanism:
Inheritance graph
[legend]
Collaboration diagram for yams::mechanisms::velocity::SmartVelocityMechanism:
Collaboration graph
[legend]

Public Member Functions

 SmartVelocityMechanism ()
 
virtual ~SmartVelocityMechanism ()=default
 
virtual wpi::cmd::Trigger Max ()=0
 
virtual wpi::cmd::Trigger Min ()=0
 
wpi::MechanismLigament2d * GetMechanismLigament ()
 
wpi::MechanismRoot2d * GetMechanismRoot ()
 
motorcontrollers::SmartMotorController * GetMotor ()
 
- Public Member Functions inherited from yams::mechanisms::SmartMechanism
 SmartMechanism ()
 
virtual ~SmartMechanism ()=default
 
virtual void SimIterate ()=0
 
virtual void UpdateTelemetry ()=0
 
virtual void VisualizationUpdate ()=0
 
virtual std::string GetName () const =0
 
virtual wpi::math::Pose3d GetPose3d () const =0
 
wpi::cmd::CommandPtr Set (double dutycycle)
 
wpi::cmd::CommandPtr Set (std::function< double()> dutycycle)
 
wpi::cmd::CommandPtr SetVoltage (wpi::units::volt_t volts)
 
wpi::cmd::CommandPtr SetVoltage (std::function< wpi::units::volt_t()> volts)
 
void SetMechanismVelocitySetpoint (wpi::units::turns_per_second_t velocity)
 
void SetMeasurementVelocitySetpoint (wpi::units::meters_per_second_t velocity)
 
void SetMechanismPositionSetpoint (wpi::units::turn_t angle)
 
void SetMeasurementPositionSetpoint (wpi::units::meter_t distance)
 
void SetVoltageSetpoint (wpi::units::volt_t voltage)
 
void SetDutyCycleSetpoint (double dutycycle)
 
motorcontrollers::SmartMotorController * GetMotorController ()
 
std::optional< wpi::units::turn_t > GetMechanismSetpoint ()
 
std::optional< wpi::units::meter_t > GetMeasurementSetpoint ()
 
wpi::Mechanism2d * GetMechanismWindow ()
 

Protected Attributes

wpi::MechanismRoot2d * m_mechanismRoot {nullptr}
 
wpi::MechanismLigament2d * m_mechanismLigament {nullptr}
 
- Protected Attributes inherited from yams::mechanisms::SmartMechanism
wpi::cmd::SubsystemBase * m_subsystem {nullptr}
 
motorcontrollers::SmartMotorController * m_smc {nullptr}
 
std::optional< wpi::Mechanism2d > m_mechanismWindow
 

Detailed Description

Abstract base class for velocity-controlled mechanisms (flywheels, rollers, etc.).

Extends SmartMechanism with hardware limit triggers and Mechanism2d ligament/root accessors for visualisation.

Constructor & Destructor Documentation

◆ SmartVelocityMechanism()

yams::mechanisms::velocity::SmartVelocityMechanism::SmartVelocityMechanism ( )
inline

◆ ~SmartVelocityMechanism()

virtual yams::mechanisms::velocity::SmartVelocityMechanism::~SmartVelocityMechanism ( )
virtualdefault

Member Function Documentation

◆ GetMechanismLigament()

wpi::MechanismLigament2d * yams::mechanisms::velocity::SmartVelocityMechanism::GetMechanismLigament ( )

Get the MechanismLigament2d used to animate this mechanism.

Returns
Pointer to the ligament, or nullptr if not initialised.

◆ GetMechanismRoot()

wpi::MechanismRoot2d * yams::mechanisms::velocity::SmartVelocityMechanism::GetMechanismRoot ( )

Get the MechanismRoot2d anchor point for this mechanism.

Returns
Pointer to the root, or nullptr if not initialised.

◆ GetMotor()

motorcontrollers::SmartMotorController * yams::mechanisms::velocity::SmartVelocityMechanism::GetMotor ( )

Get the underlying SmartMotorController (alias for GetMotorController()).

Returns
Pointer to the motor controller.

◆ Max()

virtual wpi::cmd::Trigger yams::mechanisms::velocity::SmartVelocityMechanism::Max ( )
pure virtual

Trigger that becomes true when the mechanism is at or past its maximum velocity (or forward / upper) limit.

Returns
Trigger for the maximum limit condition.

Implemented in yams::mechanisms::velocity::FlyWheel.

◆ Min()

virtual wpi::cmd::Trigger yams::mechanisms::velocity::SmartVelocityMechanism::Min ( )
pure virtual

Trigger that becomes true when the mechanism is at or past its minimum velocity (or reverse / lower) limit.

Returns
Trigger for the minimum limit condition.

Implemented in yams::mechanisms::velocity::FlyWheel.

Member Data Documentation

◆ m_mechanismLigament

wpi::MechanismLigament2d* yams::mechanisms::velocity::SmartVelocityMechanism::m_mechanismLigament {nullptr}
protected

Animated ligament representing the spinning element of the mechanism.

◆ m_mechanismRoot

wpi::MechanismRoot2d* yams::mechanisms::velocity::SmartVelocityMechanism::m_mechanismRoot {nullptr}
protected

Root anchor point in the Mechanism2d canvas.


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