Methods
1 Robot Basic Operations and Information Query
connectToRobot() [1/3]
void connectToRobot([Out] ErrorCode^% ec);
Establish connection with robot. Robot address is the one passed when creating the robot instance
- Parameters: [out] ec: Error code
connectToRobot() [2/3]
void connectToRobot(String^ remoteIP);
Connect to robot
- Parameters:
remoteIPRobot IP address
connectToRobot() [3/3]
void connectToRobot(String^ remoteIP, String^ localIP);
Connect to robot
- Parameters:
remoteIPRobot IP addresslocalIPLocal address. Used for real-time interaction data, optional; not supported by PCB3/4 axis models
disconnectFromRobot()
void disconnectFromRobot([Out] ErrorCode^% ec);
Disconnect from robot. Will stop robot motion before disconnecting, please pay attention to safety
- Parameters: [out] ec: Error code
robotInfo()
Info robotInfo([Out] ErrorCode^% ec);
Query robot basic information
- Parameters: [out] ec: Error code
- Return: Robot basic information (controller version, model, number of axes)
powerState()
PowerState powerState([Out] ErrorCode^% ec);
Robot power on/off and emergency stop status
- Parameters: [out] ec: Error code
- Return:
- on - Power on
- off - Power off
- estop - Emergency stop
- gstop - Safety door open
setPowerState()
void setPowerState(Boolean on, [Out] ErrorCode^% ec);
Robot power on/off. Note: Only robots without external enable switch or teach pendant can power on in manual mode.
- Parameters:
- [in] on: true-power on | false-power off
- [out] ec: Error code
operateMode()
OperateMode operateMode([Out] ErrorCode^% ec);
Query robot current operation mode
- Parameters: [out] ec: Error code
- Return: Manual | Automatic
setOperateMode()
void setOperateMode(OperateMode mode, [Out] ErrorCode^% ec);
Switch manual/automatic mode
- Parameters:
- [in] mode: manual - Manual/ automatic - Automatic
- [out] ec: Error code
rebootSystem()
void rebootSystem([Out] ErrorCode^% ec);
Reboot industrial computer. Note: Reboot operation not allowed in automatic mode, power off state, motion and non-idle state
- Parameters: [out] ec: Error code
shutdownSystem()
void shutdownSystem([Out] ErrorCode^% ec);
Shutdown industrial computer. Not allowed in automatic mode, power off state, motion and non-idle state. Controller software can only be started after powering off and on the control cabinet.
- Parameters: [out] ec: Error code
operationState()
OperationState operationState([Out] ErrorCode^% ec);
Query robot current running state (idle, moving, drag enabled, etc.)
- Parameters: [out] ec: Error code
- Return: Running state enum class
getStateList()
StateList getStateList([Out] ErrorCode^% ec);
Query current position, IO signals, operation mode, program speed ratio
- Parameters: [out] ec: Error code
- Return:
StateList(joint angles, Cartesian pose, digital/analog IO, operation mode, speed override, etc.)
posture()
array<double>^ posture(CoordinateType ct, [Out] ErrorCode^% ec);
Get current pose of robot flange or end
- Parameters:
- [in] ct Coordinate system type
flangeInBase: Flange relative to base coordinate system;endInRef: End relative to external reference coordinate system. For example, when handheld tool and external workpiece are set, this coordinate system type returns the coordinates of the tool relative to the workpiece coordinate system.
- [out] ec: Error code
- [in] ct Coordinate system type
- Return: double array, [X , Y , Z , Rx , Ry , Rz ], where translation unit is meters and rotation unit is radians
cartPosture()
CartesianPosition^ cartPosture(CoordinateType ct, [Out] ErrorCode^% ec);
Get current pose of robot flange or end
- Parameters:
- [in] ct Coordinate system type
- [out] ec: Error code
- Return: Current Cartesian position
jointPos()
array<double>^ jointPos([Out] ErrorCode^% ec);
Robot current joint angles, robot body + external axes, unit: radians, external axis rail, unit meters
- Parameters: [out] ec: Error code
- Return: Joint angle values and external axis values
jointVel()
array<double>^ jointVel([Out] ErrorCode^% ec);
Robot current joint velocities, robot body + external axes, unit: radians/second, external axis unit meters/second
- Parameters: [out] ec: Error code
- Return: Joint velocities
jointTorque()
array<double>^ jointTorque([Out] ErrorCode^% ec);
Joint force sensor values, unit: Nm
- Parameters: [out] ec: Error code
- Return: Torque values
baseFrame()
array<double>^ baseFrame([Out] ErrorCode^% ec);
User-defined base coordinate system, relative to world coordinate system
- Parameters: [out] ec: Error code
- Return: double array, [X, Y, Z, Rx, Ry, Rz], where translation unit is meters and rotation unit is radians
setBaseFrame()
void setBaseFrame(Frame^ frame, [Out] ErrorCode^% ec);
Set base coordinate system, only saves value after setting, takes effect after controller restart
- Parameters:
- [in] frame Coordinate system, default uses custom installation method
- [out] ec: Error code
toolset()
Toolset^ toolset([Out] ErrorCode^% ec);
Query current tool/workpiece set information
Note: This tool/workpiece set is only for SDK motion control, not related to RL projects
- Parameters: [out] ec: Error code
- Return: See Toolset data structure
setToolset() [1/2]
void setToolset(Toolset^ toolset, [Out] ErrorCode^% ec);
Set tool/workpiece set information
Note: This tool/workpiece set is only for SDK motion control, not related to RL projects. After setting, RobotAssist upper right corner will display "toolx", "wobjx", and the end coordinates displayed in status monitoring will also change. In addition to this interface, if the default tool/workpiece is changed through RobotAssist (option in upper right corner), this tool/workpiece set will also change accordingly.
- Parameters:
- [in] toolset Tool/workpiece set information
- [out] ec: Error code
setToolset() [2/2]
void setToolset(System::String^ toolName, System::String^ wobjName, [Out] ErrorCode^% ec);
Use created tools and workpieces, set tool/workpiece set information
- Note: Setting prerequisites:
- Use tools and workpieces created in RL project: Need to load corresponding RL project first;
- Global tools and workpieces: No need to load project, can call directly. e.g.
setToolset("g_tool_0", "g_wobj_0")A set of tool/workpiece cannot be both handheld or external; if there is a conflict, the tool's position takes precedence, for example, if both tool and workpiece are handheld, no error will be returned, but the workpiece's coordinate system becomes external
- Parameters:
- [in] toolName Tool name
- [in] wobjName Workpiece name
- [out] ec: Error code
calcIk() [1/2]
array<double>^ calcIk(CartesianPosition^ posture, [Out] ErrorCode^% ec);
Calculate inverse kinematics based on pose
- Parameters:
- [in] posture Robot end pose, relative to external reference coordinate system
- [out] ec: Error code
- Return: Joint angles, unit: radians
calcIk() [2/2]
array<double>^ calcIk(CartesianPosition^ posture, Toolset^ toolset, [Out] ErrorCode^% ec);
Calculate inverse kinematics under given tool/workpiece coordinate system based on pose
- Parameters:
- [in] posture Robot end pose, relative to external reference coordinate system
- [in] toolset Tool/workpiece set information
- [out] ec: Error code
- Return: Joint angles, unit: radians
calcFk() [1/2]
CartesianPosition^ calcFk(array<double>^ joints, [Out] ErrorCode^% ec);
Calculate forward kinematics based on joint angles
- Parameters:
- [in] joints Joint angles, unit: radians
- [out] ec: Error code
- Return: Robot end pose, relative to external reference coordinate system
calcFk() [2/2]
CartesianPosition^ calcFk(array<double>^ joints, Toolset^ toolset, [Out] ErrorCode^% ec);
Calculate forward kinematics under given tool/workpiece coordinate system based on joint angles
- Parameters:
- [in] joints Joint angles, unit: radians
- [in] toolset Tool/workpiece set information
- [out] ec: Error code
- Return: Robot end pose, relative to external reference coordinate system
getRobotCfg_DHparam()
array<double>^ getRobotCfg_DHparam(bool get_nominal, [Out] ErrorCode^% ec);
Read DH parameters
- Parameters:
- [in] get_nominal false - optimized or set parameters | true - nominal parameters. Generally recommended to use false
- [out] ec: Error code
- Return: Alpha[°], A[mm], D[mm], Theta[°] for each axis in order; valid when error code is 0
calcAllIkSolutions()
array<array<double>^>^ calcAllIkSolutions(CartesianPosition^ posture, array<array<int>^>^% confs, [Out] ErrorCode^% ec);
Calculate all inverse kinematics solutions for Cartesian pose. Supports all models except xMateSR(XMS)
- Parameters:
- [in] posture Cartesian pose, flange relative to base frame; other coordinate systems need to be converted by yourself
- [out] confs Corresponding confdata, valid when error code is 0
- [out] ec: Error code (including inverse kinematics failure: such as singularity, over limit, etc.)
- Return: Inverse kinematics results, unit radians, valid when error code is 0
calibrateFrame ()
FrameCalibrationResult^ calibrateFrame(FrameType type, List<array<double>^>^ points, bool is_held, array<double>^ base_aux, [Out] ErrorCode^% ec);
Coordinate system calibration (N-point calibration)
- Note: Calibration methods and precautions for different coordinate system types:
- Tool coordinate system: Three-point/four-point/six-point calibration method
- Workpiece coordinate system: Three-point calibration. Calibration result will not be transformed relative to user coordinate system, i.e., if it is an external workpiece, the returned result is relative to base coordinate system.
- Base coordinate system: Six-point calibration. Please ensure dynamic constraints and feedforward are turned off before calibration. If calibration is successful (no error code), controller will automatically save calibration result, takes effect after controller restart.
- Rail base coordinate system: Three-point calibration. If calibration is successful (no error code), controller will automatically save calibration result, takes effect after controller restart.
- Parameters:
- [in] type Coordinate system type, supports tool(FrameType::tool), workpiece(FrameType::wobj), base coordinate system(FrameType::base), rail base coordinate system(FrameType::rail)
- [in] points Joint angle list, list length is N. For example, using three-point method to calibrate tool coordinate system, should pass 3 sets of joint angles. Joint angles unit is radians.
- [in] is_held true - Robot held | false - External. Only affects tool/workpiece calibration
- [in] base_aux Auxiliary point used in base coordinate system calibration, unit [meters]
- [out] ec: Error code
- Return: Calibration result, valid when no error code is set
clearServoAlarm()
void clearServoAlarm([Out] ErrorCode^% ec);
Clear servo alarm
- Parameters: [out] ec: Error code, set to -1 when there is servo alarm and clearing fails
enableCollisionDetection() [1/2] (Industrial Robot)
void enableCollisionDetection(array<double>^ sensitivity, double fallback, [Out] ErrorCode^% ec);
Set collision detection related parameters, enable collision detection function. Industrial models only support stop1 (safety stop)
- Parameters:
- [in] sensitivity Collision detection sensitivity, range 0.01-2.0
- [in] fallback Collision fallback distance, unit: meters
- [out] ec: Error code
enableCollisionDetection() [2/2] (Collaborative Robot)
void enableCollisionDetection(array<double>^ sensitivity, StopLevel behaviour, double fallback_compliance, [Out] ErrorCode^% ec);
Set collision detection related parameters, enable collision detection function
- Parameters:
- [in] sensitivity Collision detection sensitivity, range 0.01-2.0
- [in] behaviour Robot behavior after collision, supports stop1(safety stop, stop0 and stop1 handle the same way) and stop2(trigger pause), suppleStop(compliant stop)
- [in] fallback_compliance
- When collision behavior is safety stop or trigger pause, this parameter means collision fallback distance, unit: meters
- When collision behavior is compliant stop, this parameter means compliance, range [0.0, 1.0]
- [out] ec: Error code
disableCollisionDetection()
void disableCollisionDetection([Out] ErrorCode^% ec);
Disable collision detection function
- Parameters: [out] ec: Error code
getSoftLimit()
bool getSoftLimit(array<double, 2>^% limits, [Out] ErrorCode^% ec);
Get current soft limit values
- Parameters:
- [out] limits Soft limits per axis [lower limit, upper limit], unit: radians
- [out] ec: Error code
- Return: true - Enabled | false - Disabled
setSoftLimit()
void setSoftLimit(bool enable, array<double, 2>^ limits, [Out] ErrorCode^% ec);
Set soft limits. Soft limit setting requirements:
- When enabling soft limits, the robot arm should be powered off and in manual mode;
- Soft limits cannot exceed mechanical hard limits
- Current joint angles of the robot arm should be within the set limit range
- Parameters:
- [in] enable true - Enable | false - Disable.
- [in] limits Each axis [lower limit, upper limit], unit: radians.
- When limits is default value, it is considered as only enabling soft limits without modifying values; when not default value, first modify soft limits then enable
- Soft limit values will not be modified when disabling soft limits
- [out] ec: Error code
queryControllerLog()
List<LogInfo^>^ queryControllerLog(unsigned count, LogInfo::Level level, [Out] ErrorCode^% ec);
Query latest controller logs
- Parameters:
- [in] count Query count, upper limit is 10
- [in] level Specified log level
- [out] ec: Error code
- Return: Log information
recoverState()
void recoverState(int item, [Out] ErrorCode^% ec);
Recover robot state according to option
- Parameters:
- [in] item Recovery option, 1: Emergency stop recovery
- [out] ec: Error code
setRailParameter() [1/5]
void setRailParameter(System::String^ name, Frame^ value, [Out] ErrorCode^% ec);
Set rail base coordinate system
- Parameters:
- [in] name: Parameter name, "baseFrame"
- [in] value: Base coordinate system value
- [out] ec: Error code, returns error if parameter name does not exist or data type does not match
setRailParameter() [2/5]
void setRailParameter(System::String^ name, System::String^ value, [Out] ErrorCode^% ec);
Set rail name
- Parameters:
- [in] name: Parameter name, "name"
- [in] value: Rail name
- [out] ec: Error code, returns error if parameter name does not exist or data type does not match
setRailParameter() [3/5]
void setRailParameter(System::String^ name, double value, [Out] ErrorCode^% ec);
Set rail parameters
- Parameters:
- [in] name: Parameter name, see value description
- [in] value: Parameter value
Parameter name Description reductionRatio Reduction ratio maxSpeed Maximum speed(m/s) maxAcc Maximum acceleration (m/s^2) maxJerk Maximum jerk(m/s^3) - [out] ec: Error code, returns error if parameter name does not exist or data type does not match
setRailParameter() [4/5]
void setRailParameter(System::String^ name, bool value, [Out] ErrorCode^% ec);
Enable/disable rail
- Parameters:
- [in] name: Parameter name, "enable"
- [in] value: true - Enable
- [out] ec: Error code, returns error if parameter name does not exist or data type does not match
setRailParameter() [5/5]
void setRailParameter(System::String^ name, array<double>^ value, [Out] ErrorCode^% ec);
Set rail soft limits and motion range
- Parameters:
- [in] name: Parameter name, see value description
- [in] value: Parameter value
Parameter name Description softLimit Soft limit(m), [lower limit, upper limit] range Motion range(m), [lower limit, upper limit] - [out] ec: Error code, returns error if parameter name does not exist or data type does not match
setRailParameter() [6/6]
void setRailParameter(System::String^ name, int value, [Out] ErrorCode^% ec);
Set rail parameters (integer)
- Parameters:
- [in] name: encoderResolution (encoder resolution) | motorSpeed (motor maximum speed rpm)
- [in] value: Parameter value
- [out] ec: Error code
getRailParameter() [1/5]
void getRailParameter(System::String^ name, bool% value, [Out] ErrorCode^% ec);
Read whether rail is enabled
- Parameters:
- [in] name: Parameter name, "enable"
- [out] value: true - Enabled
- [out] ec: Error code, returns error if parameter name does not exist or data type does not match
getRailParameter() [2/5]
void getRailParameter(System::String^ name, String^% value, [Out] ErrorCode^% ec);
Read rail name
- Parameters:
- [in] name: Parameter name, "name"
- [out] value: Rail name
- [out] ec: Error code, returns error if parameter name does not exist or data type does not match
getRailParameter() [3/5]
void getRailParameter(System::String^ name, Frame^% value, [Out] ErrorCode^% ec);
Read rail base coordinate system
- Parameters:
- [in] name: Parameter name, "baseFrame"
- [out] value: Rail base coordinate system
- [out] ec: Error code, returns error if parameter name does not exist or data type does not match
getRailParameter() [4/5]
void getRailParameter(System::String^ name, int% value, [Out] ErrorCode^% ec);
Read rail parameters
- Parameters:
- [in] name: Parameter name
Parameter name Description encoderResolution Encoder resolution motorSpeed Motor maximum speed(rpm) - [out] value: Parameter value
- [out] ec: Error code, returns error if parameter name does not exist or data type does not match
- [in] name: Parameter name
getRailParameter() [5/5]
void getRailParameter(System::String^ name, double% value, [Out] ErrorCode^% ec);
Read rail parameters
- Parameters:
- [in] name: Parameter name
Parameter name Description reductionRatio Reduction ratio maxSpeed Maximum speed(m/s) maxAcc Maximum acceleration (m/s^2) maxJerk Maximum jerk(m/s^3) - [out] value: Parameter value
- [out] ec: Error code, returns error if parameter name does not exist or data type does not match
- [in] name: Parameter name
getRailParameter() [6/6]
void getRailParameter(System::String^ name, array<double>^% value, [Out] ErrorCode^% ec);
Read rail soft limits and motion range
- Parameters:
- [in] name: Parameter name
Parameter name Description softLimit Soft limit(m), [lower limit, upper limit] range Motion range(m), [lower limit, upper limit] - [out] value: Parameter value
- [out] ec: Error code, returns error if parameter name does not exist or data type does not match
- [in] name: Parameter name
configNtp()
void configNtp(System::String^ server_ip, [Out] ErrorCode^% ec);
Configure NTP. Non-standard feature, needs additional installation
- Parameters:
- [in] server_ip NTP server IP
- [out] ec: Error code, NTP not installed correctly, or IP address format error
syncTimeWithServer()
void syncTimeWithServer([Out] ErrorCode^% ec);
Manually sync time once, remote IP is configured through configNtp. Takes a few seconds, blocks waiting for sync completion, interface preset timeout is 12 seconds
- Parameters: [out] ec: Error code. NTP service not installed correctly, or cannot sync with server
sdkVersion()
String^ sdkVersion();
Query xCore-SDK version
- Return: Version number
setTeachPendantMode()
void setTeachPendantMode(bool enable, [Out] ErrorCode^% ec);
Teach pendant hot swap. Note: Only supported by some models; after not using teach pendant, enable and emergency stop buttons will be invalid.
- Parameters:
- [in] enable true - Use teach pendant | false - Don't use teach pendant
- [out] ec: Error code (cannot switch during motion/manual power on, etc.; model not supported)
updateRobotState()
unsigned updateRobotState(int timeout_ms);
Receive one robot state data. Call before reading data each cycle; blocks until new data received or timeout.
- Parameters: [in] timeout_ms Timeout time[ms]
- Return: Received data length; 0 if timeout not received
- Exception:
ApiExceptionFailed to receive or parse data
startReceiveRobotState()
void startReceiveRobotState(int interval, array<System::String^>^ fields);
Let controller start sending real-time state data. Blocks until first frame received, timeout about 3 seconds.
- Parameters:
- [in] interval Sending interval[ms]: 1 / 2 / 4 / 8 / 1000 (1s)
- [in] fields Field name array, total length not exceeding 1024 bytes; consistent with
getStateDatasupport items
- Exception: Unsupported data, already sending, exceeded limit, timeout, etc.
stopReceiveRobotState()
void stopReceiveRobotState();
Stop receiving real-time state, controller stops sending at the same time. Can be used to reconfigure fields.
getStateData() [1/3]
int getStateData(String^ name, array<double>^% data);
Read robot state data (double array type). name and data length must be consistent with startReceiveRobotState configuration.
- Return: Success 0; no such field, type mismatch, etc. -1
getStateData() [2/3]
int getStateData(String^ name, UInt64% data);
Read timestamp. name is "ts", microseconds.
- Return: Same as [1/3]
getStateData() [3/3]
int getStateData(String^ name, double% data);
Read elbow angle and other scalars. For example name is "psi_m".
- Return: Same as [1/3]
2 Motion Control (Non-real-time Mode)
setMotionControlMode()
void setMotionControlMode(MotionControlMode mode, [Out] ErrorCode^% ec);
Set motion control mode
- Note: Before calling various motion control interfaces, the corresponding control mode must be set.
- Parameters:
- [in] mode: Mode
- [out] ec: Error code
moveReset()
void moveReset([Out] ErrorCode^% ec);
Motion reset, clear sent motion commands, clear execution information
- Note: Robot class will call motion reset once during initialization. When switching control between RL program and SDK motion commands, motion reset is needed.
- Parameters: [out] ec Error code
stop()
void stop([Out] ErrorCode^% ec);
Pause robot motion; can call moveStart() to continue motion after pause. If need to completely stop and not execute added commands, call moveReset()
- Note: Currently supports stop2 stop type, planned stop without power off, see StopLevel. After calling this interface, can call
moveStart()to continue motion after pause. If need to completely stop and not execute added commands, callmoveReset() - Parameters: [out] ec: Error code
moveStart()
void moveStart([Out] ErrorCode^% ec);
Start/continue motion
- Parameters: [out] ec: Error code
moveAppend() [1/2]
void moveAppend(MoveCommand::Type type, List<MoveCommand^>^ cmd, System::String^% cmdId, [Out] ErrorCode^% ec);
Add single or multiple motion commands, call moveStart() to start motion after adding
- Parameters
- [in] type Command type
- [in] cmd Command list, allowed count 1-100, must be same type commands
- [out] cmdId ID of this command, can be used to query command execution information
- [out] ec Error code, only feedbacks errors before command sending, including: 1) Network connection issues; 2) Command count mismatch;
moveAppend() [2/2]
void moveAppend(MoveCommand::Type type, MoveCommand^ cmd, System::String^% cmdId, [Out] ErrorCode^% ec);
Add single motion command, call moveStart() to start motion after adding
- Parameters:
- [in] type Command type
- [in] cmd Command
- [out] cmdId ID of this command, can be used to query command execution information
- [out] ec Error code, only feedbacks errors before command sending, including: 1) Network connection issues; 2) Command count mismatch;
executeCommand()
void executeCommand(MoveCommand::Type type, List<MoveCommand^>^ cmd, [Out] ErrorCode^% ec);
Execute single or multiple motion commands, robot starts moving immediately after calling
- Parameters:
- [in] type Command type
- [in] cmd Command list, allowed count 1-100, must be same type commands
- [out] ec Error code, only feedbacks errors before execution, including: 1) Network connection issues; 2) Command count or type mismatch;
setDefaultSpeed()
void setDefaultSpeed(double speed, [Out] ErrorCode^% ec);
Set default motion speed, initial value is 100
- Note: This value represents the maximum end linear speed (unit mm/s), automatically calculates corresponding joint speed
- Parameters:
- [in] speed This interface does not limit parameter range. Actual effective range of end linear speed is (0, 4000] (collaborative), (0, 7000] (industrial). Joint speed percentage is divided into 5 ranges:
- < 100 : 10% ;
- 100 ~ 200 : 30% ;
- 200 ~ 500 : 50% ;
- 500 ~ 800 : 80% ;
-
800 : 100%
- [out] ec Error code
- [in] speed This interface does not limit parameter range. Actual effective range of end linear speed is (0, 4000] (collaborative), (0, 7000] (industrial). Joint speed percentage is divided into 5 ranges:
setDefaultZone()
void setDefaultZone(double zone, [Out] ErrorCode^% ec);
Set default turn zone
- Note: This value represents the maximum turn zone radius (unit: mm), automatically calculates turn percentage. If not set, it is 0 (fine, no turn zone)
- Parameters:
- [in] zone: This interface does not limit parameter range. Actual effective range of turn zone radius is [0, 200]. Turn percentage is divided into 4 ranges:
- < 1 : 0 (fine) ;
- 1 ~ 20 : 10% ;
- 20 ~ 60 : 30% ;
-
60 : 100%
- [out] ec: Error code
- [in] zone: This interface does not limit parameter range. Actual effective range of turn zone radius is [0, 200]. Turn percentage is divided into 4 ranges:
setDefaultConfOpt()
void setDefaultConfOpt(bool forced, [Out] ErrorCode^% ec);
Set whether to use axis configuration data(confData) to calculate inverse kinematics. Initial value is false
- Parameters:
- [in] forced true - Use confData of motion command to calculate Cartesian point inverse kinematics, return error if calculation fails; false - Don't use, inverse kinematics will select nearest solution to current robot joint angles
- [out] ec Error code
setAutoIgnoreZone()
void setAutoIgnoreZone(bool enable, [Out] ErrorCode^% ec);
Set whether to automatically cancel turn zone for motion commands. Initial value is true
- Parameters:
- [in] enable true - Auto cancel turn zone | false - Don't auto cancel
- [out] ec Error code
setMaxCacheSize()
void setMaxCacheSize(int number, [Out] ErrorCode^% ec);
Set maximum cache command count, refers to the number of path points sent to controller for planning, allowed range [1,1000], initial value is 300.
-
Note: If the trajectory is mostly short trajectories, this value can be increased to avoid robot stopping due to untimely command sending (after stopping, if there are unexecuted commands, can
moveStart()to continue; -
Parameters:
- [in] number: Count
- [out] ec Error code
adjustSpeedOnline()
void adjustSpeedOnline(double scale, [Out] ErrorCode^% ec);
Dynamically adjust robot motion rate, effective in non-real-time mode.
- Parameters:
- [in] scale: Motion command speed ratio, range 0.01 - 1. When scale is set to 1, robot will move at original path speed.
- [out] ec: Error code
getAcceleration()
void getAcceleration(double% acc, double% jerk, [Out] ErrorCode^% ec);
Read current acceleration/deceleration and jerk
- Parameters:
- [out] acc: Percentage of system preset acceleration
- [out] jerk: Percentage of system preset jerk
- [out] ec: Error code
adjustAcceleration()
void adjustAcceleration(double acc, double jerk, [Out] ErrorCode^% ec);
Adjust motion acceleration/deceleration and jerk. If called during robot motion, current executing command does not take effect, next command takes effect
- Parameters:
- [in] acc: Percentage of system preset acceleration, range [0.2, 1.5], will not report error if out of range, automatically changed to upper or lower limit
- [in] jerk: Percentage of system preset jerk, range [0.1, 2], will not report error if out of range, automatically changed to upper or lower limit
- [out] ec: Error code
setEventWatcher()
void setEventWatcher(Event eventType, EventCallbackDelegate^ callback, [Out] ErrorCode^% ec);
Set callback function for event reception
- Parameters:
- [in] eventType: Event type (moveExecution / safety / rlExecution / logReporter)
- [in] callback: Callback function for processing events. Description:
- Event::moveExecution: Same thread callback, do not block for a long time;
- Event::safety: Separate thread callback;
- rlExecution, logReporter: Triggered by controller report
- [out] ec: Error code
queryEventInfo()
EventInfo queryEventInfo(Event eventType, [Out] ErrorCode^% ec);
Query event information. Same information as provided by setEventWatcher() callback, difference is this interface is active query method
- Parameters:
- [in] eventType: Event type
- [out] ec: Error code
- Return: Event information
startJog()
void startJog(JogSpace space, double rate, double step, unsigned index, bool direction, [Out] ErrorCode^% ec);
Start jogging robot, need to switch to manual operation mode.
- Note: After calling this interface and robot starts moving, regardless of whether robot has stopped on its own, must call
stop()to end jog operation, otherwise robot will always be in jog running state. - Parameters:
- [in] space jog reference coordinate system.
- Tool/workpiece coordinate system usage principle same as
setToolset(); - Industrial six-axis models and xMateCR/SR six-axis models support two singularity avoidance methods
Jog:Space.singularityAvoidMode, Space.baseParallelMode - CR5 axis models support parallel base mode
Jog:Space::baseParallelMode
- Tool/workpiece coordinate system usage principle same as
- [in] rate: Rate, range 0.01 - 1
- [in] step: Step. Unit: Cartesian space - millimeters | Joint space - degrees. Step greater than 0, no upper limit, robot will stop moving on its own if cannot continue jogging.
- [in] index According to different space, this parameter meaning is as follows:
- World coordinate system, base coordinate system, flange coordinate system, tool workpiece coordinate system: a) 6-axis models: 0~5 correspond to X, Y, Z, Rx, Ry, Rz. >5 represent external axes (if any) b) 7-axis models 6 represents elbow joint, >6 represent external axes (if any)
- Joint space: Joint number, starting from 0
- Singularity avoidance mode, parallel base mode:
a) 6-axis models: 0
5 correspond to X, Y, Z, J4(4th axis), Ry, J6(6th axis); b) 5-axis models: 04 correspond to X, Y, Z, Ry, J5(5th axis)
- [in] direction According to different space and index, this parameter meaning is as follows:
- Singularity avoidance mode J4: true - ±180° | false - 0°;
- Parallel base mode J4 & Ry: true - ±180° | false - 0°
- Others, true - Positive direction | false - Negative direction
- [out] ec Error code
- [in] space jog reference coordinate system.
setAvoidSingularity() [1/2] (Industrial Robot)
void setAvoidSingularity(AvoidSingularityMethod method, bool enable, double limit, [Out] ErrorCode^% ec);
Enable/disable singularity avoidance function. All three methods are supported
- Parameters:
- [in] method: Singularity avoidance method
- [in] enable: true - Enable function | false - Disable. For four-axis lock method, ensure 4th axis is at zero position before enabling.
- [in] limit: Different avoidance methods, this parameter meaning is:
- Four-axis lock: No parameter
- Sacrifice posture: Allowable posture error, range (0, PI*2], unit radians
- Axis space interpolation: Avoidance radius, range [0.005, 10], unit meters
- [out] ec: Error code
setAvoidSingularity() [2/2] (Collaborative Robot)
void setAvoidSingularity(AvoidSingularityMethod method, bool enable, double limit, [Out] ErrorCode^% ec);
Enable/disable singularity avoidance function. Only applicable to some models:
- Four-axis lock: Supports xMateCR and xMateSR models
- Sacrifice posture: Supports all collaborative six-axis models
- Axis space interpolation: Not supported
- Parameters:
- [in] method: Singularity avoidance method
- [in] enable: true - Enable function | false - Disable. For four-axis lock method, ensure 4th axis is at zero position before enabling.
- [in] limit: Different avoidance methods, this parameter meaning is:
- Four-axis lock: No parameter
- Sacrifice posture: Allowable posture error, range (0, PI*2], unit radians
- [out] ec: Error code
getAvoidSingularity()
bool getAvoidSingularity(AvoidSingularityMethod method, [Out] ErrorCode^% ec);
Query whether in singularity avoidance state
- Parameters:
- [in] method: Singularity avoidance method
- [out] ec: Error code
- Return: true - Enabled | false – Disabled
checkPath() [1/4]
array<double>^ checkPath(CartesianPosition^ start, array<double>^ start_joint, CartesianPosition^ target, [Out] ErrorCode^% ec);
Check if linear trajectory is reachable. Supports rail, returned target joint angles include axes + external axes
- Parameters:
- [in] start: Start point
- [in] start_joint: Start joint angles [radians]
- [in] target: Target point
- [out] ec: Error code
- Return: Calculated target joint angles, only valid when no error code
checkPath() [2/4]
int checkPath(array<double>^ start_joint, array<CartesianPosition^>^ targets, array<double>^% target_joint_calculated, [Out] ErrorCode^% ec);
Check multiple linear trajectories
- Parameters:
- [in] start_joint: Start joint angles, unit [radians]
- [in] targets: Cartesian points, at least 2 points, first point is start
- [out] target_joint_calculated: If check passes. Returns calculated target joint angles
- [out] ec: Reason for check failure
- Return: If check fails, returns index of error target point in points. Other cases return 0
checkPath() [3/4]
array<double>^ checkPath(CartesianPosition^ start, array<double>^ start_joint, CartesianPosition^ aux, CartesianPosition^ target, [Out] ErrorCode^% ec);
Check if arc trajectory is reachable
- Parameters:
- [in] start: Start point
- [in] start_joint: Start joint angles [radians]
- [in] aux: Auxiliary point
- [in] target: Target point
- [out] ec: Error code
- Return: Calculated target joint angles, only valid when no error code
checkPath() [4/4]
array<double>^ checkPath(CartesianPosition^ start, array<double>^ start_joint, CartesianPosition^ aux1, CartesianPosition^ aux2, double angle, double rot_type, [Out] ErrorCode^% ec);
Check if full circle trajectory is reachable
- Parameters:
- [in] start: Start point
- [in] start_joint: Start joint angles [radians]
- [in] aux1: Auxiliary point 1
- [in] aux2: Auxiliary point 2
- [in] angle: Full circle execution angle, unit radians, not equal to zero represents checking full circle trajectory
- [in] rot_type: Full circle rotation type
- [out] ec: Error code
- Return: Calculated target joint angles, only valid when no error code
getMechUnit() [1/3]
void getMechUnit(String^ name, String^ info, bool% value, [Out] ErrorCode^% ec);
Read mechanical unit parameters (bool)
- Parameters: [in] name Mechanical unit u1~u6; [in] info Parameter name (activation, enable, etc.); [out] value; [out] ec
getMechUnit() [2/3]
void getMechUnit(String^ name, String^ info, int% value, [Out] ErrorCode^% ec);
Read mechanical unit parameters (int), such as mech_link_type, etc.
getMechUnit() [3/3]
void getMechUnit(String^ name, String^ info, array<String^>^% value, [Out] ErrorCode^% ec);
Read mechanical unit parameters (string array), such as axes_info, etc.
getExtAxisInfo() [1/5]
void getExtAxisInfo(String^ name, String^ info, bool% value, [Out] ErrorCode^% ec);
Read external axis parameters (bool)
- Parameters: [in] name axis1~axis6; [in] info such as is_servo_gun, joint_orient, etc
getExtAxisInfo() [2/5]
void getExtAxisInfo(String^ name, String^ info, int% value, [Out] ErrorCode^% ec);
Read external axis parameters (int), such as ext_data_number, zero_value, etc
getExtAxisInfo() [3/5]
void getExtAxisInfo(String^ name, String^ info, double% value, [Out] ErrorCode^% ec);
Read external axis parameters (double), such as max_acc, reduction_ratio, etc
getExtAxisInfo() [4/5]
void getExtAxisInfo(String^ name, String^ info, String^% value, [Out] ErrorCode^% ec);
Read external axis parameters (string), such as driver_name, etc
getExtAxisInfo() [5/5]
void getExtAxisInfo(String^ name, String^ info, array<String^>^% value, [Out] ErrorCode^% ec);
Read external axis parameters (string array)
3 Communication Related
getDI()
bool getDI(unsigned int board, unsigned int port, [Out] ErrorCode^% ec);
Query digital input signal value.
- Parameters:
- [in] board:IO board number.
- [in] port:Signal port number.
- [out] ec:Error code.
- Return:
true- On,false- Off.
getDO()
bool getDO(unsigned int board, unsigned int port, [Out] ErrorCode^% ec);
Query digital output signal value.
- Parameters:
- [in] board:IO board number.
- [in] port:Signal port number.
- [out] ec:Error code.
- Return:
true- On,false- Off.
setDI()
void setDI(unsigned int board, unsigned int port, bool state, [Out] ErrorCode^% ec);
Set digital input signal value, can only be set when input simulation mode is enabled (see setSimulationMode()).
- Parameters:
- [in] board:IO board number.
- [in] port:Signal port number.
- [in] state:
true- On,false- Off. - [out] ec:Error code.
setDO()
void setDO(unsigned int board, unsigned int port, bool state, [Out] ErrorCode^% ec);
Set digital output signal value.
- Parameters:
- [in] board:IO board number.
- [in] port:Signal port number.
- [in] state:
true- On,false- Off. - [out] ec:Error code.
getAI()
double getAI(unsigned board, unsigned port, [Out] ErrorCode^% ec);
Read analog input signal value
- Parameters:
- [in] board IO board number
- [in] port Signal port number
- [out] ec Error code
- Return:Signal value
setAO()
void setAO(unsigned board, unsigned port, double value, [Out] ErrorCode^% ec);
Set analog output signal
- Parameters:
- [in] board IO board number
- [in] port Signal port number
- [in] value Output value
- [out] ec Error code
readRegister() [1/3]
void readRegister(System::String^ name, List<bool>^% value, [Out] ErrorCode^% ec);
Read bit/bool type register array.
- Parameters:
- [in] name Register name
- [out] value Register value
- [out] ec Error code
readRegister() [2/3]
void readRegister(System::String^ name, List<int>^% value, [Out] ErrorCode^% ec);
Read int16/int32 type register array.
- Parameters:
- [in] name Register name
- [out] value Register value
- [out] ec Error code
readRegister() [3/3]
void readRegister(System::String^ name, List<float>^% value, [Out] ErrorCode^% ec);
Read float type register array.
- Parameters:
- [in] name Register name
- [out] value Register value
- [out] ec Error code
readRegister() [4/6]
void readRegister(System::String^ name, unsigned index, bool% value, [Out] ErrorCode^% ec);
Read bit/bool type register value. Can read single register, or read register array by index
- Parameters:
- [in] name Register name
- [in] index Read element in register array by index, starting from 0. The following two cases will report error: 1) Index exceeds array length; 2) Register is not array but index > 0
- [out] value Register value
- [out] ec Error code
readRegister() [5/6]
void readRegister(System::String^ name, unsigned index, int% value, [Out] ErrorCode^% ec);
Read int16/int32 type register value. Can read single register, or read register array by index
- Parameters:
- [in] name Register name
- [in] index Read element in register array by index, starting from 0. The following two cases will report error: 1) Index exceeds array length; 2) Register is not array but index > 0
- [out] value Register value
- [out] ec Error code
readRegister() [6/6]
void readRegister(System::String^ name, unsigned index, float% value, [Out] ErrorCode^% ec);
Read float type register value. Can read single register, or read register array by index
- Parameters:
- [in] name Register name
- [in] index Read element in register array by index, starting from 0. The following two cases will report error: 1) Index exceeds array length; 2) Register is not array but index > 0
- [out] value Register value
- [out] ec Error code
writeRegister() [1/6]
void writeRegister(System::String^ name, unsigned index, bool value, [Out] ErrorCode^% ec);
Write bool/bit type register value. Can write single register, or write element in register array by index.
- Parameters:
- [in] name Register name
- [in] index Array index, starting from 0. The following two cases will report error: 1) Index exceeds array length; 2) Register is not array but index > 0
- [in] value Write value
- [out] ec Error code
writeRegister() [2/6]
void writeRegister(System::String^ name, unsigned index, Int32 value, [Out] ErrorCode^% ec);
Write byte/int16/int32 register value. Can write single register, or write element in register array by index.
- Parameters:
- [in] name Register name
- [in] index Array index, starting from 0. The following two cases will report error: 1) Index exceeds array length; 2) Register is not array but index > 0
- [in] value Write value
- [out] ec Error code
writeRegister() [3/6]
void writeRegister(System::String^ name, unsigned index, float value, [Out] ErrorCode^% ec);
Write float type register value. Can write single register, or write element in register array by index.
- Parameters:
- [in] name Register name
- [in] index Array index, starting from 0. The following two cases will report error: 1) Index exceeds array length; 2) Register is not array but index > 0
- [in] value Write value
- [out] ec Error code
writeRegister() [4/6]
void writeRegister(System::String^ name, unsigned index, array<bool>^ value, [Out] ErrorCode^% ec);
Write bool/bit type register array
- Parameters:
- [in] name Register name
- [in] index Array index, ignored when writing array
- [in] value Write value
- [out] ec Error code
writeRegister() [5/6]
void writeRegister(System::String^ name, unsigned index, array<int>^ value, [Out] ErrorCode^% ec);
Write int16/int32 type register array.
- Parameters:
- [in] name Register name
- [in] index Array index, ignored when writing array
- [in] value Write value
- [out] ec Error code
writeRegister() [6/6]
void writeRegister(System::String^ name, unsigned index, array<float>^ value, [Out] ErrorCode^% ec);
Write float type register array.
- Parameters:
- [in] name Register name
- [in] index Array index, ignored when writing array
- [in] value Write value
- [out] ec Error code
setxPanelVout()
void setxPanelVout(xPanelOpt::Vout opt, [Out] ErrorCode^% ec);
Set xPanel external power supply mode. Note: Only some models support xPanel function, unsupported models will return error code
- Parameters:
- [in] opt mode
- [out] ec Error code
setSimulationMode()
void setSimulationMode(bool state, [Out] ErrorCode^% ec);
Set input simulation mode
- Parameters:
- [in] state true - Enable | false - Disable
- [out] ec Error code
getKeypadState()
array<bool>^ getKeypadState([Out] ErrorCode^% ec);
Get end keypad state, unsupported models will return error code
- Parameters:
- [out] ec Error code
- Return:End keypad state, array length 7. See "xCore Robot Control System User Manual" for end handle diagram for keypad numbering.
setxPanelRS485()
void setxPanelRS485(xPanelOpt::Vout opt, bool if_rs485, [Out] ErrorCode^% ec);
Use CR and SR end 485 communication function, need to modify end parameter configuration, can configure parameters through this interface
- Parameters:
- [in] opt External power supply mode, 0: no output, 1: reserved, 2: 12v, 3: 24v
- [in] if_rs485 Interface working mode, whether to enable end 485 communication
- [out] ec Error code
XPRWModbusRTUReg()
void XPRWModbusRTUReg(int slave_addr, int fun_cmd, int reg_addr, String^ data_type, int num, array<int>^% data_array, bool if_crc_reverse, [Out] ErrorCode^% ec);
Read/write modbus registers through xPanel terminal
- Parameters:
- [in] slave_addr Device address 0 - 65535
- [in] fun_cmd Function code 0x03 0x04 0x06 0x10
- [in] reg_addr Register address 0 - 65535
- [in] data_type Supported data types int32, int16, uint32, uint16
- [in] num Number of continuous operation registers at once 0 - 3, when type is int16/uint16, maximum is 3; when type is int32/uint32, float, maximum is 1, when function code is 0x06, this parameter is invalid
- [in/out] data_array Send or receive data array, non-const, when function code is 0x06, only uses data[0] of this array, at this time num value is invalid, except for 0x06 function code, size needs to match num
- [in] if_crc_reverse Whether to change CRC check high/low bits, default false, few manufacturer terminal tools need reverse
- [out] ec Error code
XPRWModbusRTUCoil()
void XPRWModbusRTUCoil(int slave_addr, int fun_cmd, int coil_addr, int num, array<bool>^% data_array, bool if_crc_reverse, [Out] ErrorCode^% ec);
Read/write modbus coils or discrete inputs through xPanel terminal
- Parameters:
- [in] slave_addr Device address 0 - 65535
- [in] fun_cmd Function code 0x01 0x02 0x05 0x0F
- [in] coil_addr Coil or discrete input register address 0 - 65535
- [in] num Number of continuous read/write coils discrete inputs at once (0 - 48), when function code is 0x05, this value is invalid
- [in/out] data_array Send or receive data array, non-const, when function code is 0x05, only uses data[0] of this array, at this time num value is invalid, except for 0x05 function code, size needs to match num
- [in] if_crc_reverse Whether to change CRC check high/low bits, default false, few manufacturer terminal tools need reverse
- [out] ec Error code
XPRS485SendData()
void XPRS485SendData(int send_byte, int rev_byte, array<Byte>^ send_data, array<Byte>^% recv_data, [Out] ErrorCode^% ec);
Directly transmit RTU protocol raw data through xPanel end
- Parameters:
- [in] send_byte Send byte length 0 - 16
- [in] rev_byte Receive byte length 0 - 16
- [in] send_data Send byte data array length needs to match send_byte parameter
- [out] recv_data Receive byte data array length needs to match rev_byte parameter
- [out] ec Error code
4 RL Project
projectsInfo()
List<RLProjectInfo^>^ projectsInfo([Out] ErrorCode^% ec);
Query RL project names and tasks in industrial computer
- Parameters:
- [out] ec Error code
- Return:Project information list, returns empty list if no project created
loadProject()
void loadProject(String^ name, System::Collections::Generic::List<System::String^>^ tasks, [Out] ErrorCode^% ec);
Load project
- Parameters:
- [in] name Project name
- [in] tasks Tasks to run. This parameter must be specified, cannot be empty, otherwise project cannot be executed.
- [out] ec Error code
ppToMain()
void ppToMain([Out] ErrorCode^% ec);
Program pointer jump to main. After calling, waits for controller to parse project before returning, blocking time depends on project size, timeout set to 10 seconds.
- Parameters:
- [out] ec Error code. Error code can provide limited information, cannot feedback errors like RL syntax error, variable not exist, etc. Can query error logs through queryControllerLog().
runProject()
void runProject([Out] ErrorCode^% ec);
Start running currently loaded project
- Parameters:
- [out] ec Error code
pauseProject()
void pauseProject([Out] ErrorCode^% ec);
Pause running project
- Parameters:
- [out] ec Error code
setProjectRunningOpt()
void setProjectRunningOpt(double rate, bool loop, [Out] ErrorCode^% ec);
Change project running speed and loop mode
- Parameters:
- [in] rate Running rate, range 0.01 - 1
- [in] loop true - Loop execution | false - Single execution
- [out] ec Error code
toolsInfo()
List<WorkToolInfo^>^ toolsInfo([Out] ErrorCode^% ec);
Query tool information of currently loaded project
- Parameters:
- [out] ec Error code
- Return:Tool information list, if no project loaded or no tool created, returns default tool tool0 information
wobjsInfo()
List<WorkToolInfo^>^ wobjsInfo([Out] ErrorCode^% ec);
Query workpiece information of currently loaded project
- Parameters:
- [out] ec Error code
- Return:Workpiece information list, if no project loaded or no workpiece created, returns empty vector
importProject()
String^ importProject(String^ file_path, bool overwrite, [Out] ErrorCode^% ec);
Import local RL project zip to controller, blocks until import completes or fails
- Parameters:
- [in] file_path Local .zip path, file size within 10M
- [in] overwrite Whether to overwrite same name file, true: overwrite; false: auto rename
- [out] ec Error code
- Return:Project name (such as auto rename, returns renamed name)
removeProject()
void removeProject(String^ project_name, bool remove_all, [Out] ErrorCode^% ec);
Delete RL project in controller
- Parameters:
- [in] project_name Project name
- [in] remove_all Whether to delete all projects, true: yes false: no
- [out] ec Error code
importFile()
String^ importFile(String^ src_file_path, String^ dest, bool overwrite, [Out] ErrorCode^% ec);
Import local file to controller. Blocks until import completes or fails
- Parameters:
- [in] src_file_path Local file path. File size within 10M
- [in] dest Target path
- Transfer single RL project .mod file: project/[project name]/[task name]/[mod file name]
- Transfer RL project .json/.xml/sys format configuration file: project/[project name]/[file name]. Note: Configuration file name cannot be changed, such as task file name must be "task.xml"
- [in] overwrite Overwrite same name file: true - overwrite | false - auto rename. Only .mod files support auto rename
- [out] ec Local file not exist; file format error; transfer failed; target path does not meet requirements, etc
- Return:Imported file name
removeFiles()
void removeFiles(array<String^>^ file_path_list, [Out] ErrorCode^% ec);
Delete files in controller. Note: Project .xml, .json and other configuration files cannot be deleted, only replaced
- Parameters:
- [in] file_path_list File path list, single file path as follows:
-
- Delete .mod file under certain project certain task: project/[project name]/[task name]/[mod file name]
-
- Delete certain project certain task: project/[project name]/[task name]
-
- [out] ec Parameter format error or network error. No error code returned if project or task or file does not exist
- [in] file_path_list File path list, single file path as follows:
setToolInfo()
void setToolInfo(WorkToolInfo^ tool_info, [Out] ErrorCode^% ec);
Set global tool information, or create/set pose information and load information of tools in RL project
- Parameters:
- [in] tool_info Tool information
- [out] ec Global tools generally won't set failed. Project tools may set failed, such as pushing project tool configuration file to controller but not reloading project, tool configuration inconsistent情况下会返回错误码
setWobjInfo()
void setWobjInfo(WorkToolInfo^ wobj_info, [Out] ErrorCode^% ec);
Set global workpiece information, or create/set pose information and load information of workpieces in RL project
- Parameters:
- [in] wobj_info Workpiece information
- [out] ec Similarly to set tool interface, global workpieces generally won't set failed. Project workpieces may set failed
5 Collaboration Related
enableDrag() [1/2]
void enableDrag(DragOpt::Space space, DragOpt::Type type, [Out] ErrorCode^% ec);
Enable drag
- Parameters:
- [in] space Drag space, joint space drag only supports free drag type
- [in] type Drag type
- [out] ec Error code
enableDrag() [2/2]
void enableDrag(DragOpt::Space space, DragOpt::Type type, bool enable_drag_button, [Out] ErrorCode^% ec);
Enable drag
- Parameters:
- [in] space Drag space, joint space drag only supports free drag type
- [in] type Drag type
- [in] enable_drag_button True - After enabling drag function, can directly drag robot without holding end button
- [out] ec Error code
disableDrag()
void disableDrag([Out] ErrorCode^% ec);
Disable drag
- Parameters:
- [out] ec Error code
startRecordPath()
void startRecordPath([Out] ErrorCode^% ec);
Start recording path. Duration must be within 30 minutes; this interface does not block waiting, call stopRecordPath() to stop recording when finished
- Parameters:
- [out] ec Error code
stopRecordPath()
void stopRecordPath([Out] ErrorCode^% ec);
Stop recording path, if recording is successful (no error code) the path data is saved in cache
- Parameters:
- [out] ec Error code
cancelRecordPath()
void cancelRecordPath([Out] ErrorCode^% ec);
Cancel recording, cached path data will be deleted
- Parameters:
- [out] ec Error code
saveRecordPath()
void saveRecordPath(String^ name, String^ saveAs, [Out] ErrorCode^% ec);
Save recorded path
- Parameters:
- [in] name Path name
- [in] saveAs Rename, can pass empty string. If a path has been recorded but not saved, it will be saved with this name. If there is no unsaved path, the saved path named "name" will be renamed to "saveAs"
- [out] ec Error code
replayPath()
void replayPath(String^ name, double rate, [Out] ErrorCode^% ec);
Motion command - path replay. Similar to other motion commands, after calling replayPath, need to call moveStart to start motion.
- Parameters:
- [in] name Path name to replay
- [in] rate Replay rate, should be less than 3.0, 1 is the original path rate. Note that when the rate is greater than 1, driver following errors may occur
- [out] ec Error code
removePath()
void removePath(String^ name, bool removeAll, [Out] ErrorCode^% ec);
Delete saved path
- Parameters:
- [in] name Path name to delete
- [in] removeAll Whether to delete all paths, true: yes false: no
- [out] ec Error code
queryPathLists()
List<String^>^ queryPathLists([Out] ErrorCode^% ec);
Query all saved path names
- Parameters:
- [out] ec Error code
- Return: Name list, returns empty list if no paths
calibrateForceSensor()
void calibrateForceSensor(bool all_axes, int axis_index, [Out] ErrorCode^% ec);
Force sensor calibration. Calibration process takes about 100ms, this function does not block waiting for calibration completion. Before calibration, need to set correct load via setToolset() (Toolset.load), otherwise it will affect calibration accuracy.
- Parameters:
- [in] all_axes true - Calibrate all axes | false - Single axis calibration
- [in] axis_index Axis index, range [0, 6), only effective for single axis calibration
- [out] ec Error code
enableCompletePostureLerp()
void enableCompletePostureLerp(Boolean enable, [Out] ErrorCode^% ec);
Whether to enable parallel base mode (dedicated to xMateCr5Robot).
- Parameters:
- [in] enable true - Enable | false - Disable
- [out] ec Error code
6 Force Control Commands
forceControl()
ForceControl^ forceControl();
Force control command class
- Return: ForceControl
getEndTorque()
void getEndTorque(FrameType ref_type, array<double>^% joint_torque_measured, array<double>^% external_torque_measured, array<double>^% cart_torque, array<double>^% cart_force, [Out] ErrorCode^% ec);
Get current torque information
- Parameters:
- [in] ref_type Torque reference frame:
FrameType::world- End relative to world coordinate system torque information;FrameType::flange- End relative to flange torque information;FrameType::tool- End relative to TCP point torque information.
- [out] joint_torque_measured Joint space measured force information, torque measured by force sensor on each axis, unit Nm
- [out] external_torque_measured Joint space external force information, torque information on each axis calculated by controller based on robot model and measured force, unit Nm
- [out] cart_torque Torque received in each direction [X, Y, Z] in Cartesian space, unit Nm
- [out] cart_force Force received in each direction [X, Y, Z] in Cartesian space, unit N
- [out] ec Error code
- [in] ref_type Torque reference frame:
fcInit()
void fcInit(FrameType type, [Out] ErrorCode^% ec);
Force control initialization
- Parameters:
- [in] type Force control coordinate system, supports world/wobj/tool/baseFrame/flange. Tool workpiece coordinate system uses the coordinate system set by setToolset()
- [out] ec Error code
fcStart()
void fcStart([Out] ErrorCode^% ec);
Start force control, call after fcInit(). If need to execute motion commands in force control mode, can execute after fcStart(). Note that if motion commands are sent via moveAppend() before fcStart() but not started, these motion commands will be executed after fcStart().
- Parameters: [out] ec Error code
fcStop()
void fcStop([Out] ErrorCode^% ec);
Stop force control
- Parameters: [out] ec Error code
setControlType()
void setControlType(int type, [Out] ErrorCode^% ec);
Set impedance control type
- Parameters:
- [in] type 0 - Joint impedance | 1 - Cartesian impedance
- [out] ec Error code
setLoad()
void setLoad(Load^ load, [Out] ErrorCode^% ec);
Set load information used by force control module, can be called after fcStart().
- Parameters:
- [in] load Load
- [out] ec Error code
setJointStiffness()
void setJointStiffness(array<double>^ stiffness, [Out] ErrorCode^% ec);
Set joint impedance stiffness, takes effect after fcInit(). Maximum stiffness varies by model, please refer to the description of SetJntCtrlStiffVec command in "xCore Control System Manual"
- Parameters:
- [in] stiffness Each axis stiffness
- [out] ec Error code
setCartesianStiffness()
void setCartesianStiffness(array<double>^ stiffness, [Out] ErrorCode^% ec);
Set Cartesian impedance stiffness, takes effect after fcInit(). Maximum stiffness varies by model, please refer to the description of SetCartCtrlStiffVec command in "xCore Control System Manual"
- Parameters:
- [in] stiffness In order: X Y Z direction impedance force stiffness [N/m], X Y Z direction impedance torque stiffness [Nm/rad]
- [out] ec Error code
setCartesianNullspaceStiffness()
void setCartesianNullspaceStiffness(double stiffness, [Out] ErrorCode^% ec);
Set Cartesian null space impedance stiffness. Takes effect after fcInit()
- Parameters:
- [in] stiffness Range [0,4], values greater than 4 will be set to 4 by default, unit Nm/rad
- [out] ec Error code
setJointDesiredTorque()
void setJointDesiredTorque(array<double>^ torque, [Out] ErrorCode^% ec);
Set joint desired torque. Can be called after fcStart()
- Parameters:
- [in] torque Torque value, range [-30,30], unit Nm
- [out] ec Error code
setCartesianDesiredForce()
void setCartesianDesiredForce(array<double>^ value, [Out] ErrorCode^% ec);
Set Cartesian desired force/torque. Can be called after fcStart()
- Parameters:
- [in] value In order: X Y Z direction Cartesian desired force, range [-60,60], unit N; X Y Z direction Cartesian desired torque, range [-10,10], unit Nm
- [out] ec Error code
setSineOverlay()
void setSineOverlay(int line_dir, double amplify, double frequency, double phase, double bias, [Out] ErrorCode^% ec);
Set sine search motion rotating around a single axis. Takes effect after setting impedance control type to Cartesian impedance (i.e., setControlType(1)) and before startOverlay(). The upper limits of search motion amplitude and frequency vary by model, please refer to the description of SetSineOverlay command in "xCore Control System Manual".
- Parameters:
- [in] line_dir Search motion reference axis: 0 - X | 1 - Y | 2 - Z
- [in] amplify Search motion amplitude, unit Nm
- [in] frequency Search motion frequency, unit Hz
- [in] phase Search motion phase, range [0, PI], unit radians
- [in] bias Search motion bias, range [0, 10], unit Nm
- [out] ec Error code
setLissajousOverlay()
void setLissajousOverlay(int plane, double amplify_one, double frequency_one, double amplify_two, double frequency_two, double phase_diff, [Out] ErrorCode^% ec);
Set Lissajous search motion in plane Takes effect after setting impedance control type to Cartesian impedance (i.e., setControlType(1)) and before startOverlay().
- Parameters:
- [in] plane Search motion reference plane: 0 - XY | 1 - XZ | 2 - YZ
- [in] amplify_one Search motion one direction amplitude, range [0, 20], unit Nm
- [in] frequency_one Search motion one direction frequency, range [0, 5], unit Hz
- [in] amplify_two Search motion two direction amplitude, range [0, 20] unit Nm
- [in] frequency_two Search motion two direction frequency, range [0, 5], unit Hz
- [in] phase_diff Search motion two direction phase difference, range [0, PI], unit radians
- [out] ec Error code
startOverlay()
void startOverlay([Out] ErrorCode^% ec);
Start search motion. Takes effect after fcStart() Search motion is the superposition of previously set setSineOverlay() or setLissajousOverlay()
- Parameters:
- [out] ec Error code
stopOverlay()
void stopOverlay([Out] ErrorCode^% ec);
Stop search motion
- Parameters:
- [out] ec Error code
pauseOverlay()
void pauseOverlay([Out] ErrorCode^% ec);
Pause search motion. Takes effect after startOverlay()
- Parameters:
- [out] ec Error code
restartOverlay()
void restartOverlay([Out] ErrorCode^% ec);
Restart paused search motion. Takes effect after pauseOverlay().
- Parameters:
- [out] ec Error code
setForceCondition()
void setForceCondition(array<double>^ range, bool isInside, double timeout, [Out] ErrorCode^% ec);
Set termination conditions related to contact force
- Parameters:
- [in] range Force limits in each direction
{ X_min, X_max, Y_min, Y_max, Z_min, Z_max }, unit N. When setting lower limit, negative value indicates maximum value in negative direction; when setting upper limit, negative value indicates minimum value in negative direction. - [in] isInside true - Stop waiting when exceeding limit conditions; false - Stop waiting when meeting limit conditions
- [in] timeout Timeout time, range [1, 600], unit seconds
- [out] ec Error code
- [in] range Force limits in each direction
setTorqueCondition()
void setTorqueCondition(array<double>^ range, bool isInside, double timeout, [Out] ErrorCode^% ec);
Set termination conditions related to contact torque
- Parameters:
- [in] range Torque limits in each direction
{ X_min, X_max, Y_min, Y_max, Z_min, Z_max }, unit Nm. When setting lower limit, negative value indicates maximum value in negative direction; when setting upper limit, negative value indicates minimum value in negative direction. - [in] isInside true - Stop waiting when exceeding limit conditions; false - Stop waiting when meeting limit conditions
- [in] timeout Timeout time, range [1, 600], unit seconds
- [out] ec Error code
- [in] range Torque limits in each direction
setPoseBoxCondition()
void setPoseBoxCondition(Frame^ supervising_frame, array<double>^ box, bool isInside, double timeout, [Out] ErrorCode^% ec);
Set termination conditions related to contact position
- Parameters:
- [in] supervising_frame Reference coordinate system where the cuboid is located, relative to external workpiece coordinate system (Toolset::ref set by setToolset())
- [in] box Define a cuboid
{ X_start, X_end, Y_start, Y_end, Z_start, Z_end }, unit meters - [in] isInside true - Stop waiting when exceeding limit conditions; false - Stop waiting when meeting limit conditions
- [in] timeout Timeout time, range [1, 600], unit seconds
- [out] ec Error code
waitCondition()
void waitCondition([Out] ErrorCode^% ec);
Activate previously set termination conditions and wait until these conditions are met or timeout
- Parameters:
- [out] ec Error code
fcMonitor()
void fcMonitor(bool enable, [Out] ErrorCode^% ec);
Start/stop force control module protection monitoring
After setting setJointMaxVel, setJointMaxMomentum, setJointMaxEnergy, setCartesianMaxVel, etc., they do not take effect immediately; they start to take effect and remain after calling fcMonitor(true) until fcMonitor(false). After ending, the protection threshold returns to default value, there is still basic protection, but user-set thresholds are no longer used.
- Parameters:
- [in] enable true - Enable | false - Disable
- [out] ec Error code
setJointMaxVel()
void setJointMaxVel(array<double>^ velocity, [Out] ErrorCode^% ec);
Set maximum joint velocity in force control mode
- Parameters:
- [in] velocity Joint velocity [rad/s], range >=0
- [out] ec Error code
setJointMaxMomentum()
void setJointMaxMomentum(array<double>^ momentum, [Out] ErrorCode^% ec);
Set maximum joint momentum in force control mode Calculation method: F*t, can be understood as impulse, F is torque sensor reading, t is control cycle, if it exceeds momentum threshold for more than 30 cycles, protection is triggered
- Parameters:
- [in] momentum Momentum [N·s], range >=0
- [out] ec Error code
setJointMaxEnergy()
void setJointMaxEnergy(array<double>^ energy, [Out] ErrorCode^% ec);
Set maximum joint kinetic energy in force control mode Calculation method: F*v, can be understood as power, F is torque sensor reading, v is joint velocity, if it exceeds kinetic energy threshold for more than 30 cycles, protection is triggered
- Parameters:
- [in] energy Kinetic energy [N·rad/s], range >=0
- [out] ec Error code
setCartesianMaxVel()
void setCartesianMaxVel(array<double>^ velocity, [Out] ErrorCode^% ec);
Set maximum velocity of robot end relative to base coordinate system in force control mode
- Parameters:
- [in] velocity In order: X Y Z [m/s], A B C [rad/s], range >=0
- [out] ec Error code
setCartesianControlMaxWrench()
void setCartesianControlMaxWrench(array<double>^ max_wrench, [Out] ErrorCode^% ec);
Impedance force limit (Cartesian). Valid from fcStart() to fcStop(); used to limit end force during impedance motion and play a monitoring role.
- Parameters:
- [in] max_wrench In order: XYZ[N], ABC[Nm], range [0, 1000], default maximum
- [out] ec: Error code
setCartesianControlMaxVel()
void setCartesianControlMaxVel(array<double>^ max_cart_vel, [Out] ErrorCode^% ec);
Impedance Cartesian velocity limit. Valid from fcStart() to fcStop(); for example, can limit speed during pressing contact process with desired force.
- Parameters:
- [in] max_cart_vel XYZ [0, 3.0] m/s; ABC [0, 10.0] rad/s; default maximum
- [out] ec: Error code
setJointControlMaxTorque()
void setJointControlMaxTorque(array<double>^ max_torque, [Out] ErrorCode^% ec);
Impedance torque limit (joint). Valid from fcStart() to fcStop().
- Parameters:
- [in] max_torque Torque limit [Nm], range [0, 1000], default maximum
- [out] ec: Error code
setJointControlMaxVel()
void setJointControlMaxVel(array<double>^ max_joint_vel, [Out] ErrorCode^% ec);
Impedance joint velocity limit. Valid from fcStart() to fcStop().
- Parameters:
- [in] max_joint_vel Joint velocity limit [rad/s], range [0, 10.0], default maximum
- [out] ec: Error code
setFcGain()
void setFcGain(array<double>^ gain, [Out] ErrorCode^% ec);
Force control bandwidth
- Parameters:
- [in] gain Each axis [0, 60], default 20
- [out] ec: Error code
setFriction()
void setFriction(array<double>^ fric, [Out] ErrorCode^% ec);
Friction compensation
- Parameters:
- [in] fric Each axis [0, 1], default 0.9
- [out] ec: Error code