Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
double_dji_motor.hpp
Go to the documentation of this file.
1/*****************************************************************************/
2/********** !!! WARNING: CODE GENERATED BY TAPROOT. DO NOT EDIT !!! **********/
3/*****************************************************************************/
4
5/*
6 * Copyright (c) 2020-2021 Advanced Robotics at the University of Washington <robomstr@uw.edu>
7 *
8 * This file is part of Taproot.
9 *
10 * Taproot is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * Taproot is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with Taproot. If not, see <https://www.gnu.org/licenses/>.
22 */
23
24#ifndef TAPROOT_DOUBLE_DJI_MOTOR_HPP_
25#define TAPROOT_DOUBLE_DJI_MOTOR_HPP_
26
27#include "dji_motor.hpp"
28#include "motor_interface.hpp"
29
30#if defined(PLATFORM_HOSTED) && defined(ENV_UNIT_TESTS)
31#include <gmock/gmock.h>
32
33#include "tap/mock/dji_motor_mock.hpp"
34#endif
35
36namespace tap::motor
37{
45{
46public:
49 MotorId desMotorIdentifierOne,
50 MotorId desMotorIdentifierTwo,
51 tap::can::CanBus motorCanBusOne,
52 tap::can::CanBus motorCanBusTwo,
53 bool isInvertedOne,
54 bool isInvertedTwo,
55 const char* nameOne,
56 const char* nameTwo,
57 bool currentControl = false,
58 float gearRatio = 1,
59 uint32_t encoderHomePositionOne = 0,
60 tap::encoder::EncoderInterface* externalEncoder = nullptr);
61
62 void initialize() override;
64 {
65 return const_cast<tap::encoder::MultiEncoder<3>*>(&this->encoder);
66 }
67 void setDesiredOutput(int32_t desiredOutput) override;
68 bool isMotorOnline() const override;
69 int16_t getOutputDesired() const override;
70 int8_t getTemperature() const override;
71 int16_t getTorque() const override;
72
73protected:
74#if defined(PLATFORM_HOSTED) && defined(ENV_UNIT_TESTS)
75public:
76 testing::NiceMock<mock::DjiMotorMock> motorOne;
77 testing::NiceMock<mock::DjiMotorMock> motorTwo;
78
79protected:
80#else
83#endif
85};
86} // namespace tap::motor
87
88#endif // TAPROOT_DOUBLE_DJI_MOTOR_HPP_
Definition drivers.hpp:70
Definition encoder_interface.hpp:32
Definition multi_encoder.hpp:49
Definition dji_motor.hpp:71
Definition double_dji_motor.hpp:45
int16_t getTorque() const override
Definition double_dji_motor.cpp:106
bool isMotorOnline() const override
Definition double_dji_motor.cpp:86
DjiMotor motorTwo
Definition double_dji_motor.hpp:82
void setDesiredOutput(int32_t desiredOutput) override
Definition double_dji_motor.cpp:80
void initialize() override
Definition double_dji_motor.cpp:71
tap::encoder::EncoderInterface * getEncoder() const override
Definition double_dji_motor.hpp:63
int16_t getOutputDesired() const override
Definition double_dji_motor.cpp:91
DjiMotor motorOne
Definition double_dji_motor.hpp:81
int8_t getTemperature() const override
Definition double_dji_motor.cpp:101
tap::encoder::MultiEncoder< 3 > encoder
Definition double_dji_motor.hpp:84
Definition motor_interface.hpp:34
CanBus
Definition can_bus.hpp:30
Definition dji_motor.cpp:41
MotorId
Definition dji_motor_ids.hpp:38
fang::Drivers & drivers
Definition robot_singleton.cpp:45