#ifndef ARM_H #define ARM_H #include #include "common/math/mathTypes.h" #include "model/Joint.h" #include "model/Motor.h" #include "unitree_arm_sdk/udp.h" class ArmReal{ public: ArmReal(int dof, int motorNum, IOPort *ioPort); virtual ~ArmReal(); void setJointKp(std::vector jointKp); void setJointKd(std::vector jointKd); void setJointQ(std::vector jointQ); void setJointDq(std::vector jointDq); void setJointTau(std::vector jointTau); void getJointQ(std::vector &jointQState); void getJointDq(std::vector &jointDqState); void getJointDDq(std::vector &jointDDqState); void getJointTau(std::vector &jointTauState); void getMotorQ(std::vector &motorQ); void getMotorDq(std::vector &motorDq); void getMotorTau(std::vector &motorTau); void armCalibration(); void armCalibration(std::vector motorAngleBias); bool armComm(); size_t getDof(){return _dof;} size_t getMotorNum(){return _motorNum;} // int getMotorNum(){return _motorNum;} protected: void _init(); void _getCmd(std::vector &cmd); void _setState(std::vector &motorState); void _getMotorQBias(); // void _setComm(); void _setCaliBias(); int _motorNum; int _dof; int _commReturn; bool _commYN, _motorCommYN; std::vector _joints; std::vector _jointCaliAngle; std::vector _motorAngleBias; std::vector _motorCmd; std::vector _motorState; /* serial or UDP Communication */ IOPort *_ioPort; }; class z1Real : public ArmReal{ public: z1Real(IOPort *ioPort); ~z1Real(){} }; class TigerHeadReal : public ArmReal{ public: TigerHeadReal(IOPort *ioPort); ~TigerHeadReal(){} }; class DogHeadReal : public ArmReal{ public: DogHeadReal(IOPort *ioPort); ~DogHeadReal(){} }; class TestSerial : public ArmReal{ public: TestSerial(IOPort *ioPort); ~TestSerial(){} }; #endif // ARM_H