top of page
3.1. Instantiating the Robot
/**
* @brief Robot interface class constructor
*/
Robot();
3.2. Establishing Communication with the Controller
/**
* @brief Establish communication with the robot controller
* @param [in] ip Controller IP address, default is 192.168.58.2
* @return Error code
*/
int RPC(string ip);
3.3. Disconnect from the robot
/**
* @brief Disconnect from the robot controller
* @return Error code
*/
int CloseRPC();
3.4. Query the SDK version number
/**
* @brief Query the SDK version number
* @param [out] version SDK version number
* @return Error code
*/
int GetSDKVersion(ref string version);
3.5. Get the controller IP address
/**
* @brief Get the controller IP
* @param [out] ip Controller IP
* @return Error code
*/
int GetControllerIP(ref string ip);
3.6. Control the robot to enter or exit drag teaching mode
/**
* @brief Control the robot to enter or exit drag teaching mode
* @param [in] state 0-exit drag teaching mode, 1-enter drag teaching mode
* @return Error code
*/
int DragTeachSwitch(byte state);
3.7. Check if the robot is in drag mode
/**
* @brief Check if the robot is in drag teach mode
* @param [out] state 0-not in drag teach mode, 1-in drag teach mode
* @return Error code
*/
int IsInDragTeach(ref byte state);
3.8. Control robot enable or disable
/**
* @brief Control robot enable or disable; robot is automatically enabled by default after power-on
* @param [in] state 0-disable, 1-enable
* @return Error code
*/
int RobotEnable(byte state);
3.9. Control robot manual/automatic mode switching
/**
* @brief Control robot manual/automatic mode switching
* @param [in] mode 0-automatic mode, 1-manual mode
* @return Error code
*/
int Mode(int mode);
3.10. Shut down the robot operating system
/**
* @brief Shut down the robot operating system
* @return Error code
*/
int ShutDownRobotOS();
3.11. Code example
private void button6_Click(object sender, EventArgse)
{
int rtn = robot.ShutDownRobotOS();
Console.WriteLine($"ShutDownRobotOS rtn is {rtn}");
}
3.12. Set robot communication reconnection parameters
/**
* @brief Set robot communication reconnection parameters
* @param [in] enable Whether to enable true-enable, false-disable
* @param [in] times Reconnect times
* @param [in] period Reconnect time interval (milliseconds)
*/
void SetReconnectParam(bool enable, int times, int period);
3.13. Code example
private void btnStandard_Click(object sender, EventArgs e)
{
Robot robot = new Robot();
robot.SetReconnectParam(true, 100, 20000);//Disconnection reconnection parameters
robot.RPC("192.168.58.2");
string ip = "";