FlywheelSim

class wpilib.simulation.FlywheelSim(*args, **kwargs)

Bases: wpilib.simulation.LinearSystemSim_1_1_1

Represents a simulated flywheel mechanism.

Overloaded function.

  1. __init__(self: wpilib.simulation._simulation.FlywheelSim, plant: wpimath._controls._controls.system.LinearSystem_1_1_1, gearbox: wpimath._controls._controls.plant.DCMotor, gearing: float, measurementStdDevs: List[float[1]] = [0.0]) -> None

Creates a simulated flywheel mechanism.

Parameters
  • plant – The linear system representing the flywheel.

  • gearbox – The type of and number of motors in the flywheel gearbox.

  • gearing – The gearing of the flywheel (numbers greater than 1 represent reductions).

  • measurementStdDevs – The standard deviation of the measurement noise.

  1. __init__(self: wpilib.simulation._simulation.FlywheelSim, gearbox: wpimath._controls._controls.plant.DCMotor, gearing: float, moi: kilogram_square_meters, measurementStdDevs: List[float[1]] = [0.0]) -> None

Creates a simulated flywheel mechanism.

Parameters
  • gearbox – The type of and number of motors in the flywheel gearbox.

  • gearing – The gearing of the flywheel (numbers greater than 1 represent reductions).

  • moi – The moment of inertia of the flywheel.

  • measurementStdDevs – The standard deviation of the measurement noise.

getAngularVelocity()radians_per_second

Returns the flywheel velocity.

Returns

The flywheel velocity.

getCurrentDraw()amperes

Returns the flywheel current draw.

Returns

The flywheel current draw.

setInputVoltage(voltage: volts)None

Sets the input voltage for the flywheel.

Parameters

voltage – The input voltage.