Skip to content

Commit

Permalink
verifyConnected added to Motormonkey/highermotorcontroller/intermedia…
Browse files Browse the repository at this point in the history
…tecontroller and subclasses
  • Loading branch information
DhananjayKhulbe committed Dec 29, 2024
2 parents e79de9d + 628848a commit 06a2c16
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 22 deletions.
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,6 @@ To undo the going back:

- `git switch -` <-- goes back to latest commit

## CppCheck Warnings
```
src/frc846/cpp/frc846/math/collection.cc:11:0: warning: The function 'HorizontalDeadband' is never used. [unusedFunction]
src/frc846/cpp/frc846/math/collection.cc:25:0: warning: The function 'VerticalDeadband' is never used. [unusedFunction]
src/frc846/cpp/frc846/math/collection.cc:39:0: warning: The function 'CoterminalDifference' is never used. [unusedFunction]
src/frc846/cpp/frc846/math/collection.cc:52:0: warning: The function 'CoterminalSum' is never used. [unusedFunction]
```
## CppCheck Warnings
```
src/frc846/cpp/frc846/math/collection.cc:11:0: warning: The function 'HorizontalDeadband' is never used. [unusedFunction]
Expand Down
7 changes: 1 addition & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,7 @@ task runCppcheck(type: Exec) {
}
}

def cppcheckSection = """
## CppCheck Warnings
```
${reportContent.trim()}
```
"""
def cppcheckSection = """## CppCheck Warnings\n```\n${reportContent.trim()}\n```\n"""
def readmeFile = file('README.md')
def readmeContent = readmeFile.text
def cppcheckRegex = /## CppCheck Warnings\n```[\s\S]*?```/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "frc846/control/simulation/MCSimulator.h"
#include "frc846/control/hardware/simulation/MCSimulator.h"

#include "frc846/control/calculators/CurrentTorqueCalculator.h"
#include "frc846/control/calculators/VelocityPositionEstimator.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <variant>

#include "frc846/control/hardware/IntermediateController.h"
#include "frc846/control/base/motor_gains.h"
#include "frc846/control/base/motor_specs.h"
#include "frc846/wpilib/846_units.h"
Expand All @@ -20,7 +21,7 @@ MCSimulator
A class that simulates a motor controller. Uses motor dynamics to simulate
position and velocity accurately.
*/
class MCSimulator {
class MCSimulator : frc846::control::hardware::IntermediateController {
public:
MCSimulator(frc846::control::base::MotorSpecs specs,
frc846::wpilib::unit_ohm circuit_resistance,
Expand All @@ -33,19 +34,19 @@ class MCSimulator {
*/
void Tick(units::volt_t battery_voltage, units::newton_meter_t load);

void WriteDC(double duty_cycle);
void WriteVelocity(units::radians_per_second_t velocity);
void WritePosition(units::radian_t position);
void WriteDC(double duty_cycle) override;
void WriteVelocity(units::radians_per_second_t velocity) override;
void WritePosition(units::radian_t position) override;

units::radian_t GetPosition();
units::radians_per_second_t GetVelocity();
units::radian_t GetPosition() override;
units::radians_per_second_t GetVelocity() override;

/*
ZeroEncoder()
Sets the motor's position to specified value.
*/
void ZeroEncoder(units::radian_t position = 0_rad);
void ZeroEncoder(units::radian_t position = 0_rad) override;

/*
DisablePositionPacket()
Expand All @@ -60,7 +61,7 @@ class MCSimulator {
*/
void DisableVelocityPacket();

void SetGains(frc846::control::base::MotorGains gains);
void SetGains(frc846::control::base::MotorGains gains) override;

private:
frc846::control::base::MotorSpecs specs;
Expand Down

0 comments on commit 06a2c16

Please sign in to comment.