10 #ifndef DRIVE_H_INCLUDED 11 #define DRIVE_H_INCLUDED 22 #define CANMESSAGELENGTH 100 57 static std::map<OD_Entry_t, int> OD_Addresses = {
71 static std::map<OD_Entry_t, int> OD_Data_Size = {
109 std::vector<std::string> generateTPDOConfigSDO(std::vector<OD_Entry_t> items,
int PDO_Num,
int SyncRate);
119 std::vector<std::string> generateRPDOConfigSDO(std::vector<OD_Entry_t> items,
int PDO_Num,
int UpdateTiming);
138 std::vector<std::string> generatePosControlConfigSDO(
motorProfile positionProfile);
145 int sendSDOMessages(std::vector<std::string> messages);
197 virtual bool Init() = 0;
212 virtual bool initPDOs();
224 virtual bool initPosControl(
motorProfile posControlMotorProfile) = 0;
234 virtual bool initVelControl() = 0;
244 virtual bool initTorqControl() = 0;
251 virtual int updateDriveStatus();
259 virtual bool setPos(
int position);
267 virtual bool setVel(
int velocity);
275 virtual bool setTorque(
int torque);
282 virtual int getPos();
289 virtual int getVel();
296 virtual int getTorque();
308 virtual bool readyToSwitchOn();
319 virtual bool enable();
330 virtual bool disable();
338 virtual bool posControlConfirmSP();
OD_Entry_t
Commonly-used entries defined in the Object Dictionary for CiA402 Drives.
Abstract class describing a Drive used to communicate with a CANbus device. Note that many functions ...
int error
Current error state of the drive.
int NodeID
The CAN Node ID used to address this particular drive on the CAN bus.
struct to hold desired velocity, acceleration and deceleration values for a drives motor controller p...
virtual ~Drive()
Destroy the Drive object.
int statusWord
Current status word of the drive.