-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[wombat/utils] move motor voltage controller into voltage controller (#…
…30) reflects CurtinFRC/2024-Crescendo#39
- Loading branch information
1 parent
d954c0b
commit e73ce41
Showing
2 changed files
with
59 additions
and
136 deletions.
There are no files selected for viewing
69 changes: 0 additions & 69 deletions
69
src/content/docs/reference/utils/VoltageController/motor-voltage-controller.md
This file was deleted.
Oops, something went wrong.
126 changes: 59 additions & 67 deletions
126
...eference/utils/VoltageController/index.md → ...ocs/reference/utils/voltage-controller.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,59 @@ | ||
--- | ||
title: 'Voltage Controller' | ||
description: 'Voltage controller for the robot' | ||
--- | ||
|
||
A VoltageController is analagous to a MotorController, but in terms of voltage instead of speed. | ||
|
||
## Usage | ||
|
||
### Constructor | ||
|
||
```cpp | ||
VoltageController controller; | ||
``` | ||
|
||
### Methods | ||
|
||
#### SetVoltage | ||
|
||
Sets the voltage of the controller. | ||
|
||
##### Usage | ||
|
||
```cpp | ||
controller.SetVoltage(12_V); | ||
``` | ||
|
||
#### GetVoltage | ||
|
||
Gets the voltage of the controller. | ||
|
||
##### Usage | ||
|
||
```cpp | ||
units::volt_t voltage = controller.GetVoltage(); | ||
``` | ||
|
||
#### SetInverted | ||
|
||
Sets the inversion of the controller. | ||
|
||
##### Usage | ||
|
||
```cpp | ||
controller.SetInverted(true); | ||
``` | ||
|
||
#### GetInverted | ||
|
||
Gets the inversion of the controller. | ||
|
||
##### Usage | ||
|
||
```cpp | ||
bool inverted = controller.GetInverted(); | ||
``` | ||
|
||
#### GetEstimatedRealVoltage | ||
|
||
Get the estimated real voltage of the output, based on the controller voltage. | ||
|
||
##### Usage | ||
|
||
```cpp | ||
units::volt_t real_voltage = controller.GetEstimatedRealVoltage(); | ||
``` | ||
|
||
--- | ||
title: 'Voltage Controller' | ||
description: 'Voltage controller for the robot' | ||
--- | ||
A VoltageController is analagous to a MotorController, but in terms of voltage instead of speed. It adapts the MotorController in order to control it via voltage instead of speed. | ||
|
||
## Constructor | ||
```cpp | ||
VoltageController *controller = new VoltageController(frc::MotorController &motorController); | ||
``` | ||
|
||
## Methods | ||
### SetVoltage | ||
Sets the voltage of the controller. | ||
|
||
#### Usage | ||
```cpp | ||
controller.SetVoltage(12_V); | ||
``` | ||
|
||
### GetVoltage | ||
Gets the voltage of the controller. | ||
|
||
#### Usage | ||
```cpp | ||
units::volt_t voltage = controller.GetVoltage(); | ||
``` | ||
|
||
### SetInverted | ||
Sets the inversion of the controller. | ||
|
||
#### Usage | ||
```cpp | ||
controller.SetInverted(true); | ||
``` | ||
|
||
### GetInverted | ||
Gets the inversion of the controller. | ||
|
||
#### Usage | ||
```cpp | ||
bool inverted = controller.GetInverted(); | ||
``` | ||
|
||
### GetEstimatedRealVoltage | ||
Get the estimated real voltage of the output, based on the controller voltage. | ||
|
||
#### Usage | ||
```cpp | ||
units::volt_t real_voltage = controller.GetEstimatedRealVoltage(); | ||
``` | ||
|
||
### GetBusVoltage | ||
Gets the bus voltage of the controller. | ||
|
||
#### Usage | ||
```cpp | ||
units::volt_t bus_voltage = controller.GetBusVoltage(); | ||
``` |