Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
dji_m3508_old.hpp
Go to the documentation of this file.
1#pragma once
6
10#include "tap/util_macros.hpp"
11
12namespace trap
13{
14 namespace motor
15 {
20 {
21 public:
43 const char* name, bool inverted, double gearRatio, const DjiSpeedPid::Config& speedConfig);
44
45
49 mockable void update() override;
50
54 mockable void setTargetSpeed(const RPM& targetSpeed);
55
59 mockable RPM getSpeed() const;
60
64 mockable void initialize() override;
65
69 mockable void setDesiredOutput(DjiMotorOutput desiredOutput);
70
75 mockable bool isMotorOnline() const;
76
82
84
85 mockable const char* getName() const;
86
92 private:
93 Drivers& m_drivers;
94 tap::motor::DjiMotor m_djiMotor;
95 DjiSpeedPid m_speedPid;
96 RPM m_targetSpeed{0.0};
97 double m_gearRatio;
98
99 //Current control in DjiMotor is for the GM6020s only
100 //Setting it to true will mean the motor does not respond
101 static const bool mk_requiredCurrentMode{false};
102 };
103 }
104}
Definition drivers.hpp:70
static constexpr float GEAR_RATIO_M3508
Definition dji_motor_encoder.hpp:61
Definition dji_motor.hpp:71
static constexpr uint16_t MAX_OUTPUT_C620
Definition dji_motor.hpp:77
tap::algorithms::SmoothPidConfig Config
Definition smooth_pid.hpp:25
Definition dji_m3508_old.hpp:20
mockable bool isMotorOnline() const
Definition dji_m3508_old.cpp:59
static constexpr double k_factoryGearboxRatio
The gear ratio for the gearbox that the m3508 ships with.
Definition dji_m3508_old.hpp:91
mockable void setDesiredOutput(DjiMotorOutput desiredOutput)
Definition dji_m3508_old.cpp:48
static constexpr DjiMotorOutput k_maxOutput
Maximum output that can be sent to the C620 controller.
Definition dji_m3508_old.hpp:89
mockable void initialize() override
Definition dji_m3508_old.cpp:43
mockable RPM getSpeed() const
Definition dji_m3508_old.cpp:38
mockable void update() override
Definition dji_m3508_old.cpp:27
mockable const char * getName() const
Definition dji_m3508_old.cpp:74
mockable void setTargetSpeed(const RPM &targetSpeed)
Definition dji_m3508_old.cpp:33
mockable ~DjiM3508Old()=default
mockable Celsius getTemperature() const
Definition dji_m3508_old.cpp:64
mockable tap::can::CanBus getCanBus() const
Definition dji_m3508_old.cpp:69
Definition pwm_info.hpp:4
rail::motor::ISpeedMotor< RPM > ISpeedMotor
Definition ispeed_motor.hpp:9
Definition brushlessutils.cpp:4
CanBus
Definition can_bus.hpp:30
MotorId
Definition dji_motor_ids.hpp:38
int16_t DjiMotorOutput
Definition dji_motor_aliases.hpp:13
Definition dimensional_smooth_pid.hpp:8
fang::Drivers & drivers
Definition robot_singleton.cpp:45
Definition smooth_pid.hpp:36
Definition dji_m3508_old.hpp:23
const char * name
Definition dji_m3508_old.hpp:26
double gearRatio
Definition dji_m3508_old.hpp:28
tap::motor::MotorId motorId
Definition dji_m3508_old.hpp:24
tap::can::CanBus canBus
Definition dji_m3508_old.hpp:25
DjiSpeedPid::Config speedPidConfig
Definition dji_m3508_old.hpp:29
bool inverted
Definition dji_m3508_old.hpp:27
units::temperature::celsius_t Celsius
Definition units_alias.hpp:21
units::angular_velocity::revolutions_per_minute_t RPM
Definition units_alias.hpp:30
#define mockable
Wrap class functions that are not already virtual in this function if you wish to mock them.
Definition util_macros.hpp:38