Dobot Magician API DescriptionV1.2.3
Dobot Magician API DescriptionV1.2.3
Issue: V1.2.3
Date: 2019-07-19
Copyright © ShenZhen Yuejiang Technology Co., Ltd 2018. All rights reserved.
No part of this document may be reproduced or transmitted in any form or by any means
without prior written consent of Yuejiang Technology Co., Ltd
Disclaimer
To the maximum extent permitted by applicable law, the products described (including its
hardware, software and firmware, etc.) in this document are provided AS IS, which may have flaws,
errors or faults. Yuejiang makes no warranties of any kind, express or implied, including but not
limited to, merchantability, satisfaction of quality, fitness for a particular purpose and non-
infringement of third party rights. In no event will Yuejiang be liable for any special, incidental,
consequential or indirect damages resulting from the use of our products and documents.
Before using our product, please thoroughly read and understand the contents of this document
and related technical documents that are published online, to ensure that the robotic arm is used on
the premise of fully understanding the robotic arm and related knowledge. Please use this document
with technical guidance from professionals. Even if follow this document or any other related
instructions, Damages or losses will be happen in the using process, Dobot shall not be considered
as a guarantee regarding to all security information contained in this document.
The user has the responsibility to make sure following the relevant practical laws and
regulations of the country, in order that there is no significant danger in the use of the robotic arm.
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
i
Dobot Magician API Description Preface
Preface
Purpose
The document is aiming to have a detailed description of Dobot API and general process of
Dobot API development program.
Intended Audience
This document is intended for:
Customer Engineer
Installation and Commissioning Engineer
Technical Support Engineer
Change History
Add the description of the relationship between the speed and speed rate
Symbol Conventions
The symbols that may be founded in this document are defined as follows.
Symbol Description
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
ii
Dobot Magician API Description Contents
Contents
Dobot Commands..................................................................................................... 1
Command Timeout .................................................................................................. 2
Setting Command Timeout ............................................................................................... 2
Connect/Disconnect.................................................................................................. 3
Searching for the Dobot .................................................................................................... 3
Connecting to the Dobot ................................................................................................... 3
Disconnecting the Dobot................................................................................................... 4
Demo: Connection Example ............................................................................................. 4
Command queue controlling ................................................................................... 6
Starting Command in Command queue ............................................................................ 6
Stopping Command in Command queue .......................................................................... 6
Stopping Command in Command queue Forcedly ........................................................... 6
Demo: Processing PTP Command and Control Queue Synchronously ............................ 7
Demo: Processing PTP Command and Controlling Queue Asynchronously .................... 8
Downloading Commands.................................................................................................. 9
Stopping Downloading Commands. ................................................................................. 9
Demo: Downloading PTP Command................................................................................ 9
Clearing Command queue............................................................................................... 10
Getting Command Index ................................................................................................. 10
Demo: Checking Whether the Commands Have Been Executed ................................... 11
Device Information ................................................................................................ 13
Setting the Device Serial Number ................................................................................... 13
Getting the Device Serial Number .................................................................................. 13
Setting the Device Name ................................................................................................ 13
Getting the Device Name ................................................................................................ 13
Getting the Device Version ............................................................................................. 14
Setting the Sliding Rail Status ........................................................................................ 14
Getting the Sliding Rail Status ........................................................................................ 15
Getting the Device Clock ................................................................................................ 15
Real-time pose ........................................................................................................ 16
Getting the Real-time Pose of the Dobot ........................................................................ 16
Getting the Real-time Pose of the Sliding Rail ............................................................... 16
Resetting the Reference Value of the Real-time Pose ..................................................... 17
ALARM .................................................................................................................. 18
Getting the Alarm Status ................................................................................................. 18
Clearing the Statuses of All Alarms ................................................................................ 18
Homing Function ................................................................................................... 19
Setting the Homing Position ........................................................................................... 19
Getting the Homing Position .......................................................................................... 19
Executing the Homing Function ..................................................................................... 20
Executing the Automatic Leveling Function................................................................... 20
Getting the Automatic Leveling Results ......................................................................... 21
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
iii
Dobot Magician API Description Contents
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
vi
Dobot Magician API Description 1 Dobot Commands
Dobot Commands
Dobot controller supports two kind of commands: Immidiate command and queue command:
Immidiate command: Dobot controller will process the command once received
regardless of whether there is the rest commands processing or not in the current
controller;
Queue command: When Dobot controller receives a command, this command will be
pressed into the controller internal command queue. Dobot controller will execute
commands in the order in which the commands were pressed into the queue.
For more detailed information about Dobot commands, please refer to Dobot protocol.
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
1
Dobot Magician API Description 2 Command Timeout
Command Timeout
Description Set command timeout. If a command is required to return data within a given
time after issuing it, please call this API to set timeout to check whether the
return of this command is overtime
NOTE
API returns result as an enumerate type. You can view them in the DobotType.h file.
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
2
Dobot Magician API Description 3 Connect/Disconnect
Connect/Disconnect
Description Search for Dobot, DLL will store the information of Dobot that has been
searched for and use ConnectDobot to connect the searched Dobot
Parameter dobotNameList: String pointer, DLL will write serial port/UDP searched into
dobotNameList. For example, a specific dobotNameList is "COM1 COM3
COM6 192.168.0.5", different serial port or IP address should be separated
by the space
maxLen: Maximum String length, to avoid memory overflow
Description Connecing to the Dobot. In this process, portName can be obtained from
dobotList in the SearchDobot(char *dobotList, uint32_t maxLen) API.
If portName is empty, and ConnectDobot is called directly, DLL will
connect the random searched Dobot automatically
Parameter portName: Dobot port. As for the serial port, portName is COM3; While for
UDP, portName is 192.168.0.5
baudrate: Baud rates. Value: 115200
fwType: Firmware type. Dobot or Marlin
version: Version
time: Timeout
NOTICE
In order to make the API recognize the Dobot controller interface, please install the
required driver in advance. For more details, please refer to Dobot User Guide.
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
3
Dobot Magician API Description 3 Connect/Disconnect
Parameter None
#include "DobotDll.h"
int main(void)
{
int maxDevCount = 100;
int maxDevLen = 20;
SearchDobot(devsChr, 1024);
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
4
Dobot Magician API Description 3 Connect/Disconnect
// Control Dobot
DisconnectDobot();
delete[] devsChr;
for(int i=0; i<maxDevCount; i++)
delete[] devsList[i];
delete[] devsList;
}
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
5
Dobot Magician API Description 4 Command queue controlling
NOTICE
Only the API where the isQueued parameter is set to 1 can be added to the command
queue.
Description The Dobot controller starts to query command queue periodically. If there
are commands in queue, Dobot controller will take them out and execute the
commands in order, indicating that Dobot executes commands one after
another
Parameter None
Description The Dobot controller stops to query command queue and execute command.
However, if one command is being executed when this API is called, this
command will continue to be executed.
Parameter None
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
6
Dobot Magician API Description 4 Command queue controlling
Description Dobot controller stops to query command queue and execute command. If
one command is being executed when this API is called, this command will
be stopped forcedly.
Parameter None
#include "DobotDll.h"
int main(void)
uint64_t queuedCmdIndex = 0;
PTPCmd cmd;
cmd.ptpMode = 0;
cmd.x = 200;
cmd.y = 0;
cmd.z = 0;
cmd.r = 0;
SetQueuedCmdStartExec();
SetQueuedCmdStopExec();
DisconnectDobot();
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
7
Dobot Magician API Description 4 Command queue controlling
#include "DobotDll.h"
// Main thread
int main(void)
int onButtonClick()
if (flag)
SetQueuedCmdStartExec();
else
SetQueuedCmdStopExec();
// Child thread
int thread(void)
uint64_t queuedCmdIndex = 0;
PTPCmd cmd;
cmd.ptpMode = 0;
cmd.x = 200;
cmd.y = 0;
cmd.z = 0;
cmd.r = 0;
while(true)
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
8
Dobot Magician API Description 4 Command queue controlling
Downloading Commands
The Dobot controller supports downloading commands to the controller's external Flash, and
the commands can be triggered by pressing the keys on the controller. That is, the operation is in
offline mode.
Description Stop downloading commands. If the Dobot is in offline mode, please call this
API
Parameter None
#include "DobotDll.h"
int main(void)
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
9
Dobot Magician API Description 4 Command queue controlling
uint64_t queuedCmdIndex = 0;
PTPCmd cmd;
cmd.ptpMode = 0;
cmd.x = 200;
cmd.y = 0;
cmd.z = 0;
cmd.r = 0;
SetQueuedCmdStartDownload(2, 1);
SetQueuedCmdStopDownload();
DisconnectDobot();
Parameter None
command, the counter will automatically increment. With this internal index, you can get how many
commands the controller has executed.
Description Get the index of the command the controller has executed currently
#include "DobotDll.h"
int main(void)
uint64_t queuedCmdIndex = 0;
uint64_t executedCmdIndex = 0;
PTPCmd cmd;
cmd.ptpMode = 0;
cmd.x = 200;
cmd.y = 0;
cmd.z = 0;
cmd.r = 0;
SetQueuedCmdStartExec();
// Check whether the commands have been executed by comparing the indexes
GetQueuedCmdCurrentIndex(&executedCmdIndex);
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
11
Dobot Magician API Description 4 Command queue controlling
SetQueuedCmdStopExec();
DisconnectDobot();
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
12
Dobot Magician API Description 5 Device Information
Device Information
Description Set the device serial number. This API is valid only when shipped out (The
special password is required)
Description Set the device name. When there are multiple machines, you can use this API
to set the device name for distinction
Description Get the device name. When there are multiple machines, you can use this
API to get the device name for distinction.
Description Set the sliding rail status. When the sliding rail kit is used, please call this
API. Only the status of the sliding rail is enabled, the commands related to
the sliding rail can be effected.
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
14
Dobot Magician API Description 5 Device Information
V2.0
Description Get the sliding rail status. When the sliding rail kit is used, please call this
API
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
15
Dobot Magician API Description 6 Real-time pose
Real-time pose
In DobotV2.0, the Dobot controller calculates the reference value of the real-time pose based
on the following information.
Encoder value on the base (can be obtained by Homing).
Rear Arm angle sensor value (power on or press UNLOCK button on Forearm);
Forearm angle sensor value (power on or press UNLOCK button on Forearm).
When controlling the Dobot, the Dobot controller will update the real-time pose based on the
reference value and the real-time motion status.
Parameter Pose:
typedef struct tagPose {
float x; //Cartesian coordinate system X-axis
float y; //Cartesian coordinate system Y-axis
float z; // Cartesian coordinate system Z-axis
float r; //Cartesian coordinate system R-axis
float jointAngle[4]; //Joints (including base, Rear Arm, Forearm, and
End-effector) angles
}Pose;
Pose: Pose pointer
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
16
Dobot Magician API Description 6 Real-time pose
timeout
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
17
Dobot Magician API Description 7 ALARM
ALARM
Parameter alarmsState: The first address of the array. Each byte in the array
alarmsState identifies the alarms status of the eight alarm items, with the
MSB (Most Significant Bit) at the top and LSB (Least Significant Bit) at the
bottom.
len: The byte occupied by the alarm.
maxLen: Maximum array length, to avoid overflow
Parameter None
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
18
Dobot Magician API Description 8 Homing Function
Homing Function
If your Dobot is running too fast or the load is too large for the dobot, the position precision
can be reduced. You can execute the homing function to improve the precision.
Parameter HOMEParams:
typedef struct tagHOMEParams {
float x; //Cartesian coordinate system X-axis
float y; //Cartesian coordinate system Y-axis
float z; // Cartesian coordinate system Z-axis
float r; //Cartesian coordinate system R-axis
}HOMEParams;
homeParams: HOMEParams pointer
isQueued: Whether to add this command to the queue
queuedCmdIndex: If this command is added to the queue, queuedCmdIndex
indicates the index of this command in the queue. Otherwise, it is invalid.
Parameter HOMEParams:
typedef struct tagHOMEParams {
float x; //Cartesian coordinate system X-axis
float y; //Cartesian coordinate system Y-axis
float z; // Cartesian coordinate system Z-axis
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
19
Dobot Magician API Description 8 Homing Function
Description Execute the homing function. If you call the SetHOMEParams API before
calling this API, Dobot will move to the user-defined position. If not, Dobot
will move to the default position directly.
Parameter HOMECmd:
typedef struct tagHOMECmd {
uint32_t reserved; // Reserved for future use
}HOMECmd;
homeCmd: HOMECmd pointer
isQueued: Whether to add this command to the queue
queuedCmdIndex: If this command is added to the queue, queuedCmdIndex
indicates the index of this command in the queue. Otherwise, it is invalid.
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
20
Dobot Magician API Description 8 Homing Function
Parameter AutoLevelingCmd :
typedef struct tagAutoLevelingCmd{
uint8_t controlFlag; //Enabe Flag
float precision; //Leveling precision, the minimum is 0.02
}AutoLevelingCmd;
autoLevelingCmd : AutoLevelingCmd pointer
isQueued: Whether to add this command to the queue
queuedCmdIndex: If this command is added to the queue, queuedCmdIndex
indicates the index of this command in the queue. Otherwise, it is invalid
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
21
Dobot Magician API Description 9 HHT Function
HHT Function
HHT indicates Hand-Hold Teaching. In general, you can press and hold down Unlock key on
Forearm and drag Dobot to any position. And then save point after releasing Unlock key.
Description Set the hand-hold teaching triggering mode. If this API is not called, Dobot
will save points when releasing the UNLOCK key on Forearm
Parameter HHTTrigMode:
typedef enum tagHHTTrigMode {
TriggedOnKeyReleased, //Trigger when releasing the
UNLOCK key
TriggeredOnPeriodicInterval //Trigger when pressing the
UNLOCK key
}HHTTrigMode;
hhtTrigMode: HHTTrigMode enum
Parameter HHTTrigMode:
typedef enum tagHHTTrigMode {
TriggedOnKeyReleased, //Trigger when releasing the
UNLOCK key
TriggeredOnPeriodicInterval //Trigger when pressing the
UNLOCK key
}HHTTrigMode;
hhtTrigMode: HHTTrigMode enum
timeout
#include "DobotDll.h"
#include <queue>
#include <windows.h>
int main(void)
SetHHTTrigMode(TriggeredOnPeriodicInterval);
SetHHTTrigOutputEnabled(true);
queue<Pose> poseQueue;
Pose pose;
while(true) {
GetHHTTrigOutput(&isTriggered);
if(isTriggered) {
GetPose(&pose);
poseQueue.push(pose);
DisconnectDobot();
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
24
Dobot Magician API Description 10 End-effector
End-effector
Description Set the offset of the end-effector. If the end-effector is installed, this API is
required
If a standard end-effector is used, please refer to Dobot Magician User Guide
to obtain the X-axis offset and Y-axis offset and call this API. Otherwise,
please confirm the structural parameters.
Parameter EndEffectorParams:
typedef struct tagEndEffectorParams {
float xBias; //X-axis offset of end-effector
float yBias; //Y-axis offset of end-effector
float zBias; //Z-axis offset of end-effector
}EndEffectorParams;
endEffectorParams: EndEffectorParams pointer
isQueued: Whether to add this command to the queue
queuedCmdIndex: If this command is added to the queue, queuedCmdIndex
indicates the index of this command in the queue. Otherwise, it is invalid.
Parameter EndEffectorParams:
typedef struct tagEndEffectorParams {
float xBias; //X-axis offset of end-effector
float yBias; //Y-axis offset of end-effector
float zBias; //Z-axis offset of end-effector
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
25
Dobot Magician API Description 10 End-effector
}EndEffectorParams;
endEffectorParams: EndEffectorParams pointer
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
26
Dobot Magician API Description 10 End-effector
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
27
Dobot Magician API Description 10 End-effector
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
28
Dobot Magician API Description 11 JOG
JOG
When doing jogging, the method calculating the velocity and acceleration for each axis (in
Joint or Cartesian coordinate system) is shown as follows.
Actual jogging velocity = the set jogging velocity * the set jogging velocity rate
Actual jogging acceleration = the set jogging acceleration* the set jogging acceleration
rate
Description Set the velocity(°/s) and acceleration (°/s2) of the joint coordinate axis
when jogging
Parameter JOGJointParams:
typedef struct tagJOGJointParams {
float velocity[4]; //Joint velocity
float acceleration[4]; //Joint acceleration
}JOGJointParams;
jogJointParams: JOGJointParams pointer
isQueued: Whether to add this command to the queue
queuedCmdIndex: If this command is added to the queue, queuedCmdIndex
indicates the index of this command in the queue. Otherwise, it is invalid
Description Get the velocity(°/s) and acceleration (°/s2) of the joint coordinate axis
when jogging
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
29
Dobot Magician API Description 11 JOG
Parameter JOGJointParams:
typedef struct tagJOGJointParams {
float velocity[4]; //Joint velocity
float acceleration[4]; //Joint acceleration
}JOGJointParams;
jogJointParams: JOGJointParams pointer
Parameter JOGCoordinateParams:
typedef struct tagJOGCoordinateParams {
float velocity[4]; //Cartesian coordinate axis (X,Y,Z,R)velocity
float acceleration[4]; //Cartesian coordinate axis (X,Y,Z,R)
acceleration
}JOGCoordinateParams;
jogCoordinateParams: JOGCoordinateParams pointer
isQueued: Whether to add this command to the queue
queuedCmdIndex: If this command is added to the queue, queuedCmdIndex
indicates the index of this command in the queue. Otherwise, it is invalid.
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
30
Dobot Magician API Description 11 JOG
*jogCoordinateParams)
Description Set the velocity(mm/s) and acceleration(mm/s2) of the sliding rail when
jogging
Parameter JOGLParams:
typedef struct tagJOGLParams {
float velocity; //Sliding rail velocity
float acceleration; //Sliding rail acceleration
}JOGLParams;
jogLParams: JOGLParams
isQueued: Whether to add this command to the queue
queuedCmdIndex: If this command is added to the queue, queuedCmdIndex
indicates the index of this command in the queue. Otherwise, it is invalid.
Table 11.6 Get the velocity and acceleration of the sliding rail when jogging
Description Get the velocity(mm/s) and acceleration(mm/s2) of the sliding rail when
jogging
Parameter JOGLParams:
typedef struct tagJOGLParams {
float velocity; //Sliding rail velocity
float acceleration; //Sliding rail acceleration
}JOGLParams;
jogLParams: JOGLParams
Table 11.7 Set the velocity ratio and acceleration ratio when jogging
Description Set the velocity ratio and acceleration ratio for each axis (in both Joint and
Cartesian coordinate system) when jogging
Parameter JOGCommonParams:
typedef struct tagJOGCommonParams {
float velocityRatio; //Velocity ratio
float accelerationRatio; //Acceleration ratio
}JOGCommonParams;
jogCommonParams: JOGCommonParams pointer
isQueued: Whether to add this command to the queue
queuedCmdIndex: If this command is added to the queue, queuedCmdIndex
indicates the index of this command in the queue. Otherwise, it is invalid
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
32
Dobot Magician API Description 11 JOG
Description Get the velocity ratio and acceleration ratio for each axis (in Joint and
Cartesian coordinate system) when jogging
Parameter JOGCommonParams:
typedef struct tagJOGCommonParams {
float velocityRatio; //Velocity ratio
float accelerationRatio; //Acceleration ratio
}JOGCommonParams;
jogCommonParams: JOGCommonParams pointer
Description Execute the Jogging command. Please call this API after setting the related
parameters of jogging
Parameter JOGCmd:
typedef struct tagJOGCmd {
uint8_t isJoint; //Jogging mode: 0, Jog in Cartesian coordinate
system. 1, Jog in Joint coordinate system
uint8_t cmd; //Jogging command: 0-10
}JOGCmd;
//Details for jogging commands
enum {
IDLE, // Idle
AP_DOWN, // X+/Joint1+
AN_DOWN, // X-/Joint1-
BP_DOWN, // Y+/Joint2+
BN_DOWN, // Y-/Joint2-
CP_DOWN, // Z+/Joint3+
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
33
Dobot Magician API Description 11 JOG
CN_DOWN, // Z-/Joint3-
DP_DOWN, // R+/Joint4+
DN_DOWN, // R-/Joint4-
LP_DOWN, // L+. Only when the parameter isJoint=1, the LP_DOWN
is available
LN_DOWN // L-. Only when the parameter isJoint=1, the LN_DOWN
is available
};
jogCmd: JOGCmd pointer
isQueued: Whether to add this command to the queue
queuedCmdIndex: If this command is added to the queue, queuedCmdIndex
indicates the index of this command in the queue. Otherwise, it is invalid
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
34
Dobot Magician API Description 12 PTP
PTP
PTP mode supports MOVJ, MOVL, and JUMP, which is point-to-point movement. The
trajectory of playback depends on the motion mode.
MOVJ: Joint movement. From point A to point B, each joint will run from initial angle to
its target angle, regardless of the trajectory, as shown in Figure 12.1.
MOVL: Rectilinear movement. The joints will perform a straight line trajectory from
point A to point B, as shown in Figure 12.1.
JUMP: From point A to point B, the trajectory is shown in Figure 12.2., the end effector
will lift upwards by amount of Height (in mm) and move horizontally to a point that
is above B by Height and then move down to Point B.
When doing playback, the method calculating the velocity and acceleration for each axis (in
Joint or Cartesian coordinate system) is shown as follows.
Actual playback velocity = the set playback velocity * the set playback velocity rate
Actual playback acceleration = the set playback acceleration* the set playback
acceleration rate
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
35
Dobot Magician API Description 12 PTP
Description Set the velocity(°/s) and acceleration(°/s2) of the joint coordinate axis in
PTP mode
Parameter PTPJointParams:
typedef struct tagPTPJointParams {
float velocity[4]; // Joint velocity in PTP mode
float acceleration[4]; //Joint acceleration in PTP mode
}PTPJointParams;
ptpJointParams: PTPJointParams pointer
isQueued: Whether to add this command to the queue
queuedCmdIndex: If this command is added to the queue, queuedCmdIndex
indicates the index of this command in the queue. Otherwise, it is invalid
Description Get the velocity(°/s) and acceleration(°/s2) of the joint coordinate axis in
PTP mode
Parameter PTPJointParams
typedef struct tagPTPJointParams {
float velocity[4]; //Joint velocity in PTP mode
float acceleration[4]; //Joint acceleration in PTP mode
}PTPJointParams;
ptpJointParams: PTPJointParams pointer
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
36
Dobot Magician API Description 12 PTP
timeout
Parameter PTPCoordinateParams:
typedef struct tagPTPCoordinateParams {
float xyzVelocity; //Cartesian coordinate axis (X,Y,Z) velocity
float rVelocity; // Cartesian coordinate axis (R) velocity
float xyzAcceleration; //Cartesian coordinate axis (X,Y,Z)
acceleration
float rAcceleration; //Cartesian coordinate axis (R) acceleration
}PTPCoordinateParams;
ptpCoordinateParams: PTPCoordinateParams pointer
isQueued: Whether to add this command to the queue
queuedCmdIndex: If this command is added to the queue, queuedCmdIndex
indicates the index of this command in the queue. Otherwise, it is invalid
Parameter PTPCoordinateParams:
typedef struct tagPTPCoordinateParams {
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
37
Dobot Magician API Description 12 PTP
Setting the Lifting Height and the Maximum Lifting Height in JUMP
mode
Table 12.5 Set the lifting height and the maximum lifting height in JUMP mode
Description Set the lifting height and the maximum height in JUMP mode
Parameter PTPJumpParams:
typedef struct tagPTPJumpParams {
float jumpHeight; //Lifting height
float zLimit; //Maximum lifting height
}PTPJumpParams;
ptpJumpParams: PTPJumpParams pointer
isQueued: Whether to add this command to the queue
queuedCmdIndex: If this command is added to the queue, queuedCmdIndex
indicates the index of this command in the queue. Otherwise, it is invalid
Getting the Lifting Height and the Maximum Lifting Height in JUMP
mode
Table 12.6 Get the lifting height and the maximum lifting height in JUMP mode
Description Get the lifting height and the maximum lifting height in JUMP mode
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
38
Dobot Magician API Description 12 PTP
Parameter PTPJumpParams:
typedef struct tagPTPJumpParams {
float jumpHeight; //Lifting height
float zLimit; //Maximum lifting height
}PTPJumpParams;
ptpJumpParams: PTPJumpParams pointer
Parameter PTPJump2Params:
typedef struct tagPTPJump2Params {
float startJumpHeight; //Lifting height of starting point
float endJumpHeight; //Lifting height of end point
float zLimit; //Maximum lifting height
}PTPJump2Params;
ptpJump2Params: PTPJump2Params pointer
isQueued: Whether to add this command to the queue
queuedCmdIndex: If this command is added to the queue, queuedCmdIndex
indicates the index of this command in the queue. Otherwise, it is invalid
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
39
Dobot Magician API Description 12 PTP
Parameter PTPJump2Params:
typedef struct tagPTPJump2Params {
float startJumpHeight; //Lifting height of starting point
float endJumpHeight; //Lifting height of end point
float zLimit; //Maximum lifting height
}PTPJump2Params;
Description Set the velocity(mm/s) and acceleration(mm/s2) of the sliding rail in PTP
mode
Parameter PTPLParams:
typedef struct tagPTPJointParams {
float velocity; //Sliding rail velocity in PTP mode
float acceleration; //Sliding rail acceleration in PTP mode
}PTPLParams;
ptpLParams: PTPLParams pointer
isQueued: Whether to add this command to the queue
queuedCmdIndex: If this command is added to the queue, queuedCmdIndex
indicates the index of this command in the queue. Otherwise, it is invalid
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
40
Dobot Magician API Description 12 PTP
Description Get the velocity(mm/s) and acceleration(mm/s2) of the sliding rail in PTP
mode
Parameter PTPLParams:
typedef struct tagPTPJointParams {
float velocity; //Sliding rail velocity in PTP mode
float acceleration; //Sliding rail acceleration in PTP mode
}PTPLParams;
ptpLParams: PTPLParams pointer
Description Set the velocity ratio and acceleration ratio in PTP mode
Parameter PTPCommonParams:
typedef struct tagPTPCommonParams {
float velocityRatio; //Velocity ratio
float accelerationRatio; //Acceleration ratio
}PTPCommonParams;
ptpCommonParams: PTPCommonParams pointer
isQueued: Whether to add this command to the queue
queuedCmdIndex: If this command is added to the queue, queuedCmdIndex
indicates the index of this command in the queue. Otherwise, it is invalid
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
41
Dobot Magician API Description 12 PTP
Description Get the velocity ratio and acceleration ratio in PTP mode
Parameter PTPCommonParams:
typedef struct tagPTPCommonParams {
float velocityRatio; //Velocity ratio
float accelerationRatio; //Acceleration ratio
}PTPCommonParams;
ptpCommonParams: PTPCommonParams pointer
Description Execute a PTP command. Please call this API after setting the related
parameters in PTP mode to make the Dobot move to the target point
Parameter PTPCmd:
typedef struct tagPTPCmd {
uint8_t ptpMode; //PTP mode (0-9)
float x; //Coordinate parameters in PTP mode. (x,y,z,r)
can be set to Cartesian coordinate, joints
angle, or increment of them
float y;
float z;
float r;
}PTPCmd;
Details for ptpMode:
enum {
JUMP_XYZ, //JUMP mode, (x,y,z,r) is the target point in
Cartesian coordinate system
MOVJ_XYZ, //MOVJ mode, (x,y,z,r) is the target point in
Cartesian coordinate system
MOVL_XYZ, //MOVL mode, (x,y,z,r) is the target point in
Cartesian coordinate system
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
42
Dobot Magician API Description 12 PTP
Parameter PTPCmd:
typedef struct tagPTPCmd {
uint8_t ptpMode; //PTP mode (0-9)
float x; //Coordinate parameters in PTP mode. (x,y,z,r)
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
43
Dobot Magician API Description 12 PTP
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
44
Dobot Magician API Description 12 PTP
}ParallelOutputCmd;
ptpCmd: PTPCmd pointer
parallelCmd: ParallelOutputCmd pointer
parallelCmdCount::I/O number
isQueued: Whether to add this command to the queue
queuedCmdIndex: If this command is added to the queue, queuedCmdIndex
indicates the index of this command in the queue. Otherwise, it is invalid
Parameter PTPWithLCmd
typedef struct tagPTPWithL {
uint8_t ptpMode; //PTP mode (0-9)
float x; //Coordinate parameters in PTP mode. (x,y,z,r)
can be set to Cartesian coordinate, joints
angle, or increment of them
float y;
float z;
float r;
float l; //The distance that sliding rail moves
}PTPWithLCmd ;
Details for ptpMode:
enum {
JUMP_XYZ, //JUMP mode, (x,y,z,r) is the target point in
Cartesian coordinate system
MOVJ_XYZ, //MOVJ mode, (x,y,z,r) is the target point in
Cartesian coordinate system
MOVL_XYZ, //MOVL mode, (x,y,z,r) is the target point in
Cartesian coordinate system
JUMP_ANGLE, //JUMP mode, (x,y,z,r) is the target point in
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
45
Dobot Magician API Description 12 PTP
Executing a PTP Command with the Sliding Rail and I/O Control
Table 12.16 Execute a PTP command with the sliding rail and I/O control
Description Execute a PTP command with the sliding rail and I/O control
Parameter PTPWithLCmd
typedef struct tagPTPWithL {
uint8_t ptpMode; //PTP mode (0-9)
float x; //Coordinate parameters in PTP mode. (x,y,z,r)
can be set to Cartesian coordinate, joints
angle, or increment of them
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
46
Dobot Magician API Description 12 PTP
float y;
float z;
float r;
float l; //The distance that sliding rail moves
}PTPWithLCmd;
Details for ptpMode:
enum {
JUMP_XYZ, //JUMP mode, (x,y,z,r) is the target point in
Cartesian coordinate system
MOVJ_XYZ, //MOVJ mode, (x,y,z,r) is the target point in
Cartesian coordinate system
MOVL_XYZ, //MOVL mode, (x,y,z,r) is the target point in
Cartesian coordinate system
JUMP_ANGLE, //JUMP mode, (x,y,z,r) is the target point in
Joint coordinate system
MOVJ_ANGLE, //MOVJ mode, (x,y,z,r) is the target point in
Joint coordinate system
MOVL_ANGLE, //MOVL mode, (x,y,z,r) is the target point in
Joint coordinate system
MOVJ_INC, //MOVJ mode, (x,y,z,r) is the angle increment
in Joint coordinate system
MOVL_INC, //MOVL mode, (x,y,z,r) is the Cartesian
coordinate increment in Joint coordinate
system
MOVJ_XYZ_INC, //MOVJ mode, (x,y,z,r) is the Cartesian
coordinate increment in Cartesian
coordinate system
JUMP_MOVL_XYZ, //JUMP mode, (x,y,z,r) is the Cartesian
coordinate increment in Cartesian
coordinate system
};
ParallelOutputCmd:
typedef struct tagParallelOutputCmd {
uint8_t ratio; //The distance ratio between the two points in
PTP mode, namely, the position where I/O
is triggered
uint16_t address; //I/O address (0-20)
uint8_t level; //Output value
}ParallelOutputCmd;
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
47
Dobot Magician API Description 12 PTP
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
48
Dobot Magician API Description 13 CP
CP
CP: Continuous Path.
Parameter CPParams
typedef struct tagCPParams {
float planAcc; //The maximum planning acceleration
float junctionVel; //The maximum junction velocity
union {
float acc; //The maximum actual acceleration. It is
valid only when realTimeTrack is set to
0
float period; //Interpolation period. It is valid only when
realTimeTrack is set to 1
};
uint8_t realTimeTrack; //0: Non-real-time mode, all commands will
be executed after they are issued. 1: Real-
time mode, the command is executed while
being issued.
}CPParams;
cpParams: CPParams pointer
isQueued: Whether to add this command to the queue
queuedCmdIndex: If this command is added to the queue, queuedCmdIndex
indicates the index of this command in the queue. Otherwise, it is invalid
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
49
Dobot Magician API Description 13 CP
Parameter CPParams
typedef struct tagCPParams {
float planAcc; //The maximum planning acceleration
float junctionVel; //The maximum junction velocity
union {
float acc; //The maximum actual acceleration. It is
valid only when realTimeTrack is set to
0
float period; //Interpolation period. It is valid only when
realTimeTrack is set to 1
};
uint8_t realTimeTrack; //0: Non-real-time mode, all commands will
be executed after they are issued. 1: Real-
time mode, the command is executed while
being issued.
}CPParams;
cpParams: CPParams pointer
Parameter CPCmd
typedef struct tagCPCmd {
uint8_t cpMode; //CP mode. 0: indicate that (x,y,z) is the
Cartesian coordinate increment. 1:indicate
(x,y,z) is the target point in Cartesian
coordinate system
float x; //(x,y,z )can be set to Cartesian coordinate,
or Cartesian coordinate increment
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
50
Dobot Magician API Description 13 CP
float y;
float z;
union {
float velocity; //Reserved
float power; //Reserved
}CPCmd;
cpCmd: CPCmd pointer
isQueued: Whether to add this command to the queue
queuedCmdIndex: If this command is added to the queue, queuedCmdIndex
indicates the index of this command in the queue. Otherwise, it is invalid
NOTICE
When there are multiple CP commands in the command queue, the Dobot controller will
look ahead automatically. The look-ahead condition is that there are no JOG, PTP, ARC,
WAIT, and TRIG commands between the CP commands.
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
51
Dobot Magician API Description 13 CP
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
52
Dobot Magician API Description 14 ARC
ARC
The trajectory of the Dobot in ARC mode is an arc, which is determined by three points (the
current point, any point and the end point on the arc), as shown in Figure 14.1.
Parameter ARCParams
typedef struct tagARCParams {
float xyzVelocity; //Cartesian coordinate axis (X,Y,Z) velocity
float rVelocity; //Cartesian coordinate axis (R) velocity
float xyzAcceleration; //Cartesian coordinate axis (X,Y,Z)
acceleration
float rAcceleration; //Cartesian coordinate axis (R) acceleration
}ARCParams;
arcParams: ARCParams pointer
isQueued: Whether to add this command to the queue
queuedCmdIndex: If this command is added to the queue, queuedCmdIndex
indicates the index of this command in the queue. Otherwise, it is invalid
Parameter ARCParams
typedef struct tagARCParams {
float xyzVelocity; //Cartesian coordinate axis (X,Y,Z) velocity
float rVelocity; //Cartesian coordinate axis (R) velocity
float xyzAcceleration; //Cartesian coordinate axis (X,Y,Z)
acceleration
float rAcceleration; //Cartesian coordinate axis (R) acceleration
}ARCParams;
arcParams: ARCParams pointer
Description Execute the ARC command. Please call this API after setting the related
parameters in ARC mode to make Dobot move to the target point.
In ARC mode, it is necessary to confirm the three points with other motion
modes.
Parameter ARCCmd:
typedef struct tagARCCmd {
struct {
float x;
float y;
float z;
float r;
}cirPoint ; //Middle point. (x,y,z,r) can be set to
Cartesian coordinate
struct {
float x;
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
54
Dobot Magician API Description 14 ARC
float y;
float z;
float r;
}toPoint; //End point. (x,y,z,r) can be set to
Cartesian coordinate
}ARCCmd;
arcCmd: ARCCmd pointer
isQueued: Whether to add this command to the queue
queuedCmdIndex: If this command is added to the queue, queuedCmdIndex
indicates the index of this command in the queue. Otherwise, it is invalid
Description Execute the CIRCLE command. Please call this API after setting the related
parameters of playback in CIRCLE mode to make Dobot move to the target
point.
In CIRCLE mode, it is necessary to confirm the three points with other
motion modes.
Parameter CircleCmd
typedef struct tagCircleCmd {
struct {
float x;
float y;
float z;
float r;
}cirPoint ; //Middle point.(x,y,z,r) can be set to
Cartesian coordinate
struct {
float x;
float y;
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
55
Dobot Magician API Description 14 ARC
float z;
float r;
}toPoint; //End point. (x,y,z,r) can be set to
Cartesian coordinate
uint32_t count //Circle number
}CircleCmd;
circleCmd: CircleCmd pointer
isQueued: Whether to add this command to the queue
queuedCmdIndex: If this command is added to the queue, queuedCmdIndex
indicates the index of this command in the queue. Otherwise, it is invalid
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
56
Dobot Magician API Description 15 Losing-Step Detection
Losing-Step Detection
Description Set the losing-step threshold, checking for whether the position error exceeds
this threshold. If this threshold is exceeded, the motor loses step
If you do not call this API, the default threshold is 5
Description Execute the losing-step command. If the motor loses step, the Dobot
controller will stop to query the command queue and stop executing
commands.
This command must be added to the command queue, namely, isQueued
must be set to 1.
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
57
Dobot Magician API Description 15 Losing-Step Detection
#include "DobotDll.h"
int main(void)
PTPCmd cmd;
cmd.ptpMode = 0;
cmd.x = 200;
cmd.y = 0;
cmd.z = 0;
cmd.r = 0;
SetQueuedCmdStartExec();
SetLostStepCmd(true, &queuedCmdIndex)
SetQueuedCmdStopExec();
DisconnectDobot();
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
58
Dobot Magician API Description 16 WAITING
WAITING
Description Execute the Waiting command. If you need to set the pause time between the
two commands, please call this API
This command must be added to the command queue, namely, isQueued
must be set to 1. If not, the parameter timeout of Waiting command in the
command queue being executed may be changed because the WAITCmd
memory is shared
Parameter WAITCmd:
typedef struct tagWAITCmd {
uint32_t timeout; //Unit:ms
}WAITCmd;
waitCmd: WAITCmd pointer
isQueued: Whether to add this command to the queue
queuedCmdIndex: If this command is added to the queue, queuedCmdIndex
indicates the index of this command in the queue. Otherwise, it is invalid
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
59
Dobot Magician API Description 17 TRIGGERING
TRIGGERING
Parameter TRIGCmd:
typedef struct tagTRIGCmd {
uint8_t address; // EIO address:1-20
uint8_t mode; //Triggering mode. 0: Level
trigger.1:A/D trigger
uint8_t condition; //Triggering condition
Level: 0, equal. 1, unequal
A/D: 0, less than. 1,less than or equal
2, greater than or equal. 3, greater
than
uint16_t threshold; //Triggering threshold. Level : 0,1 .A/D:
0-4095
}TRIGCmd;
trigCmd: TRIGCmd pointer
isQueued: Whether to add this command to the queue
queuedCmdIndex: If this command is added to the queue, queuedCmdIndex
indicates the index of this command in the queue. Otherwise, it is invalid
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
60
Dobot Magician API Description 18 EIO
EIO
In the Dobot controller, the addresses of the I/O interfaces are unified. Here, you can see as
follows:
High-low level output;
PWM output;
Read High-low level output;
Read analog-digital conversion value output.
Some of the I/Os may have all the functions listed above. You need configure I/O multiplexing
when using different functions. For more details, please see Dobot Magician User Guide.
Parameter IOMultiplexing:
typedef struct tagIOMultiplexing {
uint8_t address; //I/O address
uint8_t multiplex; //I/O multiplexing function: 0-6
}IOMultiplexing;
The values supported by multiplex are as follows.
typedef enum tagIOFunction {
IOFunctionDummy; //Invalid
IOFunctionDO; // I/O output
IOFunctionPWM; // PWM output
IOFunctionDI; //I/O input
IOFunctionADC; //A/D input
IOFunctionDIPU; //Pull-up input
IOFunctionDIPD //Pull-down input
}IOFunction;
ioMultiplexing: IOMultiplexing pointer
Parameter IODO:
typedef struct tagIODO {
uint8_t address; //I/O addres
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
62
Dobot Magician API Description 18 EIO
Parameter IODO:
typedef struct tagIODO {
uint8_t address; //I/O addres
uint8_t level; //0: Low level.1: High level
}IODO;
ioDO: IODO pointer
Parameter IOPWM:
typedef struct tagIOPWM {
uint8_t address; //I/O address
float frequency; // PWM frequency: 10Hz-1MHz
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
63
Dobot Magician API Description 18 EIO
Parameter IOPWM:
typedef struct tagIOPWM {
uint8_t address; //I/O address
float frequency; // PWM frequency: 10Hz-1MHz
float dutyCycle; // PWM duty cycle: 0-100
}IOPWM;
ioPWM: IOPWM pointer
Parameter IODI:
typedef struct tagIODI {
uint8_t address; //I/O address
uint8_t level; //0: Low level. 1: High-level
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
64
Dobot Magician API Description 18 EIO
}IODI;
ioDI: IODO pointer
Parameter IOADC:
typedef struct tagIOADC {
uint8_t address; //I/O address
uint16_t value; //Input value:0-4095
}IOADC;
ioADC: IOADC pointer
Description Set the velocity of the extended motor. The motor will always be operated at
a constant velocity after calling this API
Parameter EMotor:
typedef struct tagEMotor {
uint8_t index; //Motor index. 0: Stepper1. 1:Stepper2
uint8_t isEnabled; //Control motor. 0: Disabled. 1: Enabled
uint32_t speed; //Motor velocity (Pulse number per second)
}EMotor;
eMotor: EMotor pointer
isQueued: Whether to add this command to the queue
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
65
Dobot Magician API Description 18 EIO
Description Set the velocity of the extended motor and the movement distance. The Dobot
will move for some distance at a constant velocity after calling this API
Parameter EMotorS:
typedef struct tagEMotorS{
uint8_t index; //Motor index. 0: Stepper1. 1:Stepper2
uint8_t isEnabled; //Control motor. 0: Disabled. 1: Enabled
uint32_t speed; //Motor velocity (Pulse number per second)
uint32_t distance //Movement distance (Pulse number)
}EMotorS;
eMotorS: EMotorS pointer
isQueued: Whether to add this command to the queue
queuedCmdIndex: If this command is added to the queue, queuedCmdIndex
indicates the index of this command in the queue. Otherwise, it is invalid
Parameter InfraredPort:
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
66
Dobot Magician API Description 18 EIO
enum InfraredPort {
IF_PORT_GP1;
IF_PORT_GP2;
IF_PORT_GP4;
IF_PORT_GP5;
};
enable: 0, Disabled. 1, Enabled
infraredPort: The Dobot interface that the photoelectric sensor is connected
to. Please select the corresponding interface
version: Version flag of photoelectric sensor. 0: The version is V 1.0. 1: The
version is V2.0
Parameter InfraredPort:
enum InfraredPort {
IF_PORT_GP1;
IF_PORT_GP2;
IF_PORT_GP4;
IF_PORT_GP5;
};
infraredPort: The Dobot interface that the photoelectric sensor is connected
to. Please select the corresponding interface
value: The value of the photoelectric sensor
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
67
Dobot Magician API Description 18 EIO
Parameter ColorPort:
enum ColorPort {
IF_PORT_GP1;
IF_PORT_GP2;
IF_PORT_GP4;
IF_PORT_GP5;
};
enable: 0, Disabled. 1, Enabled
colorPort: The Dobot interface that the color sensor is connected to. Please
select the corresponding interface
version: Version flag of color sensor. 0: The version is V1.0. 1: The version
is V2.0
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
68
Dobot Magician API Description 19 CAL
CAL
The Angle sensors on the Forearm and Rear Arm may have static errors due to angle sensor
welding, device status, etc. It is possible to get this static error through various means (such as
leveling, compared with the standard source), and write into the device through this API.
Forearm/Rear Arm angle = angle sensor static error of Forearm/Rear Arm + angle senor value
of Forearm/Rear Arm *Linearization parameter of Forearm/Rear Arm angle sensor
Base angle = Static error of Base Encoder + Base Encoder value
Description Set the angle sensor static errors of Forearm and Rear Arm
Parameter rearArmAngleError: The angle sensor static error of the Rear Arm
frontArmAngleError: The angle sensor static error of the Forearm
Description Get the angle sensor static errors of the Forearm and Rear Arm
Parameter rearArmAngleError: The angle sensor static error of the Rear Arm
frontArmAngleError: The angle sensor static error of the Forearm
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
69
Dobot Magician API Description 19 CAL
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
71
Dobot Magician API Description 20 WIFI
WIFI
The Dobot can be connected to a Computer via a WIFI module. After the WIFI module is
connected to the Dobot, you need to set the IP address, Sub netmask, Gateway and enable WIFI to
make the Dobot access WLAN. After the access is successful, you can connect your Dobot to your
Computer without using a USB cable.
Enabling WIFI
Table 20.1 Enable WIFI
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
72
Dobot Magician API Description 20 WIFI
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
73
Dobot Magician API Description 20 WIFI
Parameter WIFIIPAddress
typedef struct tagWIFIIPAddress {
uint8_t dhcp; //Whether to enable DHCP. 0:
Disabled1:Enabled
uint8_t addr[4]; // The IP address is divided into 4
segments, the value range of
each segment is 0-255
}WIFIIPAddress;
wifiIPAddr: WIFIIPAddress pointer
Parameter WIFIIPAddress
typedef struct tagWIFIIPAddress {
uint8_t dhcp; //Whether to enable DHCP. 0:
Disabled1:Enabled
uint8_t addr[4]; // The IP address is divided into 4
segments, the value range of
each segment is 0-255
}WIFIIPAddress;
wifiIPAddr: WIFIIPAddress pointer
Parameter WIFINetmask
typedef struct tagWIFINetmask {
uint8_t addr[4]; //The IP address is divided into 4
segments, the value range of each
segment is 0-255
}WIFINetmask;
wifiNetmask: WIFINetmask pointer
Parameter WIFINetmask
typedef struct tagWIFINetmask {
uint8_t addr[4]; //The IP address is divided into 4
segments, the value range of each
segment is 0-255
}WIFINetmask;
wifiNetmask: WIFINetmask pointer
Parameter WIFIGateway
typedef struct tagWIFIGateway {
uint8_t addr[4]; //The IP address is divided into 4
segments, the value range of each
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
75
Dobot Magician API Description 20 WIFI
segment is 0-255
}WIFIGateway;
wifiGateway: WIFIGateway pointer
Parameter WIFIGateway
typedef struct tagWIFIGateway {
uint8_t addr[4]; //The IP address is divided into 4
segments, the value range of each
segment is 0-255
}WIFIGateway;
wifiGateway: WIFIGateway pointer
Parameter WIFIDNS
typedef struct tagWIFIDNS {
uint8_t addr[4]; //The IP address is divided into 4
segments, the value range of each
segment is 0-255
}WIFIDNS;
wifiDNS: WIFIDNS pointer
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
76
Dobot Magician API Description 20 WIFI
timeout
Parameter WIFIDNS
typedef struct tagWIFIDNS {
uint8_t addr[4]; //The IP address is divided into 4
segments, the value range of each
segment is 0-255
}WIFIDNS;
wifiDNS: WIFIDNS pointer
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
77
Dobot Magician API Description 21 Other functions
Other functions
Event Loop
In some languages, the application exits directly after calling an API because there is no event
loop, resulting in the command unable to be issued to the Dobot controller. To avoid this, we provide
an event loop API, which is called before the application exits (currently known, Python need to
follow this).
Parameter None
Return Void
Issue V1.2.3 (2019-07-19) API Description Copyright © Yuejiang Technology Co., Ltd
78