YAMS
Yet Another Mechanism System
Loading...
Searching...
No Matches
FollowerSimSupplier.hpp
Go to the documentation of this file.
1// Copyright (c) 2026 Yet Another Software Suite
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
4#pragma once
5
6#include <wpi/units/angle.hpp>
7#include <wpi/units/angular_acceleration.hpp>
8#include <wpi/units/angular_velocity.hpp>
9#include <wpi/units/current.hpp>
10#include <wpi/units/voltage.hpp>
11
13
14namespace yams::motorcontrollers {
16} // namespace yams::motorcontrollers
17
19
29 public:
38
39 void UpdateSim() override {}
40 bool GetUpdatedSim() override { return true; }
41 void FeedUpdateSim() override {}
42 void StarveUpdateSim() override {}
43 bool IsInputFed() override { return true; }
44 void FeedInput() override {}
45 void StarveInput() override {}
46 void SetMechanismStatorDutyCycle(double) override {}
47 wpi::units::volt_t GetMechanismSupplyVoltage() override;
48 wpi::units::volt_t GetMechanismStatorVoltage() override;
49 void SetMechanismStatorVoltage(wpi::units::volt_t) override {}
50 wpi::units::turn_t GetMechanismPosition() override;
51 void SetMechanismPosition(wpi::units::turn_t) override {}
52 wpi::units::turn_t GetRotorPosition() override;
53 wpi::units::turns_per_second_t GetMechanismVelocity() override;
54 void SetMechanismVelocity(wpi::units::turns_per_second_t) override {}
55 wpi::units::turns_per_second_t GetRotorVelocity() override;
56 wpi::units::turns_per_second_squared_t GetMechanismAcceleration() override;
57 wpi::units::turns_per_second_squared_t GetRotorAcceleration() override;
58 void SetRotorPosition(wpi::units::turn_t) override {}
59 void SetRotorVelocity(wpi::units::turns_per_second_t) override {}
60 wpi::units::ampere_t GetStatorCurrent() override;
61 wpi::units::ampere_t GetSupplyCurrent() override;
62
63 private:
65 SimSupplier& Leader();
67 double RotorRatio();
69 wpi::units::ampere_t Share(wpi::units::ampere_t current);
70
71 SmartMotorController& m_leader;
72 SmartMotorController& m_follower;
74 double m_sign;
75};
76
77} // namespace yams::motorcontrollers::simulation
Definition SimSupplier.hpp:22
Definition SmartMotorController.hpp:49
void SetMechanismStatorDutyCycle(double) override
Definition FollowerSimSupplier.hpp:46
wpi::units::volt_t GetMechanismSupplyVoltage() override
wpi::units::volt_t GetMechanismStatorVoltage() override
wpi::units::turns_per_second_t GetRotorVelocity() override
void UpdateSim() override
Definition FollowerSimSupplier.hpp:39
FollowerSimSupplier(SmartMotorController &leader, SmartMotorController &follower, bool inverted)
void SetRotorVelocity(wpi::units::turns_per_second_t) override
Definition FollowerSimSupplier.hpp:59
void SetMechanismVelocity(wpi::units::turns_per_second_t) override
Definition FollowerSimSupplier.hpp:54
void StarveUpdateSim() override
Definition FollowerSimSupplier.hpp:42
void SetMechanismPosition(wpi::units::turn_t) override
Definition FollowerSimSupplier.hpp:51
wpi::units::turns_per_second_squared_t GetRotorAcceleration() override
void SetRotorPosition(wpi::units::turn_t) override
Definition FollowerSimSupplier.hpp:58
void FeedUpdateSim() override
Definition FollowerSimSupplier.hpp:41
wpi::units::turns_per_second_squared_t GetMechanismAcceleration() override
wpi::units::turns_per_second_t GetMechanismVelocity() override
bool GetUpdatedSim() override
Definition FollowerSimSupplier.hpp:40
void FeedInput() override
Definition FollowerSimSupplier.hpp:44
void StarveInput() override
Definition FollowerSimSupplier.hpp:45
void SetMechanismStatorVoltage(wpi::units::volt_t) override
Definition FollowerSimSupplier.hpp:49
bool IsInputFed() override
Definition FollowerSimSupplier.hpp:43
Definition SimSensorConfig.hpp:15
Definition ADRCConfig.hpp:20