Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wombat/utils] move motor voltage controller into voltage controller #30

Merged
merged 1 commit into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

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();
```