drivers for arm

master
adligeerik 5 years ago
parent 6c8e7c1eed
commit 989a808d3f

@ -0,0 +1,48 @@
import threading
import DobotDllType as dType
CON_STR = {
dType.DobotConnect.DobotConnect_NoError: "DobotConnect_NoError",
dType.DobotConnect.DobotConnect_NotFound: "DobotConnect_NotFound",
dType.DobotConnect.DobotConnect_Occupied: "DobotConnect_Occupied"}
#Load Dll
api = dType.load()
#Connect Dobot
state = dType.ConnectDobot(api, "", 115200)[0]
print("Connect status:",CON_STR[state])
if (state == dType.DobotConnect.DobotConnect_NoError):
#Clean Command Queued
dType.SetQueuedCmdClear(api)
#Async Motion Params Setting
dType.SetHOMEParams(api, 250, 0, 50, 0, isQueued = 1)
dType.SetPTPJointParams(api, 200, 200, 200, 200, 200, 200, 200, 200, isQueued = 1)
dType.SetPTPCommonParams(api, 100, 100, isQueued = 1)
#Async Home
dType.SetHOMECmd(api, temp = 0, isQueued = 1)
#Async PTP Motion
for i in range(0, 5):
if i % 2 == 0:
offset = 50
else:
offset = -50
lastIndex = dType.SetPTPCmd(api, dType.PTPMode.PTPMOVLXYZMode, 200 + offset, offset, offset, offset, isQueued = 1)[0]
#Start to Execute Command Queued
dType.SetQueuedCmdStartExec(api)
#Wait for Executing Last Command
while lastIndex > dType.GetQueuedCmdCurrentIndex(api)[0]:
dType.dSleep(100)
#Stop to Execute Command Queued
dType.SetQueuedCmdStopExec(api)
#Disconnect Dobot
dType.DisconnectDobot(api)

Binary file not shown.

Binary file not shown.

