WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
wpi::sim Namespace Reference

Classes

class  CTREPCMSim
 Class to control a simulated Pneumatic Control Module (PCM). More...
class  DutyCycleSim
 Class to control a simulated duty cycle digital input. More...
class  AddressableLEDSim
 Class to control a simulated addressable LED. More...
class  CallbackStore
 Manages simulation callbacks; each object is associated with a callback. More...
class  RoboRioSim
 A utility class to control a simulated RoboRIO. More...
class  BatterySim
 A utility class to simulate the robot battery. More...
class  SimDeviceSim
 Class to control the simulation side of a SimDevice. More...
class  SolenoidSim
class  OpModeOptions
class  DriverStationSim
 Class to control a simulated driver station. More...
class  SingleJointedArmSim
 Represents a simulated arm mechanism. More...
class  AlertSim
 Class to get info on simulated alerts. More...
class  PneumaticsBaseSim
class  DCMotorSim
 Represents a simulated DC motor mechanism. More...
class  REVPHSim
 Class to control a simulated Pneumatic Control Module (PCM). More...
class  PWMMotorControllerSim
class  FlywheelSim
 Represents a simulated flywheel mechanism. More...
class  NiDsXboxControllerSim
 Class to control a simulated NiDsXbox controller. More...
class  JoystickSim
 Class to control a simulated joystick. More...
class  DoubleSolenoidSim
class  AnalogEncoderSim
 Class to control a simulated analog encoder. More...
class  DifferentialDrivetrainSim
class  NiDsPS5ControllerSim
 Class to control a simulated NiDsPS5 controller. More...
class  GamepadSim
 Class to control a simulated Gamepad controller. More...
class  LinearSystemSim
 This class helps simulate linear systems. More...
class  PWMSim
 Class to control a simulated PWM output. More...
class  NiDsStadiaControllerSim
 Class to control a simulated NiDsStadia controller. More...
class  DutyCycleEncoderSim
 Class to control a simulated duty cycle encoder. More...
class  DigitalPWMSim
 Class to control a simulated digital PWM output. More...
class  NiDsPS4ControllerSim
 Class to control a simulated NiDsPS4 controller. More...
class  PowerDistributionSim
 Class to control a simulated Power Distribution Panel (PowerDistribution). More...
class  SendableChooserSim
 Class that facilitates control of a SendableChooser's selected option in simulation. More...
class  DIOSim
 Class to control a simulated digital input or output. More...
class  GenericHIDSim
 Class to control a simulated generic joystick. More...
class  ElevatorSim
 Represents a simulated elevator mechanism. More...
class  ADXL345Sim
 Class to control a simulated ADXL345. More...
class  AnalogInputSim
 Class to control a simulated analog input. More...
class  EncoderSim
 Class to control a simulated encoder. More...

Typedefs

using NotifyCallback = std::function<void(std::string_view, const HAL_Value*)>
using ConstBufferCallback
using OpModeOptionsCallback
using CancelCallbackFunc = void (*)(int32_t index, int32_t uid)
using CancelCallbackNoIndexFunc = void (*)(int32_t uid)
using CancelCallbackChannelFunc

Functions

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)
void OpModeOptionsCallbackStoreThunk (const char *name, void *param, const HAL_OpModeOption *opmodes, int32_t count)
void SetRuntimeType (HAL_RuntimeType type)
 Override the HAL runtime type (simulated/real).
void WaitForProgramStart ()
 Waits until the user program has started.
void SetProgramStarted (bool started)
 Sets flag that indicates if the user program has started.
bool GetProgramStarted ()
 Returns true if the user program has started.
void SetProgramState (wpi::hal::ControlWord controlWord)
 Sets the user program state (control word).
wpi::hal::ControlWord GetProgramState ()
 Gets the user program state (control word).
void RestartTiming ()
 Restart the simulator time.
void PauseTiming ()
 Pause the simulator time.
void ResumeTiming ()
 Resume the simulator time.
bool IsTimingPaused ()
 Check if the simulator time is paused.
void StepTiming (wpi::units::second_t delta)
 Advance the simulator time and wait for all notifiers to run.
void StepTimingAsync (wpi::units::second_t delta)
 Advance the simulator time and return immediately.

Typedef Documentation

◆ CancelCallbackChannelFunc

Initial value:
void (*)(int32_t index, int32_t channel,
int32_t uid)
@ index
Definition base.h:690

◆ CancelCallbackFunc

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

◆ CancelCallbackNoIndexFunc

using wpi::sim::CancelCallbackNoIndexFunc = void (*)(int32_t uid)

◆ ConstBufferCallback

Initial value:
std::function<void(
std::string_view, const unsigned char* buffer, unsigned int count)>

◆ NotifyCallback

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

◆ OpModeOptionsCallback

Initial value:
std::function<void(std::string_view, std::span<const HAL_OpModeOption>)>

Function Documentation

◆ CallbackStoreThunk()

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

◆ ConstBufferCallbackStoreThunk()

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

◆ GetProgramStarted()

bool wpi::sim::GetProgramStarted ( )

Returns true if the user program has started.

Returns
True if the user program has started.

◆ GetProgramState()

wpi::hal::ControlWord wpi::sim::GetProgramState ( )

Gets the user program state (control word).

Returns
Control word

◆ IsTimingPaused()

bool wpi::sim::IsTimingPaused ( )

Check if the simulator time is paused.

Returns
true if paused

◆ OpModeOptionsCallbackStoreThunk()

void wpi::sim::OpModeOptionsCallbackStoreThunk ( const char * name,
void * param,
const HAL_OpModeOption * opmodes,
int32_t count )

◆ PauseTiming()

void wpi::sim::PauseTiming ( )

Pause the simulator time.

◆ RestartTiming()

void wpi::sim::RestartTiming ( )

Restart the simulator time.

◆ ResumeTiming()

void wpi::sim::ResumeTiming ( )

Resume the simulator time.

◆ SetProgramStarted()

void wpi::sim::SetProgramStarted ( bool started)

Sets flag that indicates if the user program has started.

Parameters
startedtrue if started

◆ SetProgramState()

void wpi::sim::SetProgramState ( wpi::hal::ControlWord controlWord)

Sets the user program state (control word).

Parameters
controlWordcontrol word

◆ SetRuntimeType()

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

Override the HAL runtime type (simulated/real).

Parameters
typeruntime type

◆ StepTiming()

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

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

Parameters
deltathe amount to advance (in seconds)

◆ StepTimingAsync()

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

Advance the simulator time and return immediately.

Parameters
deltathe amount to advance (in seconds)

◆ WaitForProgramStart()

void wpi::sim::WaitForProgramStart ( )

Waits until the user program has started.