WPILibC++ 2024.3.2
frc::sim Namespace Reference

Classes

class  AddressableLEDSim
 Class to control a simulated addressable LED. More...
 
class  ADIS16448_IMUSim
 Class to control a simulated ADIS16448 IMU. More...
 
class  ADIS16470_IMUSim
 Class to control a simulated ADIS16470 IMU. More...
 
class  ADXL345Sim
 Class to control a simulated ADXL345. More...
 
class  ADXL362Sim
 Class to control a simulated ADXL362. More...
 
class  ADXRS450_GyroSim
 Class to control a simulated ADXRS450 gyroscope. More...
 
class  AnalogEncoderSim
 Class to control a simulated analog encoder. More...
 
class  AnalogGyroSim
 Class to control a simulated analog gyro. More...
 
class  AnalogInputSim
 Class to control a simulated analog input. More...
 
class  AnalogOutputSim
 Class to control a simulated analog output. More...
 
class  AnalogTriggerSim
 Class to control a simulated analog trigger. More...
 
class  BatterySim
 A utility class to simulate the robot battery. More...
 
class  BuiltInAccelerometerSim
 Class to control a simulated built-in accelerometer. More...
 
class  CallbackStore
 Manages simulation callbacks; each object is associated with a callback. More...
 
class  CTREPCMSim
 Class to control a simulated Pneumatic Control Module (PCM). More...
 
class  DCMotorSim
 Represents a simulated DC motor mechanism. More...
 
class  DifferentialDrivetrainSim
 
class  DigitalPWMSim
 Class to control a simulated digital PWM output. More...
 
class  DIOSim
 Class to control a simulated digital input or output. More...
 
class  DoubleSolenoidSim
 
class  DriverStationSim
 Class to control a simulated driver station. More...
 
class  DutyCycleEncoderSim
 Class to control a simulated duty cycle encoder. More...
 
class  DutyCycleSim
 Class to control a simulated duty cycle digital input. More...
 
class  ElevatorSim
 Represents a simulated elevator mechanism. More...
 
class  EncoderSim
 Class to control a simulated encoder. More...
 
class  FlywheelSim
 Represents a simulated flywheel mechanism. More...
 
class  GenericHIDSim
 Class to control a simulated generic joystick. More...
 
class  JoystickSim
 Class to control a simulated joystick. More...
 
class  LinearSystemSim
 This class helps simulate linear systems. More...
 
class  PneumaticsBaseSim
 
class  PowerDistributionSim
 Class to control a simulated Power Distribution Panel (PowerDistribution). More...
 
class  PS4ControllerSim
 Class to control a simulated PS4 controller. More...
 
class  PS5ControllerSim
 Class to control a simulated PS5 controller. More...
 
class  PWMSim
 Class to control a simulated PWM output. More...
 
class  RelaySim
 Class to control a simulated relay. More...
 
class  REVPHSim
 Class to control a simulated Pneumatic Control Module (PCM). More...
 
class  RoboRioSim
 A utility class to control a simulated RoboRIO. More...
 
class  SimDeviceSim
 Class to control the simulation side of a SimDevice. More...
 
class  SingleJointedArmSim
 Represents a simulated arm mechanism. More...
 
class  SolenoidSim
 
class  SPIAccelerometerSim
 
class  UltrasonicSim
 Class to control a simulated Ultrasonic. More...
 
class  XboxControllerSim
 Class to control a simulated Xbox 360 or Xbox One controller. More...
 

Typedefs

using NotifyCallback = std::function< void(std::string_view, const HAL_Value *)>
 
using ConstBufferCallback = std::function< void(std::string_view, const unsigned char *buffer, unsigned int count)>
 
using CancelCallbackFunc = void(*)(int32_t index, int32_t uid)
 
using CancelCallbackNoIndexFunc = void(*)(int32_t uid)
 
using CancelCallbackChannelFunc = void(*)(int32_t index, int32_t channel, int32_t uid)
 

Functions

void SetRuntimeType (HAL_RuntimeType type)
 Override the HAL runtime type (simulated/real). More...
 
void WaitForProgramStart ()
 
void SetProgramStarted ()
 
bool GetProgramStarted ()
 
void RestartTiming ()
 Restart the simulator time. More...
 
void PauseTiming ()
 Pause the simulator time. More...
 
void ResumeTiming ()
 Resume the simulator time. More...
 
bool IsTimingPaused ()
 Check if the simulator time is paused. More...
 
void StepTiming (units::second_t delta)
 Advance the simulator time and wait for all notifiers to run. More...
 
void StepTimingAsync (units::second_t delta)
 Advance the simulator time and return immediately. More...
 
void CallbackStoreThunk (const char *name, void *param, const HAL_Value *value)
 
void ConstBufferCallbackStoreThunk (const char *name, void *param, const unsigned char *buffer, unsigned int count)
 

Typedef Documentation

◆ CancelCallbackChannelFunc

using frc::sim::CancelCallbackChannelFunc = typedef void (*)(int32_t index, int32_t channel, int32_t uid)

◆ CancelCallbackFunc

using frc::sim::CancelCallbackFunc = typedef void (*)(int32_t index, int32_t uid)

◆ CancelCallbackNoIndexFunc

using frc::sim::CancelCallbackNoIndexFunc = typedef void (*)(int32_t uid)

◆ ConstBufferCallback

using frc::sim::ConstBufferCallback = typedef std::function<void( std::string_view, const unsigned char* buffer, unsigned int count)>

◆ NotifyCallback

using frc::sim::NotifyCallback = typedef std::function<void(std::string_view, const HAL_Value*)>

Function Documentation

◆ CallbackStoreThunk()

void frc::sim::CallbackStoreThunk ( const char *  name,
void *  param,
const HAL_Value value 
)

◆ ConstBufferCallbackStoreThunk()

void frc::sim::ConstBufferCallbackStoreThunk ( const char *  name,
void *  param,
const unsigned char *  buffer,
unsigned int  count 
)

◆ GetProgramStarted()

bool frc::sim::GetProgramStarted ( )

◆ IsTimingPaused()

bool frc::sim::IsTimingPaused ( )

Check if the simulator time is paused.

Returns
true if paused

◆ PauseTiming()

void frc::sim::PauseTiming ( )

Pause the simulator time.

◆ RestartTiming()

void frc::sim::RestartTiming ( )

Restart the simulator time.

◆ ResumeTiming()

void frc::sim::ResumeTiming ( )

Resume the simulator time.

◆ SetProgramStarted()

void frc::sim::SetProgramStarted ( )

◆ SetRuntimeType()

void frc::sim::SetRuntimeType ( HAL_RuntimeType  type)

Override the HAL runtime type (simulated/real).

Parameters
typeruntime type

◆ StepTiming()

void frc::sim::StepTiming ( units::second_t  delta)

Advance the simulator time and wait for all notifiers to run.

Parameters
deltathe amount to advance (in seconds)

◆ StepTimingAsync()

void frc::sim::StepTimingAsync ( units::second_t  delta)

Advance the simulator time and return immediately.

Parameters
deltathe amount to advance (in seconds)

◆ WaitForProgramStart()

void frc::sim::WaitForProgramStart ( )