@ -0,0 +1,221 @@
#ifndef DOBOTDLL_H
#define DOBOTDLL_H
#include "dobotdll_global.h"
#include "DobotType.h"
extern "C" DOBOTDLLSHARED_EXPORT int DobotExec(void);
extern "C" DOBOTDLLSHARED_EXPORT int SearchDobot(char *dobotNameList, uint32_t maxLen);
extern "C" DOBOTDLLSHARED_EXPORT int ConnectDobot(const char *portName, uint32_t baudrate, char *fwType, char *version);
extern "C" DOBOTDLLSHARED_EXPORT int DisconnectDobot(void);
extern "C" DOBOTDLLSHARED_EXPORT int SetCmdTimeout(uint32_t cmdTimeout);
// Device information
extern "C" DOBOTDLLSHARED_EXPORT int SetDeviceSN(const char *deviceSN);
extern "C" DOBOTDLLSHARED_EXPORT int GetDeviceSN(char *deviceSN, uint32_t maxLen);
extern "C" DOBOTDLLSHARED_EXPORT int SetDeviceName(const char *deviceName);
extern "C" DOBOTDLLSHARED_EXPORT int GetDeviceName(char *deviceName, uint32_t maxLen);
extern "C" DOBOTDLLSHARED_EXPORT int GetDeviceVersion(uint8_t *majorVersion, uint8_t *minorVersion, uint8_t *revision);
extern "C" DOBOTDLLSHARED_EXPORT int SetDeviceWithL(bool isWithL, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int GetDeviceWithL(bool *isWithL);
extern "C" DOBOTDLLSHARED_EXPORT int GetDeviceTime(uint32_t *deviceTime);
// Pose and Kinematics parameters are automatically get
extern "C" DOBOTDLLSHARED_EXPORT int GetPose(Pose *pose);
extern "C" DOBOTDLLSHARED_EXPORT int ResetPose(bool manual, float rearArmAngle, float frontArmAngle);
extern "C" DOBOTDLLSHARED_EXPORT int GetKinematics(Kinematics *kinematics);
extern "C" DOBOTDLLSHARED_EXPORT int GetPoseL(float *l);
// Alarms
extern "C" DOBOTDLLSHARED_EXPORT int GetAlarmsState(uint8_t *alarmsState, uint32_t *len, uint32_t maxLen);
extern "C" DOBOTDLLSHARED_EXPORT int ClearAllAlarmsState(void);
// HOME
extern "C" DOBOTDLLSHARED_EXPORT int SetHOMEParams(HOMEParams *homeParams, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int GetHOMEParams(HOMEParams *homeParams);
extern "C" DOBOTDLLSHARED_EXPORT int SetHOMECmd(HOMECmd *homeCmd, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int SetAutoLevelingCmd(AutoLevelingCmd *autoLevelingCmd, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int GetAutoLevelingResult(float *precision);
// Handheld teach
extern "C" DOBOTDLLSHARED_EXPORT int SetHHTTrigMode(HHTTrigMode hhtTrigMode);
extern "C" DOBOTDLLSHARED_EXPORT int GetHHTTrigMode(HHTTrigMode *hhtTrigMode);
extern "C" DOBOTDLLSHARED_EXPORT int SetHHTTrigOutputEnabled(bool isEnabled);
extern "C" DOBOTDLLSHARED_EXPORT int GetHHTTrigOutputEnabled(bool *isEnabled);
extern "C" DOBOTDLLSHARED_EXPORT int GetHHTTrigOutput(bool *isTriggered);
// EndEffector
extern "C" DOBOTDLLSHARED_EXPORT int SetEndEffectorParams(EndEffectorParams *endEffectorParams, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int GetEndEffectorParams(EndEffectorParams *endEffectorParams);
extern "C" DOBOTDLLSHARED_EXPORT int SetEndEffectorLaser(bool enableCtrl, bool on, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int GetEndEffectorLaser(bool *isCtrlEnabled, bool *isOn);
extern "C" DOBOTDLLSHARED_EXPORT int SetEndEffectorSuctionCup(bool enableCtrl, bool suck, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int GetEndEffectorSuctionCup(bool *isCtrlEnabled, bool *isSucked);
extern "C" DOBOTDLLSHARED_EXPORT int SetEndEffectorGripper(bool enableCtrl, bool grip, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int GetEndEffectorGripper(bool *isCtrlEnabled, bool *isGripped);
// Arm orientation
extern "C" DOBOTDLLSHARED_EXPORT int SetArmOrientation(ArmOrientation armOrientation, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int GetArmOrientation(ArmOrientation *armOrientation);
// JOG functions
extern "C" DOBOTDLLSHARED_EXPORT int SetJOGJointParams(JOGJointParams *jointJogParams, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int GetJOGJointParams(JOGJointParams *jointJogParams);
extern "C" DOBOTDLLSHARED_EXPORT int SetJOGCoordinateParams(JOGCoordinateParams *coordinateJogParams, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int GetJOGCoordinateParams(JOGCoordinateParams *coordinateJogParams);
extern "C" DOBOTDLLSHARED_EXPORT int SetJOGLParams(JOGLParams *jogLParams, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int GetJOGLParams(JOGLParams *jogLParams);
extern "C" DOBOTDLLSHARED_EXPORT int SetJOGCommonParams(JOGCommonParams *jogCommonParams, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int GetJOGCommonParams(JOGCommonParams *jogCommonParams);
extern "C" DOBOTDLLSHARED_EXPORT int SetJOGCmd(JOGCmd *jogCmd, bool isQueued, uint64_t *queuedCmdIndex);
// PTP functions
extern "C" DOBOTDLLSHARED_EXPORT int SetPTPJointParams(PTPJointParams *ptpJointParams, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int GetPTPJointParams(PTPJointParams *ptpJointParams);
extern "C" DOBOTDLLSHARED_EXPORT int SetPTPCoordinateParams(PTPCoordinateParams *ptpCoordinateParams, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int GetPTPCoordinateParams(PTPCoordinateParams *ptpCoordinateParams);
extern "C" DOBOTDLLSHARED_EXPORT int SetPTPLParams(PTPLParams *ptpLParams, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int GetPTPLParams(PTPLParams *ptpLParams);
extern "C" DOBOTDLLSHARED_EXPORT int SetPTPJumpParams(PTPJumpParams *ptpJumpParams, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int GetPTPJumpParams(PTPJumpParams *ptpJumpParams);
extern "C" DOBOTDLLSHARED_EXPORT int SetPTPCommonParams(PTPCommonParams *ptpCommonParams, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int GetPTPCommonParams(PTPCommonParams *ptpCommonParams);
extern "C" DOBOTDLLSHARED_EXPORT int SetPTPCmd(PTPCmd *ptpCmd, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int SetPTPWithLCmd(PTPWithLCmd *ptpWithLCmd, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int SetPTPJump2Params(PTPJump2Params *ptpJump2Params, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int GetPTPJump2Params(PTPJump2Params *ptpJump2Params);
extern "C" DOBOTDLLSHARED_EXPORT int SetPTPPOCmd(PTPCmd *ptpCmd, ParallelOutputCmd *parallelCmd, int parallelCmdCount, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int SetPTPPOWithLCmd(PTPWithLCmd *ptpWithLCmd, ParallelOutputCmd *parallelCmd, int parallelCmdCount, bool isQueued, uint64_t *queuedCmdIndex);
// CP functions
extern "C" DOBOTDLLSHARED_EXPORT int SetCPParams(CPParams *cpParams, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int GetCPParams(CPParams *cpParams);
extern "C" DOBOTDLLSHARED_EXPORT int SetCPCmd(CPCmd *cpCmd, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int SetCPLECmd(CPCmd *cpCmd, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int SetCPRHoldEnable(bool isEnable);
extern "C" DOBOTDLLSHARED_EXPORT int GetCPRHoldEnable(bool *isEnable);
extern "C" DOBOTDLLSHARED_EXPORT int SetCPCommonParams(CPCommonParams *cpCommonParams, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int GetCPCommonParams(CPCommonParams *cpCommonParams);
// ARC
extern "C" DOBOTDLLSHARED_EXPORT int SetARCParams(ARCParams *arcParams, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int GetARCParams(ARCParams *arcParams);
extern "C" DOBOTDLLSHARED_EXPORT int SetARCCmd(ARCCmd *arcCmd, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int SetCircleCmd(CircleCmd *circleCmd, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int SetARCCommonParams(ARCCommonParams *arcCommonParams, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int GetARCCommonParams(ARCCommonParams *arcCommonParams);
// WAIT
extern "C" DOBOTDLLSHARED_EXPORT int SetWAITCmd(WAITCmd *waitCmd, bool isQueued, uint64_t *queuedCmdIndex);
// TRIG
extern "C" DOBOTDLLSHARED_EXPORT int SetTRIGCmd(TRIGCmd *trigCmd, bool isQueued, uint64_t *queuedCmdIndex);
// EIO
extern "C" DOBOTDLLSHARED_EXPORT int SetIOMultiplexing(IOMultiplexing *ioMultiplexing, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int GetIOMultiplexing(IOMultiplexing *ioMultiplexing);
extern "C" DOBOTDLLSHARED_EXPORT int SetIODO(IODO *ioDO, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int GetIODO(IODO *ioDO);
extern "C" DOBOTDLLSHARED_EXPORT int SetIOPWM(IOPWM *ioPWM, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int GetIOPWM(IOPWM *ioPWM);
extern "C" DOBOTDLLSHARED_EXPORT int GetIODI(IODI *ioDI);
extern "C" DOBOTDLLSHARED_EXPORT int GetIOADC(IOADC *ioADC);
extern "C" DOBOTDLLSHARED_EXPORT int SetEMotor(EMotor *eMotor, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int SetEMotorS(EMotorS *eMotorS, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int SetColorSensor(bool enable,ColorPort colorPort);
extern "C" DOBOTDLLSHARED_EXPORT int GetColorSensor(uint8_t *r, uint8_t *g, uint8_t *b);
extern "C" DOBOTDLLSHARED_EXPORT int SetInfraredSensor(bool enable,InfraredPort infraredPort);
extern "C" DOBOTDLLSHARED_EXPORT int GetInfraredSensor(InfraredPort port, uint8_t *value);
// CAL
extern "C" DOBOTDLLSHARED_EXPORT int SetAngleSensorStaticError(float rearArmAngleError, float frontArmAngleError);
extern "C" DOBOTDLLSHARED_EXPORT int GetAngleSensorStaticError(float *rearArmAngleError, float *frontArmAngleError);
extern "C" DOBOTDLLSHARED_EXPORT int SetAngleSensorCoef(float rearArmAngleCoef, float frontArmAngleCoef);
extern "C" DOBOTDLLSHARED_EXPORT int GetAngleSensorCoef(float *rearArmAngleCoef, float *frontArmAngleCoef);
extern "C" DOBOTDLLSHARED_EXPORT int SetBaseDecoderStaticError(float baseDecoderError);
extern "C" DOBOTDLLSHARED_EXPORT int GetBaseDecoderStaticError(float *baseDecoderError);
extern "C" DOBOTDLLSHARED_EXPORT int SetLRHandCalibrateValue(float lrHandCalibrateValue);
extern "C" DOBOTDLLSHARED_EXPORT int GetLRHandCalibrateValue(float *lrHandCalibrateValue);
// WIFI
extern "C" DOBOTDLLSHARED_EXPORT int SetWIFIConfigMode(bool enable);
extern "C" DOBOTDLLSHARED_EXPORT int GetWIFIConfigMode(bool *isEnabled);
extern "C" DOBOTDLLSHARED_EXPORT int SetWIFISSID(const char *ssid);
extern "C" DOBOTDLLSHARED_EXPORT int GetWIFISSID(char *ssid, uint32_t maxLen);
extern "C" DOBOTDLLSHARED_EXPORT int SetWIFIPassword(const char *password);
extern "C" DOBOTDLLSHARED_EXPORT int GetWIFIPassword(char *password, uint32_t maxLen);
extern "C" DOBOTDLLSHARED_EXPORT int SetWIFIIPAddress(WIFIIPAddress *wifiIPAddress);
extern "C" DOBOTDLLSHARED_EXPORT int GetWIFIIPAddress(WIFIIPAddress *wifiIPAddress);
extern "C" DOBOTDLLSHARED_EXPORT int SetWIFINetmask(WIFINetmask *wifiNetmask);
extern "C" DOBOTDLLSHARED_EXPORT int GetWIFINetmask(WIFINetmask *wifiNetmask);
extern "C" DOBOTDLLSHARED_EXPORT int SetWIFIGateway(WIFIGateway *wifiGateway);
extern "C" DOBOTDLLSHARED_EXPORT int GetWIFIGateway(WIFIGateway *wifiGateway);
extern "C" DOBOTDLLSHARED_EXPORT int SetWIFIDNS(WIFIDNS *wifiDNS);
extern "C" DOBOTDLLSHARED_EXPORT int GetWIFIDNS(WIFIDNS *wifiDNS);
extern "C" DOBOTDLLSHARED_EXPORT int GetWIFIConnectStatus(bool *isConnected);
//FIRMWARE
extern "C" DOBOTDLLSHARED_EXPORT int UpdateFirmware(FirmwareParams *firmwareParams);
extern "C" DOBOTDLLSHARED_EXPORT int SetFirmwareMode(FirmwareMode *firmwareMode);
extern "C" DOBOTDLLSHARED_EXPORT int GetFirmwareMode(FirmwareMode *firmwareMode);
//LOSTSTEP
extern "C" DOBOTDLLSHARED_EXPORT int SetLostStepParams(float threshold, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int SetLostStepCmd(bool isQueued, uint64_t *queuedCmdIndex);
//UART4 Peripherals
extern "C" DOBOTDLLSHARED_EXPORT int GetUART4PeripheralsType(uint8_t *type);
extern "C" DOBOTDLLSHARED_EXPORT int SetUART4PeripheralsEnable(bool isEnable);
extern "C" DOBOTDLLSHARED_EXPORT int GetUART4PeripheralsEnable(bool *isEnable);
//Function Pluse Mode
extern "C" DOBOTDLLSHARED_EXPORT int SendPluse(PluseCmd *pluseCmd, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int SendPluseEx(PluseCmd *pluseCmd);
// TEST
extern "C" DOBOTDLLSHARED_EXPORT int GetUserParams(UserParams *userParams);
extern "C" DOBOTDLLSHARED_EXPORT int GetPTPTime(PTPCmd *ptpCmd, uint32_t *ptpTime);
extern "C" DOBOTDLLSHARED_EXPORT int GetServoPIDParams(PID *pid);
extern "C" DOBOTDLLSHARED_EXPORT int SetServoPIDParams(PID *pid, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int GetServoControlLoop(uint8_t index, uint8_t *controlLoop);
extern "C" DOBOTDLLSHARED_EXPORT int SetServoControlLoop(uint8_t index, uint8_t controlLoop, bool isQueued, uint64_t *queuedCmdIndex);
extern "C" DOBOTDLLSHARED_EXPORT int SaveServoPIDParams(uint8_t index, uint8_t controlLoop, bool isQueued, uint64_t *queuedCmdIndex);
// Queued command
extern "C" DOBOTDLLSHARED_EXPORT int SetQueuedCmdStartExec(void);
extern "C" DOBOTDLLSHARED_EXPORT int SetQueuedCmdStopExec(void);
extern "C" DOBOTDLLSHARED_EXPORT int SetQueuedCmdForceStopExec(void);
extern "C" DOBOTDLLSHARED_EXPORT int SetQueuedCmdStartDownload(uint32_t totalLoop, uint32_t linePerLoop);
extern "C" DOBOTDLLSHARED_EXPORT int SetQueuedCmdStopDownload(void);
extern "C" DOBOTDLLSHARED_EXPORT int SetQueuedCmdClear(void);
extern "C" DOBOTDLLSHARED_EXPORT int GetQueuedCmdCurrentIndex(uint64_t *queuedCmdCurrentIndex);
#endif // DOBOTDLL_H

Binary file not shown.

File diff suppressed because it is too large Load Diff

@ -0,0 +1,488 @@
#ifndef DOBOTTYPE_H
#define DOBOTTYPE_H
#ifdef _MSC_VER
typedef unsigned char uint8_t;
typedef signed char int8_t;
typedef unsigned short uint16_t;
typedef signed short int16_t;
typedef unsigned int uint32_t;
typedef signed int int32_t;
typedef unsigned long long uint64_t;
typedef signed long long int64_t;
#else
#include <stdint.h>
#endif
/*********************************************************************************************************
** Data structures
*********************************************************************************************************/
/*********************************************************************************************************
** Common parts
*********************************************************************************************************/
#pragma pack(push)
#pragma pack(1)
/*
* Real-time pose
*/
typedef struct tagPose {
float x;
float y;
float z;
float r;
float jointAngle[4];
}Pose;
/*
* Kinematics parameters
*/
typedef struct tagKinematics {
float velocity;
float acceleration;
}Kinematics;
/*
* HOME related
*/
typedef struct tagHOMEParams {
float x;
float y;
float z;
float r;
}HOMEParams;
typedef struct tagHOMECmd {
uint32_t reserved;
}HOMECmd;
typedef struct tagAutoLevelingCmd {
uint8_t controlFlag;
float precision;
}AutoLevelingCmd;
/*
* Hand hold teach
*/
typedef enum tagHHTTrigMode {
TriggeredOnKeyReleased,
TriggeredOnPeriodicInterval
}HHTTrigMode;
/*
* End effector
*/
typedef struct tagEndEffectorParams {
float xBias;
float yBias;
float zBias;
}EndEffectorParams;
/*
* Arm orientation
*/
typedef enum tagArmOrientation {
LeftyArmOrientation,
RightyArmOrientation,
}ArmOrientation;
/*
* JOG related
*/
typedef struct tagJOGJointParams {
float velocity[4];
float acceleration[4];
}JOGJointParams;
typedef struct tagJOGCoordinateParams {
float velocity[4];
float acceleration[4];
}JOGCoordinateParams;
typedef struct tagJOGLParams {
float velocity;
float acceleration;
}JOGLParams;
typedef struct tagJOGCommonParams {
float velocityRatio;
float accelerationRatio;
}JOGCommonParams;
enum {
JogIdle,
JogAPPressed,
JogANPressed,
JogBPPressed,
JogBNPressed,
JogCPPressed,
JogCNPressed,
JogDPPressed,
JogDNPressed,
JogEPPressed,
JogENPressed
};
typedef struct tagJOGCmd {
uint8_t isJoint;
uint8_t cmd;
}JOGCmd;
/*
* PTP related
*/
typedef struct tagPTPJointParams {
float velocity[4];
float acceleration[4];
}PTPJointParams;
typedef struct tagPTPCoordinateParams {
float xyzVelocity;
float rVelocity;
float xyzAcceleration;
float rAcceleration;
}PTPCoordinateParams;
typedef struct tagPTPLParams {
float velocity;
float acceleration;
}PTPLParams;
typedef struct tagPTPJumpParams {
float jumpHeight;
float zLimit;
}PTPJumpParams;
typedef struct tagPTPJump2Params {
float startJumpHeight;
float endJumpHeight;
float zLimit;
}PTPJump2Params;
typedef struct tagPTPCommonParams {
float velocityRatio;
float accelerationRatio;
}PTPCommonParams;
enum PTPMode {
PTPJUMPXYZMode,
PTPMOVJXYZMode,
PTPMOVLXYZMode,
PTPJUMPANGLEMode,
PTPMOVJANGLEMode,
PTPMOVLANGLEMode,
PTPMOVJANGLEINCMode,
PTPMOVLXYZINCMode,
PTPMOVJXYZINCMode,
PTPJUMPMOVLXYZMode,
};
typedef struct tagPTPCmd {
uint8_t ptpMode;
float x;
float y;
float z;
float r;
}PTPCmd;
typedef struct tagPTPWithLCmd {
uint8_t ptpMode;
float x;
float y;
float z;
float r;
float l;
}PTPWithLCmd;
typedef struct tagParallelOutputCmd {
uint8_t ratio;
uint16_t address;
uint8_t level;
}ParallelOutputCmd;
/*
* CP related
*/
typedef struct tagCPParams
{
float planAcc;
float juncitionVel;
union {
float acc;
float period;
};
uint8_t realTimeTrack;
}CPParams;
typedef struct tagCPCommonParams {
float velocityRatio;
float accelerationRatio;
}CPCommonParams;
enum CPMode {
CPRelativeMode,
CPAbsoluteMode
};
typedef struct tagCPCmd {
uint8_t cpMode;
float x;
float y;
float z;
union {
float velocity;
float power;
};
}CPCmd;
/*
* ARC related
*/
typedef struct tagARCParams {
float xyzVelocity;
float rVelocity;
float xyzAcceleration;
float rAcceleration;
}ARCParams;
typedef struct tagARCCommonParams {
float velocityRatio;
float accelerationRatio;
}ARCCommonParams;
typedef struct tagARCCmd {
struct {
float x;
float y;
float z;
float r;
}cirPoint;
struct {
float x;
float y;
float z;
float r;
}toPoint;
}ARCCmd;
typedef struct tagCircleCmd {
struct {
float x;
float y;
float z;
float r;
}cirPoint;
struct {
float x;
float y;
float z;
float r;
}toPoint;
uint32_t count;
}CircleCmd;
typedef struct tagWAITCmd {
uint32_t timeout;
}WAITCmd;
typedef enum tagTRIGMode {
TRIGInputIOMode,
TRIGADCMode
}TRIGMode;
typedef enum tagTRIGInputIOCondition {
TRIGInputIOEqual,
TRIGInputIONotEqual
}TRIGInputIOCondition;
typedef enum tagTRIGADCCondition {
TRIGADCLT, // Lower than
TRIGADCLE, // Lower than or Equal
TRIGADCGE, // Greater than or Equal
TRIGADCGT // Greater Than
}TRIGADCCondition;
typedef struct tagTRIGCmd {
uint8_t address;
uint8_t mode;
uint8_t condition;
uint16_t threshold;
}TRIGCmd;
typedef enum tagIOFunction {
IOFunctionDummy,
IOFunctionDO,
IOFunctionPWM,
IOFunctionDI,
IOFunctionADC
}IOFunction;
typedef struct tagIOMultiplexing {
uint8_t address;
uint8_t multiplex;
}IOMultiplexing;
typedef struct tagIODO {
uint8_t address;
uint8_t level;
}IODO;
typedef struct tagIOPWM {
uint8_t address;
float frequency;
float dutyCycle;
}IOPWM;
typedef struct tagIODI {
uint8_t address;
uint8_t level;
}IODI;
typedef struct tagIOADC {
uint8_t address;
uint16_t value;
}IOADC;
typedef struct tagEMotor {
uint8_t index;
uint8_t isEnabled;
int32_t speed;
}EMotor;
typedef struct tagEMotorS {
uint8_t index;
uint8_t isEnabled;
int32_t speed;
uint32_t distance;
}EMotorS;
/*
* WIFI related
*/
typedef struct tagWIFIIPAddress {
uint8_t dhcp;
uint8_t addr[4];
}WIFIIPAddress;
typedef struct tagWIFINetmask {
uint8_t addr[4];
}WIFINetmask;
typedef struct tagWIFIGateway {
uint8_t addr[4];
}WIFIGateway;
typedef struct tagWIFIDNS {
uint8_t addr[4];
}WIFIDNS;
/*
* Test
*/
typedef struct tagUserParams{
float params[8];
}UserParams;
/*
* Firmware related
*/
enum FirmwareSwitchMode{
NO_SWITCH,
DOBOT_SWITCH,
PRINTING_SWITCH,
DRIVER1_SWITCH,
DRIVER2_SWITCH,
DRIVER3_SWITCH,
DRIVER4_SWITCH,
DRIVER5_SWITCH
};
typedef struct tagFirmwareParams {
uint8_t mode;
}FirmwareParams;
enum FirewareMode{
INVALID_MODE,
DOBOT_MODE,
PRINTING_MODE,
OFFLINE_MODE
};
typedef struct tagFirmwareModes {
uint8_t mode;
uint8_t ctl; //0 or 1
}FirmwareMode;
typedef enum tagServoControlLoop{
ServoPositionLoop,
ServoVelocityLoop,
ServoCurrentLoop
}ServoControlLoop;
typedef struct tagPIDParams{
float p;
float i;
float d;
float v;
float a;
}PIDParams;
typedef struct tagPID{
uint8_t index;
uint8_t controlLoop;
PIDParams params;
}PID;
typedef enum tagColorPort{
CL_PORT_GP1,
CL_PORT_GP2,
CL_PORT_GP4,
CL_PORT_GP5
}ColorPort;
typedef enum tagInfraredPort{
IF_PORT_GP1,
IF_PORT_GP2,
IF_PORT_GP4,
IF_PORT_GP5
}InfraredPort;
typedef enum tagUART4PeripheralsType {
UART4PeripheralsUART,
UART4PeripheralsWIFI,
UART4PeripheralsBLE,
UART4PeripheralsCH375
} UART4PeripheralsType;
typedef struct tagPluseCmd {
float j1;
float j2;
float j3;
float j4;
float e1;
float e2;
} PluseCmd;
/*********************************************************************************************************
** API result
*********************************************************************************************************/
enum {
DobotConnect_NoError,
DobotConnect_NotFound,
DobotConnect_Occupied
};
enum {
DobotCommunicate_NoError,
DobotCommunicate_BufferFull,
DobotCommunicate_Timeout,
DobotCommunicate_InvalidParams
};
#pragma pack(pop)
#endif

@ -0,0 +1,12 @@
#ifndef DOBOTDLL_GLOBAL_H
#define DOBOTDLL_GLOBAL_H
#include <QtCore/qglobal.h>
#if defined(DOBOTDLL_LIBRARY)
# define DOBOTDLLSHARED_EXPORT Q_DECL_EXPORT
#else
# define DOBOTDLLSHARED_EXPORT Q_DECL_IMPORT
#endif
#endif // DOBOTDLL_GLOBAL_H

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save