diff --git a/config/cabin_robot.xml b/config/cabin_robot.xml index 67695934..22de6619 100644 --- a/config/cabin_robot.xml +++ b/config/cabin_robot.xml @@ -70,6 +70,9 @@ + + + diff --git a/src/device_manager/CMakeLists.txt b/src/device_manager/CMakeLists.txt index 54b26943..0dd2b955 100644 --- a/src/device_manager/CMakeLists.txt +++ b/src/device_manager/CMakeLists.txt @@ -15,7 +15,7 @@ target_link_libraries(device_manager PRIVATE cmvr_es::device::rh56dftp_dexhand cmvr::device::head_esp32 cmvr_es::device::humanoid_robot -# cmvr_es::device::ti5robot + cmvr_es::device::aubo_robot ) add_library(cmvr_es::device_manager ALIAS device_manager) \ No newline at end of file diff --git a/src/device_manager/src/device_factory.cpp b/src/device_manager/src/device_factory.cpp index d56641be..3f66e3db 100644 --- a/src/device_manager/src/device_factory.cpp +++ b/src/device_manager/src/device_factory.cpp @@ -2,17 +2,18 @@ // Created by xtkuang on 2025/5/13. // -#include "../include/device_factory.h" -#include "../../devices/biohead/biohead_esp32/include/biohead_esp32.h" -#include "../../devices/camera/uvc_camera/include/uvc_camera.h" -#include "../../devices/camera/mechmind/include/mechmind_camera.h" -#include "../../devices/speaker/ffmpeg_speaker/include/ffmpeg_speaker.h" -#include "../../devices/microphone/ffmpeg_microphone/include/ffmpeg_microphone.h" -#include "../../devices/camera/realsense_camera/include/realsense_camera.h" -#include "../../devices/dexhand/rh56dftp_dexhand/include/rh56dftp_dexhand.h" -#include "../../devices/robot/humanoid_robot/include/humanoid_robot.h" +#include "device_manager/include/device_factory.h" +#include "devices/biohead/biohead_esp32/include/biohead_esp32.h" +#include "devices/camera/uvc_camera/include/uvc_camera.h" +#include "devices/camera/mechmind/include/mechmind_camera.h" +#include "devices/speaker/ffmpeg_speaker/include/ffmpeg_speaker.h" +#include "devices/microphone/ffmpeg_microphone/include/ffmpeg_microphone.h" +#include "devices/camera/realsense_camera/include/realsense_camera.h" +#include "devices/dexhand/rh56dftp_dexhand/include/rh56dftp_dexhand.h" +#include "devices/robot/humanoid_robot/include/humanoid_robot.h" //#include "robot/ti5_robot/ti5_robot.h" #include "data_center/include/motors_info.h" +#include "devices/robot/aubo_robot/include/aubo_robot.h" using namespace std; using namespace cmvr::device; @@ -125,6 +126,9 @@ std::shared_ptr DeviceFactory::create_robot_(const XmlNode& cfg) motos_info->init(cfg); return std::make_shared>(cfg); } + else if (cfg.getNodeName() == "AuboRobot") { + return std::make_shared>(cfg); + } else { LOG(ERROR) << "[DeviceFactory]: Unsupported device type " << cfg.getNodeName(); return nullptr; diff --git a/src/devices/robot/CMakeLists.txt b/src/devices/robot/CMakeLists.txt index 599ad24f..89b22b90 100644 --- a/src/devices/robot/CMakeLists.txt +++ b/src/devices/robot/CMakeLists.txt @@ -1,3 +1,4 @@ #add_subdirectory(ti5_robot) add_subdirectory(humanoid_robot) -#add_subdirectory(c701) \ No newline at end of file +#add_subdirectory(c701) +add_subdirectory(aubo_robot) \ No newline at end of file diff --git a/src/devices/robot/aubo_robot/CMakeLists.txt b/src/devices/robot/aubo_robot/CMakeLists.txt new file mode 100644 index 00000000..1e16c41d --- /dev/null +++ b/src/devices/robot/aubo_robot/CMakeLists.txt @@ -0,0 +1,34 @@ +# 第一步:先定义 Aubo SDK 的路径(必须在 add_library 之前!) +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + set(AUBO_SDK_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/third_party/AuboSdk/linux/include) + set(AUBO_SDK_LIB_DIR ${CMAKE_SOURCE_DIR}/third_party/AuboSdk/linux/lib) +elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") + set(AUBO_SDK_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/third_party/AuboSdk/win/include) + set(AUBO_SDK_LIB_DIR ${CMAKE_SOURCE_DIR}/third_party/AuboSdk/win/lib) +endif() + +# 第二步:创建 aubo_robot 库(此时 SDK 路径已经定义好了) +add_library(aubo_robot SHARED src/aubo_robot.cpp) + +# 第三步:给 aubo_robot 配置头文件路径(合并你原来的 ${CMAKE_CURRENT_SOURCE_DIR} 和 SDK 的 include 目录) +target_include_directories(aubo_robot + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} # 你原来的路径(如果需要的话) + ${AUBO_SDK_INCLUDE_DIR} # SDK 头文件路径(关键!) +) + +# 第四步:给 aubo_robot 配置库文件路径(精准绑定到目标,比 link_directories 靠谱) +target_link_directories(aubo_robot + PRIVATE + ${AUBO_SDK_LIB_DIR} # SDK 库文件路径(关键!) +) + +# 第五步:链接 SDK 库(和你原来一致,但现在路径已经生效) +target_link_libraries(aubo_robot + PRIVATE + aubo_sdk + robot_proxy +) + +# 别名(不变) +add_library(cmvr_es::device::aubo_robot ALIAS aubo_robot) \ No newline at end of file diff --git a/src/devices/robot/aubo_robot/include/aubo_robot.h b/src/devices/robot/aubo_robot/include/aubo_robot.h new file mode 100644 index 00000000..83d4dc9f --- /dev/null +++ b/src/devices/robot/aubo_robot/include/aubo_robot.h @@ -0,0 +1,47 @@ +// +// Created by linbo on 2025/11/7. +// + +#ifndef CMVR_ES_AUBO_ROBOT_H +#define CMVR_ES_AUBO_ROBOT_H +#include "devices/robot/abstract_robot.h" +#include "aubo_sdk/rpc.h" +#include "cmvr/msgs/robot_detail.pb.h" +using namespace arcs::common_interface; +using namespace arcs::aubo_sdk; +namespace cmvr::device +{ + template + class AuboRobot: public AbstractRobot { + public: + explicit AuboRobot(const XmlNode& cfg); + ~AuboRobot(); + void init () override; + + void torqueOn() override; + void torqueOff() override; + + void getJointsState(std::vector& states) override; + + void moveJ(std::vector& cmd, double vel, double acc) override; + + void moveL(math::Pose3d& pose, double vel, double acc) override; + + void calibrateZeroQ(const std::string& joint_name) override; + msgs::Pose3d fk(const std::string &base_link, const std::string &ee_link) override; + std::vector ik(const std::string &base_link, const std::string &ee_link,msgs::Pose3d pose) override; + private: + static void waitForRobotMode(const RobotInterfacePtr& robot_interface, + const RobotModeType& target_mode); + private: + std::string ip_; + int port_; + std::string username_; + std::string password_; + std::shared_ptr rpc_cli_; + }; +} + + + +#endif //CMVR_ES_AUBO_ROBOT_H \ No newline at end of file diff --git a/src/devices/robot/aubo_robot/src/aubo_robot.cpp b/src/devices/robot/aubo_robot/src/aubo_robot.cpp new file mode 100644 index 00000000..79c3a52b --- /dev/null +++ b/src/devices/robot/aubo_robot/src/aubo_robot.cpp @@ -0,0 +1,271 @@ +// +// Created by linbo on 2025/11/7. +// + +#include "devices/robot/aubo_robot/include/aubo_robot.h" +using namespace std; +using namespace cmvr::device; + +template +AuboRobot::AuboRobot(const XmlNode &cfg) : AbstractRobot(cfg) +{ + try { + id_ = cfg.getAttrString("id"); + ip_ = cfg.getAttrString("ip"); + port_ = cfg.getAttrDefault("port",30004); + username_ = cfg.getAttrString("username"); + password_ = cfg.getAttrString("password"); + } catch (std::exception &e) { + throw runtime_error(e.what()); + } +} + + +template +AuboRobot::~AuboRobot() +{ + if (rpc_cli_) + { + // 接口调用: 退出登录 + rpc_cli_->logout(); + // 接口调用: 断开连接 + rpc_cli_->disconnect(); + } +} + +template +void AuboRobot::init () +{ + //初始化AuboSDK + rpc_cli_ = std::make_shared(); + + // 接口调用: 设置 RPC 超时 + rpc_cli_->setRequestTimeout(1000); + // 接口调用: 连接到 RPC 服务 + rpc_cli_->connect(ip_, port_); + // 接口调用: 登录 + rpc_cli_->login(username_, password_); +} +template +void AuboRobot::waitForRobotMode(const RobotInterfacePtr& robot_interface, + const RobotModeType& target_mode) +{ + // 接口调用: 获取当前机械臂的模式 + auto current_mode = robot_interface->getRobotState()->getRobotModeType(); + + while (current_mode != target_mode) { + std::cout << "机械臂当前模式:" << current_mode << std::endl; + std::this_thread::sleep_for(std::chrono::seconds(1)); + current_mode = robot_interface->getRobotState()->getRobotModeType(); + } +} +template +void AuboRobot::torqueOn() +{ + // 接口调用: 获取机器人的名字 + auto robot_name = rpc_cli_->getRobotNames().front(); + + auto robot_interface = rpc_cli_->getRobotInterface(robot_name); + + // 接口调用: 设置负载 + double mass = 0.0; + std::vector cog(3, 0.0); + std::vector aom(3, 0.0); + std::vector inertia(6, 0.0); + robot_interface->getRobotConfig()->setPayload(mass, cog, aom, inertia); + + // 接口调用: 获取机械臂当前模式 + auto robot_mode = robot_interface->getRobotState()->getRobotModeType(); + + if (robot_mode == RobotModeType::Running) { + std::cout << "机械臂已松刹车,处于运行模式" << std::endl; + + } else { + // 接口调用: 机械臂发起上电请求 + robot_interface->getRobotManage()->poweron(); + + // 等待机械臂进入空闲模式 + waitForRobotMode(robot_interface, RobotModeType::Idle); + + std::cout << "机械臂上电成功,当前模式:" + << robot_interface->getRobotState()->getRobotModeType() + << std::endl; + + // 接口调用: 机械臂发起松刹车请求 + rpc_cli_->getRobotInterface(robot_name)->getRobotManage()->startup(); + + // 等待机械臂进入运行模式 + waitForRobotMode(robot_interface, RobotModeType::Running); + + std::cout << "机械臂松刹车成功,当前模式:" + << robot_interface->getRobotState()->getRobotModeType() + << std::endl; + } +} +template +void AuboRobot::getJointsState(std::vector& states) +{ + try { + // 接口调用: 获取机器人的名字 + auto robot_name = rpc_cli_->getRobotNames().front(); + + auto robot_interface = rpc_cli_->getRobotInterface(robot_name); + auto rebotState = robot_interface->getRobotState(); + states.clear(); + JointState state; + //获取关节位置和速度 + for (int i = 0; i < 6; i++) { + state.velocity = rebotState->getJointSpeeds()[i]; + state.position = rebotState->getJointPositions()[i]; + states.push_back(state); + } + } catch (exception &e) { + throw runtime_error(e.what()); + } +} + + +template +void AuboRobot::torqueOff() +{ + // 接口调用: 获取机器人的名字 + auto robot_name = rpc_cli_->getRobotNames().front(); + + auto robot_interface = rpc_cli_->getRobotInterface(robot_name); + + // 接口调用: 机械臂断电 + robot_interface->getRobotManage()->poweroff(); + + // 等待机械臂进入断电模式 + waitForRobotMode(robot_interface, RobotModeType::PowerOff); + + std::cout << "机械臂断电成功,当前模式:" + << robot_interface->getRobotState()->getRobotModeType() + << std::endl; +} +template +void AuboRobot::moveJ(std::vector& cmd, double vel, double acc) +{ + try + { + //检查参数 + if (cmd.size() != dof_) + { + LOG(ERROR) << "[AuboRobot](moveJ)Wrong number of cmd"; + throw std::invalid_argument("[AuboRobot](moveJ)Wrong number of cmd"); + } + //调用aubo sdk接口实现moveJ + + // 接口调用: 获取机器人的名字 + auto robot_name = rpc_cli_->getRobotNames().front(); + + auto robot_interface = rpc_cli_->getRobotInterface(robot_name); + + // 接口调用: 设置机械臂的速度比率 + robot_interface->getMotionControl()->setSpeedFraction(0.3); + + /* + * 1、严格遵守公司安全规章制度,严格遵守相关的国家安全规章制度,发现隐患及时上报 + * 2、工作前按规定佩戴安全保护工具 + * 3、定期检查存在安全隐患的设备 + * 4、积极参与公司组织的安全培训 + * 5、在进行危险工作过程中相互监查,安全作业 + */ + // 接口调用: 关节运动 + // 关节角,单位: 弧度 (此处为6关节) + std::vector joint_angle; + for (int i = 0; i < cmd.size(); i++) + { + joint_angle.emplace_back(cmd[i].rad); + } + robot_interface->getMotionControl()->moveJoint( + joint_angle, acc, vel, 0, 0); + } + catch (std::exception& e) + { + throw std::invalid_argument(e.what()); + } +} + +template +void AuboRobot::calibrateZeroQ(const std::string& joint_name) +{ + +} + +template +cmvr::msgs::Pose3d AuboRobot::fk(const std::string &base_link, const std::string &ee_link) +{ + cmvr::msgs::Pose3d pose; + + + return pose; +} + +template +std::vector AuboRobot::ik(const std::string &base_link, const std::string &ee_link,msgs::Pose3d pose) +{ + std::vector ik; + + + return ik; +} +// 实现阻塞功能: 当机械臂运动到目标路点时,程序再往下执行 +int waitArrival(RobotInterfacePtr impl) { + const int max_retry_count = 5; + int cnt = 0; + + // 接口调用: 获取当前的运动指令 ID + int exec_id = impl->getMotionControl()->getExecId(); + + // 等待机械臂开始运动 + while (exec_id == -1) { + if (cnt++ > max_retry_count) { + return -1; + } + std::this_thread::sleep_for(std::chrono::milliseconds(50)); + exec_id = impl->getMotionControl()->getExecId(); + } + + // 等待机械臂动作完成 + while (impl->getMotionControl()->getExecId() != -1) { + std::this_thread::sleep_for(std::chrono::milliseconds(50)); + } + + return 0; +} +template +void AuboRobot::moveL(math::Pose3d& pose, double vel, double acc) +{ + // 接口调用: 获取机器人的名字 + auto robot_name = rpc_cli_->getRobotNames().front(); + + auto robot_interface = rpc_cli_->getRobotInterface(robot_name); + + // 接口调用: 设置机械臂的速度比率 + robot_interface->getMotionControl()->setSpeedFraction(0.75); + + // 接口调用: 设置工具中心点(TCP相对于法兰盘中心的偏移) + std::vector tcp_offset(6, 0.0); + robot_interface->getRobotConfig()->setTcpOffset(tcp_offset); + + // 接口调用: 直线运动到位置 + std::vector pose1; + pose1.emplace_back(pose.position.x); + pose1.emplace_back(pose.position.y); + pose1.emplace_back(pose.position.z); + pose1.emplace_back(pose.euler.rx); + pose1.emplace_back(pose.euler.ry); + pose1.emplace_back(pose.euler.rz); + robot_interface->getMotionControl()->moveLine(pose1, acc, vel, 0.025, 0); + // 阻塞 + auto ret = waitArrival(robot_interface); + if (ret == 0) { + LOG(INFO)<<"直线运动到位置成功!"; + } else { + LOG(INFO)<<"直线运动到位置失败!"; + } +} + + +template class cmvr::device::AuboRobot<6>; diff --git a/third_party/AuboSdk/linux/include/AuboRobotMetaType.h b/third_party/AuboSdk/linux/include/AuboRobotMetaType.h new file mode 100644 index 00000000..aa9995b3 --- /dev/null +++ b/third_party/AuboSdk/linux/include/AuboRobotMetaType.h @@ -0,0 +1,1670 @@ +#ifndef AUBOROBOTMETATYPE_H +#define AUBOROBOTMETATYPE_H + +#include +#include +#include "robotiomatetype.h" + +#if defined(SERVICE_INTERFACE_BUILD_STAGE) // 编译阶段 +#if defined __GNUC__ +#define SERVICE_INTERFACE_ABI_EXPORT __attribute__((visibility("default"))) +#define SERVICE_INTERFACE_ABI_LOCAL __attribute__((visibility("hidden"))) +#else +#define SERVICE_INTERFACE_ABI_EXPORT __declspec(dllexport) +#define SERVICE_INTERFACE_ABI_LOCAL __attribute__((visibility("hidden"))) +#endif +#else // 链接阶段 +#if defined __GNUC__ +#define SERVICE_INTERFACE_ABI_EXPORT +#define SERVICE_INTERFACE_ABI_LOCAL +#else +#define SERVICE_INTERFACE_ABI_EXPORT __declspec(dllimport) +#define SERVICE_INTERFACE_ABI_LOCAL +#endif +#endif + +/** + * General types + */ +typedef uint8_t boolean; +typedef int8_t int8; +typedef int16_t int16; +typedef int32_t int32; +typedef uint8_t uint8; +typedef uint16_t uint16; +typedef uint32_t uint32; +typedef int64_t int64; +typedef uint64_t uint64; +typedef float float32; +typedef double float64; + +#ifdef __GNUC__ +#define PACK(__Declaration__) __Declaration__ __attribute__((__packed__)) +#endif + +#ifdef _MSC_VER +#define PACK(__Declaration__) \ + __pragma(pack(push, 1)) __Declaration__ __pragma(pack(pop)) +#endif +#ifdef __cplusplus +extern "C" { +#endif + +/** + * 命名空间 aubo_robot_namespace + **/ +namespace aubo_robot_namespace { +enum CollisionMode +{ + CollisionMode_Free, + CollisionMode_Stuck, + // CollisionMode_Adamittance, +}; + +enum +{ + ARM_DOF = 6, //机械臂关节数 +}; + +/** + * 机械臂类型 + **/ +typedef enum +{ + ROBOT_I5 = 0, + ROBOT_I7 = 1, + ROBOT_I10_12 = 2, + ROBOT_I3S = 3, + ROBOT_I3 = 4, + ROBOT_I5S = 5, + ROBOT_I5RX = 501, + ROBOT_I5A_02 = 502, + ROBOT_I5A_03 = 503, + ROBOT_I5L = 6, + ROBOT_I10S = 7, + ROBOT_I16 = 8, + ROBOT_I20 = 9, + ROBOT_I20_1500 = 901, + ROBOT_I20_1650_A = 902, + ROBOT_I20TD = 10, + ROBOT_G3 = 11, + ROBOT_G6 = 12, + ROBOT_F12B = 20, + ROBOT_I12 = 21, + ROBOT_I18 = 22, + ROBOT_T6 = 23, + ROBOT_I5_NET = 24, + ROBOT_I20L_1900 = 25, + ROBOT_I10_CM01 = 26, + ROBOT_I20_BZL = 27, + ROBOT_IS10 = 50, + ROBOT_IS20 = 51, + ROBOT_IS7 = 52, + ROBOT_I25 = 53, + ROBOT_I27 = 54, + ROBOT_I35 = 55, + ROBOT_I10_JY = 56, + ROBOT_IS25_1500 = 57, + ROBOT_I10L = 58, + ROBOT_IS20L = 59, + ROBOT_IS20L_T0 = 60, + ROBOT_IS25_1700 = 61, + ROBOT_I3_F = 62, + ROBOT_I5_F = 63, + ROBOT_I7_F = 64, + ROBOT_I10_F = 65, + ROBOT_I12_F = 66, + ROBOT_I16_F = 67, + ROBOT_IS7_F = 68, +} RobotType; + +/** + * DH参数 + **/ +typedef struct +{ + double A3; + double A4; + double D1; + double D2; + double D5; + double D6; + + // general dh model + double alpha[ARM_DOF]; + double a[ARM_DOF]; + double d[ARM_DOF]; + double theta[ARM_DOF]; +} RobotDhPara; + +typedef enum +{ + RobotControllerErr_MotionCfgErr, // only this is recoverable. + RobotControllerErr_OverspeedProtect, + RobotControllerErr_IkFailure, + RobotControllerErr_OnlineTrajErr, + RobotControllerErr_OfflineTrajErr, + RobotControllerErr_StatusException, +} RobotControllerErrorCode; + +typedef enum +{ + RUN_TO_READY_POSITION, + RUN_PROJECT, + PAUSE_PROJECT, + CONTINUE_PROJECT, + SLOWLY_STOP_PROJECT, + LOAD_PROJECT, + ENTER_SAFEGUARD_MODE_BY_DI_EXTERNAL_SAFEGUARD_STOP, + RELEASE_SAFEGUARD_MODE_IN_AUTOMATIC_MODE, + RELEASE_SAFEGUARD_MODE_IN_MANUAL_MODE, + MANUALLY_RELEASE_SAFEGUARD_MODE_PROMPT, + ENTER_SAFEGUARD_MODE_BY_TRI_STATE_SWITCH, + RELEASE_SAFEGUARD_MODE_BY_TRI_STATE_SWITCH, + ENTER_REDUCE_MODE, + RELEASE_REDUCE_MODE, + REMOTE_CLEAR_ALARM_SIGNAL, + PROJECT_STARTUP_IS_SAFETY, + START_RUN_TO_READY_POSITION, + STOP_RUN_TO_READY_POSITION +} InterfaceBoardSafeIoEventCode; + +/** + * 机械臂诊断信息 + **/ +PACK(struct RobotDiagnosis { + uint8 + armCanbusStatus; // CAN通信状态:0x01~0x80:关节CAN通信错误(每个关节占用1bit) + // 0x00:无错误 + float armPowerCurrent; // 机械臂48V电源当前电流 + float armPowerVoltage; // 机械臂48V电源当前电压 + bool armPowerStatus; // 机械臂48V电源状态(开、关) + char contorllerTemp; // 控制箱温度 + uint8 contorllerHumidity; // 控制箱湿度 + bool remoteHalt; // 远程关机信号 + bool softEmergency; // 机械臂软急停 + bool remoteEmergency; // 远程急停信号 + bool robotCollision; // 碰撞检测位 + bool forceControlMode; // 机械臂进入力控模式标志位 + bool brakeStuats; // 刹车状态 + float robotEndSpeed; // 末端速度 + int robotMaxAcc; // 最大加速度 + bool orpeStatus; // 上位机软件状态位 + bool enableReadPose; // 位姿读取使能位 + bool robotMountingPoseChanged; // 安装位置状态 + bool encoderErrorStatus; // 磁编码器错误状态 + bool staticCollisionDetect; // 静止碰撞检测开关 + uint8 jointCollisionDetect; // 关节碰撞检测 每个关节占用1bit 0-无碰撞 + // 1-存在碰撞 + bool encoderLinesError; // 光电编码器不一致错误 0-无错误 1-有错误 + bool jointErrorStatus; // joint error status + bool singularityOverSpeedAlarm; // 机械臂奇异点过速警告 + bool robotCurrentAlarm; // 机械臂电流错误警告 + uint8 toolIoError; // tool error + bool robotMountingPoseWarning; // 机械臂安装位置错位(只在力控模式下起作用) + uint16 macTargetPosBufferSize; // mac缓冲器长度 预留 + uint16 macTargetPosDataSize; // mac缓冲器有效数据长度 预留 + uint8 macDataInterruptWarning; // mac数据中断 预留 + uint8 controlBoardAbnormalStateFlag; //主控板(接口板)异常状态标志 +}); + +PACK(struct OrpeSafetyStatus { + uint8 orpePause; // 上位机暂停状态 + uint8 orpeStop; // 上位机停止状态 + uint8 orpeError[16]; // 上位机错误 + uint8 systemEmergencyStop; // 解除系统紧急停止输出信号 + uint8 reducedModeError; // 解除缩减错误 + uint8 safetyguardResetSucc; // 防护重置成功 +}); + +PACK(struct RobotSafetyConfig { + uint16 robotReducedConfigJointSpeed[6]; //缩减配置 关节速度限制 + uint32 robotReducedConfigTcpSpeed; //缩减配置 TCP速度限制 + uint32 robotReducedConfigTcpForce; //缩减配置 TCP力(暂定为碰撞等级) + uint32 robotReducedConfigMomentum; //缩减配置 动量 + uint32 robotReducedConfigPower; //缩减配置 功率 + uint8 robotSafeguradResetConfig; //防护重 置设置 + uint8 robotOperationalModeConfig; //操作模式设置 +}); + +PACK(struct RegulateSpeedModeParamConfig_t { + double maxTcpVelocity; //末端速度 + double maxTcpAcceleration; //末端加速度 + double maxJointVelocity[ARM_DOF]; //关节速度 + double maxJointAcceleration[ARM_DOF]; //关节加速度 +}); + +PACK(struct AdmittancePatam_t { + double inertia[ARM_DOF]; //导纳系数之 惯量inertia + double damping[ARM_DOF]; //导纳系数之 阻尼(b)damping + double stiffness[ARM_DOF]; //导纳系数之 刚度(k)stiffness +}); + +/** + * @brief IO的类型枚举 + * + **/ +typedef enum +{ + RobotBoardControllerDI, // 接口板控制器DI(数字量输入)   只读(一般系统内部使用) + RobotBoardControllerDO, // 接口板控制器DO(数字量输出) 只读(一般系统内部使用) + RobotBoardControllerAI, // 接口板控制器AI(模拟量输入) + // 只读(一般系统内部使用) + RobotBoardControllerAO, // 接口板控制器AO(模拟量输出)   只读(一般系统内部使用) + + RobotBoardUserDI, // 接口板用户DI(数字量输入)   可读可写 + RobotBoardUserDO, // 接口板用户DO(数字量输出) 可读可写 + RobotBoardUserAI, // 接口板用户AI(模拟量输入) 可读可写 + RobotBoardUserAO, // 接口板用户AO(模拟量输出) 可读可写 + + RobotToolDI, // 工具端DI + RobotToolDO, // 工具端DO + RobotToolAI, // 工具端AI + RobotToolAO, // 工具端AO + +} RobotIoType; + +/** + * IO类型 + **/ +typedef enum +{ + IO_IN = 0, //输入 + IO_OUT //输出 +} ToolIOType; + +/** + * 工具的电源类型 + **/ +typedef enum +{ + OUT_0V = 0, + OUT_12V = 1, + OUT_24V = 2 +} ToolPowerType; + +typedef enum +{ + RobotToolIoTypeDI = RobotToolDI, //工具端DI + RobotToolIoTypeDO = RobotToolDO //工具端DO +} RobotToolIoType; + +typedef enum //IO状态 +{ + IO_STATUS_INVALID = 0, //有效 + IO_STATUS_VALID //无效 +} IO_STATUS; + +typedef enum +{ + TOOL_DIGITAL_IO_0 = 0, + TOOL_DIGITAL_IO_1 = 1, + TOOL_DIGITAL_IO_2 = 2, + TOOL_DIGITAL_IO_3 = 3 + +} ToolDigitalIOAddr; + +/** + * 综合描述一个IO + **/ +PACK(struct RobotIoDesc { + char ioId[32]; // IO-ID 目前未使用 + RobotIoType ioType; // IO类型 + char ioName[32]; // IO名称 + int ioAddr; // IO地址 + double ioValue; // IO状态 +}); + +//接口板数字量数据 +typedef struct +{ + uint8 addr; + uint8 value; + uint8 type; +} RobotDiagnosisIODesc; + +//接口板模拟量数据 +typedef struct +{ + uint8 addr; + float value; + uint8 type; +} RobotAnalogIODesc; + +PACK(struct ToolDigitalStatus { + ToolIOType ioType; + uint8 ioData; +}); + +typedef enum +{ + RobotToolNoError = 0, //无错误 + RobotToolOverVoltage = 1, //过压 + RobotToolUnderVoltage = 2, //欠压 + RobotToolOVerTemp = 3, //过温 + RobotToolCanBusError = 4 // CAN总线错误 +} RobotToolErrorCode; + +/** + * @brief 机械臂启动完成状态 + */ +enum ROBOT_SERVICE_STATE +{ + ROBOT_SERVICE_READY = 0, + ROBOT_SERVICE_STARTING, + ROBOT_SERVICE_WORKING, + ROBOT_SERVICE_CLOSING, + ROBOT_SERVICE_CLOSED, + ROBOT_SETVICE_FAULT_POWER, + ROBOT_SETVICE_FAULT_BRAKE, + ROBOT_SETVICE_FAULT_NO_ROBOT, + ROBOT_SETVICE_FAULT_SAFEGUARD_STOP +}; + +enum ROBOT_INIT_PHASE +{ + ROBOT_INIT_PHASE_READY = 0, + ROBOT_INIT_PHASE_HANDSHAKE, + ROBOT_INIT_PHASE_SET_POWER, + ROBOT_INIT_PHASE_SET_BRAKE, + ROBOT_INIT_PHASE_SET_COLLSION_CLASS, + ROBOT_INIT_PHASE_SET_OTHER_CMD, + ROBOT_INIT_PHASE_WORKING +}; + +typedef enum +{ + RobotModeSimulator, // 机械臂仿真模式 + RobotModeReal // 机械臂真实模式 +} RobotWorkMode; + +/** + * @brief 机械臂运动控制命令 + */ +typedef enum +{ + RobotMoveStop = 0, // 停止 + RobotMovePause = 1, // 暂停 + RobotMoveContinue = 2, // 继续 +} RobotMoveControlCommand; + +/** + * @brief 机械臂控制命令 + */ +enum RobotControlCommand +{ + RobotRelease = 0, // 释放刹车 + RobotBrake = 1, // 刹车 + OverspeedWarning = 2, // 拖动示教速度过快报警 + OverspeedRecover = 3, // 解除拖动过速报警 + DisableForceControl = 4, // 失能力控 + EnableForceControl = 5, // 使能力控 + OrpeOpen = 6, // 打开上位机软件 + OrpeClose = 7, // 关闭上位机软件 + EnableReadPose = 8, // 打开读取位姿 + DisableReadPose = 9, // 关闭读取位姿 + MountingPoseChanged = 10, // 安装位置已改变 + MountingPoseUnChanged = 11, // 安装位置未改变 + EnableStaticCollisionDetect = 12, // 打开静止碰撞检测 + DisableStaticCollisionDetect = 13, // 关闭静止碰撞检测 + ClearSingularityOverSpeedAlarm = 14, // 解除机械臂奇异点过速警告 + ClearRobotCurrentAlarm = 15, // 解除机械臂电流错误警告 + + // 适配新 aubope sdk 部分枚举,用于实现加油机器人需求 + EnterDragAndTeachMode = 0x15, //进入拖动示教模式 + ExitDragAndTeachMode = 0x16, //退出拖动示教模式 + RobotShutdown = 0x24, //上位机指令控制机械臂一类停机,并上传错误 + ClearRobotShutdown = 0x25, //清除上位机一类停机标志 + EnableCollisionStuckBrake = 0x28, //使能碰撞stuck模式锁刹车 + DisableCollisionStuckBrake = 0x29, //失能能碰撞stuck模式锁刹车 +}; + +/** + * @brief 位置信息 + **/ +struct Pos +{ + double x; + double y; + double z; +}; + +/** + * @brief 位置信息的共用体描述 + **/ +union cartesianPos_U +{ + Pos position; + double positionVector[3]; +}; + +/** + * @brief 姿态的四元素表示方法 + **/ +struct Ori +{ + double w; + double x; + double y; + double z; +}; + +/** + * @brief 姿态的欧拉角表示方法 + **/ +struct Rpy +{ + double rx; + double ry; + double rz; +}; + +typedef struct +{ + double jointPos[ARM_DOF]; +} JointParam; + +/** + * @brief 描述关节的速度和加速度 + */ +typedef struct +{ + double jointPara[ARM_DOF]; +} JointVelcAccParam; + +/** + * 关节碰撞补偿(范围0.00~0.51度) + **/ +typedef struct +{ + double jointOffset[ARM_DOF]; +} RobotJointOffset; + +/** + * @brief 机械臂的路点信息 + **/ +typedef struct +{ + cartesianPos_U cartPos; // 机械臂的位置信息(x,y,z) + Ori orientation; // 机械臂姿态信息,四元素(w,x,y,z) + double jointpos[ARM_DOF]; // 机械臂关节角信息 + int id; // 路点ID +} wayPoint_S; + +typedef struct +{ + cartesianPos_U cartPos; + Ori orientation; + double jointpos[ARM_DOF]; +} RoadPoint; + +typedef struct +{ + double data[6]; +} ForceSensorData; + +typedef struct +{ + Pos position; + Ori quaternion; +} PositionAndQuaternion; + +/** + * @brief 描述运动属性中的偏移属性 + */ +typedef struct +{ + bool ena; // 是否使能偏移 + float relativePosition[3]; // 偏移量 x,y,z + Ori relativeOri; // 姿态偏移 +} MoveRelative; + +typedef struct +{ + double minValue; + double maxValue; +} RangeOfMotion; + +/** + * 关节运动范围 + */ + +typedef struct +{ + bool enable; // 是否使能偏移 + RangeOfMotion rangeValues[ARM_DOF]; //运动范围 +} JointRangeOfMotion; + +/** + * @brief 示教模式枚举 + **/ +enum teach_mode +{ + NO_TEACH = 0, + JOINT1, + JOINT2, + JOINT3, + JOINT4, + JOINT5, + JOINT6, + MOV_X, + MOV_Y, + MOV_Z, + ROT_X, + ROT_Y, + ROT_Z +}; + +/** + * @brief 运动轨迹枚举 + **/ +enum move_track +{ + NO_TRACK = 0, + + // for moveJ and moveL + TRACKING, + + // cartesian motion for moveP + ARC_CIR, + CARTESIAN_MOVEP, + CARTESIAN_CUBICSPLINE, + CARTESIAN_UBSPLINEINTP, + CARTESIAN_GNUBSPLINEINTP, + CARTESIAN_LOOKAHEAD, + + // joint motion for moveP + JIONT_CUBICSPLINE, + JOINT_UBSPLINEINTP, + JOINT_GNUBSPLINEINTP, + + ARC, + CIRCLE, + ARC_ORI_ROTATED, + CIRCLE_ORI_ROTATED, + + ORI_POSITION_ROTATE_CIRCUMFERENCE = 101, +}; + +/** + * @brief 工具姿态标定的方法枚举 + * + */ + +enum ToolKinematicsOriCalibrateMathod +{ + ToolKinematicsOriCalibrateMathod_Invalid = -1, + ToolKinematicsOriCalibrateMathod_xOxy, // 原点、x轴正半轴、x、y轴平面的第一象限上任意一点 + ToolKinematicsOriCalibrateMathod_yOyz, // 原点、y轴正半轴、y、z轴平面的第一象限上任意一点 + ToolKinematicsOriCalibrateMathod_zOzx, // 原点、z轴正半轴、z、x轴平面的第一象限上任意一点 + ToolKinematicsOriCalibrateMathod_TxRBz_TxyPBzAndTyABnz, // 工具x轴平行反向于基坐标系z轴; + // 工具xOy平面平行于基坐标系z轴、工具y轴与基坐标系负z轴夹角为锐角 + ToolKinematicsOriCalibrateMathod_TyRBz_TyzPBzAndTzABnz, // 工具y轴平行反向于基坐标系z轴; + // 工具yOz平面平行于基坐标系z轴、工具z轴与基坐标系负z轴夹角为锐角 + ToolKinematicsOriCalibrateMathod_TzRBz_TzxPBzAndTxABnz, // 工具z轴平行反向于基坐标系z轴; + // 工具zOx平面平行于基坐标系z轴、工具x轴与基坐标系负z轴夹角为锐角 + ToolKinematicsOriCalibrateMathodCount +}; + +/** + * 该结构体描述工具惯量 + * + * 注:该结构体属于冗余数据类型,使用时把所有参数都设置为{0,0,0,0,0,0}. + **/ +typedef struct +{ + double xx; + double xy; + double xz; + double yy; + double yz; + double zz; +} ToolInertia; + +/** + * 工具动力学参数描述 + * + * 注意: + *    机械臂上电之前,安装在机器人末端的工具发生改变时都需要重新设置工具的动力学参数. + *    一般情况下,工具的动力学参数和运动学参数是需要一起设置的; + * 切记: + *    该参数如果不能正确设置会影响机械臂的安全等级和运动轨迹. + **/ +typedef struct +{ + double positionX; // 工具重心的X坐标 + double positionY; // 工具重心的Y坐标 + double positionZ; // 工具重心的Z坐标 + double payload; // 工具重量 + ToolInertia toolInertia; // 工具惯量 预留 使用是全部设置为0 +} ToolDynamicsParam; + +/** 工具描述 工具的运动学参数 + * + * 该工具用于描述一个工具或者工具的运动学参数. + */ +typedef struct +{ + Pos toolInEndPosition; // 工具相对法兰盘的位置 + Ori toolInEndOrientation; // 工具相对法兰盘的姿态 +} ToolInEndDesc; + +typedef ToolInEndDesc ToolKinematicsParam; +typedef ToolInEndDesc RobotCameraCalib; + +/** + * 焊接摇摆结构体 + */ +typedef struct +{ + bool weaveEnable; + int weaveType; + double weaveStep; + double weaveAmplitude; + double weaveHoldDistance; + double weaveAngle; +} WeaveMove; + +PACK(struct RobotRecongnitionParam { + uint8 type; //机械臂辨识参数类型 + uint8 length; //参数数据长度 + uint8 data[256]; //参数实际数据 +}); + +/** + * 坐标系类型枚举 + **/ +enum coordinate_refer +{ + BaseCoordinate = 0, // 基座坐标系 + EndCoordinate, // 末端坐标系或工具坐标系 + WorldCoordinate, // 用户坐标系 +}; + +/** + * 用户坐标系标定方法枚举 + * + * 描述:3点标定坐标系 3个示教点的含义. + **/ +enum CoordCalibrateMathod +{ + Origin_AnyPointOnPositiveXAxis_AnyPointOnPositiveYAxis, // 原点、x轴正半轴、y轴正半轴 + Origin_AnyPointOnPositiveYAxis_AnyPointOnPositiveZAxis, // 原点、y轴正半轴、z轴正半轴 + Origin_AnyPointOnPositiveZAxis_AnyPointOnPositiveXAxis, // 原点、z轴正半轴、x轴正半轴 + Origin_AnyPointOnPositiveXAxis_AnyPointOnFirstQuadrantOfXOYPlane, // 原点、x轴正半轴、x、y轴平面的第一象限上任意一点 + Origin_AnyPointOnPositiveXAxis_AnyPointOnFirstQuadrantOfXOZPlane, // 原点、x轴正半轴、x、z轴平面的第一象限上任意一点 + Origin_AnyPointOnPositiveYAxis_AnyPointOnFirstQuadrantOfYOZPlane, // 原点、y轴正半轴、y、z轴平面的第一象限上任意一点 + Origin_AnyPointOnPositiveYAxis_AnyPointOnFirstQuadrantOfYOXPlane, // 原点、y轴正半轴、y、x轴平面的第一象限上任意一点 + Origin_AnyPointOnPositiveZAxis_AnyPointOnFirstQuadrantOfZOXPlane, // 原点、z轴正半轴、z、x轴平面的第一象限上任意一点 + Origin_AnyPointOnPositiveZAxis_AnyPointOnFirstQuadrantOfZOYPlane, // 原点、z轴正半轴、z、y轴平面的第一象限上任意一点 + + CoordTypeCount, +}; + +/** + * 坐标系描述 + * + * 该结构体描述一个坐标系。系统通过该结构体描述一个坐标系(基座坐标系, + *用户坐标系, 末端坐标系或工具坐标系)。 + * + * 坐标系分3种类型: 基座坐标系(BaseCoordinate); + * 用户坐标系(WorldCoordinate); + * 末端坐标系或工具坐标系(EndCoordinate); + * + * 定义: + * 基座坐标系 是 根据机械臂基座建立的坐标系; + * 用户坐标系 是 + *用户坐标系定义在工件上,在机器人动作允许范围内的任意位置,设定任意角度的X、Y、Z轴,原点位于机器人抓取的工件上,坐标系的方向根据客户需要任意定义。 + * 末端坐标系 + *是 安装在机器人末端的工具坐标系,原点及方向都是随着末端位置与角度不断变化的,该座标系实际是将基础座标系通过旋转及位移变化而来的;法兰盘是一个特殊的末端坐标系. + * + * 结构体参数描述: + * coordType     坐标系类型,描述坐标系属于那种类型 + *    methods + *    用户坐标系的标定方法     仅在coordType为用户坐标系(WorldCoordinate)时有效; + *    wayPointArray[3]  标定用户坐标系的3个路点信息 仅在coordType为用户坐标系(WorldCoordinate)时有效; + *    toolDesc       末端工具描述   当coordType=WorldCoordinate 表示标定用户坐标系时,安装在机器人末端的工具; + * 当coordType=EndCoordinate + *描述是哪个工具的坐标系 + * + * 使用说明: + * 基座坐标系 + * coordType=BaseCoordinate + *         其他参数默认 + * 用户坐标系 + * coordType=WorldCoordinate + *         methods        为标定方法 + *         wayPointArray[3]   标定坐标系的3个路点 + *         toolDesc        标定用户坐标系时,安装在机器人末端的工具 + *    末端坐标系或工具坐标系 + * coordType=EndCoordinate + *         methods        缺省,不需要设置 + *         wayPointArray[3]   缺省,不需要设置 + *         toolDesc        机器人末端的工具 + * + * 备注: + *   法兰盘为特殊的工具,工具描述中的位置设置为(0,0,0),姿态信息设置为(1,0,0,0) + *    其结构体定义为 + * { + * pos{0,0,0}, + * Ori{1,0,0,0} + * } //伪代码 + * + * 该结构同时用于用户坐标系的标定.一般通过示教3个示教点实现,第一个示教点是用户坐标系的原点;第二个和第三个示教点的选择根据标定方法来确定,遵循右手手法. + */ +typedef struct +{ + coordinate_refer coordType; // 坐标系类型 + CoordCalibrateMathod methods; // 用户坐标系的标定方法 + JointParam wayPointArray[3]; // 用于标定用户坐标系的3个点(关节角) + ToolInEndDesc toolDesc; // 工具描述 +} CoordCalibrateByJointAngleAndTool; + +typedef struct +{ + //用于位置标定点的数量 + int posCalibrateNum; + //位置标定点 + wayPoint_S posCalibrateWaypoint[4]; + //用于姿态标定点的数量 + int oriCalibrateNum; + //姿态标定点 + wayPoint_S oriCalibrateWaypoint[3]; + //姿态标定方法 + ToolKinematicsOriCalibrateMathod CalibrateMathod; +} ToolCalibrate; + +PACK(struct MoveProfile_t { + double jointMaxAcc[ARM_DOF]; //关节型运动的最大加速度 + double jointMaxVelc[ARM_DOF]; //关节型运动的最大速度 + double endMaxLineAcc; //末端型运动的最大加速度 + double endMaxLineVelc; //末端型运动的最大速度 + + MoveRelative relative; //偏移参数 + CoordCalibrateByJointAngleAndTool relativeOnCoord; //偏移量基于那个坐标系 + + double blendRadius; //交融半径 + ToolInEndDesc toolInEndDesc; //工具属性 +}); + +/** + * @brief 机械臂状态枚举 + **/ +enum RobotState +{ + RobotStopped = 0, //停止 + RobotRunning, //运行 + RobotPaused, //暂停 + RobotResumed //恢复 +}; + +/** + * 机械臂重力分量x y z + **/ +typedef struct +{ + float x; + float y; + float z; +} RobotGravityComponent; + +/** + * 机械臂关节版本信息 + **/ +PACK(struct JointVersion { + char hw_version[8]; //硬件版本信息 + char sw_version[16]; //固件版本信息 +}); + +/** + * 关节ID信息 + **/ +PACK(struct JointProductID { char productID[16]; }); + +/** + * 该结构体描述设备信息 + **/ +PACK(struct RobotDevInfo { + uint8 type; // 设备型号、芯片型号:上位机主站:0x01 接口板0x02 + char revision[16]; // 设备版本号,eg:V1.0 + char manu_id[16]; // 厂家ID,"OUR "的ASCII码0x4F 55 52 00 + char joint_type[16]; // 机械臂类型 + JointVersion joint_ver[8]; // 机械臂关节及工具端信息 + char desc[64]; // 设备描述字符串以0x00结束 + JointProductID jointProductID[8]; // 关节ID信息 + char slave_version[16]; // 从设备版本号 - 字符串表示,如“V1.0.0 + char extio_version[16]; // IO扩展板版本号 -字符串标志,如“V1.0.0 +}); + +typedef struct PACKED +{ + uint8 io_modes; // PNP:0; NPN:1 + + uint64_t di_num; + + uint64_t do_num; + + uint64_t ai_num; + + uint64_t ao_num; + +} IoConfig; + +/** + * 描述机械臂的关节状态 + */ +PACK(struct JointStatus { + int jointCurrentI; // 关节电流 Current of driver + int jointSpeedMoto; // 关节速度 Speed of driver + float jointPosJ; // 关节角 Current position in radian + float jointCurVol; // 关节电压 Rated voltage of motor. Unit: mV + float jointCurTemp; // 当前温度 Current temprature of joint + int jointTagCurrentI; // 电机目标电流 Target current of motor + float jointTagSpeedMoto; // 电机目标速度 Target speed of motor + float jointTagPosJ; // 目标关节角  Target position of joint in radian + uint16 jointErrorNum; // 关节错误码 Joint error of joint num +}); + +PACK(struct JointCommonData { + uint16 JointCurVol; /*!< 关节当前电压 */ + uint16 JointCurTemp; /*!< 关节当前温度*/ + uint16 JointWorkMode; /*!< 关节工作模式 */ + uint16 JointDriEnable; /*!< 关节驱动器使能标志 */ + uint16 JointOpenPwm; /*!< 关节开环占空比 */ + int32_t JointTagCurrent; /*!< 关节当前的目标电流 */ + int32_t JointTagSpeed; /*!< 关节当前的目标速度 */ + int32_t JointTagPos; /*!< 关节当前的目标位置 */ + + uint16 JointMaxCur; /*!< 关节当前的最大电流 */ + uint16 JointMaxSpeed; /*!< 关节当前的最大速度 */ + uint16 JointMaxAcc; /*!< 关节当前的最大加速度 */ + int32_t JointMINPos; /*!< 关节最小位置 */ + int32_t JointMAXPos; /*!< 关节最大位置 */ + + uint16 JointSEVLock; /*!< 关节三环参数锁定标志 */ + uint16 JointCurP; /*!< 关节电流P参数 */ + uint16 JointCurI; /*!< 关节电流I参数 */ + uint16 JointCurD; /*!< 关节电流D参数 */ + uint16 JointSpeedP; /*!< 关节速度P参数 */ + uint16 JointSpeedI; /*!< 关节速度I参数 */ + uint16 JointSpeedD; /*!< 关节速度D参数 */ + uint16 JointSpeedDS; /*!< 关节速度死区 */ + uint16 JointPosP; /*!< 关节位置P参数 */ + uint16 JointPosI; /*!< 关节位置I参数 */ + uint16 JointPosD; /*!< 关节位置D参数 */ + uint16 JointPosDS; /*!< 关节位置DS参数 */ +}); + +/** + * @brief 离线轨迹相关枚举 + */ +enum Robot_Dyn_identify_traj +{ + Dyn_identify_traj_none = 0, + Dyn_identify_traj_robot, // submode: 0/1 <-> internal/hybrid + Dyn_identify_traj_tool, // submode: 0/1 <-> tool only/tool+friction + Dyn_identify_traj_tool_abort +}; + +/** + * @brief 接口板固件升级枚举 + */ +typedef enum +{ + update_master_board_firmware_trans_start = 1, + update_master_board_firmware_trans_data = 2, + update_master_board_firmware_trans_end = 3, + update_slave_board_firmware_trans_start = 4, + update_slave_board_firmware_trans_data = 5, + update_slave_board_firmware_trans_end = 6 +} update_board_firmware_cmd; + +typedef struct +{ + bool trackEnable; // T + wayPoint_S currentRoadPoint; // R + wayPoint_S nextRoadPoint; // R + int timeInterval; // T + double currentPosError[3]; // T + double maxVel; // T + double maxAcc; // T + bool paraChanged; // RT +} SeamTracking; + +PACK(struct RobotArmParamHeader { + uint16 cmd; //请求指令 0x01-读 0x02-写 + uint16 baseDataLen; //基座信息长度 + uint16 jointDataLen; //关节信息长度 +}); + +//位置姿态类型枚举 +typedef enum +{ + POSITION_MM_AND_RPY_ANGLE_SPACE_SPLIT = + 1, //位置(单位:毫米)+ 姿态(欧拉角 单位:角度制) 空格分割 + POSITION_M_AND_QUATERNION_COMMA_SPLIT = + 10, //位置(单位:米) + 姿态(四元素) 逗号分割 +} POSITION_ORIENTATION_TYPE; + +PACK(struct RobotArmParam { + RobotArmParamHeader header; + uint8 base[382]; //底座参数数据 //RobotBaseParameters + uint8 joints[512]; //关键参数数据 //RobotJointsParameter +}); + +PACK(struct RobotInfo { + uint16 robot_type; // robot type + uint16 auth_type; // auth type + uint32 robot_expire; // robot expire + uint8 reserve[12]; // reserve + uint32 robot_duration; // robot duration + uint32 joint_duration[6]; // joint duration +}); + +PACK(struct RobotDynamicsParameters { + double K[6]; // motor torque constant + double IA[4]; // rotor inertia + double M[1]; // link mass + double MXYZ[13]; // center of mass + double IXYZ[28]; // Inertia parameter + double CB[6]; // current bias +}); + +PACK(struct RobotHandguidingParameters { + double FP[6]; // friction compensation percent + double FD[6]; // damp coefficient + double FK[6]; // stiffness coefficient + double FM[6]; // mass coefficient + double pos_limit[6]; // position limit + double velocity_limit[6]; // velocity limit + double acceleration_limit[6]; // acceleration limit +}); + +PACK(struct RobotKinematicsParameters { + double da[6]; // compensation a + double dd[6]; // compensation d + double dalpha[6]; // compensation alpha + double dbeta[6]; // compensation beta + double dratio[6]; // compensation ratio + double dtheta[6]; // compensation theta +}); + +PACK(struct RobotFrictionParameters { + uint16 FL[6]; // load friction compensation + uint16 FR[6]; // reserved friction compensation + int16 tmp_a[6]; // tmp_coefficient_a + uint16 tmp_b[6]; // tmp_coefficient_b + int16 posvel_a1[6]; // positive_vel_a1 + uint16 posvel_b1[6]; // positive_vel_b1 + int16 posvel_a2[6]; // positive_vel_a2 + uint16 posvel_b2[6]; // positive_vel_b2 + uint16 posvel_c2[6]; // positive_vel_c2 + int16 negvel_a1[6]; // negative_vel_a1 + int16 negvel_b1[6]; // negative_vel_b1 + uint16 negvel_a2[6]; // negative_vel_a2 + uint16 negvel_b2[6]; // negative_vel_b2 + int16 negvel_c2[6]; // negative_vel_c2 +}); + +PACK(struct RobotBaseParameters { + RobotInfo info; + RobotDynamicsParameters dynamicParam; + RobotHandguidingParameters handguidingParam; + RobotKinematicsParameters kinematicsParam; +}); + +PACK(struct RobotJointsParameter { RobotFrictionParameters frictionParam; }); + +typedef enum +{ + LL_INFO = 0, + LL_DEBUG, + LL_WARN, + LL_ERROR, + LL_FATAL +} LOG_LEVEL; + +/** + * 描述机械臂事件类型   event define + * + * 机械臂的很多信息(故障,通知)是通过事件通知到客户的,所有在使用SDK时, + * 务必注册接收事件的回调函数。 + */ +typedef enum +{ + RobotEvent_armCanbusError, //机械臂CAN总线错误 已过时,不建议使用 + RobotEvent_remoteHalt, //远程关机 + RobotEvent_remoteEmergencyStop, //机械臂远程急停 + RobotEvent_jointError, //关节错误 PS:已过时,不建议使用 + + RobotEvent_forceControl, //力控制 + RobotEvent_exitForceControl, //退出力控制 + + RobotEvent_softEmergency, //软急停 + RobotEvent_exitSoftEmergency, //退出软急停 + + RobotEvent_collision, //碰撞 + //已过时,不建议使用 已用RobotEventJointCollision(2123) + //替代 + RobotEvent_collisionStatusChanged, //碰撞状态改变 + //已过时,不建议使用 已用RobotEventJointCollision(2123) + //替代 + RobotEvent_tcpParametersSucc, //工具动力学参数设置成功 + //系统事件,用户可以忽略 + RobotEvent_powerChanged, //机械臂电源开关状态改变 + RobotEvent_ArmPowerOff, //机械臂电源关闭 + //不建议使用  已用RobotEventArmPowerOff(2600) 替代 + RobotEvent_mountingPoseChanged, //安装位置发生改变 + RobotEvent_encoderError, //编码器错误 不建议使用 + + RobotEvent_encoderLinesError, //编码器线数不一致 + //不建议使用  已用RobotEventEncoderLineError(2203)替代 + RobotEvent_singularityOverspeed, //奇异点超速 + RobotEvent_currentAlarm, //机械臂电流异常 + RobotEvent_toolioError, //机械臂工具端错误 + RobotEvent_robotStartupPhase, //机械臂启动阶段 系统事件,用户可以忽略 + RobotEvent_robotStartupDoneResult, //机械臂启动完成结果 + //系统事件,用户可以忽略 + RobotEvent_robotShutdownDone, //机械臂关机结果 系统事件,用户可以忽略 + RobotEvent_atTrackTargetPos, //机械臂轨迹运动到位信号通知 + //系统事件,用户可以忽略 + + RobotSetPowerOnDone, //设置电源状态完成 + RobotReleaseBrakeDone, //机械臂刹车释放完成 系统事件,用户可以忽略 + RobotEvent_robotControllerStateChaned, //机械臂控制状态改变 + //系统事件,用户可以忽略 + RobotEvent_robotControllerError, //机械臂控制错误----一般是算法规划出现问题时返回 + RobotEvent_socketDisconnected, // socket断开连接 + + RobotEvent_robotControlException, + RobotEvent_trackPlayInterrupte, + + RobotEvent_staticCollisionStatusChanged, //不建议使用 已过时 + RobotEvent_MountingPoseWarning, + + RobotEvent_MacDataInterruptWarning, + RobotEvent_ToolIoError, // + RobotEvent_InterfacBoardSafeIoEvent, //安全IO通知型事件 + + RobotEvent_RobotHandShakeSucc, //系统事件,用户可以忽略 + RobotEvent_RobotHandShakeFailed, //系统事件,用户可以忽略 + + RobotEvent_RobotErrorInfoNotify, //不建议使用 已过时 + + RobotEvent_InterfacBoardDIChanged, //通知型事件 DI状态改变 + RobotEvent_InterfacBoardDOChanged, //通知型事件 DO状态改变 + RobotEvent_InterfacBoardAIChanged, //通知型事件 AI状态改变 + RobotEvent_InterfacBoardAOChanged, //通知型事件 AO状态改变 + + RobotEvent_UpdateJoint6Rot360Flag, //系统事件,用户可以忽略 + + RobotEvent_RobotMoveControlDone, //系统事件,用户可以忽略 + RobotEvent_RobotMoveControlStopDone, //系统事件,用户可以忽略 + RobotEvent_RobotMoveControlPauseDone, //系统事件,用户可以忽略 + RobotEvent_RobotMoveControlContinueDone, //系统事件,用户可以忽略 + + //主从模式切换 + RobotEvent_RobotSwitchToOnlineMaster, //通知型事件 进入联动主模式 + RobotEvent_RobotSwitchToOnlineSlave, //通知型事件 进入联动从模式 + + RobotEvent_ConveyorTrackRobotStartup, //系统事件,用户可以忽略 + RobotEvent_ConveyorTrackRobotCatchup, //系统事件,用户可以忽略 + + RobotEvent_TeachButtonStatusChanged = 80, //四五六关节示教按钮状态改变 + + RobotEvent_exceptEvent = 100, + + RobotEventInvalid = 1000, // 无效的事件 + + /** + * RobotControllerErrorEvent 控制器异常事件 1001~1499 + * + * 事件处理建议 + * 建议采取措施:停止当前运动 + * + * PS: 这些事件会引起机械臂运动的错误返回 + * 使用时尽量用枚举变量  枚举变量值只是为了查看日志方便 + * + **/ + RobotEventMoveJConfigError = + 1001, // moveJ configuration error 关节运动属性配置错误 + RobotEventMoveLConfigError = + 1002, // moveL configuration error 直线运动属性配置错误 + RobotEventMovePConfigError = + 1003, // moveP configuration error 轨迹运动属性配置错误 + RobotEventInvailConfigError = + 1004, // invail configuration 无效的运动属性配置 + RobotEventWaitRobotStopped = + 1005, // please wait robot stopped 等待机器人停止 + RobotEventJointOutRange = 1006, // joint out of range 超出关节运动范围 + RobotEventFirstWaypointSetError = + 1007, // please set first waypoint correctly in modep + // 请正确设置MODEP第一个路点 + RobotEventConveyorTrackConfigError = + 1008, // configuration error for conveyor tracking 传送带跟踪配置错误 + RobotEventConveyorTrackTrajectoryTypeError = + 1009, // unsupported conveyor tracking trajectory type + // 传送带轨迹类型错误 + RobotEventRelativeTransformIKFailed = + 1010, // inverse kinematics failure due to invalid relative transform + // 相对坐标变换逆解失败 + RobotEventTeachModeCollision = + 1011, // collision in teach-mode 示教模式发生碰撞 + RobotEventextErnalToolConfigError = + 1012, // configuration error for external tool and hand workobject + // 运动属性配置错误,外部工具或手持工件配置错误 + + RobotEventTrajectoryAbnormal = 1101, // Trajectory is abnormal 轨迹异常 + RobotEventOnlineTrajectoryPlanError = + 1102, // Trajectory is abnormal,online planning failed 轨迹规划错误 + RobotEventOnlineTrajectoryTypeIIError = + 1103, // Trajectory is abnormal,type II online planning failed + // 二型在线轨迹规划失败 + RobotEventIKFailed = + 1104, // Trajectory is abnormal,inverse kinematics failed 逆解失败 + RobotEventAbnormalLimitProtect = + 1105, // Trajectory is abnormal,abnormal limit protection 动力学限制保护 + RobotEventConveyorTrackingFailed = + 1106, // Trajectory is abnormal,conveyor tracking failed 传送带跟踪失败 + RobotEventConveyorOutWorkingRange = + 1107, // Trajectory is abnormal,exceeding the conveyor working range + // 超出传送带工作范围 + RobotEventTrajectoryJointOutOfRange = + 1108, // Trajectory is abnormal,joint out of range 关节超出范围 + RobotEventTrajectoryJointOverspeed = + 1109, // Trajectory is abnormal,joint overspeed 关节超速 + RobotEventOfflineTrajectoryPlanFailed = + 1110, // Trajectory is abnormal,Offline track planning failed + // 离线轨迹规划失败 + RobotEventTrajectoryJointAccOutOfRange = + 1111, // Trajectory is abnormal,joint acc out of range + // 轨迹异常,关节加速度超限 + RobotEventTrajectoryBeyondSafetyPlane = 1112, //超过安全平面 + + RobotEventForceModeException = 1120, // 力控模式异常 + RobotEventForceModeIKFailed = + 1121, // Trajectory is abnormal,force control mode ik failed + // 轨迹异常,力控模式下失败 + RobotEventForceModeTrackJointverspeed = + 1122, // Trajectory is abnormal,joint overspeed 关节超速 + + RobotEventControllerIKFailed = + 1200, // The controller has an exception and the inverse kinematics + // failed 控制器异常,逆解失败 + RobotEventControllerStatusException = + 1201, // The controller has an exception and the status is abnormal + // 控制器异常,状态异常 + RobotEventControllerTrackingLost = + 1202, // Exception that joint tracking is lost, 关节跟踪误差过大. + RobotEventMonitorErrTrackingLost = + 1203, // Exception that joint tracking is lost, 关节跟踪误差过大. + RobotEventMonitorErrNoArrivalInTime = 1204, // not used 预留 + RobotEventMonitorErrCurrentOverload = 1205, // not used 预留 + RobotEventMonitorErrJointOutOfRange = + 1206, // Exception that joint out of range  机械臂关节超出限制范围 + RobotEventMonitorErrFifoDataTimeNotRead = + 1207, // controller fifo data timeout was not read + // 队列中数据超时未被读取 + RobotEventThreePositionSwitchNoPress = 1208, //操作模式,三态开关未按下 + + RobotEventMoveEnterStopState = + 1300, // Movement enters the stop state 运动进入到stop阶段 + + /** + * RobotHardwareErrorEvent 来自硬件反馈的异常事件 2001~2999 + * + * 事件处理建议 + * RobotEventJointEncoderPollustion 建议采取措施:警告性通知 + * RobotEventDriveVersionError 建议采取措施:警告性通知 + * RobotEventJointCollision 建议采取措施: + 如需回复当前运动,调用暂停函数 + 恢复的时候先调用碰撞回复函数,在调用continue函数 + 如不需回复当前运动,调用停止函数 + 恢复的时候调用碰撞回复函数可以 + * 其余的事件   建议采取措施:停止当前运动 + **/ + + RobotEventHardwareErrorNotify = 2001, // Robot hardware error 机械臂硬件错误 + + RobotEventJointError = 2101, // Robot joint error 机械臂关节错误 + RobotEventJointOverCurrent = + 2102, // Robot joint over current. 机械臂关节过流 + RobotEventJointOverVoltage = + 2103, // Robot joint over voltage.  机械臂关节过压 + RobotEventJointLowVoltage = + 2104, // Robot joint low voltage.  机械臂关节欠压 + RobotEventJointOverTemperature = + 2105, // Robot joint over temperature. 机械臂关节过温 + RobotEventJointHallError = + 2106, // Robot joint hall error. 机械臂关节霍尔错误 + RobotEventJointEncoderError = + 2107, // Robot joint encoder error. 机械臂关节编码器错误 + RobotEventJointAbsoluteEncoderError = + 2108, // Robot joint absolute encoder error. 机械臂关节绝对编码器错误 + RobotEventJointCurrentDetectError = + 2109, // Robot joint current position error. 机械臂关节当前位置错误 + RobotEventJointEncoderPollustion = + 2110, // Robot joint encoder pollustion. 机械臂关节编码器污染 + // 建议采取措施:警告性通知 + RobotEventJointEncoderZSignalError = + 2111, // Robot joint encoder Z signal error. 机械臂关节编码器Z信号错误 + RobotEventJointEncoderCalibrateInvalid = + 2112, // Robot joint encoder calibrate invalid. + // 机械臂关节编码器校准失效 + RobotEventJoint_IMU_SensorInvalid = + 2113, // Robot joint IMU sensor invalid. 机械臂关节IMU传感器失效 + RobotEventJointTemperatureSensorError = + 2114, // Robot joint temperature sensor error. 机械臂关节温度传感器出错 + RobotEventJointCanBusError = + 2115, // Robot joint CAN BUS error. 机械臂关节CAN总线出错 + RobotEventJointCurrentError = + 2116, // Robot joint current error. 机械臂关节当前电流错误 + RobotEventJointCurrentPositionError = + 2117, // Robot joint current position error. 机械臂关节当前位置错误 + RobotEventJointOverSpeed = 2118, // Robot joint over speed. 机械臂关节超速 + RobotEventJointOverAccelerate = + 2119, // Robot joint over accelerate. 机械臂关节加速度过大错误 + RobotEventJointTraceAccuracy = + 2120, // Robot joint trace accuracy. 机械臂关节跟踪精度错误 + RobotEventJointTargetPositionOutOfRange = + 2121, // Robot joint target position out of range. + // 机械臂关节目标位置超范围 + RobotEventJointTargetSpeedOutOfRange = + 2122, // Robot joint target speed out of range. 机械臂关节目标速度超范围 + RobotEventJointCollision = 2123, // Robot joint collision. 机械臂碰撞 + //    建议采取措施:暂停当前运动 + RobotEventJointSlaveOverCurrent = + 2124, // Robot joint slave over current! 从机过流 + RobotEventJointSlaveOverVoltage = + 2125, // Robot joint slave over voltage! 从机过压 + RobotEventJointSlaveLowVoltage = + 2126, // Robot joint slave low voltage! 从机欠压 + RobotEventJointSlavePositionDiffOver = + 2127, // Robot joint position deviation between master and slave is too + // big! 主从机位置偏差过大 + RobotEventJointSlaveSpeedDiffOver = + 2128, // Robot joint speed deviation between master and slave is too + // big! 主从机速度偏差过大 + RobotEventJointSlaveAbsoluteEncoderError = + 2129, // Robot joint slave abs encoder! 从机绝对编码器错误 + RobotEventJointSlaveCurrentDetectError = + 2130, // Robot joint slave detect current! 从机电流检测错误 + RobotEventJointSlaveEncoderPollustion = + 2131, // Robot joint slave encoder pollustion! 从机编码器污染 + RobotEventJointSlaveEncoderZSignalError = + 2132, // Robot joint slave enocder z signal! 从机编码器Z信号错误 + RobotEventJointSlaveCommunication = + 2133, // Robot joint communication between master and slave error! + // 主从机之间通信错误 + RobotEventJointOpticalEncoderError = + 2134, // Robot joint optical encoder error! 光电编码器错误 + + RobotEventDataAbnormal = 2200, // Robot data abnormal 机械臂信息异常 + RobotEventRobotTypeError = 2201, // Robot type error 机械臂类型错误 + RobotEventAccelerationSensorError = + 2202, // Robot acceleration sensor error 机械臂加速度计芯片错误 + RobotEventEncoderLineError = + 2203, // Robot encoder line error 机械臂编码器线数错误 + RobotEventEnterDragAndTeachModeError = + 2204, // Robot enter drag and teach mode error + // 机械臂进入拖动示教模式错误 + RobotEventExitDragAndTeachModeError = + 2205, // Robot exit drag and teach mode error 机械臂退出拖动示教模式错误 + RobotEventMACDataInterruptionError = + 2206, // Robot MAC data interruption error 机械臂MAC数据中断错误 + RobotEventDriveVersionError = + 2207, // Drive version error 驱动器版本错误(关节固件版本不一致) + RobotEventToolNotExist = 2208, // Robot tool do not exist! 工具端不存在 + RobotEventPowerOnCheckError = + 2209, // Robot power on check error! 上电自检错误 + RobotEventDriverVersionTooLow = + 2210, // Robot driver firmware version is too low! 驱动器版本过低 + RobotEventTargetPosDataBufferOverflow = + 2211, // Robot target pos data buffer overflow! 目标位置数据溢出 + RobotEventRobotArmNotConnected = + 2212, // Robot arm is not connected! 机械臂未连接 + RobotEventPayloadError = 2213, // Robot payload error! 负载错误 + + RobotEventInitAbnormal = 2300, // Robot init abnormal 机械臂初始化异常 + RobotEventDriverEnableFailed = + 2301, // Robot driver enable failed 机械臂驱动器使能失败 + RobotEventDriverEnableAutoBackFailed = + 2302, // Robot driver enable auto back failed + // 机械臂驱动器使能自动回应失败 + RobotEventDriverEnableCurrentLoopFailed = + 2303, // Robot driver enable current loop failed + // 机械臂驱动器使能电流环失败 + RobotEventDriverSetTargetCurrentFailed = + 2304, // Robot driver set target current failed + // 机械臂驱动器设置目标电流失败 + RobotEventDriverReleaseBrakeFailed = + 2305, // Robot driver release brake failed 机械臂释放刹车失败 + RobotEventDriverEnablePostionLoopFailed = + 2306, // Robot driver enable postion loop failed 机械臂使能位置环失败 + RobotEventSetMaxAccelerateFailed = + 2307, // Robot set max accelerate failed 设置最大加速度失败 + RobotEventSetPositionLoopWorkModeFailed = + 2308, // Robot set position loop work mode failed! + // 设置位置环工作模式失败 + RobotEventCalcuateGravityComponentFailed = + 2309, // Robot calculate the gravity component failed! 计算重力分量错误 + RobotEventSetMaxVelocityFailed = + 2310, // Robot set max velocity failed! 设置最大速度失败 + RobotEventEnableCANSyncFrameFailed = + 2311, // Robot enable can synchronization frame failed! + // 使能CAN同步帧失败 + + RobotEventSafetyError = 2400, // Robot Safety error 机械臂安全出错 + RobotEventExternEmergencyStop = + 2401, // Robot extern emergency stop 机械臂外部紧急停止 + RobotEventSystemEmergencyStop = + 2402, // Robot system emergency stop 机械臂系统紧急停止 + RobotEventTeachpendantEmergencyStop = + 2403, // Robot teachpendant emergency stop 机械臂示教器紧急停止 + RobotEventControlCabinetEmergencyStop = + 2404, // Robot control cabinet emergency stop 机械臂控制柜紧急停止 + RobotEventProtectionStopTimeout = + 2405, // Robot protection stop timeout 机械臂保护停止超时 + RobotEventEeducedModeTimeout = + 2406, // Robot reduced mode timeout 机械臂缩减模式超时 + + RobotEventSystemAbnormal = 2500, // Robot systen abnormal 机械臂系统异常 + RobotEvent_MCU_CommunicationAbnormal = + 2501, // Robot mcu communication error 机械臂mcu通信异常 + RobotEvent485CommunicationAbnormal = + 2502, // Robot RS485 communication error 机械臂485通信异常 + RobotEvent220VDetectionBoardAbnormal = + 2503, // Robot 220v detection board abnormal 220V掉电板检测错误 + + //#if 0 // 非实时版本 + RobotEventCurrentJointOutRange = 2550, // Joint out of Range + //#else + RobotEventSoftEmergency = 2550, // 软急停 + RobotEventSoftEmergencyExit = 2551, // 软急停退出 + //#endif + + RobotEventArmPowerOff = + 2600, // Disconnecting the contactor causes the arm 48V power off + // 控制柜接触器断开导致机械臂48V断电 + + RobotEventHardwareErrorNotifyMaximumIndex = 2999, // 索引 + + RobotEventNotifyEvent = 3000, // Robot notification event 机械臂通知性事件 + RobotEventNotifyCollisionLevelChange = + 3001, // Robot Collision level change 机械臂事件通知-碰撞等级被改变 + RobotEventNotifyEnterFlexibleControlMode = 3010, // 进入柔性控制模式通知 + RobotEventNotifyExitFlexibleControlMode = 3011, // 退出柔性控制模式通知 + RobotEventNotifyEnterSpeedReducedMode = 3015, // 进入速度缩减模式通知 + RobotEventNotifyExitSpeedReducedMode = 3016, // 退出速度缩减模式通知 + + RobotEventNotifyStopCurrentMove = 3100, // 停止掉当前运动 + + RobotEventNotifyScriptFinishSucc = 3200, // 脚本运行结束:成功 + RobotEventNotifyScriptFinishFailed = 3201, // 脚本运行结束:失败 + RobotEventNotifyScriptRunInterruptedByStopOperation = + 3202, //脚本运行中断:被stop操作中断 + + RobotEventNotifyScriptRunLabel = 3300, //通知性事件:脚本运行标签 + RobotEventNotifyScriptTraceInfo = 3301, //通知性事件:脚本Print + RobotEventNotifyScriptSetVariable = 3302, //通知性事件:设置示教器全局变量值 + RobotEventNotifyScriptTimeStamp = 3303, //通知性事件:设置计时器 + RobotEventNotifyScriptPopMessage = 3304, //通知性事件:服务器脚本层弹窗 + + RobotEventNotifyJointUpdateFinishSucc = 3400, // 关节驱动升级结束:成功 + RobotEventNotifyJointUpdateFinishFailed = 3401, // 关节驱动升级结束:失败 + RobotEventNotifyJointUpdating = 3402, // 关节驱动升级中 + RobotEventNotifyJointNoProgram = + 3410, // 关节在上电后检测到没有程序,需要升级 + + RobotEventMoveGroupCurrentWaypointId = 3500, // moveGroup当前路点id + RobotEventMoveGroupPaused = 3501, // moveGroup暂停完成 + RobotEventMoveGroupResumed = 3502, // moveGroup恢复完成 + RobotEventMoveGroupStopped = 3503, // moveGroup停止完成 + RobotEventMoveGroupAtTargrtPos = 3504, // moveGroup运行结束 + + // unknown event + robot_event_unknown = 10000, + + // user event + RobotEvent_User = 9000, // first user event id + RobotEvent_MaxUser = 9999 // last user event id + +} RobotEventType; + +/** 事件类型 **/ +typedef struct +{ + RobotEventType eventType; //事件类型号 + int eventCode; // + std::string eventContent; //事件内容 +} RobotEventInfo; + +/** + * 接口函数 错误码定义 成功返回InterfaceCallSuccCode(0);失败返回对应的错误号 + * + * 下面是错误代码列表 + * 21000 ~ 21999错误码  表示错由于控制器异常事件导致的 + * 22000 ~ 22999错误码  表示错由于硬件层异常事件导致的 + */ +enum +{ + InterfaceCallSuccCode = 0, //接口调用成功的返回值 +}; + +typedef enum +{ + // clang-format off + ErrnoSucc = InterfaceCallSuccCode, // 成功 + + ErrCode_Base = 10000, + ErrCode_Failed = 10001, // 通用失败 failed + ErrCode_ParamError = 10002, // 参数错误 parameters error + ErrCode_ConnectSocketFailed = 10003, // 连接失败 socket connect failed Socket + ErrCode_SocketDisconnect = 10004, // Socket断开连接 socket disconnected Socket + ErrCode_CreateRequestFailed = 10005, // 创建请求失败 create request failed + ErrCode_RequestRelatedVariableError = 10006, // 请求相关的内部变量出错 internal error + ErrCode_RequestTimeout = 10007, // 请求超时 timout + ErrCode_SendRequestFailed = 10008, // 发送请求信息失败 send request failed + ErrCode_ResponseInfoIsNULL = 10009, // 响应信息为空 response is null + ErrCode_ResolveResponseFailed = 10010, // 解析响应失败 parse response failed + ErrCode_FkFailed = 10011, // 正解出错 fk failed + ErrCode_IkFailed = 10012, // 逆解出错 ik failed + ErrCode_ToolCalibrateError = 10013, // 工具标定参数有错 tool coordinate paramter error + ErrCode_ToolCalibrateParamError = 10014, // 工具标定参数有错 tool coordinate paramter error + ErrCode_CoordinateSystemCalibrateError = 10015, // 坐标系标定失败 user coordinate calibrate failed + ErrCode_BaseToUserConvertFailed = 10016, // 基坐标系转用户座标失败 base coordinate convert to user coordinate fialed + ErrCode_UserToBaseConvertFailed = 10017, // 用户坐标系转基座标失败 user coordinate convert to base coordinate fialed + + + ErrCode_MotionRelatedVariableError = 10018, // 运动相关的内部变量出错 move funcation paramters error + ErrCode_MotionRequestFailed = 10019, // 运动请求失败 call move funcation failed + ErrCode_CreateMotionRequestFailed = 10020, // 生成运动请求失败 create request failed + ErrCode_MotionInterruptedByEvent = 10021, // 运动被事件中断 move funcation interrupt + ErrCode_MotionWaypointVetorSizeError = 10022, // 运动相关的路点容器的长度不符合规定 parameter error + ErrCode_ResponseReturnError = 10023, // 服务器响应返回错误 server reponse error + ErrCode_RealRobotNoExist = 10024, // 真实机械臂不存在,因为有些接口只有在真是机械臂存在的情况下才可以被调用 real robot no exist + + ErrCode_moveControlSlowStopFailed = 11025, // 调用缓停接口失败 call function failed, server side error + ErrCode_moveControlFastStopFailed = 11026, // 调用急停接口失败 call function failed, server side error + ErrCode_moveControlPauseFailed = 11027, // 调用暂停接口失败 call function failed, server side error + ErrCode_moveControlContinueFailed = 11028, // 调用继续接口失败 call function failed, server side error + + + //20000~21000 的异常码是为了版本兼容 后续会逐渐取消 + ErrCode_collision = 20008, //碰撞 + ErrCode_robotControllerError = 20026, //控制器异常 + + + /** + * 控制器返回的异常 + **/ + ErrCodeMoveJConfigError = 21001, // moveJ configuration error 关节运动属性配置错误 + ErrCodeMoveLConfigError = 21002, // moveL configuration error 直线运动属性配置错误 + ErrCodeMovePConfigError = 21003, // moveP configuration error 轨迹运动属性配置错误 + ErrCodeInvailConfigError = 21004, // invail configuration 无效的运动属性配置 + ErrCodeWaitRobotStopped = 21005, // please wait robot stopped 等待机器人停止 + ErrCodeJointOutRange = 21006, // joint out of range 超出关节运动范围 + ErrCodeFirstWaypointSetError = 21007, // please set first waypoint correctly in modep 请正确设置MODEP第一个路点 + ErrCodeConveyorTrackConfigError = 21008, // configuration error for conveyor tracking 传送带跟踪配置错误 + ErrCodeConveyorTrackTrajectoryTypeError = 21009, // unsupported conveyor tracking trajectory type 传送带轨迹类型错误 + ErrCodeRelativeTransformIKFailed = 21010, // inverse kinematics failure due to invalid relative transform 相对坐标变换逆解失败 + ErrCodeTeachModeCollision = 21011, // collision in teach-mode 示教模式发生碰撞 + ErrCodeextErnalToolConfigError = 21012, // configuration error for external tool and hand workobject 运动属性配置错误,外部工具或手持工件配置错误 + + ErrCodeTrajectoryAbnormal = 21101, // Trajectory is abnormal 轨迹异常 + ErrCodeOnlineTrajectoryPlanError = 21102, // Trajectory is abnormal,online planning failed 轨迹规划错误 + ErrCodeOnlineTrajectoryTypeIIError = 21103, // Trajectory is abnormal,type II online planning failed 二型在线轨迹规划失败 + ErrCodeIKFailed = 21104, // Trajectory is abnormal,inverse kinematics failed 逆解失败 + ErrCodeAbnormalLimitProtect = 21105, // Trajectory is abnormal,abnormal limit protection 动力学限制保护 + ErrCodeConveyorTrackingFailed = 21106, // Trajectory is abnormal,conveyor tracking failed 传送带跟踪失败 + ErrCodeConveyorOutWorkingRange = 21107, // Trajectory is abnormal,exceeding the conveyor working range 超出传送带工作范围 + ErrCodeTrajectoryJointOutOfRange = 21108, // Trajectory is abnormal,joint out of range 关节超出范围 + ErrCodeTrajectoryJointOverspeed = 21109, // Trajectory is abnormal,joint overspeed 关节超速 + ErrCodeOfflineTrajectoryPlanFailed = 21110, // Trajectory is abnormal,Offline track planning failed 离线轨迹规划失败 + ErrCodeTrajectoryJointAccOutOfRange = 21111, // Trajectory is abnormal,joint acc out of range 轨迹异常,关节加速度超限 + + ErrCodeForceModeException = 21120, // 力控模式异常 + ErrCodeForceModeIKFailed = 21121, // Trajectory is abnormal,force control mode ik failed 轨迹异常,力控模式下失败 + ErrCodeForceModeTrackJointverspeed = 21122, // Trajectory is abnormal,joint overspeed 关节超速 + + ErrCodeControllerIKFailed = 21200, // The controller has an exception and the inverse kinematics failed 控制器异常,逆解失败 + ErrCodeControllerStatusException = 21201, // The controller has an exception and the status is abnormal 控制器异常,状态异常 + ErrCodeControllerTrackingLost = 21202, // Exception that joint tracking is lost, 关节跟踪误差过大. + ErrCodeMonitorErrTrackingLost = 21203, // Exception that joint tracking is lost, 关节跟踪误差过大. + ErrCodeMonitorErrNoArrivalInTime = 21204, // not used 预留 + ErrCodeMonitorErrCurrentOverload = 21205, // not used 预留 + ErrCodeMonitorErrJointOutOfRange = 21206, // Exception that joint out of range  机械臂关节超出限制范围 + ErrCodeFifoDataTimeNotRead = 21207, // 缓存区超时未更新 + + ErrCodeMoveEnterStopState = 21300, // Movement enters the stop state 运动进入到stop阶段 + ErrCodeMoveInterruptedByEvent = 21301, // Movement interrupted by the event 运动被未知事件中断 + + /** + * 来自硬件层返回的异常 + **/ + ErrCodeHardwareErrorNotify = 22001, // Robot hardware error 机械臂硬件错误 不能区分是哪种硬件异常才会返回该错误 + + ErrCodeJointError = 22101, // Robot joint error 机械臂关节错误 + ErrCodeJointOverCurrent = 22102, // Robot joint over current. 机械臂关节过流 + ErrCodeJointOverVoltage = 22103, // Robot joint over voltage.  机械臂关节过压 + ErrCodeJointLowVoltage = 22104, // Robot joint low voltage.  机械臂关节欠压 + ErrCodeJointOverTemperature = 22105, // Robot joint over temperature. 机械臂关节过温 + ErrCodeJointHallError = 22106, // Robot joint hall error. 机械臂关节霍尔错误 + ErrCodeJointEncoderError = 22107, // Robot joint encoder error. 机械臂关节编码器错误 + ErrCodeJointAbsoluteEncoderError = 22108, // Robot joint absolute encoder error. 机械臂关节绝对编码器错误 + ErrCodeJointCurrentDetectError = 22109, // Robot joint current position error. 机械臂关节当前位置错误 + ErrCodeJointEncoderPollustion = 22110, // Robot joint encoder pollustion. 机械臂关节编码器污染 建议采取措施:警告性通知 + ErrCodeJointEncoderZSignalError = 22111, // Robot joint encoder Z signal error. 机械臂关节编码器Z信号错误 + ErrCodeJointEncoderCalibrateInvalid = 22112, // Robot joint encoder calibrate invalid. 机械臂关节编码器校准失效 + ErrCodeJoint_IMU_SensorInvalid = 22113, // Robot joint IMU sensor invalid. 机械臂关节IMU传感器失效 + ErrCodeJointTemperatureSensorError = 22114, // Robot joint temperature sensor error. 机械臂关节温度传感器出错 + ErrCodeJointCanBusError = 22115, // Robot joint CAN BUS error. 机械臂关节CAN总线出错 + ErrCodeJointCurrentError = 22116, // Robot joint current error. 机械臂关节当前电流错误 + ErrCodeJointCurrentPositionError = 22117, // Robot joint current position error. 机械臂关节当前位置错误 + ErrCodeJointOverSpeed = 22118, // Robot joint over speed. 机械臂关节超速 + ErrCodeJointOverAccelerate = 22119, // Robot joint over accelerate. 机械臂关节加速度过大错误 + ErrCodeJointTraceAccuracy = 22120, // Robot joint trace accuracy. 机械臂关节跟踪精度错误 + ErrCodeJointTargetPositionOutOfRange = 22121, // Robot joint target position out of range. 机械臂关节目标位置超范围 + ErrCodeJointTargetSpeedOutOfRange = 22122, // Robot joint target speed out of range. 机械臂关节目标速度超范围 + ErrCodeJointCollision = 22123, // Robot joint collision. 机械臂碰撞    建议采取措施:暂停当前运动 + + ErrCodeDataAbnormal = 22200, // Robot data abnormal 机械臂信息异常 + ErrCodeRobotTypeError = 22201, // Robot type error 机械臂类型错误 + ErrCodeAccelerationSensorError = 22202, // Robot acceleration sensor error 机械臂加速度计芯片错误 + ErrCodeEncoderLineError = 22203, // Robot encoder line error 机械臂编码器线数错误 + ErrCodeEnterDragAndTeachModeError = 22204, // Robot enter drag and teach mode error 机械臂进入拖动示教模式错误 + ErrCodeExitDragAndTeachModeError = 22205, // Robot exit drag and teach mode error 机械臂退出拖动示教模式错误 + ErrCodeMACDataInterruptionError = 22206, // Robot MAC data interruption error 机械臂MAC数据中断错误 + ErrCodeDriveVersionError = 22207, // Drive version error 驱动器版本错误(关节固件版本不一致) + + ErrCodeInitAbnormal = 22300, // Robot init abnormal 机械臂初始化异常 + ErrCodeDriverEnableFailed = 22301, // Robot driver enable failed 机械臂驱动器使能失败 + ErrCodeDriverEnableAutoBackFailed = 22302, // Robot driver enable auto back failed 机械臂驱动器使能自动回应失败 + ErrCodeDriverEnableCurrentLoopFailed = 22303, // Robot driver enable current loop failed 机械臂驱动器使能电流环失败 + ErrCodeDriverSetTargetCurrentFailed = 22304, // Robot driver set target current failed 机械臂驱动器设置目标电流失败 + ErrCodeDriverReleaseBrakeFailed = 22305, // Robot driver release brake failed 机械臂释放刹车失败 + ErrCodeDriverEnablePostionLoopFailed = 22306, // Robot driver enable postion loop failed 机械臂使能位置环失败 + ErrCodeSetMaxAccelerateFailed = 22307, // Robot set max accelerate failed 设置最大加速度失败 + + ErrCodeSafetyError = 22400, // Robot Safety error 机械臂安全出错 + ErrCodeExternEmergencyStop = 22401, // Robot extern emergency stop 机械臂外部紧急停止 + ErrCodeSystemEmergencyStop = 22402, // Robot system emergency stop 机械臂系统紧急停止 + ErrCodeTeachpendantEmergencyStop = 22403, // Robot teachpendant emergency stop 机械臂示教器紧急停止 + ErrCodeControlCabinetEmergencyStop = 22404, // Robot control cabinet emergency stop 机械臂控制柜紧急停止 + ErrCodeProtectionStopTimeout = 22405, // Robot protection stop timeout 机械臂保护停止超时 + ErrCodeEeducedModeTimeout = 22406, // Robot reduced mode timeout 机械臂缩减模式超时 + + ErrCodeSystemAbnormal = 22500, // Robot systen abnormal 机械臂系统异常 + ErrCode_MCU_CommunicationAbnormal = 22501, // Robot mcu communication error 机械臂mcu通信异常 + ErrCode485CommunicationAbnormal = 22502, // Robot RS485 communication error 机械臂485通信异常 + + ErrCodeSoftEmergency = 22550, // 软急停 + + ErrCodeArmPowerOff = 22600, //Disconnecting the contactor causes the arm 48V power off 控制柜接触器断开导致机械臂48V断电 + + ErrCodeInterfaceNotImpleted = 30000, // 此接口不支持 + // clang-format on +} RobotErrorCode; + +enum class MoveModeType : int +{ + NONE = 0, + MOVE_GROUP, + SERVOJ, + FORCE_TEACH, + TRAJECTORY_ANALYSE, + TOOL_DYNAMIC_IDENTIFY +}; + +} // namespace aubo_robot_namespace +#ifdef __cplusplus +} +#endif + +/** + * @brief 获取实时关节状态回调函数类型. + * @param jointStatus 当前的关节状态; + * @param size     上一个参数(jointStatus)的长度; + * @param arg      使用者在注册回调函数中传递的第二个参数; + */ +typedef void (*RealTimeJointStatusCallback)( + const aubo_robot_namespace::JointStatus *jointStatus, int size, void *arg); + +/** + * @brief 获取实时路点信息的回调函数类型. + * @param wayPoint  当前的路点信息; + * @param arg      使用者在注册回调函数中传递的第二个参数; + */ +typedef void (*RealTimeRoadPointCallback)( + const aubo_robot_namespace::wayPoint_S *wayPoint, void *arg); + +/** + *@brief 获取实时末端速度的回调函数类型 + *@param speed 当前的末端速度; + *@param arg   使用者在注册回调函数中传递的第二个参数; + */ +typedef void (*RealTimeEndSpeedCallback)(double speed, void *arg); + +/** + *@brief 获取实时Movep执行进度的回调函数类型 + *@param num 当前的Movep执行进度; + *@param arg   使用者在注册回调函数中传递的第二个参数; + */ +typedef void (*RealTimeMovepStepNumNotifyCallback)(int num, void *arg); + +/** + * @brief 获取机械臂事件信息的回调函数类型 + * @param arg 使用者在注册回调函数中传递的第二个参数; + */ +typedef void (*RobotEventCallback)( + const aubo_robot_namespace::RobotEventInfo *eventInfo, void *arg); + +/** + * @brief 日志输出对应的回调函数类型 + * @param logLevel 日志级别; + * @param str 日志信息; + */ +typedef void (*RobotLogPrintCallback)(aubo_robot_namespace::LOG_LEVEL logLevel, + const char *str, void *arg); + +#endif // AUBOROBOTMETATYPE_H diff --git a/third_party/AuboSdk/linux/include/aubo/aubo_api.h b/third_party/AuboSdk/linux/include/aubo/aubo_api.h new file mode 100644 index 00000000..37a6c530 --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo/aubo_api.h @@ -0,0 +1,357 @@ +/** @file aubo_api.h + * @brief \~chinese 机器人及外部轴等控制API接口,如获取机器人列表、获取系统信息等等 + * @brief \~english API for controlling the robot and external axis + */ +#ifndef AUBO_SDK_AUBO_API_INTERFACE_H +#define AUBO_SDK_AUBO_API_INTERFACE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace arcs { +namespace common_interface { + +class ARCS_ABI_EXPORT AuboApi +{ +public: + AuboApi(); + virtual ~AuboApi(); + + /** + * \chinese + * 获取纯数学相关接口 + * + * @return MathPtr对象的指针 + * + * @par Python函数原型 + * getMath(self: pyaubo_sdk.AuboApi) -> pyaubo_sdk.Math + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * MathPtr ptr = rpc_cli->getMath(); + * @endcode + * \endchinese + * + *\english + * Get pure mathematic related API + * + * @return Shared pointer to a Math object + * + * @par Python function prototype + * getMath(self: pyaubo_sdk.AuboApi) -> pyaubo_sdk.Math + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * MathPtr ptr = rpc_cli->getMath(); + * @endcode + *\endenglish + */ + MathPtr getMath(); + + /** + * \chinese + * 获取系统信息 + * + * @return SystemInfoPtr对象的指针 + * + * @par Python函数原型 + * getSystemInfo(self: pyaubo_sdk.AuboApi) -> pyaubo_sdk.SystemInfo + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * SystemInfoPtr ptr = rpc_cli->getSystemInfo(); + * @endcode + * \endchinese + * + * \english + * Get system info + * + * @return Shared pointer to SystemInfo object + * + * @par Python function prototype + * getSystemInfo(self: pyaubo_sdk.AuboApi) -> pyaubo_sdk.SystemInfo + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * SystemInfoPtr ptr = rpc_cli->getSystemInfo(); + * @endcode + * \endenglish + */ + SystemInfoPtr getSystemInfo(); + + /** + * \chinese + * 获取运行时接口 + * + * @return RuntimeMachinePtr对象的指针 + * + * @par Python函数原型 + * getRuntimeMachine(self: pyaubo_sdk.AuboApi) -> pyaubo_sdk.RuntimeMachine + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * RuntimeMachinePtr ptr = rpc_cli->getRuntimeMachine(); + * @endcode + * \endchinese + * + * \english + * Get runtime api + * + * @return Shared pointer to RuntimeMachine object + * Python function prototype + * getRuntimeMachine(self: pyaubo_sdk.AuboApi) -> pyaubo_sdk.RuntimeMachine + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * RuntimeMachinePtr ptr = rpc_cli->getRuntimeMachine(); + * @endcode + * \endenglish + */ + RuntimeMachinePtr getRuntimeMachine(); + + /** + * \chinese + * 对外寄存器接口 + * + * @return RegisterControlPtr对象的指针 + * + * @par Python函数原型 + * getRegisterControl(self: pyaubo_sdk.AuboApi) -> + * pyaubo_sdk.RegisterControl + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * RegisterControlPtr ptr = rpc_cli->getRegisterControl(); + * @endcode + * \endchinese + * + * \english + * External registers api + * + * @return Shared pointer to RegisterControl object + * + * @par Python function prototype + * getRegisterControl(self: pyaubo_sdk.AuboApi) -> + * pyaubo_sdk.RegisterControl + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * RegisterControlPtr ptr = rpc_cli->getRegisterControl(); + * @endcode + * \endenglish + */ + RegisterControlPtr getRegisterControl(); + + /** + * \chinese + * 获取机器人列表 + * + * @return 机器人列表 + * + * @par Python函数原型 + * getRobotNames(self: pyaubo_sdk.AuboApi) -> List[str] + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * @endcode + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"getRobotNames","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":["rob1"]} + * \endchinese + * + * \english + * Get robot list + * + * @return robot list + * + * @par Python function prototype + * getRobotNames(self: pyaubo_sdk.AuboApi) -> List[str] + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * @endcode + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"getRobotNames","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":["rob1"]} + * \endenglish + */ + std::vector getRobotNames(); + + /** + * \chinese + * 根据名字获取 RobotInterfacePtr 接口 + * + * @param name 机器人名字 + * @return RobotInterfacePtr对象的指针 + * + * @par Python函数原型 + * getRobotInterface(self: pyaubo_sdk.AuboApi, arg0: str) -> + * pyaubo_sdk.RobotInterface + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * RobotInterfacePtr ptr = rpc_cli->getRobotInterface(robot_name); + * @endcode + * \endchinese + * + * \english + * Get RobotInterfacePtr based on name + * + * @param name Robot name + * @return Shared pointer to a RobotInterface object + * + * @par Python function prototype + * getRobotInterface(self: pyaubo_sdk.AuboApi, arg0: str) -> + * pyaubo_sdk.RobotInterface + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * RobotInterfacePtr ptr = rpc_cli->getRobotInterface(robot_name); + * @endcode + * \endenglish + */ + RobotInterfacePtr getRobotInterface(const std::string &name); + + /** + * \~chinese 获取外部轴列表 \~english Get external axis list + * + * @return + */ + std::vector getAxisNames(); + + /** + * \chinese + * 获取外部轴接口 + * + * @param name + * @return + * \endchinese + * + * \english + * Get external axis interface + * + * @param name + * @return + * \endenglish + */ + AxisInterfacePtr getAxisInterface(const std::string &name); + + /// \~chinese 获取独立 IO 模块接口 \~english Get independent IO module interface + + /** + * \chinese + * 获取 socket + * @return SocketPtr对象的指针 + * + * @par Python函数原型 + * getSocket(self: pyaubo_sdk.AuboApi) -> arcs::common_interface::Socket + * @endcode + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * SocketPtr ptr = rpc_cli->getSocket(); + * @endcode + * \endchinese + * + * \english + * Get socket + * @return Shared pointer to a socket object + * + * @par Python function prototype + * getSocket(self: pyaubo_sdk.AuboApi) -> arcs::common_interface::Socket + * @endcode + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * SocketPtr ptr = rpc_cli->getSocket(); + * @endcode + * \endenglish + */ + SocketPtr getSocket(); + + /** + * \chinese + * @return SerialPtr对象的指针 + * + * @par Python函数原型 + * getSerial(self: pyaubo_sdk.AuboApi) -> arcs::common_interface::Serial + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * SerialPtr ptr = rpc_cli->getSerial(); + * @endcode + * \endchinese + * + * \english + * @return Shared pointer to Serial object + * + * @par Python function prototype + * getSerial(self: pyaubo_sdk.AuboApi) -> arcs::common_interface::Serial + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * SerialPtr ptr = rpc_cli->getSerial(); + * @endcode + * \endenglish + */ + SerialPtr getSerial(); + + /** + * \~chinese 获取同步运动接口 \~english Get syncronous move interface + * + * \~chinese @return SyncMovePtr对象的指针 + * \~english @return Shared pointer to SyncMove object + */ + SyncMovePtr getSyncMove(const std::string &name); + + /** + * \~chinese 获取告警信息接口 + * \~english Get alert interface + * + * \~chinese @return TracePtr对象的指针 + * \~english @return Shared pointer of trace object + */ + TracePtr getTrace(const std::string &name); + +protected: + void *d_{ nullptr }; +}; +using AuboApiPtr = std::shared_ptr; + +} // namespace common_interface +} // namespace arcs + +#endif // AUBO_SDK_AUBO_API_H diff --git a/third_party/AuboSdk/linux/include/aubo/axis_interface.h b/third_party/AuboSdk/linux/include/aubo/axis_interface.h new file mode 100644 index 00000000..a9ed14e6 --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo/axis_interface.h @@ -0,0 +1,381 @@ +/** @file axes.h + * @brief 外部轴接口 + */ +#ifndef AUBO_SDK_AXIS_INTERFACE_H +#define AUBO_SDK_AXIS_INTERFACE_H + +#include +#include + +namespace arcs { +namespace common_interface { + +/** + * \~chinese 外部轴API接口 + * \~english External axis API interface + */ +class ARCS_ABI_EXPORT AxisInterface +{ +public: + AxisInterface(); + virtual ~AxisInterface(); + + /** + * \~chinese 通电 + * \~english Power on + * @return + */ + int poweronExtAxis(); + + /** + * \~chinese 断电 + * \~english Power off + * @return + */ + int poweroffExtAxis(); + + /** + * \~chinese 使能 + * \~english Enable + * @return + */ + int enableExtAxis(); + + /** + * \~chinese 设置外部轴的安装位姿(相对于世界坐标系) + * \~chinese @param pose + * \~english Set mounting pose of external axis (wrt world frame) + * \~english @param pose + + * @return + */ + int setExtAxisMountingPose(const std::vector &pose); + + /** + * \chinese 运动到指定点, 旋转或者平移 + * + * @param pos + * @param v + * @param a + * @param duration + * @return + * \endchinese + * + * \english move to pos, rotation or linear + * + * @param pos + * @param v + * @param a + * @param duration + * @return + * \endenglish + */ + int moveExtJoint(double pos, double v, double a, double duration); + + /** + * \chinese + * 制定目标运动速度 + * + * @param v + * @param a + * @param duration + * @return + * \endchinese + * + * \english + * Set target speed, acceleration and duration + * @param v + * @param a + * @param duration + * @return + * \endenglish + */ + int speedExtJoint(double v, double a, double duration); + + int stopExtJoint(double a); + + /** + * \~chinese 获取外部轴的类型 0代表是旋转 1代表平移 + * \~english Get external axis type: 0 for rotation, 1 for linear + * @return + */ + int getExtAxisType(); + + /** + * \chinese + * 获取当前外部轴的状态 + * + * @return 当前外部轴的状态 + * \endchinese + * + * \english + * Get external axis status + * + * @return Current exteral axis status + * \endenglish + */ + AxisModeType getAxisModeType(); + + /** + * \chinese + * 获取外部轴安装位姿 + * + * @return 外部轴安装位姿 + * \endchinese + * + * \english + * Get external axis mounting pose + * + * @return External axis pose + * \endenglish + */ + std::vector getExtAxisMountingPose(); + + /** + * \chinese + * 获取相对于安装坐标系的位姿,外部轴可能为变位机或者导轨 + * + * @return 相对于安装坐标系的位姿 + * \endchinese + * + * \english + * Get pose wrt mounting coordinate system, axis can be positioner or linear rail + * + * @return Pose wrt mounting coordinate system + * \endenglish + */ + std::vector getExtAxisPose(); + + /** + * \chinese + * 获取外部轴位置 + * + * @return 外部轴位置 + * \endchinese + * + * \english + * Get external axis position + * + * @return External axis position + * \endenglish + */ + double getExtAxisPosition(); + + /** + * \chinese + * 获取外部轴运行速度 + * + * @return 外部轴运行速度 + * \endchinese + * + * \english + * Get external axis speed + * + * @return External axis speed + * \endenglish + */ + double getExtAxisVelocity(); + + /** + * \chinese + * 获取外部轴运行加速度 + * + * @return 外部轴运行加速度 + * \endchinese + * + * \english + * Get external axis acceleration + * + * @return External axis acceleration + * \endenglish + */ + double getExtAxisAcceleration(); + + /** + * \chinese + * 获取外部轴电流 + * + * @return 外部轴电流 + * \endchinese + * + * \english + * Get external axis current + * + * @return External axis current + * \endenglish + */ + double getExtAxisCurrent(); + + /** + * \chinese + * 获取外部轴温度 + * + * @return 外部轴温度 + * \endchinese + * + * \english + * Get external axis temperature + * + * @return External axis temperature + * \endenglish + */ + double getExtAxisTemperature(); + + /** + * \chinese + * 获取外部轴电压 + * + * @return 外部轴电压 + * \endchinese + * + * \english + * Get external axis voltage + * + * @return External axis voltage + * \endenglish + */ + double getExtAxisBusVoltage(); + + /** + * \chinese + * 获取外部轴电流 + * + * @return 外部轴电流 + * \endchinese + * + * \english + * Get external axis current + * + * @return external axis current + * \endenglish + */ + double getExtAxisBusCurrent(); + + /** + * \chinese + * 获取外部轴最大位置 + * + * @return 外部轴最大位置 + * \endchinese + * + * \english + * Get external axis max position + * + * @return External axis max position + * \endenglish + */ + double getExtAxisMaxPosition(); + + /** + * \chinese + * 获取外部轴最小位置 + * + * @return 外部轴最小位置 + * \endchinese + * + * \english + * Get external axis min position + * + * @return External axis min position + * \endenglish + */ + double getExtMinPosition(); + + /** + * \chinese + * 获取外部轴最大速度 + * + * @return 外部轴最大速度 + * \endchinese + * + * \english + * Get external axis max speed + * + * @return External axis max speed + * \endenglish + */ + double getExtAxisMaxVelocity(); + + /** + * \chinese + * 获取外部轴最大加速度 + * + * @return 外部轴最大加速度 + * \endchinese + * + * \english + * Get external axis max acceleration + * + * @return External axis max acceleration + * \endenglish + */ + double getExtAxisMaxAcceleration(); + + /** + * \chinese + * 跟踪另一个外部轴的运动(禁止运动过程中使用) + * + * @param target_name 目标的外部轴名字 + * @param phase 相位差 + * @param err 跟踪运行的最大误差 + * @return + * \endchinese + * + * \english + * Follow motion of another external axis (not to be used during motion) + * + * @param target_name name of target axis + * @param phase phase difference + * @param err max error when following motion + * @return + * \endenglish + */ + int followAnotherAxis(const std::string &target_name, double phase, + double err); + + /** + * \~chinese @brief stopFollowAnotherAxis(禁止运动过程中使用) + * \~english @brief stopFollowAnotherAxis(not to be used during motion) + * @return + */ + int stopFollowAnotherAxis(); + + /** + * \chinese + * 获取外部轴错误码 + * + * @return 外部轴错误码 + * \endchinese + * + * \english + * Get external axis error code + * + * @return External axis error code + * \endenglish + */ + int getErrorCode(); + + /** + * \chinese + * 重置外部轴错误 + * + * @return + * \endchinese + * + * \english + * Reset axis error + * + * @return + * \endenglish + */ + int clearAxisError(); + +protected: + void *d_; +}; +using AxisInterfacePtr = std::shared_ptr; + +} // namespace common_interface +} // namespace arcs + +#endif // AUBO_SDK_AXIS_INTERFACE_H diff --git a/third_party/AuboSdk/linux/include/aubo/error_stack/error_stack.h b/third_party/AuboSdk/linux/include/aubo/error_stack/error_stack.h new file mode 100644 index 00000000..141a8941 --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo/error_stack/error_stack.h @@ -0,0 +1,114 @@ +/** @file error_stack.h + * @brief 汇总错误码 + */ +#ifndef AUBO_SDK_ERROR_STACK_H +#define AUBO_SDK_ERROR_STACK_H + +#include +#include +#include +#include +#include +#include + +#include + +// 格式化占位符,默认是 fmt 的格式 +#ifndef _PH1_ +#define _PH1_ "{}" +#define _PH2_ "{}" +#define _PH3_ "{}" +#define _PH4_ "{}" +#endif + +namespace arcs { +namespace error_stack { + +constexpr int ARCS_ABI_EXPORT codeCompose(int aa, int bb, int cccc) +{ + return (int)((aa * 1000000) + (bb * 10000) + cccc); +} + +constexpr int ARCS_ABI_EXPORT mod(int x) +{ + return (x % 1000000); +} + +#include +#include +#include + +#define ARCS_ERROR_CODES \ + SYSTEM_ERRORS \ + JOINT_ERRORS \ + SAFETY_INTERFACE_BOARD_ERRORS \ + RTM_ERRORS \ + TOOL_ERRORS \ + PEDSTRAL_ERRORS \ + HARDWARE_INTERFACE_ERRORS \ + _D(ARCS_MAX_ERROR_CODE, -1, "Max error code", "suggest...") + +// 错误代码枚举 +enum ErrorCodes +{ +#define _D(n, v, s, r) n = (int)v, + ARCS_ERROR_CODES +#undef _D +}; + +inline int str2ErrorCode(const char *err_code_name) +{ +#define _D(n, v, s, r) \ + if (strcmp(#n, err_code_name) == 0) \ + return v; + ARCS_ERROR_CODES +#undef _D + return ARCS_MAX_ERROR_CODE; +} + +inline const char *errorCode2Str(int err_code) +{ + static const char *errcode_str[] = { +#define _D(n, v, s, r) s, + ARCS_ERROR_CODES +#undef _D + }; + + enum arcs_index + { +#define _D(n, v, s, r) n##_INDEX, + ARCS_ERROR_CODES +#undef _D + }; + + int index = -1; + +#define _D(n, v, s, r) \ + if (err_code == v) \ + index = n##_INDEX; + ARCS_ERROR_CODES +#undef _D + + if (index == -1) { + index = ARCS_MAX_ERROR_CODE_INDEX; + } + + return errcode_str[(unsigned)index]; +} + +inline std::ostream &dump(std::ostream &os) +{ +#define _D(n, v, s, r) \ + os << std::setw(20) << #n << "\t" << v << "\t" << s << "\t" << r \ + << std::endl; + + ARCS_ERROR_CODES +#undef _D + + return os; +} + +} // namespace error_stack +} // namespace arcs + +#endif // AUBO_SDK_ERROR_STACK_H diff --git a/third_party/AuboSdk/linux/include/aubo/error_stack/hal_error.h b/third_party/AuboSdk/linux/include/aubo/error_stack/hal_error.h new file mode 100644 index 00000000..e04e1358 --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo/error_stack/hal_error.h @@ -0,0 +1,164 @@ +/** @file hal_error.h + * @brief 定义硬件抽象层的错误码 + */ +#ifndef AUBO_SDK_HAL_ERROR_H +#define AUBO_SDK_HAL_ERROR_H + +// 缩写说明 +// JNT: joint +// PDL: pedstral +// TP: teach pendant +// COMM: communication +// ENC: encoder +// CURR: current +// POS: position +// PKG: package +// PROG: program + +// clang-format off +#define JOINT_ERRORS \ + _D(JOINT_ERR_OVER_CURRENET, 10001, "joint" _PH1_ " error: over current", "(a) Check for short circuit. (b) Do a Complete rebooting sequence. (c) If this happens more than two times in a row, replace joint") \ + _D(JOINT_ERR_OVER_VOLTAGE, 10002, "joint" _PH1_ " error: over voltage", "(a) Do a Complete rebooting sequence. (b) Check 48 V Power supply, current distributer, energy eater and Control Board for issues") \ + _D(JOINT_ERR_LOW_VOLTAGE, 10003, "joint" _PH1_ " error: low voltage", "(a) Do a Complete rebooting sequence. (b) Check for short circuit in robot arm. (c) Check 48 V Power supply, current distributer, energy eater and Control Board for issues") \ + _D(JOINT_ERR_OVER_TEMP, 10004, "joint" _PH1_ " error: over temperature", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_HALL, 10005, "joint" _PH1_ " error: hall", "suggest...") \ + _D(JOINT_ERR_ENCODER, 10006, "joint" _PH1_ " error: encoder", "Check encoder connections") \ + _D(JOINT_ERR_ABS_ENCODER, 10007, "joint" _PH1_ " error: abs encoder", "suggest...") \ + _D(JOINT_ERR_Q_CURRENT, 10008, "joint" _PH1_ " error: detect current", "suggest...") \ + _D(JOINT_ERR_ENC_POLL, 10009, "joint" _PH1_ " error: encoder pollustion", "suggest...") \ + _D(JOINT_ERR_ENC_Z_SIGNAL, 10010, "joint" _PH1_ " error: enocder z signal", "suggest...") \ + _D(JOINT_ERR_ENC_CAL, 10011, "joint" _PH1_ " error: encoder calibrate", "suggest...") \ + _D(JOINT_ERR_IMU_SENS, 10012, "joint" _PH1_ " error: IMU sensor", "suggest...") \ + _D(JOINT_ERR_TEMP_SENS, 10013, "joint" _PH1_ " error: TEMP sensor", "suggest...") \ + _D(JOINT_ERR_CAN_BUS, 10014, "joint" _PH1_ " error: CAN bus error", "suggest...") \ + _D(JOINT_ERR_SYS_CUR, 10015, "joint" _PH1_ " error: system current error", "suggest...") \ + _D(JOINT_ERR_SYS_POS, 10016, "joint" _PH1_ " error: system position error","suggest...") \ + _D(JOINT_ERR_OVER_SP, 10017, "joint" _PH1_ " error: over speed","suggest...") \ + _D(JOINT_ERR_OVER_ACC, 10018, "joint" _PH1_ " error: over accelerate", "suggest...") \ + _D(JOINT_ERR_TRACE, 10019, "joint" _PH1_ " error: trace accuracy", "suggest...") \ + _D(JOINT_ERR_TAG_POS_OVER, 10020, "joint" _PH1_ " error: target position out of range", "suggest...") \ + _D(JOINT_ERR_TAG_SP_OVER, 10021, "joint" _PH1_ " error: target speed out of range", "suggest...") \ + _D(JOINT_ERR_COLLISION, 10022, "joint" _PH1_ " error: collision", "suggest...") \ + _D(JOINT_ERR_COMMON, 10023, "joint" _PH1_ " error: unkown error. Check communication with joint.", "suggest...") \ + _D(JOINT_ERR_SWITCH_SERVO_MODE, 10024, "joint" _PH1_ " error: switch servo mode timeout.", "suggest...") \ + _D(JOINT_ERR_MOTOR_STUCK, 10025, "joint" _PH1_ " error: motor stucked.", "suggest...") \ + _D(JOINT_ERR_REDUCER_OVER_TEMP, 10026, "joint" _PH1_ " error: reducer over temperature", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_REDUCER_NTC, 10027, "joint" _PH1_ " error: reducer TEMP sensor failure", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_ABS_MULTITURN, 10028, "joint" _PH1_ " error: absolute encoder multiturn error", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_ADC_ZERO_OFFSET, 10029, "joint" _PH1_ " error: ADC zero offset failure", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_SHORT_CIRCUIT, 10030, "joint" _PH1_ " error: short circuit", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_PHASE_LOST, 10031, "joint" _PH1_ " error: motor phase lost", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_BRAKE, 10032, "joint" _PH1_ " error: brake failure", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_FIRMWARE_UPDATE, 10033, "joint" _PH1_ " error: firmware update failure", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_BATTERY_LOW, 10034, "joint" _PH1_ " error: battery low", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_PHASE_ALIGN, 10035, "joint" _PH1_ " error: phase align", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_CAN_HW_FAULT, 10036, "joint" _PH1_ " error: CAN bus hw fault", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_POS_DISCONTINUOUS, 10037, "joint" _PH1_ " error: target position discontinuous", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_POS_INIT, 10038, "joint" _PH1_ " error: position initiallization failure", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_TORQUE_SENSOR, 10039, "joint" _PH1_ " error: torqure sensor failure", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_OFFLINE, 10040, "joint" _PH1_ " error: joint may be offline", "(a) Check joint's hardware. (b) Check joint's id.") \ + _D(JOINT_ERR_BOOTLOADER, 10041, "joint" _PH1_ " error: The joint is in bootloader mode. Retry firmware update. ", "suggest...") \ + _D(JOINT_ERR_SLAVE_OFFLINE, 10042, "slave joint" _PH1_ " error: slave joint may be offline", "(a) Check slave joint's hardware. (b) Check slave joint's id.") \ + _D(JOINT_ERR_SLAVE_BOOTLOADER, 10043, "slave joint" _PH1_ " error: The slave joint is in bootloader mode. Retry firmware update. ", "suggest...") + +#define TOOL_ERRORS \ + _D(TOOL_FLASH_VERIFY_FAILED, 40001, "Flash write verify failed", "suggest...") \ + _D(TOOL_PROGRAM_CRC_FAILED, 40002, "Program flash checksum failed during bootloading", "suggest...") \ + _D(TOOL_PROGRAM_CRC_FAILED2, 40003, "Program flash checksum failed at runtime", "suggest...") \ + _D(TOOL_ID_UNDIFINED, 40004, "Tool ID is undefined", "suggest...") \ + _D(TOOL_ILLEGAL_BL_CMD, 40005, "Illegal bootloader command", "suggest...") \ + _D(TOOL_FW_WRONG, 40006, "Wrong firmware at the joint", "suggest...") \ + _D(TOOL_HW_INVALID, 40007, "Invalid hardware revision", "suggest...") \ + _D(TOOL_SHORT_CURCUIT_H, 40011, "Short circuit detected on Digital Output: " _PH1_ " high side", "suggest...") \ + _D(TOOL_SHORT_CURCUIT_L, 40012, "Short circuit detected on Digital Output: " _PH1_ " low side", "suggest...") \ + _D(TOOL_AVERAGE_CURR_HIGH, 40013, "10 second Average tool IO Current of " _PH1_ " A is outside of the allowed range.", "suggest...") \ + _D(TOOL_POWER_PIN_OVER_CURR, 40014, "Current of " _PH1_ " A on the POWER pin is outside of the allowed range.", "suggest...") \ + _D(TOOL_DOUT_PIN_OVER_CURR, 40015, "Current of " _PH1_ " A on the Digital Output pins is outside of the allowed range.", "suggest...") \ + _D(TOOL_GROUND_PIN_OVER_CURR, 40016, "Current of " _PH1_ " A on the ground pin is outside of the allowed range.", "suggest...") \ + _D(TOOL_RX_FRAMING, 40021, "RX framing error", "suggest...") \ + _D(TOOL_RX_PARITY, 40022, "RX Parity error", "suggest...") \ + _D(TOOL_48V_LOW, 40031, "48V input is too low", "suggest...") \ + _D(TOOL_48V_HIGH, 40032, "48V input is too high", "suggest...") \ + _D(TOOL_ERR_OFFLINE, 40033, "tool error: tool may be offline", "(a) Check tool's hardware. (b) Check joint's id.") \ + _D(TOOL_ERR_BOOTLOADER, 40034, "tool error: The tool is in bootloader mode. Retry firmware update. ", "suggest...") + + +#define PEDSTRAL_ERRORS \ + _D(PKG_LOST, 50001, "Lost package from pedestal", "suggest...") \ + _D(PEDSTRAL_OFFLINE, 50002, "pedestal error: pedestal may be offline", "(a) Check pedestal's hardware. (b) Check pedestal's id.") \ + _D(PEDESTAL_ERR_BOOTLOADER, 50003, "pedestal error: The pedestal is in bootloader mode. Retry firmware update. ", "suggest...") + + +#define SAFETY_INTERFACE_BOARD_ERRORS \ + _D(IFB_ERR_ROBOTTYPE, 20001, "Robot error type!", "suggest...") \ + _D(IFB_ERR_ADXL_SENS, 20002, "Acceleration sensor error!", "suggest...") \ + _D(IFB_ERR_EN_LINE, 20003, "Encoder line error!", "suggest...") \ + _D(IFB_ERR_ENTER_HDG_MODE, 20004, "Robot enter handguide mode!", "suggest...") \ + _D(IFB_ERR_EXIT_HDG_MODE, 20005, "Robot exit handguide mode!", "suggest...") \ + _D(IFB_ERR_MAC_DATA_BREAK, 20006, "MAC data break!", "suggest...") \ + _D(IFB_ERR_DRV_FIRMWARE_VERSION, 20007, "Motor driver firmware version error!", "suggest...") \ + _D(INIT_ERR_EN_DRV, 20008, "Motor driver enable failed!", "suggest...") \ + _D(INIT_ERR_EN_AUTO_BACK, 20009, "Motor driver enable auto back failed!", "suggest...") \ + _D(INIT_ERR_EN_CUR_LOOP, 20010, "Motor driver enable current loop failed!", "suggest...") \ + _D(INIT_ERR_SET_TAG_CUR, 20011, "Motor driver set target current failed!", "suggest...") \ + _D(INIT_ERR_RELEASE_BRAKE, 20012, "Motor driver release brake failed!", "suggest...") \ + _D(INIT_ERR_EN_POS_LOOP, 20013, "Motor driver enable postion loop failed!", "suggest...") \ + _D(INIT_ERR_SET_MAX_ACC, 20014, "Motor set max accelerate failed!", "suggest...") \ + _D(SAFETY_ERR_PROTECTION_STOP_TIMEOUT, 20015, "Protective stop timeout!", "suggest...") \ + _D(SAFETY_ERR_REDUCED_MODE_TIMEOUT, 20016, "Reduced mode timeout!", "suggest...") \ + _D(SYS_ERR_MCU_COM, 20017, "Robot system error: mcu communication error!", "suggest...") \ + _D(SYS_ERR_RS485_COM, 20018, "Robot system error: RS485 communication error!", "suggest...") \ + _D(IFB_ERR_DISCONNECTED, 20019, "Interface board may be disconnected. Please check connection between IPC and Interface board.", "suggest...")\ + _D(IFB_ERR_PAYLOAD_ERROR, 20020, "Payload error.", "suggest...") \ + _D(IFB_OFFLINE, 20021, "ifaceboard error: ifaceboard may be offline", "(a) Check ifaceboard's hardware. (b) Check ifaceboard's id.") \ + _D(IFB_ERR_BOOTLOADER, 20022, "ifaceboard error: The ifaceboard is in bootloader mode. Retry firmware update. ", "suggest...") \ + _D(IFB_SLAVE_OFFLINE, 20023, "interface slave board error: interface slave board may be offline", "(a) Check interface slave board's hardware. (b) Check interface slave board's id.") \ + _D(IFB_SLAVE_ERR_BOOTLOADER, 20024, "interface slave board error: The interface slave board is in bootloader mode. Retry firmware update. ", "suggest...") + + +#define HARDWARE_INTERFACE_ERRORS \ + _D(HW_SCB_SETUP_FAILED, 60001, "Setup of Interface Board failed", "suggest...") \ + _D(HW_PKG_CNT_DISAGEE, 60002, "Packet counter disagreements", "suggest...") \ + _D(HW_SCB_DISCONNECT, 60003, "Connection to Interface Board lost", "suggest...") \ + _D(HW_SCB_PKG_LOST, 60004, "Package lost from Interface Board", "suggest...") \ + _D(HW_SCB_CONN_INIT_FAILED, 60005, "Ethernet connection initialization with Interface Board failed", "suggest...") \ + _D(HW_LOST_JOINT_PKG, 60006, "Lost package from joint " _PH1_ "", "suggest...") \ + _D(HW_LOST_TOOL_PKG, 60007, "Lost package from tool", "suggest...") \ + _D(HW_JOINT_PKG_CNT_DISAGREE, 60008, "Packet counter disagreement in packet from joint " _PH1_ "", "suggest...") \ + _D(HW_TOOL_PKG_CNT_DISAGREE, 60009, "Packet counter disagreement in packet from tool", "suggest...") \ + _D(HW_JOINTS_FAULT, 60011, "" _PH1_ " joint entered the Fault State", "suggest...") \ + _D(HW_JOINTS_VIOLATION, 60012, "" _PH1_ " joint entered the Violation State", "suggest...") \ + _D(HW_TP_FAULT, 60013, "Teach Pendant entered the Fault State", "suggest...") \ + _D(HW_TP_VIOLATION, 60014, "Teach Pendant entered the Violation State", "suggest...") \ + _D(HW_JOINT_MV_TOO_FAR, 60021, "" _PH1_ " joint moved too far before robot entered RUNNING State", "suggest...") \ + _D(HW_JOINT_STOP_NOT_FAST, 60022, "Joint Not stopping fast enough", "suggest...") \ + _D(HW_JOINT_MV_LIMIT, 60023, "Joint moved more than allowable limit", "suggest...") \ + _D(HW_FT_SENSOR_DATA_INVALID, 60024, "Force-Torque Sensor data invalid", "suggest...") \ + _D(HW_NO_FT_SENSOR, 60025, "Force-Torque sensor is expected, but it cannot be detected", "suggest...") \ + _D(HW_FT_SENSOR_NOT_CALIB, 60026, "Force-Torque sensor is detected but not calibrated", "suggest...") \ + _D(HW_RELEASE_BRAKE_FAILED, 60030, "Robot was not able to brake release, see log for details", "suggest...") \ + _D(HW_OVERCURR_SHUTDOWN, 60040, "Overcurrent shutdown", "suggest...") \ + _D(HW_ENERGEY_SURPLUS, 60050, "Energy surplus shutdown", "suggest...") \ + _D(HW_IDLE_POWER_HIGH, 60060, "Idle power consumption to high", "suggest...") \ + _D(HW_ENTER_COLLISION_TIMEOUT, 60071, "Enter collision stop procedure timeout", "suggest...") \ + _D(HW_POWERON_TIMEOUT, 60072, "Poweron robot timeout", "suggest...") \ + _D(HW_NO_NIC_FOUND, 60073, "No network cards found.", "suggest...") \ + _D(HW_IFB_NOT_FOUND, 60074, "No Interface Board found.", "suggest...") \ + _D(HW_IFB_BOOTLOAD, 60075, "The Interface Board is in bootloader mode. Update firmware firstly.", "suggest...") \ + _D(HW_TOOL_NOT_FOUND, 60076, "No Tool Board found.", "suggest...") \ + _D(HW_BASE_NOT_FOUND, 60077, "No Base Board found.", "suggest...") \ + _D(HW_BRINGUP_TIMEOUT, 60078, "Poweron robot timeout", "suggest...") \ + _D(HW_COLLISION_RECOVERY_FAILED, 60079, "Collision recovery failed", "suggest...") \ + _D(HW_TP_ENABLED, 60080, "Teach pendant enabled status changed to " _PH1_, "suggest...") + +// clang-format on + +// 定义硬件抽象层的错误代码 +#define HAL_ERRORS \ + JOINT_ERRORS \ + SAFETY_INTERFACE_BOARD_ERRORS \ + TOOL_ERRORS \ + PEDSTRAL_ERRORS \ + HARDWARE_INTERFACE_ERRORS + +#endif // AUBO_SDK_JOINT_ERROR_H diff --git a/third_party/AuboSdk/linux/include/aubo/error_stack/rtm_error.h b/third_party/AuboSdk/linux/include/aubo/error_stack/rtm_error.h new file mode 100644 index 00000000..50c17697 --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo/error_stack/rtm_error.h @@ -0,0 +1,171 @@ +/** @file rtm_error.h + * @brief 运行时错误码 + */ +#ifndef AUBO_SDK_RTM_ERROR_H +#define AUBO_SDK_RTM_ERROR_H + +// clang-format off + +#define RTM_ERRORS \ + _D(ROBOT_BE_PULLING, 30001, "Something is pulling the robot.","Please check TCP configuration,payload and mounting settings") \ + _D(PSTOP_ELBOW_POS, 30002, "Protective Stop: Elbow position close to safety plane limits.","Please move robot Elbow joint away from the safety plane") \ + _D(PSTOP_STOP_TIME, 30003, "Protective Stop: Exceeding user safety settings for stopping time.","(a) Check speeds and accelerations in the program (b) Check usage of TCP,payload and CoG correctly (c) Check external equipmentactivation if correctly set") \ + _D(PSTOP_STOP_DISTANCE, 30004, "Protective Stop: Exceeding user safety settings for stopping distance.","(a) Check speeds and accelerations in the program (b) Check usage of TCP,payload and CoG correctly (c) Check external equipmentactivation if correctly set") \ + _D(PSTOP_CLAMP, 30005, "Protective Stop: Danger of clamping between the Robot’s lower arm and tool.","(a) Check speeds and accelerations in the program (b) Check usage of TCP,payload and CoG correctly (c) Check external equipmentactivation if correctly set") \ + _D(PSTOP_POS_LIMIT, 30006, "Protective Stop: Position close to joint limits", "suggest...") \ + _D(PSTOP_ORI_LIMIT, 30007, "Protective Stop: Tool orientation close to limits", "suggest...") \ + _D(PSTOP_PLANE_LIMIT, 30008, "Protective Stop: Position close to safety plane limits", "suggest...") \ + _D(PSTOP_POS_DEVIATE, 30009, "Protective Stop: Position deviates from path", "Check payload, center of gravity and acceleration settings.") \ + _D(JOINT_CHK_PAYLOAD, 30010, "Joint " _PH1_ ": Check payload, center of gravity and acceleration settings. Log screen may contain additional information.", "suggest...") \ + _D(PSTOP_SINGULARITY, 30011, "Protective Stop: Position in singularity.","Please use MoveJ or change the motion") \ + _D(PSTOP_CANNOT_MAINTAIN, 30012, "Protective Stop: Robot cannot maintain its position, check if payload is correct", "suggest...") \ + _D(PSTOP_WRONG_PAYLOAD, 30013, "Protective Stop: Wrong payload or mounting detected, or something is pushing the robot when entering Freedrive mode","Verify that the TCP configuration and mounting in the used installation is correct") \ + _D(PSTOP_JOINT_COLLISION, 30014, "Protective Stop: Collision detected by joint " _PH1_, "Make sure no objects are in the path of the robot and resume the program") \ + _D(PSTOP_POS_DISAGREE, 30015, "Protective stop: The robot was powered off last time due to a joint position disagreement."," (a) Verify that the robot position in the 3D graphics matches the real robot, to ensure that the encoders function before releasing the brakes. Stand back and monitor the robot performing its first program cycle as expected. (b) If the position is not correct, the robot must be repaired. In this case, click Power Off Robot. (c) If the position is correct, please tick the check box below the 3D graphics and click Robot Position Verified") \ + _D(TARGET_JOINT_SPEED_EXCEED, 30016, "Target joint speed exceed limits", "suggest...") \ + _D(TARGET_POS_SUDDEN_CHG, 30017, "Sudden change in target position", "suggest...") \ + _D(SUDDEN_STOP, 30018, "Sudden stop."," To abort a motion, use \"stopj\" or \"stopl\" script commands to generate a smooth deceleration before using \"wait\". Avoid aborting motions between waypoints with blend”") \ + _D(ROBOT_STOP_ABNORMAL, 30019, "Robot has not stopped in the allowed reaction and braking time", "suggest...") \ + _D(PROG_INVALID_SETP, 30020, "Robot program resulted in invalid setpoint.", "Please review waypoints in the program") \ + _D(BLEND_INVALID_SETP, 30021, "Blending failed and resulted in an invalid setpoint.", "Try changing the blend radius or contact technical support") \ + _D(APPROACH_SINGULARITY, 30022, "Robot approaching singularity – Acceleration threshold failed.","Review waypoints in the program, try using MoveJ instead of MoveL in the position close to singularity") \ + _D(TSPEED_UNMATCH_POS, 30023, "Target speed does not match target position", "suggest...") \ + _D(INCONSIS_TPOS_SPD, 30024, "Inconsistency between target position and speed", "suggest...") \ + _D(JOINT_TSPD_UNMATCH_POS, 30025, "Target joint speed does not match target joint position change – Joint " _PH1_ "", "suggest...") \ + _D(FIELDBUS_INPUT_DISCONN, 30026, "Fieldbus input disconnected.","Please check fieldbus connections (RTDE, ModBus, EtherNet/IP and Profinet) or disable the fieldbus in the installation. Check RTDE watchdog feature. Check if a URCap is using this feature.") \ + _D(OPMODE_CHANGED, 30027, "Operational mode changed: " _PH1_ "", "suggest...") \ + _D(NO_KIN_CALIB, 30028, "No Kinematic Calibration found (calibration.conf file is either corrupt or missing).","A new kinematics calibration may be needed if the robot needs to improve its kinematics, otherwise, ignore this message)") \ + _D(KIN_CALIB_UNMATCH_JOINT, 30029, "Kinematic Calibration for the robot does not match the joint(s).", "If moving a program from a different robot to this one, rekinematic calibrate the second robot to improve kinematics, otherwise ignore this message.") \ + _D(KIN_CALIB_UNMATCH_ROBOT, 30030, "Kinematic Calibration does not match the robot.","Please check if the serial number of the robot arm matches the Control Box") \ + _D(JOINT_OFFSET_CHANGED, 30031, "Large movement of the robot detected while it was powered off. The joints were moved while it was powered off, or the encoders do not function", "suggest...") \ + _D(OFFSET_CHANGE_HIGH, 30032, "Change in offset is too high", "suggest...") \ + _D(JOINT_SPEED_LIMIT, 30033, "Close to joint speed safety limit.", "Review program speed and acceleration") \ + _D(TOOL_SPEED_LIMIT, 30034, "Close to tool speed safety limit.", "Review program speed and acceleration") \ + _D(MOMENTUM_LIMIT, 30035, "Close to momentum safety limit.", "Review program speed and acceleration") \ + _D(ROBOT_MV_STOP, 30036, "Robot is moving when in Stop Mode", "suggest...") \ + _D(HAND_PROTECTION, 30037, "Hand protection: Tool is too close to the lower arm: " _PH1_ " meter.","(a) Check wrist position. (b) Verify mounting (c) Do a Complete rebooting sequence (d) Update software (e) Contact your local AUBO Robots service provider for assistance") \ + _D(WRONG_SAFETYMODE, 30038, "Wrong safety mode: " _PH1_, "suggest...") \ + _D(SAFETYMODE_CHANGED, 30039, "Safety mode changed: " _PH1_, "suggest...") \ + _D(JOINT_ACC_LIMIT, 30040, "Close to joint acceleration safety limit", "suggest...") \ + _D(TOOL_ACC_LIMIT, 30041, "Close to tool acceleration safety limit", "suggest...") \ + _D(JOINT_TEMPERATURE_LIMIT, 30042, "Joint " _PH1_ " temperature too high(>" _PH2_ "℃)", "suggest...") \ + _D(CONTROL_BOX_TEMPERATURE_LIMIT, 30043, "Control box temperature too high(>" _PH1_ "℃)", "suggest...") \ + _D(ROBOT_EMERGENCY_STOP, 30044, "Robot emergency stop", "suggest...") \ + _D(ROBOTMODE_CHANGED, 30045, "Robot mode changed: " _PH1_, "suggest...") \ + _D(ROBOTMODE_ERROR, 30046, "Wrong robot mode: " _PH1_, "suggest...") \ + _D(POSE_OUT_OF_REACH, 30047, "Target pose [" _PH1_ "] out of reach", "suggest...") \ + _D(TP_PLAN_FAILED, 30048, "Trajectory plan FAILED." , "suggest...") \ + _D(START_FORCE_FAILED, 30049, "Start force control failed, because force sensor does not exist." , "suggest...") \ + _D(OVER_SAFE_PLANE_LIMIT,30050, _PH1_ " axis exceeds the safety plane limit (Move_type:" _PH2_ " id:" _PH3_ ").","Please move the robot to the safety plane range.") \ + _D(POWERON_FAIL_VIOLATION,30051, "Failed to power on because the robot safety mode is in violation", "suggest...") \ + _D(POWERON_FAIL_SYSTEMEMERGENCYSTOP, 30052, "Failed to power on because the robot safety mode is in system emergency stop", "suggest...") \ + _D(POWERON_FAIL_ROBOTEMERGENCYSTOP, 30053, "Failed to power on because the robot safety mode is in robot emergency stop", "Pop up the red emergency stop button on the teach pendant when the robot is in a safe range of motion") \ + _D(POWERON_FAIL_FAULT, 30054, "Failed to power on because the robot safety mode is in fault", "suggest...") \ + _D(STARTUP_FAIL_VIOLATION, 30055, "Failed to startup because the robot safety mode is in violation", "suggest...") \ + _D(STARTUP_FAIL_SYSTEMEMERGENCYSTOP, 30056, "Failed to startup because the robot safety mode is in system emergency stop", "suggest...") \ + _D(STARTUP_FAIL_ROBOTEMERGENCYSTOP, 30057, "Failed to startup because the robot safety mode is in robot emergency stop", "Pop up the red emergency stop button on the teach pendant when the robot is in a safe range of motion") \ + _D(STARTUP_FAIL_FAULT, 30058, "Failed to startup because the robot safety mode is in fault", "suggest...") \ + _D(BACKDRIVE_FAIL_VIOLATION, 30059, "Failed to backdrive because the robot safety mode is in violation", "suggest...") \ + _D(BACKDRIVE_FAIL_SYSTEMEMERGENCYSTOP, 30060, "Failed to backdrive because the robot safety mode is in system emergency stop", "suggest...") \ + _D(BACKDRIVE_FAIL_ROBOTEMERGENCYSTOP, 30061, "Failed to backdrive because the robot safety mode is in robot emergency stop", "Pop up the red emergency stop button on the teach pendant when the robot is in a safe range of motion") \ + _D(BACKDRIVE_FAIL_FAULT, 30062, "Failed to backdrive because the robot safety mode is in fault", "suggest...") \ + _D(SETSIM_FAIL_VIOLATION, 30063, "Switch sim mode failed because the robot safety mode is in violation", "suggest...") \ + _D(SETSIM_FAIL_SYSTEMEMERGENCYSTOP, 30064, "Switch sim mode failed because the robot safety mode is in system emergency stop", "suggest...") \ + _D(SETSIM_FAIL_ROBOTEMERGENCYSTOP, 30065, "Switch sim mode failed because the robot safety mode is in robot emergency stop", "Pop up the red emergency stop button on the teach pendant when the robot is in a safe range of motion") \ + _D(SETSIM_FAIL_FAULT, 30066, "Switch sim mode failed because the robot safety mode is in fault", "suggest...") \ + _D(FREEDRIVE_FAIL_VIOLATION, 30067, "Enable handguide mode failed because the robot safety mode is in violation", "suggest...") \ + _D(FREEDRIVE_FAIL_SYSTEMEMERGENCYSTOP, 30068, "Enable handguide mode failed because the robot safety mode is in system emergency stop", "suggest...") \ + _D(FREEDRIVE_FAIL_ROBOTEMERGENCYSTOP, 30069, "Enable handguide mode failed because the robot safety mode is in robot emergency stop", "Pop up the red emergency stop button on the teach pendant when the robot is in a safe range of motion") \ + _D(FREEDRIVE_FAIL_FAULT, 30070, "Enable handguide mode failed because the robot safety mode is in fault", "suggest...") \ + _D(UPFIRMWARE_FAIL_VIOLATION, 30071, "Firmware update failed because the robot safety mode is in violation", "suggest...") \ + _D(UPFIRMWARE_FAIL_SYSTEMEMERGENCYSTOP, 30072, "Firmware update failed because the robot safety mode is in system emergency stop", "suggest...") \ + _D(UPFIRMWARE_FAIL_ROBOTEMERGENCYSTOP, 30073, "Firmware update failed because the robot safety mode is in robot emergency stop", "Pop up the red emergency stop button on the teach pendant when the robot is in a safe range of motion") \ + _D(UPFIRMWARE_FAIL_FAULT, 30074, "Firmware update failed because the robot safety mode is in fault", "suggest...") \ + _D(SETPERSOSTENT_FAIL_VIOLATION, 30075, "Set persistent parameter failed because the robot safety mode is in violation", "suggest...") \ + _D(SETPERSOSTENT_FAIL_SYSTEMEMERGENCYSTOP, 30076, "Set persistent parameter failed because the robot safety mode is in system emergency stop", "suggest...") \ + _D(SETPERSOSTENT_FAIL_ROBOTEMERGENCYSTOP, 30077, "Set persistent parameter failed because the robot safety mode is in robot emergency stop", "Pop up the red emergency stop button on the teach pendant when the robot is in a safe range of motion") \ + _D(SETPERSOSTENT_FAIL_FAULT, 30078, "Set persistent parameter failed because the robot safety mode is in fault", "suggest...") \ + _D(SETPERSOSTENT_FAIL_PARAM_ERR, 30079, "Set persistent parameter failed", "(a) Check the parameter format, whether all are floating point numbers") \ + _D(ROBOT_CABLE_DISCONN, 30080, "Robot cable not connected", "(a) Make sure the cable between Control Box and Robot Arm is correctly connected and it has no damage. (b) Check for loose connections (c) Do a Complete rebooting sequence (d) Update software (e) Contact your local AUBO Robots service provider for assistance Contact your local AUBO Robots service provider for assistance.") \ + _D(TP_TOO_SHORT, 30081, "The generated trajectory is ignored because it is too short", "(a) Please check if the added waypoints are coincident (b) If it is an arc movement, please check whether the three points are collinear") \ + _D(INV_KIN_FAIL, 30082, "Inverse kinematics solution failed. The target pose may be in a singular position or exceed the joint limits", "(a) Change the target pose and try moving again") \ + _D(FREEDRIVE_ENABLED, 30083, "Freedrive status changed to " _PH1_ "", "suggest...") \ + _D(TP_INV_FAIL_REFERENCE_JOINT_OUT_OF_LIMIT, 30084, "Inverse kinematics solution failed. Reference angle [" _PH1_ "] exceeds joint limit [" _PH2_ "].", "suggest...") \ + _D(TP_INV_FAIL_NO_SOLUTION, 30085, "Inverse kinematics solution failed. The reference angle [" _PH1_ "] and the target angle [" _PH2_ "] are used as parameters. there is no solution in the calculation of the inverse solution process.", "suggest...")\ + _D(SERVO_FAIL_VIOLATION, 30086, "Switch servo mode failed because the robot safety mode is in violation", "suggest...") \ + _D(SERVO_FAIL_SYSTEMEMERGENCYSTOP, 30087, "Switch servo mode failed because the robot safety mode is in system emergency stop", "suggest...") \ + _D(SERVO_FAIL_ROBOTEMERGENCYSTOP, 30088, "Switch servo mode failed because the robot safety mode is in robot emergency stop", "Pop up the red emergency stop button on the teach pendant when the robot is in a safe range of motion") \ + _D(SERVO_FAIL_FAULT, 30089, "Switch servo mode failed because the robot safety mode is in fault", "suggest...") \ + _D(FREEDRIVE_FAIL_NO_RUNNING, 30090, "Enable handguide mode failed because the robot mode type is " _PH1_ "(not running)", "suggest...") \ + _D(RUNTIME_MACHINE_ERROR, 30091, "The state of the running machine is " _PH1_ ", not " _PH2_ ". " _PH3_ " function execution failed because the state is wrong." , "suggest...") \ + _D(RESUME_FAR_PAUSE_PT, 30092, "Cannot resume from joint position [" _PH1_ "].\\nToo far away from paused point [" _PH2_ "]." , "suggest...") \ + _D(PAYLOAD_LIGHTER_ERROR, 30093, "The payload setting is too small!" , "suggest...") \ + _D(PAYLOAD_OVERLOAD_ERROR, 30094, "The payload setting is too large!" , "suggest...") \ + _D(PAUSE_FAIL_NOT_POSITION_PLAN_MODE, 30095, "This motion does not support the pause function. The motion is stopping." , "suggest...") \ + _D(TP_PLAN_FAILED_CIRCULAR_WAYPOINTS_COINCIDE, 30096, "The planning failed because the three waypoints of the arc were determined to coincide." , "Check the circular waypoints to make sure they are different.") \ + _D(SERVO_WRONG_SAFETYMODE, 30097, "Switch servo mode failed because the robot safety mode is in " _PH1_ "." , "Check the circular waypoints to make sure they are different.") \ + _D(SET_PERSTPARAM_WRONG_SAFETYMODE, 30098, "Set persistent parameter failed because the robot safety mode is in " _PH1_ , "suggest...") \ + _D(SET_KINPARAM_WRONG_SAFETYMODE, 30099, "Set Kinematics Compensate parameters failed because the robot safety mode is in " _PH1_ , "suggest...") \ + _D(SET_ROBOT_ZERO_WRONG_SAFETYMODE, 30100, "Set current joint angles to zero failed because the robot safety mode is in " _PH1_ , "suggest...") \ + _D(UPFIRMWARE_WRONG_SAFETYMODE, 30101, "Firmware update failed because the robot safety mode is in " _PH1_, "suggest...") \ + _D(POWERON_WRONG_SAFETYMODE, 30102, "Failed to power on because the robot safety mode is in " _PH1_, "suggest...") \ + _D(STARTUP_WRONG_SAFETYMODE, 30103, "Failed to startup because the robot safety mode is in " _PH1_, "suggest...") \ + _D(BACKDRIVE_WRONG_SAFETYMODE, 30104, "Failed to backdrive because the robot safety mode is in system emergency stop", "suggest...") \ + _D(SETSIM_WRONG_SAFETYMODE, 30105, "Switch sim mode failed because the robot safety mode is in violation", "suggest...") \ + _D(FREEDRIVE_WRONG_SAFETYMODE, 30106, "Enable handguide mode failed because the robot safety mode is in wrong safety mode: " _PH1_, "suggest...") \ + _D(TP_PLAN_FAILED_JOINT_JUMP_BIGGER, 30107, "Inverse kinematics solution failed. The target point and the current point are in different robot configuration spaces.", "Add a few more points between the target point and the current point.") \ + _D(RUN_PROGRAM_FAILED, 30108, "Run program " _PH1_ " failed.", "suggset...") \ + _D(FREEDRIVE_FAIL_WRONG_RTMSTATE, 30109, "Unable to enter the HandGuide mode as the robot is not currently in a stopped or paused state.", "suggset...") \ + _D(SAFEGUARDSTOP_CONFIGURABLE_INPUT, 30110, "Configurable safety input is triggered.", "suggset...") \ + _D(SAFEGUARDSTOP_3PE, 30111, "3PE is triggered.", "suggset...") \ + _D(SAFEGUARDSTOP_SI, 30112, "SI0/SI1 is triggered.", "suggset...") \ + _D(ROBOT_TYPE_CHANGED, 30200, "Robot type changed to '" _PH1_ "', and robot subtype changed to '" _PH2_ "'", "suggest...") \ + _D(LINKMODE_CHANGED, 30201, "Link mode changed to " _PH1_ "", "suggest...") \ + _D(ROBOT_SELF_COLLISION, 30301, "Detect risk of robot self collision", "suggest...") \ + _D(CONSTANT_INVALID, 30302, "Joint torque constants are invalid. HandGuide will be disabled, and the collision protection may be triggered by mistake.", "suggest...") \ + _D(GRAVITY_INVALID, 30303, "Abnormal value of gravity acceleration sensor. HandGuide will be disabled, and the collision protection may be triggered by mistake.", "suggest...") \ + _D(DYNAMICS_INVALID, 30304, "Robot dynamics parameters are invalid. HandGuide will be disabled, and the collision protection may be triggered by mistake.", "suggest...") \ + _D(FRICTION_INVALID, 30305, "Joint friction parameters are invalid. HandGuide will be disabled, and the collision protection may be triggered by mistake.", "suggest...") \ + _D(HANDGUIDE_UNDER_DEVELOP, 30306, "Robot type of " _PH1_ " function under development. HandGuide will be disabled, and the collision protection may be triggered by mistake.", "suggest...") \ + _D(SLOW_DOWN_INFO, 30307, "Slow down level changed to " _PH1_ "(" _PH2_ "%)", "suggest...") \ + _D(WRONG_JOINT_DESIGNED_LIMIT, 30308, "Joint designed ranges exceeds ranges read from hardware interface.", "suggest...") \ + _D(FREEDRIVE_IN_SIMULATION, 30309, "Enable handguide mode failed because the robot is in simulation mode.", "suggest...") \ + _D(ROBOT_STOPPING_TIMEOUT, 30310, "Robot stopping timeout.", "suggest...") \ + _D(PSTOP_INCORRECT_FORCE_OFFSET, 30311, "Protective Stop: Sudden change in force control target position. Force sensor offset may be incorrect or force sensor fault.", "suggest...") \ + _D(WRONG_JOINT_SAFETY_LIMIT, 30312, "Joint safety ranges exceeds designed ranges.", "suggest...") \ + _D(PSTOP_TCP_PLANE_VIOLATION, 30401, "Protective Stop: TCP position close to safety plane limits.", "suggest...") \ + _D(PSTOP_ELBOW_PLANE_VIOLATION, 30402, "Protective Stop: elbow position close to safety plane limits.", "suggest...") \ + _D(PSTOP_JOINT_TORQUE_VIOLATION, 30403, "Protective Stop: joint" _PH1_ " exceeds torque limit.", "suggest...") \ + _D(PSTOP_JOINT_POSITION_VIOLATION, 30404, "Protective Stop: joint" _PH1_ " exceeds position limit.", "suggest...") \ + _D(PSTOP_JOINT_SPEED_VIOLATION, 30405, "Protective Stop: joint" _PH1_ " exceeds speed limit.", "suggest...") \ + _D(PSTOP_TCP_SPEED_VIOLATION, 30406, "Protective Stop: TCP speed close to safety limits.", "suggest...") \ + _D(PSTOP_ELBOW_SPEED_VIOLATION, 30407, "Protective Stop: elbow speed close to safety limits.", "suggest...") \ + _D(PSTOP_TCP_FORCE_VIOLATION, 30408, "Protective Stop: TCP foece close to safety limits.", "suggest...") \ + _D(PSTOP_ELBOW_TORQUE_VIOLATION, 30409, "Protective Stop: elbow torque close to safety limits.", "suggest...") \ + _D(PSTOP_POWER_VIOLATION, 30410, "Protective Stop: robot power close to safety limits.", "suggest...") \ + _D(PSTOP_MOMENTUM_VIOLATION, 30411, "Protective Stop: robot momentum close to safety limits.", "suggest...") \ + _D(PSTOP_TCP_CUBE_VIOLATION, 30412, "Protective Stop: TCP position close to safety cube.", "suggest...") \ + _D(PSTOP_ELBOW_CUBE_VIOLATION, 30413, "Protective Stop: TCP position close to safety cube.", "suggest...") \ + _D(REDUCE_ELBOW_PLANE_TRIGGER, 30414, "Reduce mode: elbow close to safety plane triggers reduction mode.", "suggest...") \ + _D(REDUCE_TCP_PLANE_TRIGGER, 30415, "Reduce mode: TCP close to safety plane triggers reduction mode.", "suggest...") \ + _D(PSTOP_MOVE_OUT_RANGE, 30416, "Joint " _PH1_ " has exceeded the limit, please do not continue to move out of the range", "suggest...") \ + _D(RESUME_PAUSE_FAILED, 30417, "Resume Failed: Safety mode type is " _PH1_ "", "suggest...") \ + _D(FIRMWARE_UPDATE_FAIL_EMERGENCYSTOP, 30418, "Failed to firmware update because the robot safety mode is in " _PH1_ , "Release emergency stop when the robot is in a safe range of motion") \ + _D(TOOL_SENSOR_CHANGED, 30419, "Tool sensor type changed to " _PH1_ "", "suggest...") \ + _D(TOOL_SENSOR_REMOVED, 30420, "Tool sensor is removed.", "suggest...") \ + _D(CAL_TARGET_CURRENT_ERR, 30421, "The calculation of the target current failed. Please try again later.", "suggest...") \ + _D(CONVEYOR_MODE_CHANGED, 30422, "Conveyor" _PH1_ ": track mode changed to " _PH2_ ", track item id is " _PH3_, "suggest...") \ + _D(CONVEYOR_ENQUEUE, 30423, "Conveyor" _PH1_ ": the queue has been changed, item" _PH2_ " is enqueue", "suggest...") \ + _D(CONVEYOR_DEQUEUE_FINISH, 30424, "Conveyor" _PH1_ ": the queue has been changed, item" _PH2_ " dequeue due to track finished", "suggest...") \ + _D(CONVEYOR_DEQUEUE_STARTWINDOW, 30425, "Conveyor" _PH1_ ": the queue has been changed, item" _PH2_ " dequeue due to exceeds startwindow", "suggest...") \ + _D(CONVEYOR_DEQUEUE_LIMIT, 30426, "Conveyor" _PH1_ ": the queue has been changed, item" _PH2_ " dequeue due to exceed limit area", "suggest...") \ + _D(CONVEYOR_DEQUEUE_CLEAR, 30427, "Conveyor" _PH1_ ": item queue is cleared", "suggest...") \ + _D(CONVEYOR_NEXT_TRACK, 30428, "Conveyor" _PH1_ ": item" _PH2_ " inside the start window that can be tracked ", "suggest...") \ + _D(CONVEYOR_EXCEED_LIMIT, 30429, "Conveyor" _PH1_ ": item" _PH2_ " exceeds the limit area during tracking", "suggest...") \ + _D(WRONG_POWER_SAFETY_LIMIT, 30430, "Robot power safety value exceeds designed value.", "suggest...") \ + _D(WRONG_POWER_DESIGNED_LIMIT, 30431, "Power designed value exceeds value read from hardware interface.", "suggest...") \ + _D(TOOL_SENSOR_STATUS_CHANGED, 30432, "Tool sensor status changed to " _PH1_, "suggest...") + +// clang-format on + +#endif // AUBO_SDK_RTM_ERROR_H diff --git a/third_party/AuboSdk/linux/include/aubo/error_stack/system_error.h b/third_party/AuboSdk/linux/include/aubo/error_stack/system_error.h new file mode 100644 index 00000000..aa5e8cd1 --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo/error_stack/system_error.h @@ -0,0 +1,56 @@ +/** @file system_error.h + * @brief 系统错误码 + */ +#ifndef AUBO_SDK_SYSTEM_ERROR_H +#define AUBO_SDK_SYSTEM_ERROR_H + +#define SYSTEM_ERRORS \ + _D(DEBUG, 0, "Debug message " _PH1_, "suggest...") \ + _D(POPUP, 1, "Popup title: " _PH1_ ", msg: " _PH2_ ", mode: " _PH3_, \ + "suggest...") \ + _D(POPUP_DISMISS, 2, _PH1_, "suggest...") \ + _D(SYSTEM_HALT, 3, _PH1_, "suggest...") \ + _D(INV_ARGUMENTS, 4, "Invalid arguments.", "suggest...") \ + _D(USER_NOTIFY, 5, _PH1_, "suggest...") \ + _D(MODBUS_SIGNAL_CREATED, 10, "Modbus signal " _PH1_ " created.", \ + "suggest...") \ + _D(MODBUS_SIGNAL_REMOVED, 11, "Modbus signal " _PH1_ " removed.", \ + "suggest...") \ + _D(MODBUS_SIGNAL_VALUE_CHANGED, 12, \ + "Modbus signal " _PH1_ " value changed to " _PH2_, "suggest...") \ + _D(RUNTIME_CONTEXT, 13, \ + "tid: " _PH1_ " lineno: " _PH2_ " index: " _PH3_ " comment: " _PH4_, \ + "suggest...") \ + _D(INTERP_CONTEXT, 14, \ + "tid: " _PH1_ " lineno: " _PH2_ " index: " _PH3_ " comment: " _PH4_, \ + "suggest...") \ + _D(PROGRAM_LOADED, 15, "program loaded: " _PH1_, "suggest...") \ + _D(TASK_DELETED, 16, "tid: " _PH1_, " was deleted") \ + _D(MODBUS_SLAVE_BIT, 20, "Modbus slave address: " _PH1_ " value " _PH2_, \ + "suggest...") \ + _D(MODBUS_SLAVE_REG, 21, "Modbus slave address: " _PH1_ " value " _PH2_, \ + "suggest...") \ + _D(PNIO_SLAVE_SLOT_VALUE, 30, \ + "PNIO slot: " _PH1_ " subslot " _PH2_ " index " _PH3_ " value " _PH4_, \ + "suggest...") \ + _D(PNIO_CONNECT_STATUS, 31, "PNIO connection status changed to " _PH1_, \ + "suggest...") \ + _D(PNIO_DEVICE_NAME, 32, "PNIO device name changed to " _PH1_, \ + "suggest...") \ + _D(PNIO_IP, 33, "PNIO ip " _PH1_ " mask " _PH2_ " gateway " _PH3_, \ + "suggest...") \ + _D(ICM_SERVER_STATUS, 40, " ICM server status changed to " _PH1_, \ + "suggest...") \ + _D(EIP_X, 50, "ICM slot: " _PH1_ " index " _PH2_ " subindex " _PH3_, \ + "suggest...") \ + _D(LOG_PROGRAM_SUCCESS, 100, \ + "[" _PH1_ "] Load program " _PH2_ " successful", "suggest...") \ + _D(LOG_PROGRAM_FAILED, 101, \ + "[" _PH1_ "] Load program " _PH2_ " failed, file not found", \ + "suggest...") \ + _D(LOG_PROGRAM_FAILED2, 102, \ + "[" _PH1_ "] Load program " _PH2_ \ + " failed, configuration file (.ins) does not match", \ + "suggest...") + +#endif // AUBO_SDK_SYSTEM_ERROR_H diff --git a/third_party/AuboSdk/linux/include/aubo/global_config.h b/third_party/AuboSdk/linux/include/aubo/global_config.h new file mode 100644 index 00000000..3673c806 --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo/global_config.h @@ -0,0 +1,178 @@ +/* + global_config.h + this file is generated. Do not change! +*/ + +#ifndef ARCS_GLOBALCONFIG_H +#define ARCS_GLOBALCONFIG_H + +/* #undef ARCS_BUILD_SHARED_LIBS */ +/* #undef ARCS_ENABLE_THREADING_SUPPORT */ + +//------------------------------------------------------------------- +// Header Availability +//------------------------------------------------------------------- + +/* #undef ARCS_HAVE_CXXABI_H */ + +//------------------------------------------------------------------- +// Version information +//------------------------------------------------------------------- + +#define INTERFACE_VERSION_MAJOR 0 +#define INTERFACE_VERSION_MINOR 26 +#define INTERFACE_VERSION_PATCH 0 +#define INTERFACE_VERSION "0.26.0" + +//------------------------------------------------------------------- +// Platform defines +//------------------------------------------------------------------- + +#if defined(__APPLE__) +#define ARCS_PLATFORM_APPLE +#endif + +#if defined(__linux__) +#define ARCS_PLATFORM_LINUX +#endif + +#if defined(_WIN32) || defined(_WIN64) +#define ARCS_PLATFORM_WINDOWS +#else +#define ARCS_PLATFORM_POSIX +#endif + +/* #undef ARCS_BIG_ENDIAN */ +/* #undef ARCS_LITTLE_ENDIAN */ + +#define ARCS_LIB_PREFIX "lib" +#define ARCS_LIB_EXT ".so" +#define ARCS_EXE_EXT "" + +#ifdef NDEBUG // Defined by cmake UNLESS Debug build type is chosen +#define ARCS_LIB_POSTFIX "" +#else +#define ARCS_LIB_POSTFIX \ + "" // Set in top level CMakeList.txt +#endif + +#define ARCS_FUNCTION // 函数接口 +#define ARCS_INSTRUCT // 指令接口 + +///------------------------------------------------------------------- +// Macros for import/export declarations +//------------------------------------------------------------------- + +#if defined(ARCS_PLATFORM_WINDOWS) +#define ARCS_ABI_EXPORT __declspec(dllexport) +#define ARCS_ABI_IMPORT __declspec(dllimport) +#define ARCS_ABI_LOCAL +#elif defined(ARCS_HAVE_VISIBILITY_ATTRIBUTE) +#define ARCS_ABI_EXPORT __attribute__((visibility("default"))) +#define ARCS_ABI_IMPORT __attribute__((visibility("default"))) +#define ARCS_ABI_LOCAL __attribute__((visibility("hidden"))) +#else +#define ARCS_ABI_EXPORT +#define ARCS_ABI_IMPORT +#define ARCS_ABI_LOCAL +#endif + +#ifdef ARCS_BUILDING_STAGE +#define ARCS_ABI ARCS_ABI_EXPORT +#else +#define ARCS_ABI ARCS_ABI_IMPORT +#endif + +//------------------------------------------------------------------- +// Macros for suppressing warnings +//------------------------------------------------------------------- + +#ifdef _MSC_VER +#define ARCS_MSVC_PUSH_DISABLE_WARNING(wn) \ + __pragma(warning(push)) __pragma(warning(disable : wn)) +#define ARCS_MSVC_POP_WARNING __pragma(warning(pop)) +#define ARCS_MSVC_DISABLE_WARNING(wn) __pragma(warning(disable : wn)) +#else +#define ARCS_MSVC_PUSH_DISABLE_WARNING(wn) +#define ARCS_MSVC_POP_WARNING +#define ARCS_MSVC_DISABLE_WARNING(wn) +#endif + +#ifdef __GNUC__ +#define aubo_gcc_pragma_expand(x) _Pragma(#x) +#define ARCS_GCC_PUSH_DISABLE_WARNING(wn) \ + _Pragma("GCC diagnostic push") \ + aubo_gcc_pragma_expand(GCC diagnostic ignored "-W" #wn) +#define ARCS_GCC_POP_WARNING _Pragma("GCC diagnostic pop") +#else +#define ARCS_GCC_PUSH_DISABLE_WARNING(wn) +#define ARCS_GCC_POP_WARNING +#endif + +#if defined(__GNUC__) +#define ARCS_DEPRECATED __attribute__((deprecated)) +#elif defined(_MSC_VER) +#define ARCS_DEPRECATED __declspec(deprecated) +#else +#pragma message( \ + "WARNING: You need to implement ARCS_DEPRECATED for your compiler!") +#define ARCS_DEPRECATED +#endif + +// Do not warn about the usage of deprecated unsafe functions +ARCS_MSVC_DISABLE_WARNING(4996) + +// Mark a variable or expression result as unused +#define ARCS_UNUSED(x) (void)(x) + +//------------------------------------------------------------------- +// C++ Language features +//------------------------------------------------------------------- + +/* #undef ARCS_HAVE_THREAD_LOCAL */ + +//------------------------------------------------------------------- +// C++ Library features +//------------------------------------------------------------------- + +/* #undef ARCS_HAVE_REGEX */ + +//------------------------------------------------------------------- +// Hash Container +//------------------------------------------------------------------- + +#define ARCS_HASH_FUNCTION_BEGIN(type) \ + namespace std { \ + template <> \ + struct hash \ + { \ + std::size_t operator()(const type &arg) const \ + { +#define ARCS_HASH_FUNCTION_END \ + } \ + } \ + ; \ + } + +//------------------------------------------------------------------- +// Utility macros +//------------------------------------------------------------------- + +#define ARCS_STR_(x) #x +#define ARCS_STR(x) ARCS_STR_(x) +#define ARCS_CONCAT_(x, y) x##y +#define ARCS_CONCAT(x, y) ARCS_CONCAT_(x, y) + +//------------------------------------------------------------------- +// Backwards compatibility macros +//------------------------------------------------------------------- + +#if !defined(__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 +#define ARCS_FUTURE_READY true +#define ARCS_FUTURE_TIMEOUT false +#else +#define ARCS_FUTURE_READY std::future_status::ready +#define ARCS_FUTURE_TIMEOUT std::future_status::timeout +#endif + +#endif // ARCS_GLOBALCONFIG_H diff --git a/third_party/AuboSdk/linux/include/aubo/math.h b/third_party/AuboSdk/linux/include/aubo/math.h new file mode 100644 index 00000000..1be0a44e --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo/math.h @@ -0,0 +1,909 @@ +/** @file math.h + * \~chinese @brief 数学方法接口,如欧拉角与四元数转换、位姿的加减运算 + * \~english @brief Mathematic operation interface, such as euler to quaternion conversion, addition/subtraction of poses + */ +#ifndef AUBO_SDK_MATH_INTERFACE_H +#define AUBO_SDK_MATH_INTERFACE_H + +#include +#include + +#include +#include + +namespace arcs { +namespace common_interface { + +class ARCS_ABI_EXPORT Math +{ +public: + Math(); + virtual ~Math(); + + /** + * \english + * Pose addition + * + * Both arguments contain three position parameters (x, y, z) jointly called + * P, and three rotation parameters (R_x, R_y, R_z) jointly called R. This + * function calculates the result x_3 as the addition of the given poses as + * follows: + * + * p_3.P = p_1.P + p_2.P + * + * p_3.R = p_1.R * p_2.R + * + * @param p1 Tool pose 1 + * @param p2 Tool pose 2 + * @return sum of position parts and product of rotation parts (pose) + * + * @par Python interface prototype + * poseAdd(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float]) -> + * List[float] + * + * @par Lua interface prototype + * poseAdd(p1: table, p2: table) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Math.poseAdd","params":[[0.2, 0.5, 0.1, 1.57, + * 0, 0],[0.2, 0.5, 0.6, 1.57, 0, 0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.4,1.0,0.7,3.14,-0.0,0.0]} + * \endengish + * + * \chinese + * 位姿相加。 + * 两个参数都包含三个位置参数(x、y、z),统称为P, + * 以及三个旋转参数(R_x、R_y、R_z),统称为R。 + * 此函数根据以下方式计算结果 p_3,即给定位姿的相加: + * p_3.P = p_1.P + p_2.P, + * p_3.R = p_1.R * p_2.R + * + * @param p1 工具位姿1(pose) + * @param p2 工具位姿2(pose) + * @return 位置部分之和和旋转部分之积(pose) + * + * @par Python函数原型 + * poseAdd(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float]) -> + * List[float] + * + * @par Lua函数原型 + * poseAdd(p1: table, p2: table) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Math.poseAdd","params":[[0.2, 0.5, 0.1, 1.57, + * 0, 0],[0.2, 0.5, 0.6, 1.57, 0, 0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.4,1.0,0.7,3.14,-0.0,0.0]} + * \endchinese + */ + std::vector poseAdd(const std::vector &p1, + const std::vector &p2); + + /** + * \chinese + * 位姿相减 + * + * 两个参数都包含三个位置参数(x、y、z),统称为P, + * 以及三个旋转参数(R_x、R_y、R_z),统称为R。 + * 此函数根据以下方式计算结果 p_3,即给定位姿的相加: + * p_3.P = p_1.P - p_2.P, + * p_3.R = p_1.R * p_2.R.inverse + * + * @param p1 工具位姿1 + * @param p2 工具位姿2 + * @return 位姿相减计算结果 + * + * @par Python函数原型 + * poseSub(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float]) -> + * List[float] + * + * @par Lua函数原型 + * poseSub(p1: table, p2: table) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Math.poseSub","params":[[0.2, 0.5, 0.1, 1.57, + * 0, 0],[0.2, 0.5, 0.6, 1.57, 0, 0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,-0.5,0.0,-0.0,0.0]} + * \endchinese + * + * \english + * Pose subtraction + * + * Both arguments contain three position parameters (x, y, z) jointly called + * P, and three rotation parameters (R_x, R_y, R_z) jointly called R. This + * function calculates the result x_3 as the addition of the given poses as + * follows: + * + * p_3.P = p_1.P - p_2.P, + * + * p_3.R = p_1.R * p_2.R.inverse + * + * @param p1 tool pose 1 + * @param p2 tool pose 2 + * @return difference between two poses + * + * @par Python interface prototype + * poseSub(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float]) -> + * List[float] + * + * @par Lua interface prototype + * poseSub(p1: table, p2: table) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Math.poseSub","params":[[0.2, 0.5, 0.1, 1.57, + * 0, 0],[0.2, 0.5, 0.6, 1.57, 0, 0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,-0.5,0.0,-0.0,0.0]} + * \endenglish + */ + std::vector poseSub(const std::vector &p1, + const std::vector &p2); + + /** + * \chinese + * 计算线性插值 + * + * @param p1 起点的TCP位姿 + * @param p2 终点的TCP位姿 + * @param alpha 系数, + * 当01,返回p2; + * 当alpha<0,返回p1; + * @return 插值计算结果 + * + * @par Python函数原型 + * interpolatePose(self: pyaubo_sdk.Math, arg0: List[float], arg1: + * List[float], arg2: float) -> List[float] + * + * @par Lua函数原型 + * interpolatePose(p1: table, p2: table, alpha: number) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Math.interpolatePose","params":[[0.2, 0.2, + * 0.4, 0, 0, 0],[0.2, 0.2, 0.6, 0, 0, 0],0.5],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.2,0.2,0.5,0.0,-0.0,0.0]} + * \endchinese + * + * \english + * Calculate linear interpolation + * + * @param p1 starting TCP pose + * @param p2 ending TCP pose + * @param alpha coefficient; + * When 01, return p2; + * When alpha<0,return p1; + * @return interpolation result + * + * @par Python interface prototype + * interpolatePose(self: pyaubo_sdk.Math, arg0: List[float], arg1: + * List[float], arg2: float) -> List[float] + * + * @par Lua interface prototype + * interpolatePose(p1: table, p2: table, alpha: number) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Math.interpolatePose","params":[[0.2, 0.2, + * 0.4, 0, 0, 0],[0.2, 0.2, 0.6, 0, 0, 0],0.5],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.2,0.2,0.5,0.0,-0.0,0.0]} + * \endenglish + * + */ + std::vector interpolatePose(const std::vector &p1, + const std::vector &p2, + double alpha); + /** + * \chinese + * 位姿变换 + * + * 第一个参数 p_from 用于转换第二个参数 p_from_to,并返回结果。 + * 这意味着结果是从 p_from 的坐标系开始, + * 然后在该坐标系中移动 p_from_to后的位姿。 + * + * 这个函数可以从两个不同的角度来看。 + * 一种是函数将 p_from_to 根据 p_from 的参数进行转换,即平移和旋转。 + * 另一种是函数被用于获取结果姿态,先对 p_from 进行移动,然后再对 p_from_to + * 进行移动。 如果将姿态视为转换矩阵,它看起来像是: + * + * T_world->to = T_world->from * T_from->to, + * T_x->to = T_x->from * T_from->to + * + * 这两个方程描述了姿态变换的基本原理,根据给定的起始姿态和相对于起始姿态的姿态变化,可以计算出目标姿态。 + * + * 举个例子,已知B相对于A的位姿、C相对于B的位姿,求C相对于A的位姿。 + * 第一个参数是B相对于A的位姿,第二个参数是C相对于B的位姿, + * 返回值是C相对于A的位姿。 + * + * @param pose_from 起始位姿(空间向量) + * @param pose_from_to 相对于起始位姿的姿态变化(空间向量) + * @return 结果位姿 (空间向量) + * + * @par Python函数原型 + * poseTrans(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float]) -> + * List[float] + * + * @par Lua函数原型 + * poseTrans(pose_from: table, pose_from_to: table) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Math.poseTrans","params":[[0.2, 0.5, + * 0.1, 1.57, 0, 0],[0.2, 0.5, 0.6, 1.57, 0, 0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.4,-0.09960164640373415,0.6004776374923573,3.14,-0.0,0.0]} + * \endchinese + * + * \english + * Pose transformation + * + * The first argument, p_from, is used to transform the second argument, + * p_from_to, and the result is then returned. This means that the result is + * the resulting pose, when starting at the coordinate system of p_from, and + * then in that coordinate system moving p_from_to. + * + * This function can be seen in two different views. Either the function + * transforms, that is translates and rotates, p_from_to by the parameters + * of p_from. Or the function is used to get the resulting pose, when first + * making a move of p_from and then from there, a move of p_from_to. If the + * poses were regarded as transformation matrices, it would look like: + * + * T_world->to = T_world->from * T_from->to, + * T_x->to = T_x->from * T_from->to + * + * + * These two equations describes the foundations for pose transformation. + * Based on a starting pose and the pose transformation relative to the starting pose, we can get the target pose. + * + * For example, we know pose of B relative to A, pose of C relative to B, find pose of C relative to A. + * param 1 is pose of B relative to A,param 2 is pose of C relative to B, + * the return value is the pose of C relative to A + * + * @param pose_from starting pose(vector in 3D space) + * @param pose_from_to pose transformation relative to starting pose(vector in 3D space) + * @return final pose (vector in 3D space) + * + * @par Python interface prototype + * poseTrans(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float]) -> + * List[float] + * + * @par Lua interface prototype + * poseTrans(pose_from: table, pose_from_to: table) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Math.poseTrans","params":[[0.2, 0.5, + * 0.1, 1.57, 0, 0],[0.2, 0.5, 0.6, 1.57, 0, 0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.4,-0.09960164640373415,0.6004776374923573,3.14,-0.0,0.0]} + * \endenglish + */ + std::vector poseTrans(const std::vector &pose_from, + const std::vector &pose_from_to); + + /** + * \english + * Pose inverse transformation + * + * Given pose of C relative to A, pose of C relative to B, find pose of B relative to A. + * param 1 is pose of C relative to A,param 2 is pose of C relative to B, + * the return value is the pose of B relative to A + * + * @param pose_from starting pose + * @param pose_to_from pose transformation relative to final pose + * @return resulting pose + * + * @par Python interface prototype + * poseTransInv(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float]) + * -> List[float] + * + * @par Lua interface prototype + * poseTransInv(pose_from: table, pose_to_from: table) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Math.poseTransInv","params":[[0.4, -0.0996016, + * 0.600478, 3.14, 0, 0],[0.2, 0.5, 0.6, 1.57, 0, 0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.2,0.5000000464037341,0.10000036250764266,1.57,-0.0,0.0]} + * \endenglish + * + * \chinese + * 姿态逆变换 + * + * 已知C相对于A的位姿、C相对于B的位姿,求B相对于A的位姿。 + * 第一个参数是C相对于A的位姿,第二个参数是C相对于B的位姿, + * 返回值是B相对于A的位姿。 + * + * @param pose_from 起始位姿 + * @param pose_to_from 相对于结果位姿的姿态变化 + * @return 结果位姿 + * + * @par Python函数原型 + * poseTransInv(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float]) + * -> List[float] + * + * @par Lua函数原型 + * poseTransInv(pose_from: table, pose_to_from: table) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Math.poseTransInv","params":[[0.4, -0.0996016, + * 0.600478, 3.14, 0, 0],[0.2, 0.5, 0.6, 1.57, 0, 0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.2,0.5000000464037341,0.10000036250764266,1.57,-0.0,0.0]} + * \endchinese + */ + std::vector poseTransInv(const std::vector &pose_from, + const std::vector &pose_to_from); + + /** + * \chinese + * 获取位姿的逆 + * + * @param pose 工具位姿(空间向量) + * @return 工具位姿的逆转换(空间向量) + * + * @par Python函数原型 + * poseInverse(self: pyaubo_sdk.Math, arg0: List[float]) -> List[float] + * + * @par Lua函数原型 + * poseInverse(pose: table) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Math.poseInverse","params":[[0.2, 0.5, + * 0.1, 1.57, 0, 3.14]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.19920341988726448,-0.09960155178838484,-0.5003973704832628, + * 1.5699999989900404,-0.0015926530848129354,-3.1415913853161266]} + * + * \endchinese + * + * \english + * Get the inverse of a pose + * + * @param pose tool pose (spatial vector) + * @return inverse tool pose transformation (spatial vector) + * + * @par Python interface prototype + * poseInverse(self: pyaubo_sdk.Math, arg0: List[float]) -> List[float] + * + * @par Lua interface prototype + * poseInverse(pose: table) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Math.poseInverse","params":[[0.2, 0.5, + * 0.1, 1.57, 0, 3.14]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.19920341988726448,-0.09960155178838484,-0.5003973704832628, + * 1.5699999989900404,-0.0015926530848129354,-3.1415913853161266]} + * \endenglish + * + */ + std::vector poseInverse(const std::vector &pose); + + /** + * \chinese + * 计算两个位姿的位置距离 + * + * @param p1 位姿1 + * @param p2 位姿2 + * @return 两个位姿的位置距离 + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Math.poseDistance","params":[[0.1, 0.3, 0.1, + * 0.3142, 0.0, 1.571],[0.2, 0.5, 0.6, 0, -0.172, 0.0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.5477225575051661} + * \endchinese + * + * \english + * Calculate distance between two poses + * + * @param p1 pose 1 + * @param p2 pose 2 + * @return distance between the poses + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Math.poseDistance","params":[[0.1, 0.3, 0.1, + * 0.3142, 0.0, 1.571],[0.2, 0.5, 0.6, 0, -0.172, 0.0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.5477225575051661} + * \endenglish + * + */ + double poseDistance(const std::vector &p1, + const std::vector &p2); + + /** + * \chinese + * 计算两个位姿的轴角距离 + * + * @param p1 位姿1 + * @param p2 位姿2 + * @return 轴角距离 + * \endchinese + * + * \english + * Calculate axis-angle difference between two poses + * + * @param p1 pose 1 + * @param p2 pose 2 + * @return axis angle difference + * \endenglish + */ + double poseAngleDistance(const std::vector &p1, + + const std::vector &p2); + + /** + * \chinese + * 判断两个位姿是否相等 + * + * @param p1 位姿1 + * @param p2 位姿2 + * @param eps 误差 + * @return 相等返回true,反之返回false + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Math.poseDistance","params":[[0.1, 0.3, 0.1, + * 0.3142, 0.0, 1.571],[0.1, 0.3, 0.1, 0.3142, 0.0, 1.5711]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * \endchinese + * + * \english + * Determine if two poses are equivalent + * + * @param p1 pose 1 + * @param p2 pose 2 + * @param eps error margin + * @return true or false + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Math.poseDistance","params":[[0.1, 0.3, 0.1, + * 0.3142, 0.0, 1.571],[0.1, 0.3, 0.1, 0.3142, 0.0, 1.5711]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * \endenglish + */ + bool poseEqual(const std::vector &p1, const std::vector &p2, + double eps = 5e-5); + + /** + * \chinese + * @param F_b_a_old + * @param V_in_a + * @param type + * @return + * + * @par Python函数原型 + * transferRefFrame(self: pyaubo_sdk.Math, arg0: List[float], arg1: + * List[float[3]], arg2: int) -> List[float] + * + * @par Lua函数原型 + * transferRefFrame(F_b_a_old: table, V_in_a: table, type: number) -> table + * \endchinese + * + * \english + * @param F_b_a_old + * @param V_in_a + * @param type + * @return + * + * @par Python interface prototype + * transferRefFrame(self: pyaubo_sdk.Math, arg0: List[float], arg1: + * List[float[3]], arg2: int) -> List[float] + * + * @par Lua interface prototype + * transferRefFrame(F_b_a_old: table, V_in_a: table, type: number) -> table + * \endenglish + */ + std::vector transferRefFrame(const std::vector &F_b_a_old, + const Vector3d &V_in_a, int type); + + /** + * \chinese + * 姿态旋转 + * + * @param pose + * @param rotv + * @return + * + * @par Python函数原型 + * poseRotation(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float]) + * -> List[float] + * + * @par Lua函数原型 + * poseRotation(pose: table, rotv: table) -> table + * \endchinese + * + * \english + * Pose rotation + * + * @param pose + * @param rotv + * @return + * + * @par Python interface prototype + * poseRotation(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float]) + * -> List[float] + * + * @par Lua interface prototype + * poseRotation(pose: table, rotv: table) -> table + * \endenglish + */ + std::vector poseRotation(const std::vector &pose, + const std::vector &rotv); + + /** + * \chinese + * 欧拉角转四元数 + * + * @param rpy 欧拉角 + * @return 四元数 + * + * @par Python函数原型 + * rpyToQuaternion(self: pyaubo_sdk.Math, arg0: List[float]) -> List[float] + * + * @par Lua函数原型 + * rpyToQuaternion(rpy: table) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Math.rpyToQuaternion","params":[[0.611, 0.785, + * 0.960]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.834721517970497,0.07804256900772265,0.4518931575790371,0.3048637712043723]} + * \endchinese + * + * \english + * Euler angles to quaternions + * + * @param rpy euler angles + * @return quaternions + * + * @par Python interface prototype + * rpyToQuaternion(self: pyaubo_sdk.Math, arg0: List[float]) -> List[float] + * + * @par Lua interface prototype + * rpyToQuaternion(rpy: table) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Math.rpyToQuaternion","params":[[0.611, 0.785, + * 0.960]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.834721517970497,0.07804256900772265,0.4518931575790371,0.3048637712043723]} + * \endenglish + */ + std::vector rpyToQuaternion(const std::vector &rpy); + + /** + * \chinese + * 四元数转欧拉角 + * + * @param quat 四元数 + * @return 欧拉角 + * + * @par Python函数原型 + * quaternionToRpy(self: pyaubo_sdk.Math, arg0: List[float]) -> List[float] + * + * @par Lua函数原型 + * quaternionToRpy(quat: table) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Math.quaternionToRpy","params":[[0.834722, + * 0.0780426, 0.451893, 0.304864]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.6110000520523781,0.7849996877683915,0.960000543982093]} + * \endchinese + * + * \english + * Quaternions to euler angles + * + * @param quat quaternions + * @return euler angles + * + * @par Python interface prototype + * quaternionToRpy(self: pyaubo_sdk.Math, arg0: List[float]) -> List[float] + * + * @par Lua interface prototype + * quaternionToRpy(quat: table) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Math.quaternionToRpy","params":[[0.834722, + * 0.0780426, 0.451893, 0.304864]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.6110000520523781,0.7849996877683915,0.960000543982093]} + * \endenglish + */ + std::vector quaternionToRpy(const std::vector &quat); + + /** + * \chinese + * 四点法标定TCP偏移 + * + * 找一个尖点,将机械臂工具末端点绕着尖点示教四个位置,姿态差别要大。 + * 设置完毕后即可计算出来结果。 + * + * @param poses 四个点的位姿集合 + * @return TCP标定结果和标定结果是否有效 + * + * @par Python函数原型 + * tcpOffsetIdentify(self: pyaubo_sdk.Math, arg0: List[List[float]]) -> + * Tuple[List[float], int] + * + * @par Lua函数原型 + * tcpOffsetIdentify(poses: table) -> table + * \endchinese + * + * \english + * Four point method calibration for TCP offset + * + * About a sharp point, move the robot's tcp in four different poses. Difference between each pose should be drastic. + * Result can be obtained based on these four poses + * + * @param poses combination of four different poses + * @return TCP calibration result and whether successfull + * + * @par Python interface prototype + * tcpOffsetIdentify(self: pyaubo_sdk.Math, arg0: List[List[float]]) -> + * Tuple[List[float], int] + * + * @par Lua interface prototype + * tcpOffsetIdentify(poses: table) -> table + * \endenglish + */ + ResultWithErrno tcpOffsetIdentify( + const std::vector> &poses); + + /** + * \chinese + * 三点法标定坐标系 + * + * @param poses 三个点的位姿集合 + * @param type 类型:\n + * 0 - oxy 原点 x轴正方向 xy平面(y轴正方向)\n + * 1 - oxz 原点 x轴正方向 xz平面(z轴正方向)\n + * 2 - oyz 原点 y轴正方向 yz平面(z轴正方向)\n + * 3 - oyx 原点 y轴正方向 yx平面(x轴正方向)\n + * 4 - ozx 原点 z轴正方向 zx平面(x轴正方向)\n + * 5 - ozy 原点 z轴正方向 zy平面(y轴正方向)\n + * @return 坐标系标定结果和标定结果是否有效 + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Math.calibrateCoordinate","params":[[[0.55462,0.06219,0.37175,-3.142,0.0,1.580], + * [0.63746,0.11805,0.37175,-3.142,0.0,1.580],[0.40441,0.28489,0.37174,-3.142,0.0,1.580]],0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[[0.55462,0.06219,0.37175,-3.722688983883945e-05,-1.6940658945086007e-21,0.5932768162455785],0]} + * \endchinese + * + * \english + * Calibrate coordinate system with 3 points + * + * @param poses set of 3 poses + * @param type type:\n + * 0 - oxy origin, +x axis, xy plane (+y direction) \n + * 1 - oxz origin, +x axis, xz plane (+z direction) \n + * 2 - oyz origin, +y axis, yz plane (+z direction) \n + * 3 - oyx origin, +y axis, yx plane (+x direction) \n + * 4 - ozx origin, +z axis, zx plane (+x direction) \n + * 5 - ozy origin, +z axis, zy plane (+y direction) \n + * @return Coordinate system calibration result and whether the calibration result is valid + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Math.calibrateCoordinate","params":[[[0.55462,0.06219,0.37175,-3.142,0.0,1.580], + * [0.63746,0.11805,0.37175,-3.142,0.0,1.580],[0.40441,0.28489,0.37174,-3.142,0.0,1.580]],0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[[0.55462,0.06219,0.37175,-3.722688983883945e-05,-1.6940658945086007e-21,0.5932768162455785],0]} + * \endenglish + */ + ResultWithErrno calibrateCoordinate( + const std::vector> &poses, int type); + + /** + * \chinese + * 根据圆弧的三个点,计算出拟合成的圆的另一半圆弧的中间点位置 + * + * @param p1 圆弧的起始点 + * @param p2 圆弧的中间点 + * @param p3 圆弧的结束点 + * @param mode 当mode等于1的时候,表示需要对姿态进行圆弧规划; + * 当mode等于0的时候,表示不需要对姿态进行圆弧规划 + * + * @return 拟合成的圆的另一半圆弧的中间点位置和计算结果是否有效 + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Math.calculateCircleFourthPoint","params":[[0.5488696249770836,-0.1214996547187204,0.2631931199112321,-3.14159198038469,-3.673205103150083e-06,1.570796326792424], + * [0.5488696249770835,-0.1214996547187207,0.3599720701808493,-3.14159198038469,-3.6732051029273e-06,1.570796326792423], + * [0.5488696249770836,-0.0389996547187214,0.3599720701808496,-3.141591980384691,-3.673205102557476e-06, + * 1.570796326792422],1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[[0.5488696249770837,-0.031860179583911546,0.27033259504604207,-3.1415919803846903,-3.67320510285378e-06,1.570796326792423],1]} + * + * \endchinese + * + * \english + * Based on three points on an arc, calculate the position of the midpoint of the other half of the fitted circle's arc + * + * @param p1 start point of the arc + * @param p2 middle point of the arc + * @param p3 end point of the arc + * @param mode when mode = 1, need to plan for orientation around arc; + * when mode = 0, do not need to plan for orientation around arc. + * @return position of the midpoint of the other half of the fitted circle's arc and whether the result is valid. + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Math.calculateCircleFourthPoint","params":[[0.5488696249770836,-0.1214996547187204,0.2631931199112321,-3.14159198038469,-3.673205103150083e-06,1.570796326792424], + * [0.5488696249770835,-0.1214996547187207,0.3599720701808493,-3.14159198038469,-3.6732051029273e-06,1.570796326792423], + * [0.5488696249770836,-0.0389996547187214,0.3599720701808496,-3.141591980384691,-3.673205102557476e-06, + * 1.570796326792422],1],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[[0.5488696249770837,-0.031860179583911546,0.27033259504604207,-3.1415919803846903,-3.67320510285378e-06,1.570796326792423],1]} + * + * \endenglish + */ + ResultWithErrno calculateCircleFourthPoint(const std::vector &p1, + const std::vector &p2, + const std::vector &p3, + int mode); + /** + * \chinese + * @brief forceTrans: + * 变换力和力矩的参考坐标系 force_in_b = pose_a_in_b * force_in_a + * @param pose_a_in_b: a 坐标系在 b 坐标系的位姿 + * @param force_in_a: 力和力矩在 a 坐标系的描述 + * @return force_in_b,力和力矩在 b 坐标系的描述 + * \endchinese + * + * \english + * @brief forceTrans: + * Transform the reference frame of force and torque: force_in_b = pose_a_in_b * force_in_a + * @param pose_a_in_b: pose of frame a in frame b + * @param force_in_a: force and torque described in frame a + * @return Force_in_b, force and torque described in frame b + * \endenglish + */ + std::vector forceTrans(const std::vector &pose_a_in_b, + const std::vector &force_in_a); + + /** + * \chinese + * @brief 通过距离计算工具坐标系下的位姿增量 + * @param distances: N 个距离, N >=3 + * @param position: 距离参考轨迹的保持高度 + * @param radius: 传感器中心距离末端tcp的等效半径 + * @param track_scale: 跟踪比例, 设置范围(0, 1], 1表示跟踪更快 + * @return 基于工具坐标系的位姿增量 + * \endchinese + * + * \english + * @brief Calculate pose increment in tool coordinate system based on sensor data + * @param distances: N distances, N >= 3 + * @param position: reference height to maintain from the trajectory + * @param radius: effective radius from sensor center to tool TCP + * @param track_scale: tracking ratio, range (0, 1], 1 means faster tracking + * @return Pose increment in tool coordinate system + * \endenglish + */ + std::vector getDeltaPoseBySensorDistance( + const std::vector &distances, double position, double radius, + double track_scale); + + /** + * \chinese + * @brief changeFTFrame: 变换力和力矩的参考坐标系 + * @param pose_a_in_b: a 坐标系在 b 坐标系的位姿 + * @param ft_in_a: 作用在 a 点的力和力矩在 a 坐标系的描述 + * @return ft_in_b,作用在 b 点的力和力矩在 b 坐标系的描述 + * \endchinese + * + * \english + * @brief changeFTFrame: Transform the reference frame of force and torque + * @param pose_a_in_b: pose of frame a in frame b + * @param ft_in_a: force and torque applied at point a, described in frame a + * @return ft_in_b, force and torque applied at point b, described in frame b + * \endenglish + */ + std::vector deltaPoseTrans(const std::vector &pose_a_in_b, + const std::vector &ft_in_a); + + /** + * \chinese + * @brief addDeltaPose: 计算以给定速度变换单位时间后的位姿 + * @param pose_a_in_b: 当前时刻 a 相对于 b 的位姿 + * @param v_in_b: 当前时刻 a 坐标系的速度在 b 的描述 + * @return pose_in_b, 单位时间后的位姿在 b 的描述 + * \endchinese + * + * \english + * @brief addDeltaPose: Calculate the pose after unit time given a velocity + * @param pose_a_in_b: current pose of a relative to b + * @param v_in_b: velocity of frame a described in frame b at current time + * @return pose_in_b, pose after unit time described in frame b + * \endenglish + */ + std::vector deltaPoseAdd(const std::vector &pose_a_in_b, + const std::vector &v_in_b); + + /** + * \chinese + * @brief changePoseWithXYRef: 修改 pose_tar 的xy轴方向,尽量与 pose_ref 一致, + * @param pose_tar: 需要修改的目标位姿 + * @param pose_ref: 参考位姿 + * @return 修改后的位姿,采用pose_tar的 xyz 坐标和 z 轴方向 + * \endchinese + * + * \english + * @brief changePoseWithXYRef: Modify the XY axis direction of pose_tar to be as consistent as possible with pose_ref + * @param pose_tar: target pose to be modified + * @param pose_ref: reference pose + * @return Modified pose, using the xyz coordinates and z axis direction of pose_tar + * \endenglish + */ + std::vector changePoseWithXYRef( + const std::vector &pose_tar, + const std::vector &pose_ref); + + /** + * \chinese + * @brief homMatrixToPose: 由齐次变换矩阵得到位姿 + * @param homMatrix: 4*4 齐次变换矩阵, 输入元素采用横向排列 + * @return 对应的位姿 + * \endchinese + * + * \english + * @brief homMatrixToPose: Get pose from homogeneous transformation matrix + * @param homMatrix: 4x4 homogeneous transformation matrix, input elements are arranged row-wise + * @return corresponding pose + * \endenglish + */ + std::vector homMatrixToPose(const std::vector &homMatrix); + + /** + * \chinese + * @brief poseToHomMatrix: 位姿变换得到齐次变换矩阵 + * @param pose: 输入的位姿 + * @return 输出的齐次变换矩阵,元素横向排列 + * \endchinese + * + * \english + * @brief poseToHomMatrix: Get homogeneous transformation matrix from pose + * @param pose: input pose + * @return output homogeneous transformation matrix, elements arranged row-wise + * \endenglish + */ + std::vector poseToHomMatrix(const std::vector &pose); + +protected: + void *d_; +}; +using MathPtr = std::shared_ptr; + +} // namespace common_interface +} // namespace arcs +#endif diff --git a/third_party/AuboSdk/linux/include/aubo/register_control.h b/third_party/AuboSdk/linux/include/aubo/register_control.h new file mode 100644 index 00000000..609bf938 --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo/register_control.h @@ -0,0 +1,2726 @@ +/** @file register_control.h + * @brief 寄存器操作接口,用于三个模块之间的数据交换功能 + */ +#ifndef AUBO_SDK_REGISTER_CONTROL_INTERFACE_H +#define AUBO_SDK_REGISTER_CONTROL_INTERFACE_H + +#include +#include +#include + +#include +#include + +enum ModbusErrorNum +{ + /** MODBUS unit not initiallized + */ + MB_ERR_NOT_INIT = -1, + + /** MODBUS unit disconnected + */ + MB_ERR_DISCONNECTED = -2, + + /** The function code received in the query is not an allowable action for + * the server (or slave). + */ + MB_ERR_ILLEGAL_FUNCTION = 1, + + /** The function code received in the query is not an allowable action for + * the server (or slave), check that the entered signal address corresponds + * to the setup of the remote MODBUS server. + */ + MB_ERR_ILLEGAL_DATA_ADDRESS = 2, + + /** A value contained in the query data field is not an allowable value for + * server (or slave), check that the enterd signal value is valid for the + * specified address on the remote MODBUS server. + */ + MB_ERR_ILLEGAL_DATA_VALUE = 3, + + /** An unrecoverable error occurred while the server (or slave) was + * attempting to perform the requested action. + */ + MB_ERR_SLAVE_DEVICE_FAILURE = 4, + + /** Specialized use in conjunction with programming commands sent to the + * remote MODBUS unit. + */ + MB_ERR_ACKNOWLEDGE = 5, + + /** Specialized use in conjunction with programming commands sent to the + * remote MODBUS unit, the slave (server) is not able to respond now + */ + MB_ERR_SLAVE_DEVICE_BUSY = 6, +}; + +namespace arcs { +namespace common_interface { + +/** + * \~chinese 通用寄存器 \~english General Registers + */ +class ARCS_ABI_EXPORT RegisterControl +{ +public: + RegisterControl(); + virtual ~RegisterControl(); + + /** + * \chinese + * + * 从一个输入寄存器中读取布尔值,也可以通过现场总线进行访问。 + * 注意,它使用自己的内存空间。 + * + * @param address 寄存器的地址(0:127) + * @return 寄存器中保存的布尔值(true、false) + * + * @note 布尔输入寄存器的较低范围[0:63]保留供FieldBus/PLC接口使用。 + * 较高范围[64:127]无法通过FieldBus/PLC接口访问,因为它保留供外部RTDE客户端使用。 + * + * @par Python函数原型 + * getBoolInput(self: pyaubo_sdk.RegisterControl, arg0: int) -> bool + * + * @par Lua函数原型 + * getBoolInput(address: number) -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getBoolInput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * \endchinese + * + * \english + * Reads the boolean from one of the input registers, which can also be + * accessed by a Field bus. Note, uses its own memory space. + * + * @param address Address of the register (0:127) + * @return Boolean value held by the register (true, false) + * + * @note The lower range of the boolean input registers [0:63] is reserved + * for FieldBus/PLC interface usage. The upper range [64:127] cannot be + * accessed by FieldBus/PLC interfaces, since it is reserved for external + * RTDE clients. + * + * @par Python interface prototype + * getBoolInput(self: pyaubo_sdk.RegisterControl, arg0: int) -> bool + * + * @par Lua interface prototype + * getBoolInput(address: number) -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getBoolInput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * \endenglish + */ + bool getBoolInput(uint32_t address); + + /** + * \chinese + * + * @param address + * @param value + * @return + * + * @note 只有在实现 RTDE/Modbus Slave/PLC 服务端时使用 + * + * @par Python函数原型 + * setBoolInput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: bool) -> + * int + * + * @par Lua函数原型 + * setBoolInput(address: number, value: boolean) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setBoolInput","params":[0,true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * + * @param address Address of the register (0:127) + * @param value Boolean value to set (true or false) + * @return Returns 0 on success, or an error code + * + * @note Only used when implementing RTDE/Modbus Slave/PLC server + * + * @par Python interface prototype + * setBoolInput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: bool) -> int + * + * @par Lua interface prototype + * setBoolInput(address: number, value: boolean) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setBoolInput","params":[0,true],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setBoolInput(uint32_t address, bool value); + + /** + * \chinese + * + * 从一个输入寄存器中读取整数值,也可以通过现场总线进行访问。 + * 注意,它使用自己的内存空间。 + * + * @param address 寄存器的地址(0:47) + * @return 寄存器中保存的整数值[-2,147,483,648 : 2,147,483,647] + * + * @note 整数输入寄存器的较低范围[0:23]保留供FieldBus/PLC接口使用。 + * 较高范围[24:47]无法通过FieldBus/PLC接口访问,因为它保留供外部RTDE客户端使用。 + * + * @par Python函数原型 + * getInt32Input(self: pyaubo_sdk.RegisterControl, arg0: int) -> int + * + * @par Lua函数原型 + * getInt32Input(address: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getInt32Input","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * + * \english + * Reads the integer from one of the input registers, which can also be + * accessed by a FieldBus. Note, uses it’s own memory space. + * + * @param address Address of the register (0:47) + * @return The value held by the register [-2,147,483,648 : 2,147,483,647] + * + * @note The lower range of the integer input registers [0:23] is reserved + * for FieldBus/PLC interface usage. The upper range [24:47] cannot be + * accessed by FieldBus/PLC interfaces, since it is reserved for external + * RTDE clients. + * + * @par Python interface prototype + * getInt32Input(self: pyaubo_sdk.RegisterControl, arg0: int) -> int + * + * @par Lua interface prototype + * getInt32Input(address: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getInt32Input","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + */ + int getInt32Input(uint32_t address); + + /** + * \chinese + * + * @param address 寄存器的地址(0:47) + * @param value 要设置的整数值 + * @return 返回0表示成功,其他为错误码 + * + * @note 只有在实现 RTDE/Modbus Slave/PLC 服务端时使用 + * + * @par Python函数原型 + * setInt32Input(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: int) -> int + * + * @par Lua函数原型 + * setInt32Input(address: number, value: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setInt32Input","params":[0,33],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * + * @param address Address of the register (0:47) + * @param value Integer value to set + * @return Returns 0 on success, or an error code + * + * @note Only used when implementing RTDE/Modbus Slave/PLC server + * + * @par Python interface prototype + * setInt32Input(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: int) -> int + * + * @par Lua interface prototype + * setInt32Input(address: number, value: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setInt32Input","params":[0,33],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setInt32Input(uint32_t address, int value); + + /** + * \chinese + * Reads the float from one of the input registers, which can also be + * accessed by a Field bus. Note, uses it’s own memory space. + * + * 从一个输入寄存器中读取浮点数,也可以通过现场总线进行访问。 + * 注意,它使用自己的内存空间。 + * + * @param address Address of the register (0:47) + * 寄存器地址(0:47) + * @return The value held by the register (float) + * 寄存器中保存的浮点数值 + * + * @note The lower range of the float input registers [0:23] is reserved + * for FieldBus/PLC interface usage. The upper range [24:47] cannot be + * accessed by FieldBus/PLC interfaces, since it is reserved for external + * RTDE clients. + * 浮点数输入寄存器的较低范围[0:23]保留供现场总线/PLC接口使用。 + * 较高范围[24:47]不能通过现场总线/PLC接口访问,因为它们是为外部RTDE客户端保留的。 + * + * @par Python函数原型 + * getFloatInput(self: pyaubo_sdk.RegisterControl, arg0: int) -> float + * + * @par Lua函数原型 + * getFloatInput(address: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getFloatInput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endchinese + * + * \english + * Reads the float from one of the input registers, which can also be + * accessed by a Field bus. Note, uses it’s own memory space. + * + * @param address Address of the register (0:47) + * @return The value held by the register (float) + * + * @note The lower range of the float input registers [0:23] is reserved + * for FieldBus/PLC interface usage. The upper range [24:47] cannot be + * accessed by FieldBus/PLC interfaces, since it is reserved for external + * RTDE clients. + * + * @par Python interface prototype + * getFloatInput(self: pyaubo_sdk.RegisterControl, arg0: int) -> float + * + * @par Lua interface prototype + * getFloatInput(address: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getFloatInput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + */ + float getFloatInput(uint32_t address); + + /** + * \chinese + * + * @param address 寄存器的地址(0:47) + * @param value 要设置的浮点数值 + * @return 返回0表示成功,其他为错误码 + * + * @note 只有在实现 RTDE/Modbus Slave/PLC 服务端时使用 + * + * @par Python函数原型 + * setFloatInput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: float) -> int + * + * @par Lua函数原型 + * setFloatInput(address: number, value: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setFloatInput","params":[0,3.3],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * + * @param address Address of the register (0:47) + * @param value Float value to set + * @return Returns 0 on success, or an error code + * + * @note Only used when implementing RTDE/Modbus Slave/PLC server + * + * @par Python interface prototype + * setFloatInput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: float) -> int + * + * @par Lua interface prototype + * setFloatInput(address: number, value: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setFloatInput","params":[0,3.3],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setFloatInput(uint32_t address, float value); + + /** + * \chinese + * + * 从一个输入寄存器中读取双精度浮点数,也可以通过现场总线进行访问。 + * 注意,它使用自己的内存空间。 + * + * @param address 寄存器的地址(0:47) + * @return 寄存器中保存的双精度浮点数值 + * + * @par Python函数原型 + * getDoubleInput(self: pyaubo_sdk.RegisterControl, arg0: int) -> float + * + * @par Lua函数原型 + * getDoubleInput(address: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getDoubleInput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endchinese + * \english + * + * Reads the double value from one of the input registers, which can also be accessed by a FieldBus. Note, uses its own memory space. + * + * @param address Address of the register (0:47) + * @return The double value held by the register + * + * @par Python interface prototype + * getDoubleInput(self: pyaubo_sdk.RegisterControl, arg0: int) -> float + * + * @par Lua interface prototype + * getDoubleInput(address: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getDoubleInput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endenglish + */ + double getDoubleInput(uint32_t address); + + /** + * \english + * @param address + * @param value + * @return + * + * @note Only used when implementing RTDE/Modbus Slave/PLC server + * + * @par Python interface prototype + * setDoubleInput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: float) + * -> int + * + * @par Lua interface prototype + * setDoubleInput(address: number, value: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setDoubleInput","params":[0,6.6],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + * + * \chinese + * @param address + * @param value + * @return + * + * @note 只有在实现 RTDE/Modbus Slave/PLC 服务端时使用 + * + * @par Python函数原型 + * setDoubleInput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: float) + * -> int + * + * @par Lua函数原型 + * setDoubleInput(address: number, value: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setDoubleInput","params":[0,6.6],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + */ + int setDoubleInput(uint32_t address, double value); + + /** + * \chinese + * 从一个输出寄存器中读取布尔值,也可以通过现场总线进行访问。 + * 注意,它使用自己的内存空间。 + * + * @param address 寄存器地址(0:127) + * @return 寄存器中保存的布尔值(true, false) + * + * @note 布尔输出寄存器的较低范围[0:63]保留供现场总线/PLC接口使用。 + * 较高范围[64:127]不能通过现场总线/PLC接口访问,因为它们是为外部RTDE客户端保留的。 + * + * @par Python函数原型 + * getBoolOutput(self: pyaubo_sdk.RegisterControl, arg0: int) -> bool + * + * @par Lua函数原型 + * getBoolOutput(address: number) -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getBoolOutput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * \endchinese + * + * \english + * Reads the boolean from one of the output registers, which can also be + * accessed by a Field bus. + * Note, uses its own memory space. + * + * @param address Address of the register (0:127) + * @return The boolean value held by the register (true, false) + * + * @note The lower range of the boolean output registers [0:63] is reserved + * for FieldBus/PLC interface usage. The upper range [64:127] cannot be + * accessed by FieldBus/PLC interfaces, since it is reserved for external + * RTDE clients. + * + * @par Python interface prototype + * getBoolOutput(self: pyaubo_sdk.RegisterControl, arg0: int) -> bool + * + * @par Lua interface prototype + * getBoolOutput(address: number) -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getBoolOutput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * \endenglish + */ + bool getBoolOutput(uint32_t address); + + /** + * \chinese + * + * @param address 寄存器地址(0:127) + * @param value 要设置的布尔值(true 或 false) + * @return 返回0表示成功,其他为错误码 + * + * @par Python函数原型 + * setBoolOutput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: bool) -> int + * + * @par Lua函数原型 + * setBoolOutput(address: number, value: boolean) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setBoolOutput","params":[0,false],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * + * @param address Address of the register (0:127) + * @param value Boolean value to set (true or false) + * @return Returns 0 on success, or an error code + * + * @par Python interface prototype + * setBoolOutput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: bool) -> int + * + * @par Lua interface prototype + * setBoolOutput(address: number, value: boolean) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setBoolOutput","params":[0,false],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setBoolOutput(uint32_t address, bool value); + + /** + * \chinese + * 从一个输出寄存器中读取整数值,也可以通过现场总线进行访问。 + * 注意,它使用自己的内存空间。 + * + * @param address 寄存器地址(0:47) + * @return 寄存器中保存的整数值(-2,147,483,648 : 2,147,483,647) + * + * @note 整数输出寄存器的较低范围[0:23]保留供现场总线/PLC接口使用。 + * 较高范围[24:47]不能通过现场总线/PLC接口访问,因为它们是为外部RTDE客户端保留的。 + * + * @par Python函数原型 + * getInt32Output(self: pyaubo_sdk.RegisterControl, arg0: int) -> int + * + * @par Lua函数原型 + * getInt32Output(address: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getInt32Output","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * + * \english + * Reads the integer from one of the output registers, which can also be + * accessed by a FieldBus. Note, uses its own memory space. + * + * @param address Address of the register (0:47) + * @return The int value held by the register [-2,147,483,648 : 2,147,483,647] + * + * @note The lower range of the integer output registers [0:23] is reserved + * for FieldBus/PLC interface usage. The upper range [24:47] cannot be + * accessed by FieldBus/PLC interfaces, since it is reserved for external + * RTDE clients. + * + * @par Python interface prototype + * getInt32Output(self: pyaubo_sdk.RegisterControl, arg0: int) -> int + * + * @par Lua interface prototype + * getInt32Output(address: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getInt32Output","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int getInt32Output(uint32_t address); + + /** + * \chinese + * + * @param address 寄存器地址(0:47) + * @param value 要设置的整数值 + * @return 返回0表示成功,其他为错误码 + * + * @par Python函数原型 + * setInt32Output(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: int) -> int + * + * @par Lua函数原型 + * setInt32Output(address: number, value: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setInt32Output","params":[0,100],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * + * @param address Address of the register (0:47) + * @param value Integer value to set + * @return Returns 0 on success, or an error code + * + * @par Python interface prototype + * setInt32Output(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: int) -> int + * + * @par Lua interface prototype + * setInt32Output(address: number, value: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setInt32Output","params":[0,100],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setInt32Output(uint32_t address, int value); + + /** + * \chinese + * 从一个输出寄存器中读取浮点数,也可以通过现场总线进行访问。 + * 注意,它使用自己的内存空间。 + * + * @param address 寄存器地址(0:47) + * @return 寄存器中保存的浮点数值(float) + * + * @note 浮点数输出寄存器的较低范围[0:23]保留供现场总线/PLC接口使用。 + * 较高范围[24:47]不能通过现场总线/PLC接口访问,因为它们是为外部RTDE客户端保留的。 + * + * @par Python函数原型 + * getFloatOutput(self: pyaubo_sdk.RegisterControl, arg0: int) -> float + * + * @par Lua函数原型 + * getFloatOutput(address: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getFloatOutput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":3.3} + * \endchinese + * + * \english + * Reads the float from one of the output registers, which can also be + * accessed by a FieldBus. Note, uses its own memory space. + * + * @param address Address of the register (0:47) + * @return The value held by the register (float) + * + * @note The lower range of the float output registers [0:23] is reserved + * for FieldBus/PLC interface usage. The upper range [24:47] cannot be + * accessed by FieldBus/PLC interfaces, since it is reserved for external + * RTDE clients. + * + * @par Python interface prototype + * getFloatOutput(self: pyaubo_sdk.RegisterControl, arg0: int) -> float + * + * @par Lua interface prototype + * getFloatOutput(address: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getFloatOutput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":3.3} + * \endenglish + */ + float getFloatOutput(uint32_t address); + + /** + * \chinese + * + * @param address 寄存器地址(0:47) + * @param value 要设置的浮点数值 + * @return 返回0表示成功,其他为错误码 + * + * @par Python函数原型 + * setFloatOutput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: float) -> int + * + * @par Lua函数原型 + * setFloatOutput(address: number, value: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setFloatOutput","params":[0,5.5],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * + * @param address Address of the register (0:47) + * @param value Float value to set + * @return Returns 0 on success, or an error code + * + * @par Python interface prototype + * setFloatOutput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: float) -> int + * + * @par Lua interface prototype + * setFloatOutput(address: number, value: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setFloatOutput","params":[0,5.5],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setFloatOutput(uint32_t address, float value); + + /** + * \chinese + * + * 从一个输出寄存器中读取双精度浮点数。 + * + * @param address 寄存器地址 + * @return 寄存器中保存的双精度浮点数值 + * + * @par Python函数原型 + * getDoubleOutput(self: pyaubo_sdk.RegisterControl, arg0: int) -> float + * + * @par Lua函数原型 + * getDoubleOutput(address: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getDoubleOutput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endchinese + * \english + * + * Reads the double value from one of the output registers. + * + * @param address Address of the register + * @return The double value held by the register + * + * @par Python interface prototype + * getDoubleOutput(self: pyaubo_sdk.RegisterControl, arg0: int) -> float + * + * @par Lua interface prototype + * getDoubleOutput(address: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getDoubleOutput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endenglish + */ + double getDoubleOutput(uint32_t address); + + /** + * \chinese + * + * @param address 寄存器地址 + * @param value 要设置的双精度浮点数值 + * @return 返回0表示成功,其他为错误码 + * + * @par Python函数原型 + * setDoubleOutput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: float) + * -> int + * + * @par Lua函数原型 + * setDoubleOutput(address: number, value: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setDoubleOutput","params":[0,4.4],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * + * @param address Address of the register + * @param value Double value to set + * @return Returns 0 on success, or an error code + * + * @par Python interface prototype + * setDoubleOutput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: float) + * -> int + * + * @par Lua interface prototype + * setDoubleOutput(address: number, value: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setDoubleOutput","params":[0,4.4],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setDoubleOutput(uint32_t address, double value); + + /** + * \chinese + * 用于 Modbus Slave + * + * @param address + * @return + * + * @par Python函数原型 + * getInt16Register(self: pyaubo_sdk.RegisterControl, arg0: int) -> int + * + * @par Lua函数原型 + * getInt16Register(address: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getInt16Register","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Used for Modbus Slave + * + * @param address + * @return + * + * @par Python interface prototype + * getInt16Register(self: pyaubo_sdk.RegisterControl, arg0: int) -> int + * + * @par Lua interface prototype + * getInt16Register(address: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getInt16Register","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int16_t getInt16Register(uint32_t address); + + /** + * \chinese + * + * @param address 寄存器地址 + * @param value 要设置的值 + * @return 返回0表示成功,其他为错误码 + * + * @par Python函数原型 + * setInt16Register(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: int) + * -> int + * + * @par Lua函数原型 + * setInt16Register(address: number, value: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setInt16Register","params":[0,0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * + * @param address Register address + * @param value Value to set + * @return Returns 0 on success, otherwise error code + * + * @par Python interface prototype + * setInt16Register(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: int) -> int + * + * @par Lua interface prototype + * setInt16Register(address: number, value: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setInt16Register","params":[0,0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setInt16Register(uint32_t address, int16_t value); + + /** + * \chinese + * 具名变量是否存在 + * + * @param key 变量名 + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.hasNamedVariable","params":["custom"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endchinese + * \english + * Whether the named variable exists + * + * @param key Variable name + * @return + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.hasNamedVariable","params":["custom"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endenglish + */ + bool hasNamedVariable(const std::string &key); + + /** + * \chinese + * 获取具名变量的类型 + * + * @param key + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getNamedVariableType","params":["custom"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"NONE"} + * + * \endchinese + * \english + * Get the type of a named variable + * + * @param key + * @return + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getNamedVariableType","params":["custom"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"NONE"} + * + * \endenglish + */ + std::string getNamedVariableType(const std::string &key); + + /** + * \chinese + * 具名变量是否更新 + * + * @param key + * @param since + * @return + * + * @par Python函数原型 + * variableUpdated(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int) + * -> bool + * + * @par Lua函数原型 + * variableUpdated(key: string, since: number) -> boolean + * \endchinese + * + * \english + * Whether the named variable has been updated + * + * @param key + * @param since + * @return + * + * @par Python interface prototype + * variableUpdated(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int) + * -> bool + * + * @par Lua interface prototype + * variableUpdated(key: string, since: number) -> boolean + * \endchinese + */ + bool variableUpdated(const std::string &key, uint64_t since); + + /** + * \chinese + * 获取变量值 + * + * @param key + * @param default_value + * @return + * + * @par Python函数原型 + * getBool(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: bool) -> bool + * + * @par Lua函数原型 + * getBool(key: string, default_value: boolean) -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getBool","params":["custom",false],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endchinese + * \english + * Get variable value + * + * @param key + * @param default_value + * @return + * + * @par Python interface prototype + * getBool(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: bool) -> bool + * + * @par Lua interface prototype + * getBool(key: string, default_value: boolean) -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getBool","params":["custom",false],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endenglish + */ + bool getBool(const std::string &key, bool default_value); + + /** + * \chinese + * 设置/更新变量值 + * + * @param key + * @param value + * @return + * + * @par Python函数原型 + * setBool(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: bool) -> int + * + * @par Lua函数原型 + * setBool(key: string, value: boolean) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setBool","params":["custom",true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set or update the variable value + * + * @param key + * @param value + * @return Returns 0 on success, otherwise error code + * + * @par Python interface prototype + * setBool(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: bool) -> int + * + * @par Lua interface prototype + * setBool(key: string, value: boolean) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setBool","params":["custom",true],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setBool(const std::string &key, bool value); + + /** + * \chinese + * 获取变量值 + * + * @param key + * @param default_value + * @return + * + * @par Python函数原型 + * getVecChar(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: List[str]) + * -> List[str] + * + * @par Lua函数原型 + * getVecChar(key: string, default_value: table) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getVecChar","params":["custom",[]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0,1,0]} + * + * \endchinese + * \english + * Get variable value + * + * @param key + * @param default_value + * @return + * + * @par Python interface prototype + * getVecChar(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: List[str]) -> List[str] + * + * @par Lua interface prototype + * getVecChar(key: string, default_value: table) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getVecChar","params":["custom",[]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0,1,0]} + * + * \endenglish + */ + std::vector getVecChar(const std::string &key, + const std::vector &default_value); + + /** + * \chinese + * 设置/更新变量值 + * + * @param key + * @param value + * @return + * + * @par Python函数原型 + * setVecChar(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: List[str]) + * -> int + * + * @par Lua函数原型 + * setVecChar(key: string, value: table) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setVecChar","params":["custom",[0,1,0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set or update the variable value + * + * @param key + * @param value + * @return Returns 0 on success, otherwise error code + * + * @par Python interface prototype + * setVecChar(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: List[str]) -> int + * + * @par Lua interface prototype + * setVecChar(key: string, value: table) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setVecChar","params":["custom",[0,1,0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setVecChar(const std::string &key, const std::vector &value); + + /** + * \chinese + * 获取变量值 + * + * @param key + * @param default_value + * @return + * + * @par Python函数原型 + * getInt32(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int) -> int + * + * @par Lua函数原型 + * getInt32(key: string, default_value: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getInt32","params":["custom",0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":6} + * + * \endchinese + * \english + * Get variable value + * + * @param key + * @param default_value + * @return + * + * @par Python interface prototype + * getInt32(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int) -> int + * + * @par Lua interface prototype + * getInt32(key: string, default_value: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getInt32","params":["custom",0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":6} + * + * \endenglish + */ + int getInt32(const std::string &key, int default_value); + + /** + * \chinese + * 设置/更新变量值 + * + * @param key + * @param value + * @return + * + * @par Python函数原型 + * setInt32(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int) -> int + * + * @par Lua函数原型 + * setInt32(key: string, value: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setInt32","params":["custom",6],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set or update the variable value + * + * @param key + * @param value + * @return + * + * @par Python interface prototype + * setInt32(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int) -> int + * + * @par Lua interface prototype + * setInt32(key: string, value: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setInt32","params":["custom",6],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setInt32(const std::string &key, int value); + + /** + * \chinese + * 获取变量值 + * + * @param key + * @param default_value + * @return + * + * @par Python函数原型 + * getVecInt32(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: List[int]) + * -> List[int] + * + * @par Lua函数原型 + * getVecInt32(key: string, default_value: table) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getVecInt32","params":["custom",[]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[1,2,3,4]} + * + * \endchinese + * \english + * Get variable value + * + * @param key + * @param default_value + * @return + * + * @par Python interface prototype + * getVecInt32(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: List[int]) -> List[int] + * + * @par Lua interface prototype + * getVecInt32(key: string, default_value: table) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getVecInt32","params":["custom",[]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[1,2,3,4]} + * + * \endenglish + */ + std::vector getVecInt32(const std::string &key, + const std::vector &default_value); + + /** + * \chinese + * 设置/更新变量值 + * + * @param key + * @param value + * @return + * + * @par Python函数原型 + * setVecInt32(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: List[int]) + * -> int + * + * @par Lua函数原型 + * setVecInt32(key: string, value: table) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setVecInt32","params":["custom",[1,2,3,4]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set or update the variable value + * + * @param key + * @param value + * @return + * + * @par Python interface prototype + * setVecInt32(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: List[int]) -> int + * + * @par Lua interface prototype + * setVecInt32(key: string, value: table) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setVecInt32","params":["custom",[1,2,3,4]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setVecInt32(const std::string &key, const std::vector &value); + + /** + * \chinese + * 获取变量值 + * + * @param key + * @param default_value + * @return + * + * @par Python函数原型 + * getFloat(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: float) -> + * float + * + * @par Lua函数原型 + * getFloat(key: string, default_value: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getFloat","params":["custom",0.0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":4.400000095367432} + * + * \endchinese + * \english + * Get variable value + * + * @param key + * @param default_value + * @return + * + * @par Python interface prototype + * getFloat(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: float) -> float + * + * @par Lua interface prototype + * getFloat(key: string, default_value: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getFloat","params":["custom",0.0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":4.400000095367432} + * + * \endenglish + */ + float getFloat(const std::string &key, float default_value); + + /** + * \chinese + * 设置/更新变量值 + * + * @param key + * @param value + * @return + * + * @par Python函数原型 + * setFloat(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: float) -> int + * + * @par Lua函数原型 + * setFloat(key: string, value: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setFloat","params":["custom",4.4],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set or update the variable value + * + * @param key + * @param value + * @return + * + * @par Python interface prototype + * setFloat(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: float) -> int + * + * @par Lua interface prototype + * setFloat(key: string, value: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setFloat","params":["custom",4.4],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setFloat(const std::string &key, float value); + + /** + * \chinese + * 获取变量值 + * + * @param key + * @param default_value + * @return + * + * @par Python函数原型 + * getVecFloat(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: + * List[float]) -> List[float] + * + * @par Lua函数原型 + * getVecFloat(key: string, default_value: table) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getVecFloat","params":["custom",[]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.10000000149011612,3.299999952316284]} + * + * \endchinese + * \english + * Get variable value + * + * @param key + * @param default_value + * @return + * + * @par Python interface prototype + * getVecFloat(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: + * List[float]) -> List[float] + * + * @par Lua interface prototype + * getVecFloat(key: string, default_value: table) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getVecFloat","params":["custom",[]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.10000000149011612,3.299999952316284]} + * + * \endenglish + */ + std::vector getVecFloat(const std::string &key, + const std::vector &default_value); + + /** + * \chinese + * 设置/更新变量值 + * + * @param key + * @param value + * @return + * + * @par Python函数原型 + * setVecFloat(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: + * List[float]) -> int + * + * @par Lua函数原型 + * setVecFloat(key: string, value: table) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setVecFloat","params":["custom",[0.0,0.1,3.3]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set or update the variable value + * + * @param key + * @param value + * @return + * + * @par Python interface prototype + * setVecFloat(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: List[float]) -> int + * + * @par Lua interface prototype + * setVecFloat(key: string, value: table) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setVecFloat","params":["custom",[0.0,0.1,3.3]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setVecFloat(const std::string &key, const std::vector &value); + + /** + * \chinese + * 获取变量值 + * + * @param key + * @param default_value + * @return + * + * @par Python函数原型 + * getDouble(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: float) -> + * float + * + * @par Lua函数原型 + * getDouble(key: string, default_value: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getDouble","params":["custom",0.0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endchinese + * \english + * Get variable value + * + * @param key + * @param default_value + * @return + * + * @par Python interface prototype + * getDouble(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: float) -> float + * + * @par Lua interface prototype + * getDouble(key: string, default_value: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getDouble","params":["custom",0.0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endenglish + */ + double getDouble(const std::string &key, double default_value); + + /** + * \chinese + * 设置/更新变量值 + * + * @param key + * @param value + * @return + * + * @par Python函数原型 + * setDouble(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: float) -> int + * + * @par Lua函数原型 + * setDouble(key: string, value: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setDouble","params":["custom",6.6],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set or update the variable value + * + * @param key + * @param value + * @return + * + * @par Python interface prototype + * setDouble(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: float) -> int + * + * @par Lua interface prototype + * setDouble(key: string, value: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setDouble","params":["custom",6.6],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setDouble(const std::string &key, double value); + + /** + * \chinese + * 获取变量值 + * + * @param key + * @param default_value + * @return + * + * @par Python函数原型 + * getVecDouble(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: + * List[float]) -> List[float] + * + * @par Lua函数原型 + * getVecDouble(key: string, default_value: table) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getVecDouble","params":["custom",[]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.1,0.2,0.3]} + * + * \endchinese + * \english + * Get variable value + * + * @param key + * @param default_value + * @return + * + * @par Python interface prototype + * getVecDouble(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: + * List[float]) -> List[float] + * + * @par Lua interface prototype + * getVecDouble(key: string, default_value: table) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getVecDouble","params":["custom",[]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.1,0.2,0.3]} + * + * \endenglish + */ + std::vector getVecDouble(const std::string &key, + const std::vector &default_value); + + /** + * \chinese + * 设置/更新变量值 + * + * @param key + * @param value + * @return + * + * @par Python函数原型 + * setVecDouble(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: + * List[float]) -> int + * + * @par Lua函数原型 + * setVecDouble(key: string, value: table) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setVecDouble","params":["custom",[0.1,0.2,0.3]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set or update the variable value + * + * @param key + * @param value + * @return + * + * @par Python interface prototype + * setVecDouble(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: List[float]) -> int + * + * @par Lua interface prototype + * setVecDouble(key: string, value: table) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setVecDouble","params":["custom",[0.1,0.2,0.3]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setVecDouble(const std::string &key, const std::vector &value); + + /** + * \chinese + * 获取变量值 + * + * @param key + * @param default_value + * @return + * + * @par Python函数原型 + * getString(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: str) -> str + * + * @par Lua函数原型 + * getString(key: string, default_value: string) -> string + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getString","params":["custom",""],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"test"} + * + * \endchinese + * \english + * Get variable value + * + * @param key + * @param default_value + * @return + * + * @par Python interface prototype + * getString(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: str) -> str + * + * @par Lua interface prototype + * getString(key: string, default_value: string) -> string + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getString","params":["custom",""],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"test"} + * + * \endenglish + */ + std::string getString(const std::string &key, + const std::string &default_value); + + /** + * \chinese + * 设置/更新变量值 + * + * @param key + * @param value + * @return + * + * @par Python函数原型 + * setString(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: str) -> int + * + * @par Lua函数原型 + * setString(key: string, value: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setString","params":["custom","test"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set or update the variable value + * + * @param key + * @param value + * @return Returns 0 on success, otherwise error code + * + * @par Python interface prototype + * setString(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: str) -> int + * + * @par Lua interface prototype + * setString(key: string, value: string) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setString","params":["custom","test"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setString(const std::string &key, const std::string &value); + + /** + * \chinese + * 清除变量 + * + * @param key + * @return + * + * @par Python函数原型 + * clearNamedVariable(self: pyaubo_sdk.RegisterControl, arg0: str) -> int + * + * @par Lua函数原型 + * clearNamedVariable(key: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.clearNamedVariable","params":["custom"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1} + * + * \endchinese + * \english + * Clear variable + * + * @param key + * @return + * + * @par Python interface prototype + * clearNamedVariable(self: pyaubo_sdk.RegisterControl, arg0: str) -> int + * + * @par Lua interface prototype + * clearNamedVariable(key: string) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.clearNamedVariable","params":["custom"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1} + * + * \endenglish + */ + int clearNamedVariable(const std::string &key); + + /** + * \chinese + * 设置看门狗 + * + * 看门狗被触发之后控制器会执行对应的动作,并自动删除看门狗 + * + * @param key + * @param timeout 超时时间,单位秒(s),超时时间最小为 0.1s + * @param action + * NONE (0): 无动作 + * PAUSE(1): 暂停运行时 + * STOP (2): 停止运行时/停止机器人运动 + * PROTECTIVE_STOP (3): 触发防护停止 + * @return + * \endchinese + * \english + * Set the watchdog + * + * After the watchdog is triggered, the controller will perform the corresponding action and automatically delete the watchdog. + * + * @param key + * @param timeout Timeout in seconds (s), minimum timeout is 0.1s + * @param action + * NONE (0): No action + * PAUSE(1): Pause runtime + * STOP (2): Stop runtime/stop robot motion + * PROTECTIVE_STOP (3): Trigger protective stop + * @return + * \endenglish + */ + int setWatchDog(const std::string &key, double timeout, int action); + + /** + * \chinese + * 获取看门狗动作 + * + * @param key + * @return + * \endchinese + * \english + * Get the watchdog action + * + * @param key + * @return + * \endenglish + */ + int getWatchDogAction(const std::string &key); + + /** + * \chinese + * 获取看门狗超时时间 + * + * @param key + * @return + * \endchinese + * \english + * Get the watchdog timeout value + * + * @param key + * @return + * \endenglish + */ + int getWatchDogTimeout(const std::string &key); + + /** + * \chinese + * 添加一个新的Modbus信号以供控制器监视。不需要返回响应。 + * + * @param device_info 设备信息 + * 设备信息是RTU格式,例如:"serial_port,baud,parity,data_bit,stop_bit" + * (1)serial_port参数指定串口的名称,例如,在Linux上为"/dev/ttyS0"或"/dev/ttyUSB0",在Windows上为"\.\COM10" + * (2)baud参数指定通信的波特率,例如9600、19200、57600、115200等 + * (3)parity参数指定奇偶校验方式,N表示无校验,E表示偶校验,O表示奇校验 + * (4)data_bit参数指定数据位数,允许的值为5、6、7和8 + * (5)stop_bit参数指定停止位数,允许的值为1和2 + * + * 设备信息是TCP格式,例如:"ip address,port" + * (1)ip address参数指定服务器的IP地址 + * (2)port参数指定服务器监听的端口号 + * @param slave_number 通常不使用,设置为255即可,但可以在0到255之间自由选择 + * @param signal_address 指定新信号应该反映的线圈或寄存器的地址。请参考Modbus单元的配置以获取此信息。 + * @param signal_type 指定要添加的信号类型。0 = 数字输入,1 = 数字输出,2 = 寄存器输入,3 = 寄存器输出。 + * @param signal_name 唯一标识信号的名词。如果提供的字符串与已添加的信号相等,则新信号将替换旧信号。字符串的长度不能超过20个字符。 + * @param sequential_mode 设置为True会强制Modbus客户端在发送下一个请求之前等待响应。某些fieldbus单元需要此模式。可选参数。 + * @return + * + * @par Python函数原型 + * modbusAddSignal(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int, arg2: int, arg3: int, arg4: str, arg5: bool) -> int + * + * @par Lua函数原型 + * modbusAddSignal(device_info: string, slave_number: number, signal_address: number, signal_type: number, signal_name: string, sequential_mode: boolean) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusAddSignal","params":["/dev/ttyRobotTool,115200,N,8,1",1,264,3,"Modbus_0",false],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Adds a new modbus signal for the controller to supervise. Expects no response. + * + * @param device_info is rtu format. + * eg,"serial_port,baud,parity,data_bit,stop_bit" + * (1)The serial_port argument specifies the name of the serial port eg. On Linux ,"/dev/ttyS0" or "/dev/ttyUSB0". On Windows, "\.\COM10". + * (2)The baud argument specifies the baud rate of the communication, eg. 9600, 19200, 57600, 115200, etc. + * (3)parity:N for none,E for even,O for odd. + * (4)data_bit:The data_bits argument specifies the number of bits of data, the allowed values are 5, 6, 7 and 8. + * (5)stop_bit:The stop_bits argument specifies the bits of stop, the allowed values are 1 and 2. + * + * device_info is tcp format.eg,"ip address,port" + * (1)The ip address parameter specifies the ip address of the server + * (2)The port parameter specifies the port number that the server is listening on. + * @param slave_number An integer normally not used and set to 255, but is a free choice between 0 and 255. + * @param signal_address An integer specifying the address of the either the coil or the register that this new signal should reflect. Consult the configuration of the modbus unit for this information. + * @param signal_type An integer specifying the type of signal to add. 0 = digital input, 1 = digital output, 2 = register input and 3 = register output. + * @param signal_name A string uniquely identifying the signal. If a string is supplied which is equal to an already added signal, the new signal will replace the old one. The length of the string cannot exceed 20 characters. + * @param sequential_mode Setting to True forces the modbus client to wait for a response before sending the next request. This mode is required by some fieldbus units (Optional). + * @return + * + * @par Python interface prototype + * modbusAddSignal(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int, arg2: int, arg3: int, arg4: str, arg5: bool) -> int + * + * @par Lua interface prototype + * modbusAddSignal(device_info: string, slave_number: number, signal_address: number, signal_type: number, signal_name: string, sequential_mode: boolean) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusAddSignal","params":["/dev/ttyRobotTool,115200,N,8,1",1,264,3,"Modbus_0",false],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int modbusAddSignal(const std::string &device_info, int slave_number, + int signal_address, int signal_type, + const std::string &signal_name, bool sequential_mode); + + /** + * \chinese + * 删除指定名称的信号。 + * + * @param signal_name 要删除的信号的名称 + * @return + * + * @par Python函数原型 + * modbusDeleteSignal(self: pyaubo_sdk.RegisterControl, arg0: str) -> int + * + * @par Lua函数原型 + * modbusDeleteSignal(signal_name: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusDeleteSignal","params":["Modbus_1"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Deletes the signal identified by the supplied signal name. + * + * @param signal_name A string equal to the name of the signal that should be deleted. + * @return + * + * @par Python interface prototype + * modbusDeleteSignal(self: pyaubo_sdk.RegisterControl, arg0: str) -> int + * + * @par Lua interface prototype + * modbusDeleteSignal(signal_name: string) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusDeleteSignal","params":["Modbus_1"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int modbusDeleteSignal(const std::string &signal_name); + + /** + * \chinese + * 删除所有modbus信号 + * + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusDeleteAllSignals","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Delete all modbus signals + * + * @return + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusDeleteAllSignals","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int modbusDeleteAllSignals(); + + /** + * \chinese + * 读取特定信号的当前值。 + * + * @param signal_name 要获取值的信号的名称 + * @return 对于数字信号:1或0。 + * 对于寄存器信号:表示为整数的寄存器值。如果值为-1,则表示该信号不存在。 + * + * @par Python函数原型 + * modbusGetSignalStatus(self: pyaubo_sdk.RegisterControl, arg0: str) -> int + * + * @par Lua函数原型 + * modbusGetSignalStatus(signal_name: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalStatus","params":["Modbus_0"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1} + * \endchinese + * \english + * Reads the current value of a specific signal. + * + * @param signal_name A string equal to the name of the signal for which the value should be gotten. + * @return An integer or a boolean. For digital signals: 1 or 0. For register signals: The register value expressed as an integer. If the value is -1, it means the signal does not exist. + * + * @par Python interface prototype + * modbusGetSignalStatus(self: pyaubo_sdk.RegisterControl, arg0: str) -> int + * + * @par Lua interface prototype + * modbusGetSignalStatus(signal_name: string) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalStatus","params":["Modbus_0"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1} + * \endenglish + */ + int modbusGetSignalStatus(const std::string &signal_name); + + /** + * \chinese + * 获取所有信号的名字集合 + * + * @return 所有信号的名字集合 + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalNames","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":["Modbus_0"]} + * + * \endchinese + * \english + * Get the collection of all signal names + * + * @return Collection of all signal names + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalNames","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":["Modbus_0"]} + * + * \endenglish + */ + std::vector modbusGetSignalNames(); + + /** + * \chinese + * 获取所有信号的类型集合 + * + * @return 所有信号的类型集合 + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalTypes","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[1,0,2,3]} + * + * \endchinese + * \english + * Get the collection of all signal types + * + * @return Collection of all signal types + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalTypes","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[1,0,2,3]} + * + * \endenglish + */ + std::vector modbusGetSignalTypes(); + + /** + * \chinese + * 获取所有信号的数值集合 + * + * @return 所有信号的数值集合 + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalValues","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[1,1,88,33]} + * + * \endchinese + * \english + * Get the collection of all signal values + * + * @return Collection of all signal values + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalValues","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[1,1,88,33]} + * + * \endenglish + */ + std::vector modbusGetSignalValues(); + + /** + * \chinese + * 获取所有信号的请求是否有错误(0:无错误,其他:有错误)集合 + * + * @return ModbusErrorNum + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalErrors","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[6,6,6,6]} + * + * \endchinese + * \english + * Get the error status of all signal requests (0: no error, others: error) as a collection + * + * @return ModbusErrorNum + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalErrors","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[6,6,6,6]} + * + * \endenglish + */ + std::vector modbusGetSignalErrors(); + + /** + * \chinese + * 将用户指定的命令发送到指定IP地址上的Modbus单元。 + * 由于不会接收到响应,因此不能用于请求数据。 + * 用户负责提供对所提供的功能码有意义的数据。 + * 内置函数负责构建Modbus帧,因此用户不需要关心命令的长度。 + * + * @param device_info 设备信息 + * 设备信息是RTU格式,例如:"serial_port,baud,parity,data_bit,stop_bit" + * (1)serial_port参数指定串口的名称,例如,在Linux上为"/dev/ttyS0"或"/dev/ttyUSB0",在Windows上为"\.\COM10" + * (2)baud参数指定通信的波特率,例如9600、19200、57600、115200等 + * (3)parity参数指定奇偶校验方式,N表示无校验,E表示偶校验,O表示奇校验 + * (4)data_bit参数指定数据位数,允许的值为5、6、7和8 + * (5)stop_bit参数指定停止位数,允许的值为1和2 + * + * 设备信息是TCP格式,例如:"ip address,port" + * (1)ip address参数指定服务器的IP地址 + * (2)port参数指定服务器监听的端口号 + * @param slave_number 指定用于自定义命令的从站号 + * @param function_code 指定自定义命令的功能码 + * + * Modbus功能码 + * MODBUS_FC_READ_COILS 0x01 + * MODBUS_FC_READ_DISCRETE_INPUTS 0x02 + * MODBUS_FC_READ_HOLDING_REGISTERS 0x03 + * MODBUS_FC_READ_INPUT_REGISTERS 0x04 + * MODBUS_FC_WRITE_SINGLE_COIL 0x05 + * MODBUS_FC_WRITE_SINGLE_REGISTER 0x06 + * MODBUS_FC_READ_EXCEPTION_STATUS 0x07 + * MODBUS_FC_WRITE_MULTIPLE_COILS 0x0F + * MODBUS_FC_WRITE_MULTIPLE_REGISTERS 0x10 + * MODBUS_FC_REPORT_SLAVE_ID 0x11 + * MODBUS_FC_MASK_WRITE_REGISTER 0x16 + * MODBUS_FC_WRITE_AND_READ_REGISTERS 0x17 + * + * @param data 必须是有效的字节值(0-255) + * @return + * + * @par Python函数原型 + * modbusSendCustomCommand(self: pyaubo_sdk.RegisterControl, arg0: str, + * arg1: int, arg2: int, arg3: List[int]) -> int + * + * @par Lua函数原型 + * modbusSendCustomCommand(device_info: string, slave_number: number, + * function_code: number, data: table) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusSendCustomCommand","params":["/dev/ttyRobotTool,115200,N,8,1",1,10,[1,2,0,2,4,0,0,0,0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Sends a command specified by the user to the modbus unit located on the + * specified IP address. Cannot be used to request data, since the response + * will not be received. The user is responsible for supplying data which + * is meaningful to the supplied function code. The builtin function takes + * care of constructing the modbus frame, so the user should not be + * concerned with the length of the command. + * + * @param device_info is rtu format. + * eg,"serial_port,baud,parity,data_bit,stop_bit" + * (1)The serial_port argument specifies the name of the serial port eg. On + * Linux ,"/dev/ttyS0" or "/dev/ttyUSB0". On Windows, "\.\COM10". + * (2)The baud argument specifies the baud rate of the communication, eg. + * 9600, 19200, 57600, 115200, etc. + * (3)parity:N for none,E for even,O for odd. + * (4)data_bit:The data_bits argument specifies the number of bits of data, + * the allowed values are 5, 6, 7 and 8. + * (5)stop_bit:The stop_bits argument + * specifies the bits of stop, the allowed values are 1 and 2. + * + * device_info is tcp format.eg,"ip address,port" + * (1)The ip address parameter specifies the ip address of the server + * (2)The port parameter specifies the port number that the server is listening on. + * @param slave_number An integer specifying the slave number to use for + * the custom command. + * @param function_code An integer specifying the function code for the + * custom command. + * + * Modbus function codes + * MODBUS_FC_READ_COILS 0x01 + * MODBUS_FC_READ_DISCRETE_INPUTS 0x02 + * MODBUS_FC_READ_HOLDING_REGISTERS 0x03 + * MODBUS_FC_READ_INPUT_REGISTERS 0x04 + * MODBUS_FC_WRITE_SINGLE_COIL 0x05 + * MODBUS_FC_WRITE_SINGLE_REGISTER 0x06 + * MODBUS_FC_READ_EXCEPTION_STATUS 0x07 + * MODBUS_FC_WRITE_MULTIPLE_COILS 0x0F + * MODBUS_FC_WRITE_MULTIPLE_REGISTERS 0x10 + * MODBUS_FC_REPORT_SLAVE_ID 0x11 + * MODBUS_FC_MASK_WRITE_REGISTER 0x16 + * MODBUS_FC_WRITE_AND_READ_REGISTERS 0x17 + * + * @param data An array of integers in which each entry must be a valid + * byte (0-255) value. + * @return + * + * @par Python interface prototype + * modbusSendCustomCommand(self: pyaubo_sdk.RegisterControl, arg0: str, + * arg1: int, arg2: int, arg3: List[int]) -> int + * + * @par Lua interface prototype + * modbusSendCustomCommand(device_info: string, slave_number: number, + * function_code: number, data: table) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusSendCustomCommand","params":["/dev/ttyRobotTool,115200,N,8,1",1,10,[1,2,0,2,4,0,0,0,0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int modbusSendCustomCommand(const std::string &device_info, + int slave_number, int function_code, + const std::vector &data); + + /** + * \chinese + * 将选择的数字输入信号设置为“default”或“freedrive” + * + * @param robot_name 连接的机器人名称 + * @param signal_name 先前被添加的数字输入信号 + * @param action 操作类型。操作可以是“default”或“freedrive” + * @return + * + * @par Python函数原型 + * modbusSetDigitalInputAction(self: pyaubo_sdk.RegisterControl, arg0: str, + * arg1: str, arg2: int) + * + * @par Lua函数原型 + * modbusSetDigitalInputAction(robot_name: string, signal_name: string, + * action: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetDigitalInputAction","params":["rob1","Modbus_0","Handguide"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Sets the selected digital input signal to either a "default" or + * "freedrive" action. + * + * @param robot_name A string identifying a robot name that connected robot + * @param signal_name A string identifying a digital input signal that was + * previously added. + * @param action The type of action. The action can either be "default" or + * "freedrive". (string) + * @return + * + * @par Python interface prototype + * modbusSetDigitalInputAction(self: pyaubo_sdk.RegisterControl, arg0: str, + * arg1: str, arg2: int) + * + * @par Lua interface prototype + * modbusSetDigitalInputAction(robot_name: string, signal_name: string, + * action: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetDigitalInputAction","params":["rob1","Modbus_0","Handguide"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int modbusSetDigitalInputAction(const std::string &robot_name, + const std::string &signal_name, + StandardInputAction action); + + /** + * \chinese + * 设置 Modbus 信号输出动作 + * + * @param robot_name + * @param signal_name + * @param runstate + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputRunstate","params":["rob1","Modbus_0","None"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set Modbus signal output action + * + * @param robot_name + * @param signal_name + * @param runstate + * @return + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputRunstate","params":["rob1","Modbus_0","None"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int modbusSetOutputRunstate(const std::string &robot_name, + const std::string &signal_name, + StandardOutputRunState runstate); + + /** + * \chinese + * 将指定名称的输出寄存器信号设置为给定的值 + * + * @param signal_name 提前被添加的输出寄存器信号 + * @param value 必须是有效的整数,范围是 0-65535 + * @return + * + * @par Python函数原型 + * modbusSetOutputSignal(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int) -> int + * + * @par Lua函数原型 + * modbusSetOutputSignal(signal_name: string, value: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputSignal","params":["Modbus_0",0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Sets the output register signal identified by the given name to the given value. + * + * @param signal_name A string identifying an output register signal that in advance has been added. + * @param value An integer which must be a valid word (0-65535) + * @return + * + * @par Python interface prototype + * modbusSetOutputSignal(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int) -> int + * + * @par Lua interface prototype + * modbusSetOutputSignal(signal_name: string, value: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputSignal","params":["Modbus_0",0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int modbusSetOutputSignal(const std::string &signal_name, uint16_t value); + + /** + * \chinese + * 设置modbus信号输出脉冲(仅支持线圈输出类型) + * + * @param signal_name: 提前被添加的输出寄存器信号 + * @param value: 必须是有效的整数,范围是 0-65535 + * @param duration: 信号持续时间,单位为秒 + * @return + * + * @par Python函数原型 + * modbusSetOutputSignalPulse(self: pyaubo_sdk.RegisterControl, arg0: str, + * arg1: int, arg2 double) -> int + * + * @par Lua函数原型 + * modbusSetOutputSignalPulse(signal_name: string, value: number, duration: + * number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputSignalPulse","params":["Modbus_0",1,0.5],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set modbus signal output pulse (only supports coil output type) + * + * @param signal_name: A string identifying an output register signal that + * has been added in advance. + * @param value: An integer which must be a valid word (0-65535) + * @param duration: Duration of the signal, in seconds + * @return + * + * @par Python interface prototype + * modbusSetOutputSignalPulse(self: pyaubo_sdk.RegisterControl, arg0: str, + * arg1: int, arg2: double) -> int + * + * @par Lua interface prototype + * modbusSetOutputSignalPulse(signal_name: string, value: number, duration: + * number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputSignalPulse","params":["Modbus_0",1,0.5],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int modbusSetOutputSignalPulse(const std::string &signal_name, + uint16_t value, double duration); + + /** + * \chinese + * 设置机器人向Modbus控制器发送请求的频率,用于读取或写入信号值 + * + * @param signal_name 提前被添加的输出数字信号 + * @param update_frequency 更新频率(以赫兹为单位),范围是0-125 + * @return + * + * @par Python函数原型 + * modbusSetSignalUpdateFrequency(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int) -> int + * + * @par Lua函数原型 + * modbusSetSignalUpdateFrequency(signal_name: string, update_frequency: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetSignalUpdateFrequency","params":["Modbus_0",1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Sets the frequency with which the robot will send requests to the Modbus + * controller to either read or write the signal value. + * + * @param signal_name A string identifying an output digital signal that + * in advance has been added. + * @param update_frequency An integer in the range 0-125 specifying the + * update frequency in Hz. + * @return + * + * @par Python interface prototype + * modbusSetSignalUpdateFrequency(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int) -> int + * + * @par Lua interface prototype + * modbusSetSignalUpdateFrequency(signal_name: string, update_frequency: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetSignalUpdateFrequency","params":["Modbus_0",1],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int modbusSetSignalUpdateFrequency(const std::string &signal_name, + int update_frequency); + + /** + * \chinese + * 获取指定 modbus 信号索引,从0开始,不能存在则返回-1 + * + * @param signal_name + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalIndex","params":["Modbus_0"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get the index of the specified modbus signal, starting from 0. Returns -1 if it does not exist. + * + * @param signal_name + * @return + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalIndex","params":["Modbus_0"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int modbusGetSignalIndex(const std::string &signal_name); + + /** + * \chinese + * 获取指定 modbus 信号的错误状态 + * + * @param signal_name + * @return 返回错误代码 ModbusErrorNum + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalError","params":["Modbus_0"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":6} + * \endchinese + * \english + * Get the error status of the specified modbus signal + * + * @param signal_name + * @return Returns error code ModbusErrorNum + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalError","params":["Modbus_0"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":6} + * \endenglish + */ + int modbusGetSignalError(const std::string &signal_name); + + /** + * \chinese + * 获取指定 modbus 设备的连接状态 + * + * @param device_name + * 设备名是TCP格式,"ip:port", 例如:"127.0.0.1:502" \n + * 设备名是RTU格式,"serial_port", 例如:"/dev/ttyUSB0" \n + * + * @return + * 0: 表示设备处于连接状态 + * -1: 表示设备不存在 + * -2: 表示设备处于断开状态 + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getModbusDeviceStatus","params":["172.16.26.248:502"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get the connection status of the specified modbus device + * + * @param device_name + * Device name in TCP format: "ip:port", e.g. "127.0.0.1:502" \n + * Device name in RTU format: "serial_port", e.g. "/dev/ttyUSB0" \n + * + * @return + * 0: Device is connected + * -1: Device does not exist + * -2: Device is disconnected + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getModbusDeviceStatus","params":["172.16.26.248:502"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int getModbusDeviceStatus(const std::string &device_name); + + /** + * \chinese + * 将某个 modbus 寄存器信号作为编码器 + * + * @param encoder_id 不能为0 + * @param signal_name modbus 信号名字,必须为寄存器类型 + * @return + * \endchinese + * \english + * Use a modbus register signal as an encoder + * + * @param encoder_id Must not be 0 + * @param signal_name Name of the modbus signal, must be of register type + * @return + * \endenglish + */ + int addModbusEncoder(int encoder_id, int range_id, + const std::string &signal_name); + + /** + * \chinese + * 添加Int32寄存器的虚拟编码器 + * + * @param encoder_id 编码器ID + * @param range_id 范围ID + * @param key 变量名 + * @return + * \endchinese + * \english + * Add a virtual encoder for an Int32 register + * + * @param encoder_id Encoder ID + * @param range_id Range ID + * @param key Variable name + * @return + * \endenglish + */ + int addInt32RegEncoder(int encoder_id, int range_id, + const std::string &key); + + /** + * \chinese + * 删除虚拟编码器 + * + * @param encoder_id + * @return + * \endchinese + * \english + * Delete virtual encoder + * + * @param encoder_id + * @return + * \endenglish + */ + int deleteVirtualEncoder(int encoder_id); + +protected: + void *d_; +}; +using RegisterControlPtr = std::shared_ptr; + +} // namespace common_interface +} // namespace arcs + +#endif // AUBO_SDK_REGISTER_CONTROL_INTERFACE_H diff --git a/third_party/AuboSdk/linux/include/aubo/robot/force_control.h b/third_party/AuboSdk/linux/include/aubo/robot/force_control.h new file mode 100644 index 00000000..d2185a47 --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo/robot/force_control.h @@ -0,0 +1,2574 @@ +/** + * \chinese + * @file force_control.h + * @brief 力控接口 + * + * 力控的限制 + * 当机器人处于力控模式时,以下功能不可用: + * + * • 碰撞检测(选项 613-1)\n + * • SoftMove(选项 885-1)\n + * • 跟踪功能,如输送带跟踪(选项 606-1)、光学跟踪(6601)和焊接引导(815-2)\n + * • 传感器同步或模拟同步\n + * • 世界区域(选项 608-1)\n + * • 独立轴(选项 610-1)\n + * • 路径偏移(选项 612-1)\n + * • 弧焊选项\n + * • PickMaster 选项\n + * • 关节软伺服(指令 SoftAct)\n + * • 当机器人以 MultiMove 协调模式(选项 604-1)运行时,不能激活力控。\n + * • 如果力控与 SafeMove(选项 810-2)或电子位置开关(选项 810-1)一起使用,必须使用操作安全范围功能。请参阅这些选项的相关手册。\n + * • RAPID 指令如 FCAct、FCDeact、FCConditionWaitWhile 和 FCRefStop 只能从运动任务的普通级别调用。 + * + * 应用:抛光、打磨、清洁\n + * FC Pressure\n + * 设置轨迹坐标系的 z 方向为力控轴,spring 设置为 0\n + * 在还没接触前设置输出力为 0,spring 设置为固定值(根据 vel 确定)\n + * 离开接触面:设置输出力为 0,spring 设置为固定值\n + * + * 活塞装配\n + * Forward clutch hub\n + * 设置力控终止模式 + * + * 基于末端力传感器的拖动示教\n + * spring = 0; force_ref = 0; 参考轨迹点任意 + * \endchinese + * \english + * @file force_control.h + * @brief Force control interface + * + * Force control limitations + * When the robot is force controlled, the following functionality is not accessible: + * + * • Collision Detection (option 613-1) \n + * • SoftMove (option 885-1) \n + * • Tracking functionality like Conveyor Tracking (option 606-1), Optical Tracking (6601) and Weld Guide (815-2) \n + * • Sensor Synchronization or Analog Synchronization \n + * • World Zones (option 608-1) \n + * • Independent Axes (option 610-1) \n + * • Path Offset (option 612-1) \n + * • Arc options \n + * • PickMaster options \n + * • Joint soft servo (instruction SoftAct) \n + * • Force Control cannot be activated when the robot is running in MultiMove Coordinated mode (option 604-1). \n + * • If Force Control is used together with SafeMove (option 810-2) or Electronic Position Switches (option 810-1), the function Operational Safety Range must be used. See the respective manual for these options. \n + * • RAPID instructions such as FCAct, FCDeact, FCConditionWaitWhile and FCRefStop can only be called from normal level in a motion task. + * + * Applications: polishing, grinding, cleaning \n + * FC Pressure \n + * Set the z direction of the trajectory coordinate system as the force control axis, set spring to 0 \n + * Before contact, set output force to 0, spring to a fixed value (determined by vel) \n + * Leaving the contact surface: set output force to 0, spring to a fixed value \n + * + * Piston assembly \n + * Forward clutch hub \n + * Set force control termination mode + * + * Drag teaching based on end force sensor \n + * spring = 0; force_ref = 0; reference trajectory point arbitrary + * \endenglish + */ +#ifndef AUBO_SDK_FORCE_CONTROL_INTERFACE_H +#define AUBO_SDK_FORCE_CONTROL_INTERFACE_H + +#include +#include + +#include +#include + +namespace arcs { +namespace common_interface { + +/** + * \chinese + * 力控接口抽象类 + * \endchinese + * \english + * Abstract class for force control interface + * \endenglish + */ +class ARCS_ABI_EXPORT ForceControl +{ +public: + ForceControl(); + virtual ~ForceControl(); + + /** + * \chinese + * 使能力控。 + * fcEnable 被用于使能力控。 在力控被使能的同时, + * fcEnable 用于定义力控的坐标系,并调整力和力矩的阻尼。 + * 如果在 fcEnable 中未指定坐标系, + * 则会创建一个默认的力控制坐标系,其方向与工作对象坐标系相同。 + * 所有力控制监管功能都被 fcEnable 激活。 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * fcEnable(self: pyaubo_sdk.ForceControl) -> int + * + * @par Lua函数原型 + * fcEnable() -> nil + * + * @par Lua示例 + * fcEnable() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.ForceControl.fcEnable","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * + * \english + * Start force control + * + * fcEnable is used to enable Force Control. At the same time as Force + * Control is enabled, fcEnable is used to define the coordinate system + * for Force Control, and tune the force and torque damping. If a coordinate + * system is not specified in fcEnable a default force control coordinate + * system is created with the same orientation as the work object coordinate + * system. All Force Control supervisions are activated by fcEnable. + * + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * fcEnable(self: pyaubo_sdk.ForceControl) -> int + * + * @par Lua Function Prototype + * fcEnable() -> nil + * + * @par Lua example + * fcEnable() + * + * @par JSON-RPC Request example + * {"jsonrpc":"2.0","method":"rob1.ForceControl.fcEnable","params":[],"id":1} + * + * @par JSON-RPC Response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + + int fcEnable(); + + /** + * \chinese + * 失能力控。 + * fcDisable 被用于失能力控。 在成功失能力控之后,机器人将回到位置控制模式。 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * fcDisable(self: pyaubo_sdk.ForceControl) -> int + * + * @par Lua函数原型 + * fcDisable() -> nil + * + * @par Lua示例 + * fcDisable() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.ForceControl.fcDisable","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * + * \english + * End force control + * + * fcDisable is used to disable Force Control. After a successful + * deactivation the robot is back in position control. + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * fcDisable(self: pyaubo_sdk.ForceControl) -> int + * + * @par Lua Function Prototype + * fcDisable() -> nil + * + * @par Lua example + * fcDisable() + * + * @par JSON-RPC Request example + * {"jsonrpc":"2.0","method":"rob1.ForceControl.fcDisable","params":[],"id":1} + * + * @par JSON-RPC Response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + + int fcDisable(); + + /** + * \chinese + * 判断力控是否被使能 + * + * @return 使能返回true,失能返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * isFcEnabled(self: pyaubo_sdk.ForceControl) -> bool + * + * @par Lua函数原型 + * isFcEnabled() -> boolean + * + * @par Lua示例 + * Fc_status = isFcEnabled() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.ForceControl.isFcEnabled","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * \endchinese + * + * \english + * Check if force control is enabled + * + * @return Returns true if enabled, false if disabled + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * isFcEnabled(self: pyaubo_sdk.ForceControl) -> bool + * + * @par Lua Function Prototype + * isFcEnabled() -> boolean + * + * @par Lua example + * Fc_status = isFcEnabled() + * + * @par JSON-RPC Request example + * {"jsonrpc":"2.0","method":"rob1.ForceControl.isFcEnabled","params":[],"id":1} + * + * @par JSON-RPC Response example + * {"id":1,"jsonrpc":"2.0","result":false} + * \endenglish + */ + bool isFcEnabled(); + + /** + * \chinese + * 设置力控参考(目标)值 + * + * @param feature: 参考几何特征,用于生成力控参考坐标系 + * @param compliance: 柔性轴(方向)选择 + * @param wrench: 目标力/力矩 + * @param limits: 速度限制 + * @param type: 力控参考坐标系类型 + * + * 使用说明: + * 1. 基坐标系: + * feature = {0,0,0,0,0,0} + * type = TaskFrameType::NONE + * + * 2. 法兰坐标系: + * feature = {0,0,0,0,0,0} + * type = TaskFrameType::TOOL_FORCE + * + * 3. TCP坐标系: + * feature = tcp_offset + * type = TaskFrameType::TOOL_FORCE + * + * 4. 用户坐标系(FRAME_FORCE): + * type = TaskFrameType::FRAME_FORCE + * feature 设为用户定义的参考坐标,例如 getTcpPose() 表示以当前 TCP 坐标作为力控坐标系。 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setTargetForce(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * List[bool], arg2: List[float], arg3: List[float], arg4: + * arcs::common_interface::TaskFrameType) -> int + * + * @par Lua函数原型 + * setTargetForce(feature: table, compliance: table, wrench: table, limits: + * table, type: number) -> nil + * + * @par Lua示例 + * setTargetForce({0,0,0,0,0,0},{true,false,false,false,false,false},{10,0,0,0,0,0},{0,0,0,0,0,0},4) + * + * \endchinese + * \english + * Set force control reference (target) value + * + * @param feature: Reference geometric feature for generating force control reference frame + * @param compliance: Compliance axis (direction) selection + * @param wrench: Target force/torque + * @param limits: Velocity limits + * @param type: Force control reference frame type + * + * Usage Examples: + * 1. Base Coordinate Frame: + * feature = {0,0,0,0,0,0} + * type = TaskFrameType::NONE + * + * 2. Flange Coordinate Frame: + * feature = {0,0,0,0,0,0} + * type = TaskFrameType::TOOL_FORCE + * + * 3. TCP Coordinate Frame: + * feature = tcp_offset + * type = TaskFrameType::TOOL_FORCE + * + * 4. User Coordinate Frame (FRAME_FORCE): + * type = TaskFrameType::FRAME_FORCE + * feature should be the user-defined reference frame, + * for example, getTcpPose() means setting the force control frame to current TCP pose. + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setTargetForce(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * List[bool], arg2: List[float], arg3: List[float], arg4: + * arcs::common_interface::TaskFrameType) -> int + * + * @par Lua Function Prototype + * setTargetForce(feature: table, compliance: table, wrench: table, limits: + * table, type: number) -> nil + * + * @par Lua example + * setTargetForce({0,0,0,0,0,0},{true,false,false,false,false,false},{10,0,0,0,0,0},{0,0,0,0,0,0},4) + * + * \endenglish + */ + int setTargetForce(const std::vector &feature, + const std::vector &compliance, + const std::vector &wrench, + const std::vector &limits, + TaskFrameType type = TaskFrameType::FRAME_FORCE); + + /** + * \chinese + * 设置力控动力学模型 + * + * @param env_stiff: 环境刚度,表示为接触轴方向上的工件刚度,取值范围[0, 1],默认为0 + * @param damp_scale: 表征阻尼水平的参数,取值范围[0, 1],默认为0.5 + * @param stiff_scale: 表征软硬程度的参数,取值范围[0, 1],默认为0.5 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setDynamicModel1(self: pyaubo_sdk.ForceControl, arg0: List[float], + * arg1: List[float], arg2: List[float]) -> int + * + * @par Lua函数原型 + * setDynamicModel1(env_stiff: table, damp_scale: table, stiff_scale: + * table) -> nil + * + * @par Lua示例 + * setDynamicModel1({0,0,0,0,0,0},{0.5,0.5,0.5,0.5,0.5,0.5},{0.5,0.5,0.5,0.5,0.5,0.5}) + * + * \endchinese + * \english + * Set force control dynamics model + * + * @param env_stiff: Environment stiffness, representing the workpiece stiffness in the contact axis direction, range [0, 1], default 0 + * @param damp_scale: Parameter representing damping level, range [0, 1], default 0.5 + * @param stiff_scale: Parameter representing stiffness level, range [0, 1], default 0.5 + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setDynamicModel1(self: pyaubo_sdk.ForceControl, arg0: List[float], + * arg1: List[float], arg2: List[float]) -> int + * + * @par Lua Function Prototype + * setDynamicModel1(env_stiff: table, damp_scale: table, stiff_scale: + * table) -> nil + * + * @par Lua example + * setDynamicModel1({0,0,0,0,0,0},{0.5,0.5,0.5,0.5,0.5,0.5},{0.5,0.5,0.5,0.5,0.5,0.5}) + * + * \endenglish + */ + int setDynamicModel1(const std::vector &env_stiff, + const std::vector &damp_scale, + const std::vector &stiff_scale); + + /** + * \chinese + * 计算力控动力学模型 + * + * @param env_stiff: 环境刚度,表示为接触轴方向上的工件刚度,取值范围[0, 1],默认为0 + * @param damp_scale: 表征阻尼水平的参数,取值范围[0, 1],默认为0.5 + * @param stiff_scale: 表征软硬程度的参数,取值范围[0, 1],默认为0.5 + * + * @return 力控动力学模型MDK + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * fcCalDynamicModel(self: pyaubo_sdk.ForceControl, arg0: List[float], + * arg1: List[float], arg2: List[float]) -> Tuple[List[float], List[float], List[float]] + * + * @par Lua函数原型 + * fcCalDynamicModel(env_stiff: table, damp_scale: table, stiff_scale: table) -> table + * + * @par Lua示例 + * fc_table = fcCalDynamicModel({0,0,0,0,0,0},{0.5,0.5,0.5,0.5,0.5,0.5},{0.5,0.5,0.5,0.5,0.5,0.5}) + * + * \endchinese + * \english + * Calculate force control dynamics model + * + * @param env_stiff: Environment stiffness, representing the workpiece stiffness in the contact axis direction, range [0, 1], default 0 + * @param damp_scale: Parameter representing damping level, range [0, 1], default 0.5 + * @param stiff_scale: Parameter representing stiffness level, range [0, 1], default 0.5 + * + * @return Force control dynamics model MDK + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * fcCalDynamicModel(self: pyaubo_sdk.ForceControl, arg0: List[float], + * arg1: List[float], arg2: List[float]) -> Tuple[List[float], List[float], List[float]] + * + * @par Lua Function Prototype + * fcCalDynamicModel(env_stiff: table, damp_scale: table, stiff_scale: table) -> table + * + * @par Lua example + * fc_table = fcCalDynamicModel({0,0,0,0,0,0},{0.5,0.5,0.5,0.5,0.5,0.5},{0.5,0.5,0.5,0.5,0.5,0.5}) + * + * \endenglish + */ + DynamicsModel fcCalDynamicModel(const std::vector &env_stiff, + const std::vector &damp_scale, + const std::vector &stiff_scale); + + /** + * \chinese + * 设置力控搜孔场景下的动力学模型 + * + * @param damp_scale: 表征阻尼水平的参数,取值范围[0, 1],默认为0.5 + * @param stiff_scale: 表征软硬程度的参数,取值范围[0, 1],默认为0.5 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setDynamicModelSearch(self: pyaubo_sdk.ForceControl, arg0: List[float], + * arg1: List[float]) -> int + * + * @par Lua函数原型 + * setDynamicModelSearch(damp_scale: table, stiff_scale: table) -> nil + * + * @par Lua示例 + * setDynamicModelSearch({0.5,0.5,0.5,0.5,0.5,0.5},{0.5,0.5,0.5,0.5,0.5,0.5}) + * + * \endchinese + * \english + * Set force control dynamics model for hole searching scenario + * + * @param damp_scale: Parameter representing damping level, range [0, 1], default 0.5 + * @param stiff_scale: Parameter representing stiffness level, range [0, 1], default 0.5 + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setDynamicModelSearch(self: pyaubo_sdk.ForceControl, arg0: List[float], + * arg1: List[float]) -> int + * + * @par Lua Function Prototype + * setDynamicModelSearch(damp_scale: table, stiff_scale: table) -> nil + * + * @par Lua example + * setDynamicModelSearch({0.5,0.5,0.5,0.5,0.5,0.5},{0.5,0.5,0.5,0.5,0.5,0.5}) + * + * \endenglish + */ + int setDynamicModelSearch(const std::vector &damp_scale, + const std::vector &stiff_scale); + + /** + * \chinese + * 设置力控插/拔孔场景下的动力学模型 + * + * @param damp_scale: 表征阻尼水平的参数,取值范围[0, 1],默认为0.5 + * @param stiff_scale: 表征软硬程度的参数,取值范围[0, 1],默认为0.5 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setDynamicModelInsert(self: pyaubo_sdk.ForceControl, arg0: List[float], + * arg1: List[float]) -> int + * + * @par Lua函数原型 + * setDynamicModelInsert(damp_scale: table, stiff_scale: table) -> nil + * + * @par Lua示例 + * setDynamicModelInsert({0.5,0.5,0.5,0.5,0.5,0.5},{0.5,0.5,0.5,0.5,0.5,0.5}) + * + * \endchinese + * \english + * Set force control dynamics model for insertion/extraction scenario + * + * @param damp_scale: Parameter representing damping level, range [0, 1], default 0.5 + * @param stiff_scale: Parameter representing stiffness level, range [0, 1], default 0.5 + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setDynamicModelInsert(self: pyaubo_sdk.ForceControl, arg0: List[float], + * arg1: List[float]) -> int + * + * @par Lua Function Prototype + * setDynamicModelInsert(damp_scale: table, stiff_scale: table) -> nil + * + * @par Lua example + * setDynamicModelInsert({0.5,0.5,0.5,0.5,0.5,0.5},{0.5,0.5,0.5,0.5,0.5,0.5}) + * + * \endenglish + */ + int setDynamicModelInsert(const std::vector &damp_scale, + const std::vector &stiff_scale); + /** + * \chinese + * 设置力控接触场景下的动力学模型 + * + * @param env_stiff: 表征环境刚度的参数,取值范围[0, 1],默认为0 + * @param damp_scale: 表征阻尼水平的参数,取值范围[0, 1],默认为0.5 + * @param stiff_scale: 表征软硬程度的参数,取值范围[0, 1],默认为0.5 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setDynamicModelContact(self: pyaubo_sdk.ForceControl, arg0: List[float], + * arg1: List[float], arg2: List[float]) -> int + * + * @par Lua函数原型 + * setDynamicModelContact(env_stiff: table, damp_scale: table, stiff_scale: + * table) -> nil + * + * @par Lua示例 + * setDynamicModelContact({0,0,0,0,0,0},{0.5,0.5,0.5,0.5,0.5,0.5},{0.5,0.5,0.5,0.5,0.5,0.5}) + * + * \endchinese + * \english + * Set force control dynamics model for contact scenario + * + * @param env_stiff: Parameter representing environment stiffness, range [0, 1], default 0 + * @param damp_scale: Parameter representing damping level, range [0, 1], default 0.5 + * @param stiff_scale: Parameter representing stiffness level, range [0, 1], default 0.5 + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setDynamicModelContact(self: pyaubo_sdk.ForceControl, arg0: List[float], + * arg1: List[float], arg2: List[float]) -> int + * + * @par Lua Function Prototype + * setDynamicModelContact(env_stiff: table, damp_scale: table, stiff_scale: + * table) -> nil + * + * @par Lua example + * setDynamicModelContact({0,0,0,0,0,0},{0.5,0.5,0.5,0.5,0.5,0.5},{0.5,0.5,0.5,0.5,0.5,0.5}) + * + * \endenglish + */ + int setDynamicModelContact(const std::vector &env_stiff, + const std::vector &damp_scale, + const std::vector &stiff_scale); + + /** + * \chinese + * 设置力控动力学模型 + * + * @param m 质量参数 + * @param d 阻尼参数 + * @param k 刚度参数 + * + * 参数单位说明: + * - 质量: + * - 笛卡尔空间:单位为 kg,长度为工作空间维度(一般为6),顺序为 [x, y, z, Rx, Ry, Rz] + * - 关节空间:单位为 kg·m²,长度为机器人自由度(一般为6),顺序为 [J1, J2, J3, J4, J5, J6] + * - 阻尼: + * - 笛卡尔空间:单位为 N·s/m,顺序为 [x, y, z, Rx, Ry, Rz] + * - 关节空间:单位为 N·m·s/rad,顺序为 [J1, J2, J3, J4, J5, J6] + * - 刚度: + * - 笛卡尔空间:单位为 N/m,顺序为 [x, y, z, Rx, Ry, Rz] + * - 关节空间:单位为 N·m/rad,顺序为 [J1, J2, J3, J4, J5, J6] + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setDynamicModel(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * List[float], arg2: List[float]) -> int + * + * @par Lua函数原型 + * setDynamicModel(m: table, d: table, k: table) -> nil + * + * @par Lua示例 + * setDynamicModel({20.0, 20.0, 20.0, 10.0, 10.0, 10.0},{2000, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0}) + * + * \endchinese + * \english + * Set force control dynamics model + * + * @param m Mass parameters + * @param d Damping parameters + * @param k Stiffness parameters + * + * Parameter unit description: + * - Mass: + * - Cartesian space: unit is kg, length is 6, order is [x, y, z, Rx, Ry, Rz] + * - Joint space: unit is kg·m², length is 6, order is [J1, J2, J3, J4, J5, J6] + * - Damping: + * - Cartesian space: unit is N·s/m, order is [x, y, z, Rx, Ry, Rz] + * - Joint space: unit is N·m·s/rad, order is [J1, J2, J3, J4, J5, J6] + * - Stiffness: + * - Cartesian space: unit is N/m, order is [x, y, z, Rx, Ry, Rz] + * - Joint space: unit is N·m/rad, order is [J1, J2, J3, J4, J5, J6] + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setDynamicModel(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * List[float], arg2: List[float]) -> int + * + * @par Lua Function Prototype + * setDynamicModel(m: table, d: table, k: table) -> nil + * + * @par Lua example + * setDynamicModel({20.0, 20.0, 20.0, 10.0, 10.0, 10.0},{2000, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0}) + * + * \endenglish + */ + int setDynamicModel(const std::vector &m, + const std::vector &d, + const std::vector &k); + + /** + * \chinese + * 设置力控阈值 + * + * @param thresholds: 力控阈值 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * fcSetSensorThresholds(self: pyaubo_sdk.ForceControl, arg0: + * List[float]) -> int + * + * @par Lua函数原型 + * fcSetSensorThresholds(thresholds: table) -> nil + * + * @par Lua示例 + * fcSetSensorThresholds({1.0,1.0,1.0,0.5,0.5,0.5}) + * + * \endch + * \endchinese + * \english + * Set force control thresholds + * + * @param thresholds: Force control thresholds + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * fcSetSensorThresholds(self: pyaubo_sdk.ForceControl, arg0: + * List[float]) -> int + * + * @par Lua Function Prototype + * fcSetSensorThresholds(thresholds: table) -> nil + * + * @par Lua example + * fcSetSensorThresholds({1.0,1.0,1.0,0.5,0.5,0.5}) + * + * \endenglish + */ + int fcSetSensorThresholds(const std::vector &thresholds); + + /** + * \chinese + * 设置力控最大受力限制 + * + * @param limits: 力限制 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * fcSetSensorLimits(self: pyaubo_sdk.ForceControl, arg0: + * List[float]) -> int + * + * @par Lua函数原型 + * fcSetSensorLimits(limits: table) -> nil + * + * @par Lua示例 + * fcSetSensorLimits({200.0,200.0,200.0,50.0,50.0,50.0}) + * + * \endchinese + * \english + * Set force control maximum force limits + * + * @param limits: Force limits + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * fcSetSensorLimits(self: pyaubo_sdk.ForceControl, arg0: + * List[float]) -> int + * + * @par Lua Function Prototype + * fcSetSensorLimits(limits: table) -> nil + * + * @par Lua example + * fcSetSensorLimits({200.0,200.0,200.0,50.0,50.0,50.0}) + * + * \endenglish + */ + int fcSetSensorLimits(const std::vector &limits); + + /** + * \chinese + * 获取力控阈值 + * + * @return 力控最小力阈值 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getFcSensorThresholds(self: pyaubo_sdk.ForceControl) -> list + * + * @par Lua函数原型 + * getFcSensorThresholds() -> table + * + * @par Lua函数示例 + * Fc_Thresholds = getFcSensorThresholds() + * + * \endchinese + * \english + * Get force control thresholds + * + * @return Minimum force control thresholds + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * getFcSensorThresholds(self: pyaubo_sdk.ForceControl) -> list + * + * @par Lua Function Prototype + * getFcSensorThresholds() -> table + * + * @par Lua example + * Fc_Thresholds = getFcSensorThresholds() + * + * \endenglish + */ + std::vector getFcSensorThresholds(); + + /** + * \chinese + * 获取最大力限制 + * + * @return 力控最大力限制 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getFcSensorLimits(self: pyaubo_sdk.ForceControl) -> list + * + * @par Lua函数原型 + * getFcSensorLimits() -> table + * + * @par Lua示例 + * Fc_Limits = getFcSensorLimits() + * + * \endchinese + * \english + * Get maximum force limits + * + * @return Force control maximum force limits + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * getFcSensorLimits(self: pyaubo_sdk.ForceControl) -> list + * + * @par Lua Function Prototype + * getFcSensorLimits() -> table + * + * @par Lua example + * Fc_Limits = getFcSensorLimits() + * + * \endenglish + */ + std::vector getFcSensorLimits(); + + /** + * \chinese + * 获取力控动力学模型 + * + * @return 力控动力学模型 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getDynamicModel(self: pyaubo_sdk.ForceControl) -> Tuple[List[float], + * List[float], List[float]] + * + * @par Lua函数原型 + * getDynamicModel() -> table + * + * @par Lua示例 + * Fc_Model = getDynamicModel() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.ForceControl.getDynamicModel","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[[],[20.0,20.0,20.0,5.0,5.0,5.0],[]]} + * \endchinese + * \english + * Get force control dynamics model + * + * @return Force control dynamics model + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * getDynamicModel(self: pyaubo_sdk.ForceControl) -> Tuple[List[float], + * List[float], List[float]] + * + * @par Lua Function Prototype + * getDynamicModel() -> table + * + * @par Lua example + * Fc_Model = getDynamicModel() + * + * @par JSON-RPC Request example + * {"jsonrpc":"2.0","method":"rob1.ForceControl.getDynamicModel","params":[],"id":1} + * + * @par JSON-RPC Response example + * {"id":1,"jsonrpc":"2.0","result":[[],[20.0,20.0,20.0,5.0,5.0,5.0],[]]} + * \endenglish + */ + DynamicsModel getDynamicModel(); + + /** + * \chinese + * 设置力控终止条件:力,当测量的力在设置的范围之内,力控算法将保持运行,直到设置的条件不满足,力控将退出 + * + * The condition is lateractivated by calling the instruction + * FCCondWaitWhile, which will wait and hold the program execution while the + * specified condition is true. This allows the reference force, torque and + * movement to continue until the force is outside the specified limits. + * + * A force condition is set up by defining minimum and maximum limits for + * the force in the directions of the force control coordinate system. Once + * activated with FCCondWaitWhile, the program execution will continue to + * wait while the measured force is within its specified limits. + * + * It is possible to specify that the condition is fulfilled when the force + * is outside the specified limits instead. This is done by using the switch + * argument Outside. The condition on force is specified in the force + * control coordinate system. This coordinate system is setup by the user in + * the instruction FCAct. + * + * @param min 各方向最小的力/力矩 + * @param max 各方向最大的力/力矩 + * @param outside false 在设置条件的范围之内有效 + * true 在设置条件的范围之外有效 + * @param timeout + * 时间限制,单位s(秒),从开始力控到达该时间时,不管是否满足力控终止条件,都会终止力控 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setCondForce(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * List[float], arg2: bool, arg3: float) -> int + * + * @par Lua函数原型 + * setCondForce(min: table, max: table, outside: boolean, timeout: number) + * -> nil + * @par Lua示例 + * setCondForce({0.1,0.1,0.1,0.1,0.1,0.1},{50,50,50,5,5,5},{true,true,true,true,true,true},10) + * + * \endchinese + * \english + * Set force control termination condition: Force. When the measured force is within + * the specified range, the force control algorithm will continue to run until the set + * condition is not met, at which point force control will exit. + * + * The condition is lateractivated by calling the instruction + * FCCondWaitWhile, which will wait and hold the program execution while the + * specified condition is true. This allows the reference force, torque and + * movement to continue until the force is outside the specified limits. + * + * A force condition is set up by defining minimum and maximum limits for + * the force in the directions of the force control coordinate system. Once + * activated with FCCondWaitWhile, the program execution will continue to + * wait while the measured force is within its specified limits. + * + * It is possible to specify that the condition is fulfilled when the force + * is outside the specified limits instead. This is done by using the switch + * argument Outside. The condition on force is specified in the force + * control coordinate system. This coordinate system is setup by the user in + * the instruction FCAct. + * + * @param min Minimum force/torque in each direction + * @param max Maximum force/torque in each direction + * @param outside false: valid within the specified range + * true: valid outside the specified range + * @param timeout + * Time limit in seconds; when this time is reached from the start of force control, + * force control will terminate regardless of whether the end condition is met + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setCondForce(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * List[float], arg2: bool, arg3: float) -> int + * + * @par Lua Function Prototype + * setCondForce(min: table, max: table, outside: boolean, timeout: number) + * -> nil + * @par Lua example + * setCondForce({0.1,0.1,0.1,0.1,0.1,0.1},{50,50,50,5,5,5},{true,true,true,true,true,true},10) + * + * \endenglish + */ + int setCondForce(const std::vector &min, + const std::vector &max, bool outside, + double timeout); + + /** + * \chinese + * 设置力控终止条件:姿态,当测量的姿态在设置的范围之内,力控算法将保持运行,直到设置的条件不满足,力控将退出. + * + * setCondOrient is used to set up an end condition for the tool orientation. + * The condition is lateractivated by calling the instruction + * FCCondWaitWhile, which will wait and hold the program execution while the + * specified condition is true. This allows the reference force, torque and + * movement to continue until the orientation is outside the specified + * limits. + * + * An orientation condition is set up by defining a maximum angle and a + * maximum rotation from a reference orientation. The reference orientation + * is either defined by the current z direction of the tool, or by + * specifying an orientation in relation to the z direction of the work + * object. + * + * Once activated, the tool orientation must be within the limits (or + * outside, if the argument Outside is used). + * + * @param frame + * @param max_angle + * @param max_rot + * @param outside + * @param timeout + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setCondOrient(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * float, arg2: float, arg3: bool, arg4: float) -> int + * + * @par Lua函数原型 + * setCondOrient(frame: table, max_angle: number, max_rot: number, outside: + * boolean, timeout: number) -> nil + * + * @par Lua示例 + * setCondOrient({0.1, 0.3, 0.1, 0.3142, 0.0, 1.571},30.0,20.0,true,10.0) + * + * \endchinese + * + * \english + * setCondOrient is used to set up an end condition for the tool orientation. + * The condition will wait and hold the program execution while the + * specified condition is true. This allows the reference force, torque and + * movement to continue until the orientation is outside the specified + * limits. + * + * An orientation condition is set up by defining a maximum angle and a + * maximum rotation from a reference orientation. The reference orientation + * is either defined by the current z direction of the tool, or by + * specifying an orientation in relation to the z direction of the work + * object. + * + * Once activated, the tool orientation must be within the limits (or + * outside, if the argument Outside is used). + * + * @param frame + * @param max_angle + * @param max_rot + * @param outside + * @param timeout + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setCondOrient(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * float, arg2: float, arg3: bool, arg4: float) -> int + * + * @par Lua Function Prototype + * setCondOrient(frame: table, max_angle: number, max_rot: number, outside: + * boolean, timeout: number) -> nil + * + * @par Lua example + * setCondOrient({0.1, 0.3, 0.1, 0.3142, 0.0, 1.571},30.0,20.0,true,10.0) + * + * \endenglish + */ + int setCondOrient(const std::vector &frame, double max_angle, + double max_rot, bool outside, double timeout); + + /** + * \chinese + * 指定力控有效平面,x-y平面,z方向有效 + * + * @param plane={A,B,C,D} + * 平面表示方法 Ax +By +Cz + D = 0 + * 其中,n = (A, B, C)是平面的法向量, + * D 是将平面平移到坐标原点所需距离(所以D=0时,平面过原点) + * @param timeout + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setCondPlane(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * float) -> int + * + * @par Lua函数原型 + * setCondPlane(plane: table, timeout: number) -> nil + * + * @par Lua示例 + * setCondPlane({0.1, 0.3, 0.1, 0.3},10.0) + * + * \endchinese + * \english + * Specify a valid force control plane, x-y plane, z direction is valid + * + * @param plane={A,B,C,D} + * Plane equation: Ax + By + Cz + D = 0 + * where n = (A, B, C) is the normal vector of the plane, + * D is the distance required to move the plane to the origin (so D=0 means the plane passes through the origin) + * @param timeout + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setCondPlane(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * float) -> int + * + * @par Lua Function Prototype + * setCondPlane(plane: table, timeout: number) -> nil + * + * @par Lua example + * setCondPlane({0.1, 0.3, 0.1, 0.3},10.0) + * + * \endenglish + */ + int setCondPlane(const std::vector &plane, double timeout); + + /** + * \chinese + * 指定力控有效圆柱体,提供中心轴和圆柱半径,可以指定圆柱内部还是外部 + * + * @param axis + * @param radius + * @param outside + * @param timeout + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setCondCylinder(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * float, arg2: bool, arg3: float) -> int + * + * @par Lua函数原型 + * setCondCylinder(axis: table, radius: number, outside: boolean, timeout: + * number) -> nil + * + * @par Lua示例 + * setCondCylinder({0,1,0},10.0,true,5,0) + * + * \endchinese + * \english + * Specify a valid force control cylinder by providing the central axis and cylinder radius, and specify whether the inside or outside of the cylinder is valid. + * + * @param axis + * @param radius + * @param outside + * @param timeout + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setCondCylinder(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * float, arg2: bool, arg3: float) -> int + * + * @par Lua Function Prototype + * setCondCylinder(axis: table, radius: number, outside: boolean, timeout: + * number) -> nil + * + * @par Lua example + * setCondCylinder({0,1,0},10.0,true,5,0) + * + * \endenglish + */ + int setCondCylinder(const std::vector &axis, double radius, + bool outside, double timeout); + + /** + * \chinese + * 指定力控有效球体,提供球心和半径,可以指定球体内部还是外部 + * + * @param center + * @param radius + * @param outside + * @param timeout + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setCondSphere(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * float, arg2: bool, arg3: float) -> int + * + * @par Lua函数原型 + * setCondSphere(center: table, radius: number, outside: boolean, timeout: + * number) -> nil + * + * @par Lua示例 + * setCondSphere({0.2, 0.5, 0.1, 1.57, 0, 0},10.0,true,5,0) + * + * \endchinese + * \english + * Specify a valid force control sphere by providing the center and radius, and specify whether the inside or outside of the sphere is valid. + * + * @param center + * @param radius + * @param outside + * @param timeout + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setCondSphere(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * float, arg2: bool, arg3: float) -> int + * + * @par Lua Function Prototype + * setCondSphere(center: table, radius: number, outside: boolean, timeout: + * number) -> nil + * + * @par Lua example + * setCondSphere({0.2, 0.5, 0.1, 1.57, 0, 0},10.0,true,5,0) + * + * \endenglish + */ + int setCondSphere(const std::vector ¢er, double radius, + bool outside, double timeout); + + /** + * \chinese + * 设置TCP速度的终止条件。该条件可通过调用FCCondWaitWhile指令激活, + * 在指定条件为真时,程序将等待并保持执行。这样可以使参考力、力矩和运动继续, + * 直到速度超出指定范围。 + * + * 通过定义TCP在工作对象所有方向上的最小和最大速度限制来设置TCP速度条件。 + * 一旦通过FCCondWaitWhile激活,程序将在测量速度处于指定范围内时继续等待。 + * + * 也可以指定当速度超出指定范围时条件成立,通过使用outside参数实现。 + * TCP速度条件在工作对象坐标系中指定。 + * + * @param min 最小速度 + * @param max 最大速度 + * @param outside 是否在范围外有效 + * @param timeout 超时时间 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setCondTcpSpeed(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * List[float], arg2: bool, arg3: float) -> int + * + * @par Lua函数原型 + * setCondTcpSpeed(min: table, max: table, outside: boolean, timeout: + * number) -> nil + * + * @par Lua示例 + * setCondTcpSpeed({0.2, 0.2, 0.2, 0.2, 0.2, 0.2},{1.2, 1.2, 1.2, 1.2, 1.2, 1.2},true,5,0) + * + * \endchinese + * \english + * setCondTcpSpeed is used to setup an end condition for the TCP speed. The + * condition is later activated by calling the instruction FCCondWaitWhile, + * which will wait and hold the program execution while the specified + * condition is true. This allows the reference force, torque and movement + * to continue until the speed is outside the specified limits. + * + * A TCP speed condition is set up by defining minimum and maximum limits + * for the TCP speed in all directions of the work object. Once activated + * with FCCondWaitWhile, the program execution will continue to wait while + * the measured speed is within its specified limits. + * + * It is possible to specify that the condition is fulfilled when the speed + * is outside the specified limits instead. This is done by using the + * switch argument Outside. The condition on TCP speed is specified in the + * work object coordinate system. + * + * @param min + * @param max + * @param outside + * @param timeout + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setCondTcpSpeed(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * List[float], arg2: bool, arg3: float) -> int + * + * @par Lua Function Prototype + * setCondTcpSpeed(min: table, max: table, outside: boolean, timeout: + * number) -> nil + * + * @par Lua example + * setCondTcpSpeed({0.2, 0.2, 0.2, 0.2, 0.2, 0.2},{1.2, 1.2, 1.2, 1.2, 1.2, 1.2},true,5,0) + * + * \endenglish + */ + int setCondTcpSpeed(const std::vector &min, + const std::vector &max, bool outside, + double timeout); + + /** + * \chinese + * 力控终止条件-距离 + * + * @param distance 距离 + * @param timeout 超时时间 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Lua函数原型 + * setCondDistance(distance: number, timeout: number) + * + * @par Lua示例 + * setCondDistance(0.2, 10.0) + * + * \endchinese + * \english + * Force control termination condition - distance + * + * @param distance Distance + * @param timeout Timeout + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Lua Function Prototype + * setCondDistance(distance: number, timeout: number) + * + * @par Lua example + * setCondDistance(0.2, 10.0) + * + * \endenglish + */ + int setCondDistance(double distance, double timeout); + + /** + * \chinese + * 高级力控终止条件 + * + * @param type 类型 + * @param args 参数 + * @param timeout 超时时间 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Lua函数原型 + * setCondAdvanced(type: number, args: table, timeout: number) + * + * @par Lua示例 + * setCondAdvanced(1, {0,1,0,0,0,0},10) + * + * \endchinese + * \english + * Advanced force control termination condition + * + * @param type Type + * @param args Arguments + * @param timeout Timeout + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Lua Function Prototype + * setCondAdvanced(type: number, args: table, timeout: number) + * + * @par Lua example + * setCondAdvanced(1, {0,1,0,0,0,0},10) + * + * \endenglish + */ + int setCondAdvanced(const std::string &type, + const std::vector &args, double timeout); + + /** + * \chinese + * 激活力控终止条件 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setCondActive(self: pyaubo_sdk.ForceControl) -> int + * + * @par Lua函数原型 + * setCondActive() -> nil + * + * @par Lua示例 + * setCondActive() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.ForceControl.setCondActive","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Activate force control termination condition + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setCondActive(self: pyaubo_sdk.ForceControl) -> int + * + * @par Lua Function Prototype + * setCondActive() -> nil + * + * @par Lua example + * setCondActive() + * + * @par JSON-RPC Request example + * {"jsonrpc":"2.0","method":"rob1.ForceControl.setCondActive","params":[],"id":1} + * + * @par JSON-RPC Response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setCondActive(); + + /** + * \chinese + * 力控终止条件是否已经满足 + * + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * isCondFullfiled(self: pyaubo_sdk.ForceControl) -> bool + * + * @par Lua函数原型 + * isCondFullfiled() -> boolean + * + * @par Lua示例 + * status = isCondFullfiled() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.ForceControl.isCondFullfiled","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * \endchinese + * \english + * Check if the force control termination condition has been fulfilled + * + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * isCondFullfiled(self: pyaubo_sdk.ForceControl) -> bool + * + * @par Lua Function Prototype + * isCondFullfiled() -> boolean + * + * @par Lua example + * status = isCondFullfiled() + * + * @par JSON-RPC Request example + * {"jsonrpc":"2.0","method":"rob1.ForceControl.isCondFullfiled","params":[],"id":1} + * + * @par JSON-RPC Response example + * {"id":1,"jsonrpc":"2.0","result":false} + * \endenglish + */ + bool isCondFullfiled(); + + /** + * \chinese + * setSupvForce 用于在力控中设置力监督。监督在通过 FCAct 指令激活力控时被激活。 + * + * 力监督通过在力控坐标系的各个方向上定义最小和最大力限制来设置。 + * 一旦激活,如果力超出允许的范围,监督将停止执行。力监督在力控坐标系中指定。 + * 该坐标系由用户通过 FCAct 指令设置。 + * + * @param min 最小力限制 + * @param max 最大力限制 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setSupvForce(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * List[float]) -> int + * + * @par Lua函数原型 + * setSupvForce(min: table, max: table) -> nil + * + * @par Lua示例 + * setSupvForce({0.1 ,0.1 ,0.1 ,0.1 ,0.1 ,0.1}, {10.0 ,10.0 ,10.0 ,10.0 ,10.0 ,10.0}) + * + * \endchinese + * \english + * setSupvForce is used to set up force supervision in Force Control. The + * supervision is activated when Force Control is activated with the + * instruction FCAct. + * + * The force supervision is set up by defining minimum and maximum limits + * for the force in the directions of the force control coordinate system. + * Once activated, the supervision will stop the execution if the force is + * outside the allowed values. The force supervision is specified in the + * force control coordinate system. This coordinate system is setup by the + * user with the instruction FCAct. + * + * @param min + * @param max + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setSupvForce(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * List[float]) -> int + * + * @par Lua Function Prototype + * setSupvForce(min: table, max: table) -> nil + * + * @par Lua example + * setSupvForce({0.1 ,0.1 ,0.1 ,0.1 ,0.1 ,0.1}, {10.0 ,10.0 ,10.0 ,10.0 ,10.0 ,10.0}) + * + * \endenglish + */ + int setSupvForce(const std::vector &min, + const std::vector &max); + + /** + * \chinese + * setSupvOrient 用于设置工具姿态的监督条件。 + * 当通过 FCAct 指令激活力控时,监督条件被激活。 + * + * 姿态监督通过定义相对于参考姿态的最大角度和最大旋转来设置。 + * 参考姿态可以由工具当前的z方向定义,也可以通过指定相对于工作对象z方向的姿态来定义。 + * + * 一旦激活,工具姿态必须在限制范围内,否则监督将停止执行。 + * + * @param frame + * @param max_angle + * @param max_rot + * @param outside + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setSupvOrient(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * float, arg2: float, arg3: bool) -> int + * + * @par Lua函数原型 + * setSupvOrient(frame: table, max_angle: number, max_rot: number, + * outside: boolean) -> nil + * \endchinese + * \english + * setSupvOrient is used to set up an supervision for the tool orientation. + * The supervision is activated when Force Control is activated with the + * instruction FCAct. + * + * An orientation supervision is set up by defining a maximum angle and a + * maximum rotation from a reference orientation. The reference orientation + * is either defined by the current z direction of the tool, or by + * specifying an orientation in relation to the z direction of the work + * object. + * + * Once activated, the tool orientation must be within the limits otherwise + * the supervision will stop the execution. + * + * @param frame + * @param max_angle + * @param max_rot + * @param outside + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setSupvOrient(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * float, arg2: float, arg3: bool) -> int + * + * @par Lua Function Prototype + * setSupvOrient(frame: table, max_angle: number, max_rot: number, + * outside: boolean) -> nil + * \endenglish + */ + int setSupvOrient(const std::vector &frame, double max_angle, + double max_rot, bool outside); + + /** + * \chinese + * setSupvPosBox 用于在力控中设置位置监督。监督在通过 FCAct 指令激活力控时被激活。 + * 位置监督通过为TCP定义空间体积来设置。一旦激活,如果TCP超出该体积,监督将停止执行。 + * + * @param frame + * @param box + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setSupvPosBox(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * List[float[6]]) -> int + * + * @par Lua函数原型 + * setSupvPosBox(frame: table, box: table) -> nil + * \endchinese + * \english + * setSupvPosBox is used to set up position supervision in Force Control. + * Supervision is activated when Force Control is activated with the + * instruction FCAct. Position supervision is set up by defining a volume in + * space for the TCP. Once activated, the supervision will stop the + * execution if the TCP is outside this volume. + * + * @param frame + * @param box + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setSupvPosBox(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * List[float[6]]) -> int + * + * @par Lua Function Prototype + * setSupvPosBox(frame: table, box: table) -> nil + * \endenglish + */ + int setSupvPosBox(const std::vector &frame, const Box &box); + + /** + * \chinese + * + * @param frame + * @param cylinder + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setSupvPosCylinder(self: pyaubo_sdk.ForceControl, arg0: List[float], + * arg1: List[float[5]]) -> int + * + * @par Lua函数原型 + * setSupvPosCylinder(frame: table, cylinder: table) -> nil + * + * \endchinese + * \english + * + * @param frame + * @param cylinder + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setSupvPosCylinder(self: pyaubo_sdk.ForceControl, arg0: List[float], + * arg1: List[float[5]]) -> int + * + * @par Lua Function Prototype + * setSupvPosCylinder(frame: table, cylinder: table) -> nil + * + * \endenglish + */ + int setSupvPosCylinder(const std::vector &frame, + const Cylinder &cylinder); + + /** + * \chinese + * + * @param frame + * @param sphere + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setSupvPosSphere(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * List[float[3]]) -> int + * + * @par Lua函数原型 + * setSupvPosSphere(frame: table, sphere: table) -> nil + * + * \endchinese + * \english + * + * @param frame + * @param sphere + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setSupvPosSphere(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * List[float[3]]) -> int + * + * @par Lua Function Prototype + * setSupvPosSphere(frame: table, sphere: table) -> nil + * + * \endenglish + */ + int setSupvPosSphere(const std::vector &frame, + const Sphere &sphere); + + /** + * \chinese + * setSupvReoriSpeed 用于在力控中设置重新定向速度监督。监督在通过 FCAct 指令激活力控时被激活。 + * + * 重新定向速度监督通过定义工作对象坐标系轴周围重新定向速度的最小和最大限制来设置。 + * 一旦激活,如果重新定向速度的值过高,监督将停止执行。 + * + * 有两种速度监督:FCSupvReoriSpeed 和 FCSupvTCPSpeed,后者在第199页的 FCSupvTCPSpeed 部分有描述。 + * 可能需要两种监督,因为: + * - 机器人轴可以在 TCP 静止时高速旋转。 + * - 当 TCP 距离旋转轴较远时,轴的微小旋转可能导致 TCP 的高速运动。 + * + * @param speed_limit 速度限制 + * @param outside 是否在范围外有效 + * @param timeout 超时时间 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setSupvReoriSpeed(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: bool, arg2: float) -> int + * + * @par Lua函数原型 + * setSupvReoriSpeed(speed_limit: table, outside: boolean, timeout: number) -> nil + * \endchinese + * \english + * setSupvReoriSpeed is used to set up reorientation speed supervision in Force Control. The supervision is activated when Force Control is activated with the instruction FCAct. + * + * The reorientation speed supervision is set up by defining minimum and maximum limits for the reorientation speed around the axis of the work object coordinate system. Once activated, the supervision will stop the execution if the values of the reorientation speed are too high. + * + * There are two speed supervisions: FCSupvReoriSpeed and FCSupvTCPSpeed, which is described in section FCSupvTCPSpeed on page 199. + * Both supervisions may be required because: + * - A robot axis can rotate with high speed while the TCP is stationary. + * - The TCP can be far from the rotating axis and a small axis rotation may result in a high speed movement of the TCP. + * + * @param speed_limit + * @param outside + * @param timeout + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setSupvReoriSpeed(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: bool, arg2: float) -> int + * + * @par Lua Function Prototype + * setSupvReoriSpeed(speed_limit: table, outside: boolean, timeout: number) -> nil + * \endenglish + */ + int setSupvReoriSpeed(const std::vector &speed_limit, bool outside, + double timeout); + + /** + * \chinese + * setSupvTcpSpeed 用于在力控中设置TCP速度监督。监督在通过 FCAct 指令激活力控时被激活。 + * TCP速度监督通过定义工作对象坐标系各方向上的最小和最大速度限制来设置。 + * 一旦激活,如果检测到过高的TCP速度值,监督将停止执行。 + * + * 有两种速度监督:FCSupvTCPSpeed 和 FCSupvReoriSpeed,后者在第197页的 FCSupvReoriSpeed 部分有描述。 + * + * 可能需要两种监督,因为: + * - 机器人轴可以在TCP静止时高速旋转。 + * - 当TCP距离旋转轴较远时,轴的微小旋转可能导致TCP的高速运动。 + * + * @param speed_limit 速度限制 + * @param outside 是否在范围外有效 + * @param timeout 超时时间 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setSupvTcpSpeed(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: bool, arg2: float) -> int + * + * @par Lua函数原型 + * setSupvTcpSpeed(speed_limit: table, outside: boolean, timeout: number) -> nil + * \endchinese + * \english + * setSupvTcpSpeed is used to set up TCP speed supervision in Force Control. + * The supervision is activated when Force Control is activated with the + * instruction FCAct. The TCP speed supervision is set up by defining + * minimum and maximum limits for the TCP speed in the directions of the + * work object coordinate system. Once activated, the supervision will stop + * the execution if too high TCP speed values are detected. + * + * There are two speed supervisions: FCSupvTCPSpeed and FCSupvReoriSpeed, + * which is described in section FCSupvReoriSpeed on page 197. + * + * Both supervisions may be required because: + * - A robot axis can rotate with high speed while the TCP is stationary. + * - The TCP can be far from the rotating axis and a small axis rotation may + * result in a high speed movement of the TCP. + * + * @param speed_limit + * @param outside + * @param timeout + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setSupvTcpSpeed(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: bool, arg2: float) -> int + * + * @par Lua Function Prototype + * setSupvTcpSpeed(speed_limit: table, outside: boolean, timeout: number) -> nil + * \endenglish + */ + int setSupvTcpSpeed(const std::vector &speed_limit, bool outside, + double timeout); + + // 设置低通滤波器 + // --- force frame filter: 过滤测量到的力/力矩 + // +++ force loop filter: 力控输出参考速度的滤波器 + + /** + * \chinese + * 设置低通滤波器 + * + * --- force frame filter: 过滤测量到的力/力矩 + * +++ force loop filter: 力控输出参考速度的滤波器 + * + * @param cutoff_freq 截止频率 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setLpFilter(self: pyaubo_sdk.ForceControl, arg0: List[float]) -> int + * + * @par Lua函数原型 + * setLpFilter(cutoff_freq: table) -> nil + * \endchinese + * \english + * Set low-pass filter + * + * --- force frame filter: filter measured force/torque + * +++ force loop filter: filter for force control output reference speed + * + * FCSetLPFilterTune is used to change the response of force loop according to + * the description in Damping and LP-filter on page 103. + * + * @param cutoff_freq Cutoff frequency + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setLpFilter(self: pyaubo_sdk.ForceControl, arg0: List[float]) -> int + * + * @par Lua Function Prototype + * setLpFilter(cutoff_freq: table) -> nil + * \endenglish + */ + int setLpFilter(const std::vector &cutoff_freq); + + /** + * \chinese + * 重置低通滤波器 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * resetLpFilter(self: pyaubo_sdk.ForceControl) -> int + * + * @par Lua函数原型 + * resetLpFilter() -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.ForceControl.resetLpFilter","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Reset low-pass filter + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * resetLpFilter(self: pyaubo_sdk.ForceControl) -> int + * + * @par Lua Function Prototype + * resetLpFilter() -> nil + * + * @par JSON-RPC Request example + * {"jsonrpc":"2.0","method":"rob1.ForceControl.resetLpFilter","params":[],"id":1} + * + * @par JSON-RPC Response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int resetLpFilter(); + + /** + * \chinese + * speedChangeEnable 用于激活 FC SpeedChange 功能,并设置期望的参考力和恢复行为。 + * 当 FC SpeedChange 功能被激活时,机器人速度会根据测量信号与参考值的接近程度自动降低或提高。 + * + * @param ref_force 参考力 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * speedChangeEnable(self: pyaubo_sdk.ForceControl, arg0: float) -> int + * + * @par Lua函数原型 + * speedChangeEnable(ref_force: number) -> nil + * \endchinese + * \english + * The speedChangeEnable is used to activate FC SpeedChange function with desired + * reference and recover behavior. When FC SpeedChange function is active, + * the robot speed will be reduced/increased in order to keep the measured + * signal close to the reference. + * + * @param ref_force + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * speedChangeEnable(self: pyaubo_sdk.ForceControl, arg0: float) -> int + * + * @par Lua Function Prototype + * speedChangeEnable(ref_force: number) -> nil + * \endenglish + */ + int speedChangeEnable(double ref_force); + + /** + * \chinese + * 停用 FC SpeedChange 功能。 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * speedChangeDisable(self: pyaubo_sdk.ForceControl) -> int + * + * @par Lua函数原型 + * speedChangeDisable() -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.ForceControl.speedChangeDisable","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Deactivate FC SpeedChange function. + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * speedChangeDisable(self: pyaubo_sdk.ForceControl) -> int + * + * @par Lua Function Prototype + * speedChangeDisable() -> nil + * + * @par JSON-RPC Request example + * {"jsonrpc":"2.0","method":"rob1.ForceControl.speedChangeDisable","params":[],"id":1} + * + * @par JSON-RPC Response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int speedChangeDisable(); + + /** + * \chinese + * speedChangeTune 用于将 FC SpeedChange 系统参数设置为新值。 + * + * @param speed_levels 速度级别 + * @param speed_ratio_min 最小速度比例 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * speedChangeTune(self: pyaubo_sdk.ForceControl, arg0: int, arg1: float) -> int + * + * @par Lua函数原型 + * speedChangeTune(speed_levels: number, speed_ratio_min: number) -> nil + * \endchinese + * \english + * speedChangeTune is used to set FC SpeedChange system parameters to a new value. + * + * @param speed_levels + * @param speed_ratio_min + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * speedChangeTune(self: pyaubo_sdk.ForceControl, arg0: int, arg1: float) -> int + * + * @par Lua Function Prototype + * speedChangeTune(speed_levels: number, speed_ratio_min: number) -> nil + * \endenglish + */ + int speedChangeTune(int speed_levels, double speed_ratio_min); + + /* Defines how many Newtons are required to make the robot move 1 m/s. The + higher the value, the less responsive the robot gets. + The damping can be tuned (as a percentage of the system parameter values) + by the RAPID instruction FCAct. */ + // 设置阻尼系数,阻尼的系统参数需要通过配置文件设置 + // [damping_fx, damping_fy, damping_fz, damping_tx, damping_ty, damping_tz] + // A value between min and 10,000,000 Ns/m. + // A value between minimum and 10,000,000 Nms/rad. + + /** + * \chinese + * setDamping 用于在力控坐标系中调整阻尼。可调参数包括扭矩x方向到扭矩z方向的阻尼(见第255页)以及力x方向到力z方向的阻尼(见第254页)。 + * + * 阻尼可以通过配置文件或FCAct指令设置。不同之处在于本指令可在力控激活时使用。FCSetDampingTune调整的是FCAct指令设置的实际值,而不是配置文件中的值。 + * + * @param damping 阻尼参数 + * @param ramp_time 斜坡时间 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setDamping(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: float) -> int + * + * @par Lua函数原型 + * setDamping(damping: table, ramp_time: number) -> nil + * \endchinese + * \english + * setDamping is used to tune the damping in the force control coordinate systems. The parameters tuned are those described in Damping in Torque x Direction - Damping in Torque z Direction on page 255 and Damping in Force x Direction - Damping in Force z Direction on page 254. + * + * Damping can be set in the configuration file or by the instruction FCAct. The difference is that this instruction can be used when force control is active. FCSetDampingTune tunes the actual values set by the instruction FCAct, not the value in the configuration file. + * + * @param damping + * @param ramp_time + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setDamping(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: float) -> int + * + * @par Lua Function Prototype + * setDamping(damping: table, ramp_time: number) -> nil + * \endenglish + */ + int setDamping(const std::vector &damping, double ramp_time); + + /** + * \chinese + * 重置阻尼参数 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * resetDamping(self: pyaubo_sdk.ForceControl) -> int + * + * @par Lua函数原型 + * resetDamping() -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.ForceControl.resetDamping","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Reset damping parameters + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * resetDamping(self: pyaubo_sdk.ForceControl) -> int + * + * @par Lua Function Prototype + * resetDamping() -> nil + * + * @par JSON-RPC Request example + * {"jsonrpc":"2.0","method":"rob1.ForceControl.resetDamping","params":[],"id":1} + * + * @par JSON-RPC Response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int resetDamping(); + + /** + * \chinese + * 启用软浮动功能。 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.ForceControl.softFloatEnable","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Enable soft float function. + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC Request example + * {"jsonrpc":"2.0","method":"rob1.ForceControl.softFloatEnable","params":[],"id":1} + * + * @par JSON-RPC Response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int softFloatEnable(); + + /** + * \chinese + * 停用软浮动功能。 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.ForceControl.softFloatDisable","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":-1} + * \endchinese + * \english + * Disable soft float function. + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC Request example + * {"jsonrpc":"2.0","method":"rob1.ForceControl.softFloatDisable","params":[],"id":1} + * + * @par JSON-RPC Response example + * {"id":1,"jsonrpc":"2.0","result":-1} + * \endenglish + */ + int softFloatDisable(); + + /** + * \chinese + * 返回是否开启了软浮动 + * + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.ForceControl.isSoftFloatEnabled","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * \endchinese + * \english + * Returns whether soft float is enabled + * + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC Request example + * {"jsonrpc":"2.0","method":"rob1.ForceControl.isSoftFloatEnabled","params":[],"id":1} + * + * @par JSON-RPC Response example + * {"id":1,"jsonrpc":"2.0","result":false} + * \endenglish + */ + bool isSoftFloatEnabled(); + + /** + * \chinese + * 设置软浮动参数 + * + * @param joint_softfloat 是否在关节空间启用软浮动 + * @param select 选择哪些自由度启用软浮动 + * @param stiff_percent 刚度百分比 + * @param stiff_damp_ratio 刚度阻尼比 + * @param force_threshold 力阈值 + * @param force_limit 力限制 + * @return 返回0表示成功,其他为错误码 + * \endchinese + * \english + * Set soft float parameters + * + * @param joint_softfloat Whether to enable soft float in joint space + * @param select Select which degrees of freedom to enable soft float + * @param stiff_percent Stiffness percentage + * @param stiff_damp_ratio Stiffness damping ratio + * @param force_threshold Force threshold + * @param force_limit Force limit + * @return Return 0 if succeeded, otherwise error code + * \endenglish + */ + int setSoftFloatParams(bool joint_space, const std::vector &select, + const std::vector &stiff_percent, + const std::vector &stiff_damp_ratio, + const std::vector &force_threshold, + const std::vector &force_limit); + + /** + * \chinese + * 检测工具和外部物体的接触 + * + * @param direction + * 预期的接触方向,如果所有的元素为0,表示检测所有方向的接触 + * @return + * 返回从当前点回退到碰撞开始点的周期步数,如果返回值为0,表示没有接触 + * \endchinese + * \english + * Detect contact between the tool and external objects + * + * @param direction + * Expected contact direction. If all elements are 0, detect contact in all directions. + * @return + * Returns the number of cycle steps back from the current point to the collision start point. If the return value is 0, no contact is detected. + * \endenglish + */ + int toolContact(const std::vector &direction); + + /** + * \chinese + * @brief 获取历史关节角度 + * + * 根据给定的周期步数,从关节状态历史中回退指定数量的周期,获取当时的关节角度数据。 + * + * @param steps + * 需要回退的周期数(单位:控制周期数),值越大表示获取越早的历史数据 + * @return std::vector + * 对应时间点的各关节角度(单位:弧度) + * \endchinese + * \english + * @brief Get historical joint positions + * + * According to the given number of cycle steps, go back the specified number of cycles from the joint state history to obtain the joint position data at that time. + * + * @param steps + * Number of cycles to go back (unit: control cycles), the larger the value, the earlier the historical data is obtained + * @return std::vector + * Joint positions (unit: radians) at the corresponding time point + * \endenglish + */ + std::vector getActualJointPositionsHistory(int steps); + +protected: + void *d_{ nullptr }; +}; +using ForceControlPtr = std::shared_ptr; +} // namespace common_interface +} // namespace arcs + +#endif // AUBO_SDK_FORCE_CONTROL_INTERFACE_H diff --git a/third_party/AuboSdk/linux/include/aubo/robot/io_control.h b/third_party/AuboSdk/linux/include/aubo/robot/io_control.h new file mode 100644 index 00000000..e4e53d01 --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo/robot/io_control.h @@ -0,0 +1,4567 @@ +/** @file io_control.h + * @brief IO控制接口 + */ +#ifndef AUBO_SDK_IO_CONTROL_INTERFACE_H +#define AUBO_SDK_IO_CONTROL_INTERFACE_H + +#include +#include + +#include +#include + +namespace arcs { +namespace common_interface { + +/** + * \chinese + * IoControl类提供了一系列的接口对机器人标配的一些数字、模拟IO进行配置,输出状态设置、读取 + * + * 1. 获取各种IO的数量 \n + * 2. 配置IO的输入输出功能 \n + * 3. 可配置IO的配置 \n + * 4. 模拟IO的输入输出范围设置、读取 + * + * 标准数字输入输出:控制柜IO面板上的标准IO \n + * 工具端数字输入输出:通过工具末端航插暴露的数字IO \n + * 可配置输入输出:可以配置为安全IO或者普通数字IO \n + * \endchinese + * \english + * The IoControl class provides a series of interfaces for configuring and reading the robot's standard digital and analog IO, as well as setting output states. + * + * 1. Get the number of various IOs \n + * 2. Configure IO input/output functions \n + * 3. Configuration of configurable IOs \n + * 4. Set and read the input/output range of analog IOs + * + * Standard digital input/output: Standard IOs on the control cabinet IO panel \n + * Tool digital input/output: Digital IOs exposed via the tool-end connector \n + * Configurable input/output: Can be configured as safety IO or general digital IO \n + * \endenglish + */ +class ARCS_ABI_EXPORT IoControl +{ +public: + IoControl(); + virtual ~IoControl(); + + /** + * \chinese + * 获取标准数字输入数量 + * + * @return 标准数字输入数量 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStandardDigitalInputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getStandardDigitalInputNum() -> number + * + * @par Lua示例 + * num = getStandardDigitalInputNum() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalInputNum","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":16} + * + * \endchinese + * \english + * Get the number of standard digital inputs. + * + * @return Number of standard digital inputs. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStandardDigitalInputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getStandardDigitalInputNum() -> number + * + * @par Lua example + * num = getStandardDigitalInputNum() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalInputNum","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":16} + * + * \endenglish + */ + int getStandardDigitalInputNum(); + + /** + * \chinese + * 获取工具端数字IO数量(包括数字输入和数字输出) + * + * @return 工具端数字IO数量(包括数字输入和数字输出) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolDigitalInputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getToolDigitalInputNum() -> number + * + * @par Lua示例 + * num = getStandardDigitalInputNum() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalInputNum","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":4} + * + * \endchinese + * \english + * Get the number of tool digital IOs (including digital inputs and outputs). + * + * @return Number of tool digital IOs (including digital inputs and outputs). + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolDigitalInputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getToolDigitalInputNum() -> number + * + * @par Lua example + * num = getStandardDigitalInputNum() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalInputNum","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":4} + * + * \endenglish + */ + int getToolDigitalInputNum(); + + /** + * \chinese + * 获取可配置数字输入数量 + * + * @return 可配置数字输入数量 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getConfigurableDigitalInputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getConfigurableDigitalInputNum() -> number + * + * @par Lua示例 + * num = getConfigurableDigitalInputNum() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalInputNum","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":16} + * + * \endchinese + * \english + * Get the number of configurable digital inputs. + * + * @return Number of configurable digital inputs. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getConfigurableDigitalInputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getConfigurableDigitalInputNum() -> number + * + * @par Lua example + * num = getConfigurableDigitalInputNum() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalInputNum","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":16} + * + * \endenglish + */ + int getConfigurableDigitalInputNum(); + + /** + * \chinese + * 获取标准数字输出数量 + * + * @return 标准数字输出数量 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStandardDigitalOutputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getStandardDigitalOutputNum() -> number + * + * @par Lua示例 + * num = getStandardDigitalOutputNum() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalOutputNum","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":8} + * + * \endchinese + * \english + * Get the number of standard digital outputs. + * + * @return Number of standard digital outputs. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStandardDigitalOutputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getStandardDigitalOutputNum() -> number + * + * @par Lua example + * num = getStandardDigitalOutputNum() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalOutputNum","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":8} + * + * \endenglish + */ + int getStandardDigitalOutputNum(); + + /** + * \chinese + * 获取工具端数字IO数量(包括数字输入和数字输出) + * + * @return 工具端数字IO数量(包括数字输入和数字输出) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolDigitalOutputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getToolDigitalOutputNum() -> number + * + * @par Lua示例 + * num = getToolDigitalOutputNum() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalOutputNum","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":4} + * + * \endchinese + * \english + * Get the number of tool digital IOs (including digital inputs and outputs). + * + * @return Number of tool digital IOs (including digital inputs and outputs). + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolDigitalOutputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getToolDigitalOutputNum() -> number + * + * @par Lua example + * num = getToolDigitalOutputNum() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalOutputNum","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":4} + * + * \endenglish + */ + int getToolDigitalOutputNum(); + + /** + * \chinese + * 设置指定的工具端数字IO为输入或输出 + * + * 工具端数字IO比较特殊,IO可以配置为输入或者输出 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param input: 表示指定IO是否为输入。 + * input 为true时,设置指定IO为输入,否则为输出 + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setToolIoInput(self: pyaubo_sdk.IoControl, arg0: int, arg1: bool) -> int + * + * @par Lua函数原型 + * setToolIoInput(index: number, input: boolean) -> nil + * + * @par Lua示例 + * setToolIoInput(0,true) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolIoInput","params":[0,true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the specified tool digital IO as input or output. + * + * Tool digital IOs are special and can be configured as input or output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param input: Indicates whether the specified IO is input. + * If input is true, set the IO as input; otherwise, set as output. + * @return Returns 0 on success; error code on failure. + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setToolIoInput(self: pyaubo_sdk.IoControl, arg0: int, arg1: bool) -> int + * + * @par Lua function prototype + * setToolIoInput(index: number, input: boolean) -> nil + * + * @par Lua example + * setToolIoInput(0,true) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolIoInput","params":[0,true],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setToolIoInput(int index, bool input); + + /** + * \chinese + * 判断指定的工具端数字IO类型是否为输入 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @return 当指定的IO为输入时返回 true, 否则为 false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * isToolIoInput(self: pyaubo_sdk.IoControl, arg0: int) -> bool + * + * @par Lua函数原型 + * isToolIoInput(index: number) -> boolean + * + * @par Lua示例 + * status = isToolIoInput(0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.isToolIoInput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endchinese + * \english + * Determine whether the specified tool digital IO is configured as input. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @return Returns true if the specified IO is input, otherwise false. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * isToolIoInput(self: pyaubo_sdk.IoControl, arg0: int) -> bool + * + * @par Lua function prototype + * isToolIoInput(index: number) -> boolean + * + * @par Lua example + * status = isToolIoInput(0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.isToolIoInput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endenglish + */ + bool isToolIoInput(int index); + + /** + * \chinese + * 获取可配置数字输出数量 + * + * @return 可配置数字输出数量 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getConfigurableDigitalOutputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getConfigurableDigitalOutputNum() -> number + * + * @par Lua示例 + * num = getConfigurableDigitalOutputNum() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalOutputNum","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":16} + * + * \endchinese + * \english + * Get the number of configurable digital outputs. + * + * @return Number of configurable digital outputs. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getConfigurableDigitalOutputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getConfigurableDigitalOutputNum() -> number + * + * @par Lua example + * num = getConfigurableDigitalOutputNum() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalOutputNum","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":16} + * + * \endenglish + */ + int getConfigurableDigitalOutputNum(); + + /** + * \chinese + * 获取标准模拟输入数量 + * + * @return 标准模拟输入数量 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStandardAnalogInputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getStandardAnalogInputNum() -> number + * + * @par Lua示例 + * num = getStandardAnalogInputNum() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardAnalogInputNum","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":2} + * + * \endchinese + * \english + * Get the number of standard analog inputs. + * + * @return Number of standard analog inputs. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStandardAnalogInputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getStandardAnalogInputNum() -> number + * + * @par Lua example + * num = getStandardAnalogInputNum() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardAnalogInputNum","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":2} + * + * \endenglish + */ + int getStandardAnalogInputNum(); + + /** + * \chinese + * 获取工具端模拟输入数量 + * + * @return 工具端模拟输入数量 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolAnalogInputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getToolAnalogInputNum() -> number + * + * @par Lua示例 + * num = getToolAnalogInputNum() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolAnalogInputNum","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":2} + * + * \endchinese + * \english + * Get the number of tool analog inputs. + * + * @return Number of tool analog inputs. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolAnalogInputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getToolAnalogInputNum() -> number + * + * @par Lua example + * num = getToolAnalogInputNum() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolAnalogInputNum","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":2} + * + * \endenglish + */ + int getToolAnalogInputNum(); + + /** + * \chinese + * 获取标准模拟输出数量 + * + * @return 标准模拟输出数量 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStandardAnalogOutputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getStandardAnalogOutputNum() -> number + * + * @par Lua示例 + * num = getStandardAnalogOutputNum() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardAnalogOutputNum","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":2} + * + * \endchinese + * \english + * Get the number of standard analog outputs. + * + * @return Number of standard analog outputs. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStandardAnalogOutputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getStandardAnalogOutputNum() -> number + * + * @par Lua example + * num = getStandardAnalogOutputNum() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardAnalogOutputNum","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":2} + * + * \endenglish + */ + int getStandardAnalogOutputNum(); + + /** + * \chinese + * 获取工具端模拟输出数量 + * + * @return 工具端模拟输出数量 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolAnalogOutputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getToolAnalogOutputNum() -> number + * + * @par Lua示例 + * num = getToolAnalogOutputNum() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolAnalogOutputNum","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get the number of tool analog outputs. + * + * @return Number of tool analog outputs. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolAnalogOutputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getToolAnalogOutputNum() -> number + * + * @par Lua example + * num = getToolAnalogOutputNum() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolAnalogOutputNum","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int getToolAnalogOutputNum(); + + /** + * \chinese + * 设置所有数字输入动作为无触发 + * + * @note + * 当输入动作为无触发时,用户设置数字输入值为高电平,不会触发机器人发生动作 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setDigitalInputActionDefault(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * setDigitalInputActionDefault() -> nil + * + * @par Lua示例 + * setDigitalInputActionDefault() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setDigitalInputActionDefault","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set all digital input actions to no trigger. + * + * @note + * When the input action is set to no trigger, setting the digital input value to high will not trigger any robot action. + * + * @return Returns 0 on success; error code on failure. + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setDigitalInputActionDefault(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * setDigitalInputActionDefault() -> nil + * + * @par Lua example + * setDigitalInputActionDefault() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setDigitalInputActionDefault","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setDigitalInputActionDefault(); + + /** + * \chinese + * 设置标准数字输入触发动作 + * + * @note + * 当给输入设置为无触发动作(StandardInputAction::Default)时, + * 用户设置数字输入值为高电平,不会触发机器人发生动作。\n + * 当给输入设置触发动作时,用户设置数字输入值为高电平,会触发机器人执行相应的动作。\n + * 例如,当设置DI0的触发动作为拖动示教(StandardInputAction::Handguide)时, + * 用户设置DI0为高电平,机器人会进入拖动示教。 + * 设置DI0为低电平,机器人会退出拖动示教。 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param action: 触发动作 + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setStandardDigitalInputAction(self: pyaubo_sdk.IoControl, arg0: int, + * arg1: arcs::common_interface::StandardInputAction) -> int + * + * @par Lua函数原型 + * setStandardDigitalInputAction(index: number, action: number) -> nil + * + * @par Lua示例 + * setStandardDigitalInputAction(0,1) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setStandardDigitalInputAction","params":[0,"Handguide"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the trigger action for standard digital input. + * + * @note + * When the input is set to no trigger action (StandardInputAction::Default), + * setting the digital input value to high will not trigger any robot action.\n + * When a trigger action is set, setting the digital input value to high will trigger the corresponding robot action.\n + * For example, if DI0 is set to trigger Handguide (StandardInputAction::Handguide), + * setting DI0 to high will enable hand-guiding mode. + * Setting DI0 to low will exit hand-guiding mode. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param action: Trigger action + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setStandardDigitalInputAction(self: pyaubo_sdk.IoControl, arg0: int, + * arg1: arcs::common_interface::StandardInputAction) -> int + * + * @par Lua function prototype + * setStandardDigitalInputAction(index: number, action: number) -> nil + * + * @par Lua example + * setStandardDigitalInputAction(0,1) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setStandardDigitalInputAction","params":[0,"Handguide"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setStandardDigitalInputAction(int index, StandardInputAction action); + + /** + * \chinese + * 设置工具数字输入触发动作 + * + * @note + * 当给输入设置为无触发动作(StandardInputAction::Default)时, + * 用户设置工具数字输入值为高电平,不会触发机器人发生动作。\n + * 当给输入设置触发动作时,用户设置工具数字输入值为高电平,会触发机器人执行相应的动作。\n + * 例如,当设置TOOL_IO[0]的类型为输入而且触发动作为拖动示教(StandardInputAction::Handguide)时, + * 用户设置TOOL_IO[0]为高电平,机器人会进入拖动示教。 + * 设置TOOL_IO[0]为低电平,机器人会退出拖动示教。 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param action: 触发动作 + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setToolDigitalInputAction(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * arcs::common_interface::StandardInputAction) -> int + * + * @par Lua函数原型 + * setToolDigitalInputAction(index: number, action: number) -> nil + * + * @par Lua示例 + * setToolDigitalInputAction(0,1) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolDigitalInputAction","params":[0,"Handguide"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the trigger action for tool digital input. + * + * @note + * When the input is set to no trigger action (StandardInputAction::Default), + * setting the tool digital input value to high will not trigger any robot action.\n + * When a trigger action is set, setting the tool digital input value to high will trigger the corresponding robot action.\n + * For example, if TOOL_IO[0] is set as input and its trigger action is Handguide (StandardInputAction::Handguide), + * setting TOOL_IO[0] to high will enable hand-guiding mode. + * Setting TOOL_IO[0] to low will exit hand-guiding mode. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param action: Trigger action + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setToolDigitalInputAction(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * arcs::common_interface::StandardInputAction) -> int + * + * @par Lua function prototype + * setToolDigitalInputAction(index: number, action: number) -> nil + * + * @par Lua example + * setToolDigitalInputAction(0,1) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolDigitalInputAction","params":[0,"Handguide"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setToolDigitalInputAction(int index, StandardInputAction action); + + /** + * \chinese + * 设置可配置数字输入触发动作 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param action: 触发动作 + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @note 需要将可配置输入的安全输入动作设置为 + * SafetyInputAction::Unassigned时这个函数的配置才会生效 + * + * @par Python函数原型 + * setConfigurableDigitalInputAction(self: pyaubo_sdk.IoControl, arg0: int, + * arg1: arcs::common_interface::StandardInputAction) -> int + * + * @par Lua函数原型 + * setConfigurableDigitalInputAction(index: number, action: number) -> nil + * + * @par Lua示例 + * setConfigurableDigitalInputAction(0,1) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setConfigurableDigitalInputAction","params":[0,"Handguide"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the trigger action for configurable digital input. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param action: Trigger action + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @note This function takes effect only when the safety input action of the configurable input is set to SafetyInputAction::Unassigned. + * + * @par Python function prototype + * setConfigurableDigitalInputAction(self: pyaubo_sdk.IoControl, arg0: int, + * arg1: arcs::common_interface::StandardInputAction) -> int + * + * @par Lua function prototype + * setConfigurableDigitalInputAction(index: number, action: number) -> nil + * + * @par Lua example + * setConfigurableDigitalInputAction(0,1) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setConfigurableDigitalInputAction","params":[0,"Handguide"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setConfigurableDigitalInputAction(int index, + StandardInputAction action); + + /** + * \chinese + * 获取标准数字输入触发动作 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @return 标准数字输入触发动作 + * + * @par Python函数原型 + * getStandardDigitalInputAction(self: pyaubo_sdk.IoControl, arg0: int) -> + * arcs::common_interface::StandardInputAction + * + * @par Lua函数原型 + * getStandardDigitalInputAction(index: number) -> number + * + * @par Lua示例 + * num = getStandardDigitalInputAction(0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalInputAction","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"Default"} + * + * \endchinese + * \english + * Get the trigger action for standard digital input. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @return Standard digital input trigger action + * + * @par Python function prototype + * getStandardDigitalInputAction(self: pyaubo_sdk.IoControl, arg0: int) -> + * arcs::common_interface::StandardInputAction + * + * @par Lua function prototype + * getStandardDigitalInputAction(index: number) -> number + * + * @par Lua example + * num = getStandardDigitalInputAction(0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalInputAction","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"Default"} + * + * \endenglish + */ + StandardInputAction getStandardDigitalInputAction(int index); + + /** + * \chinese + * 获取工具端数字输入触发动作 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @return 工具端数字输入触发动作 + * + * @par Python函数原型 + * getToolDigitalInputAction(self: pyaubo_sdk.IoControl, arg0: int) -> + * arcs::common_interface::StandardInputAction + * + * @par Lua函数原型 + * getToolDigitalInputAction(index: number) -> number + * + * @par Lua示例 + * getToolDigitalInputAction(0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalInputAction","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"Default"} + * + * \endchinese + * \english + * Get the trigger action for tool digital input. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @return Tool digital input trigger action + * + * @par Python function prototype + * getToolDigitalInputAction(self: pyaubo_sdk.IoControl, arg0: int) -> + * arcs::common_interface::StandardInputAction + * + * @par Lua function prototype + * getToolDigitalInputAction(index: number) -> number + * + * @par Lua example + * getToolDigitalInputAction(0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalInputAction","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"Default"} + * + * \endenglish + */ + StandardInputAction getToolDigitalInputAction(int index); + + /** + * \chinese + * 获取可配置数字输入的输入触发动作 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @return 返回输入触发动作 + * + * @par Python函数原型 + * getConfigurableDigitalInputAction(self: pyaubo_sdk.IoControl, arg0: int) + * -> arcs::common_interface::StandardInputAction + * + * @par Lua函数原型 + * getConfigurableDigitalInputAction(index: number) -> number + * + * @par Lua示例 + * num = getConfigurableDigitalInputAction(0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalInputAction","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"Default"} + * + * \endchinese + * \english + * Get the trigger action for configurable digital input. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @return Returns the input trigger action. + * + * @par Python function prototype + * getConfigurableDigitalInputAction(self: pyaubo_sdk.IoControl, arg0: int) + * -> arcs::common_interface::StandardInputAction + * + * @par Lua function prototype + * getConfigurableDigitalInputAction(index: number) -> number + * + * @par Lua example + * num = getConfigurableDigitalInputAction(0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalInputAction","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"Default"} + * + * \endenglish + */ + StandardInputAction getConfigurableDigitalInputAction(int index); + + /** + * \chinese + * 设置所有数字输出状态选择为无 + * + * @note + * 当给输出状态设置为无(StandardOutputRunState::None)时, + * 用户可以设置数字输出值。\n + * 当给输出设置状态时,用户不可设置数字输出值,控制器会自动设置数字输出值。\n + * 例如,当设置DO0的输出状态为高电平指示正在拖动示教(StandardOutputRunState::Handguiding)时, + * 机器人进入拖动示教,DO0会自动变为高电平。 + * 机器人退出拖动示教,DO0会自动变为低电平。 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setDigitalOutputRunstateDefault(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * setDigitalOutputRunstateDefault() -> nil + * + * @par Lua示例 + * setDigitalOutputRunstateDefault() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setDigitalOutputRunstateDefault","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set all digital output runstates to None. + * + * @note + * When the output runstate is set to None (StandardOutputRunState::None), + * users can set the digital output value.\n + * When the output runstate is set, users cannot set the digital output value, and the controller will set it automatically.\n + * For example, when DO0's output runstate is set to indicate hand-guiding (StandardOutputRunState::Handguiding), + * the robot enters hand-guiding mode and DO0 will automatically become high. + * When the robot exits hand-guiding, DO0 will automatically become low. + * + * @return Returns 0 on success; error code on failure. + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setDigitalOutputRunstateDefault(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * setDigitalOutputRunstateDefault() -> nil + * + * @par Lua example + * setDigitalOutputRunstateDefault() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setDigitalOutputRunstateDefault","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setDigitalOutputRunstateDefault(); + + /** + * \chinese + * 设置标准数字输出状态选择 + * + * @note + * 当给输出状态设置为无(StandardOutputRunState::None)时, + * 用户可以设置数字输出值。\n + * 当给输出设置状态时,用户不可设置数字输出值,控制器会自动设置数字输出值。\n + * 例如,当设置DO0的输出状态为高电平指示正在拖动示教(StandardOutputRunState::Handguiding)时, + * 机器人进入拖动示教,DO0会自动变为高电平。 + * 机器人退出拖动示教,DO0会自动变为低电平。 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param runstate: 输出状态选择 + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setStandardDigitalOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int, + * arg1: arcs::common_interface::StandardOutputRunState) -> int + * + * @par Lua函数原型 + * setStandardDigitalOutputRunstate(index: number, runstate: number) -> nil + * + * @par Lua示例 + * setStandardDigitalOutputRunstate(0,1) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setStandardDigitalOutputRunstate","params":[0,"PowerOn"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the runstate for standard digital output. + * + * @note + * When the output runstate is set to None (StandardOutputRunState::None), + * users can set the digital output value.\n + * When the output runstate is set, users cannot set the digital output value, and the controller will set it automatically.\n + * For example, when DO0's output runstate is set to indicate hand-guiding (StandardOutputRunState::Handguiding), + * the robot enters hand-guiding mode and DO0 will automatically become high. + * When the robot exits hand-guiding, DO0 will automatically become low. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param runstate: Output runstate selection + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setStandardDigitalOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int, + * arg1: arcs::common_interface::StandardOutputRunState) -> int + * + * @par Lua function prototype + * setStandardDigitalOutputRunstate(index: number, runstate: number) -> nil + * + * @par Lua example + * setStandardDigitalOutputRunstate(0,1) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setStandardDigitalOutputRunstate","params":[0,"PowerOn"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setStandardDigitalOutputRunstate(int index, + StandardOutputRunState runstate); + + /** + * \chinese + * 设置工具端数字输出状态选择 + * + * @note + * 当给输出状态设置为无(StandardOutputRunState::None)时, + * 用户可以设置数字输出值。\n + * 当给输出设置状态时,用户不可设置数字输出值,控制器会自动设置数字输出值。\n + * 例如,当设置TOOL_IO[0]类型为输出且输出状态为高电平指示正在拖动示教(StandardOutputRunState::Handguiding)时, + * 机器人进入拖动示教,TOOL_IO[0]会自动变为高电平。 + * 机器人退出拖动示教,TOOL_IO[0]会自动变为低电平。 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param runstate: 输出状态选择 + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setToolDigitalOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * arcs::common_interface::StandardOutputRunState) -> int + * + * @par Lua函数原型 + * setToolDigitalOutputRunstate(index: number, runstate: number) -> nil + * + * @par Lua示例 + * setToolDigitalOutputRunstate(0,1) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolDigitalOutputRunstate","params":[0,"None"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the runstate for tool digital output. + * + * @note + * When the output runstate is set to None (StandardOutputRunState::None), + * users can set the digital output value.\n + * When the output runstate is set, users cannot set the digital output value, and the controller will set it automatically.\n + * For example, when TOOL_IO[0] is set as output and its runstate is set to indicate hand-guiding (StandardOutputRunState::Handguiding), + * the robot enters hand-guiding mode and TOOL_IO[0] will automatically become high. + * When the robot exits hand-guiding, TOOL_IO[0] will automatically become low. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param runstate: Output runstate selection + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setToolDigitalOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * arcs::common_interface::StandardOutputRunState) -> int + * + * @par Lua function prototype + * setToolDigitalOutputRunstate(index: number, runstate: number) -> nil + * + * @par Lua example + * setToolDigitalOutputRunstate(0,1) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolDigitalOutputRunstate","params":[0,"None"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setToolDigitalOutputRunstate(int index, + StandardOutputRunState runstate); + + /** + * \chinese + * 设置可配置数字输出状态选择 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param runstate: 输出状态选择 + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setConfigurableDigitalOutputRunstate(self: pyaubo_sdk.IoControl, arg0: + * int, arg1: arcs::common_interface::StandardOutputRunState) -> int + * + * @par Lua函数原型 + * setConfigurableDigitalOutputRunstate(index: number, runstate: number) -> + * nil + * + * @par Lua示例 + * setConfigurableDigitalOutputRunstate(0,1) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setConfigurableDigitalOutputRunstate","params":[0,"None"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the runstate for configurable digital output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param runstate: Output runstate selection + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setConfigurableDigitalOutputRunstate(self: pyaubo_sdk.IoControl, arg0: + * int, arg1: arcs::common_interface::StandardOutputRunState) -> int + * + * @par Lua function prototype + * setConfigurableDigitalOutputRunstate(index: number, runstate: number) -> + * nil + * + * @par Lua example + * setConfigurableDigitalOutputRunstate(0,1) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setConfigurableDigitalOutputRunstate","params":[0,"None"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setConfigurableDigitalOutputRunstate(int index, + StandardOutputRunState runstate); + + /** + * \chinese + * 获取标准数字输出状态选择 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @return 输出状态选择 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStandardDigitalOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int) + * -> arcs::common_interface::StandardOutputRunState + * + * @par Lua函数原型 + * getStandardDigitalOutputRunstate(index: number) -> number + * + * @par Lua示例 + * num = getStandardDigitalOutputRunstate(0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalOutputRunstate","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"None"} + * + * \endchinese + * \english + * Get the runstate for standard digital output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @return Output runstate selection + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStandardDigitalOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int) + * -> arcs::common_interface::StandardOutputRunState + * + * @par Lua function prototype + * getStandardDigitalOutputRunstate(index: number) -> number + * + * @par Lua example + * num = getStandardDigitalOutputRunstate(0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalOutputRunstate","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"None"} + * + * \endenglish + */ + StandardOutputRunState getStandardDigitalOutputRunstate(int index); + + /** + * \chinese + * 获取工具端数字输出状态选择 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @return 输出状态选择 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolDigitalOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int) -> + * arcs::common_interface::StandardOutputRunState + * + * @par Lua函数原型 + * getToolDigitalOutputRunstate(index: number) -> number + * + * @par Lua示例 + * num = getToolDigitalOutputRunstate(0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalOutputRunstate","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"None"} + * + * \endchinese + * \english + * Get the runstate for tool digital output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @return Output runstate selection + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolDigitalOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int) -> + * arcs::common_interface::StandardOutputRunState + * + * @par Lua function prototype + * getToolDigitalOutputRunstate(index: number) -> number + * + * @par Lua example + * num = getToolDigitalOutputRunstate(0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalOutputRunstate","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"None"} + * + * \endenglish + */ + StandardOutputRunState getToolDigitalOutputRunstate(int index); + + /** + * \chinese + * 获取可配置数字输出状态选择 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @return 输出状态选择 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getConfigurableDigitalOutputRunstate(self: pyaubo_sdk.IoControl, arg0: + * int) + * -> arcs::common_interface::StandardOutputRunState + * + * @par Lua函数原型 + * getConfigurableDigitalOutputRunstate(index: number) -> number + * + * @par Lua示例 + * num = getConfigurableDigitalOutputRunstate(0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalOutputRunstate","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"None"} + * + * \endchinese + * \english + * Get the runstate for configurable digital output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @return Output runstate selection + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getConfigurableDigitalOutputRunstate(self: pyaubo_sdk.IoControl, arg0: + * int) + * -> arcs::common_interface::StandardOutputRunState + * + * @par Lua function prototype + * getConfigurableDigitalOutputRunstate(index: number) -> number + * + * @par Lua example + * num = getConfigurableDigitalOutputRunstate(0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalOutputRunstate","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"None"} + * + * \endenglish + */ + StandardOutputRunState getConfigurableDigitalOutputRunstate(int index); + + /** + * \chinese + * 设置标准模拟输出状态选择 + * + * @note + * 当给输出状态设置为无(StandardOutputRunState::None)时, + * 用户可以设置模拟输出值。\n + * 当给输出设置状态时,用户不可设置模拟输出值,控制器会自动设置模拟输出值。\n + * 例如,当设置AO0的输出状态为高电平指示正在拖动示教(StandardOutputRunState::Handguiding)时, + * 机器人进入拖动示教,AO0的值会自动变为最大值。 + * 机器人退出拖动示教,AO0的值会自动变为0。 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param runstate: 输出状态选择 + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setStandardAnalogOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int, + * arg1: arcs::common_interface::StandardOutputRunState) -> int + * + * @par Lua函数原型 + * setStandardAnalogOutputRunstate(index: number, runstate: number) -> nil + * + * @par Lua示例 + * setStandardAnalogOutputRunstate(0,6) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setStandardAnalogOutputRunstate","params":[0,"None"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the runstate for standard analog output. + * + * @note + * When the output runstate is set to None (StandardOutputRunState::None), + * users can set the analog output value.\n + * When the output runstate is set, users cannot set the analog output value, and the controller will set it automatically.\n + * For example, when AO0's output runstate is set to indicate hand-guiding (StandardOutputRunState::Handguiding), + * the robot enters hand-guiding mode and AO0 will automatically become the maximum value. + * When the robot exits hand-guiding, AO0 will automatically become 0. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param runstate: Output runstate selection + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setStandardAnalogOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int, + * arg1: arcs::common_interface::StandardOutputRunState) -> int + * + * @par Lua function prototype + * setStandardAnalogOutputRunstate(index: number, runstate: number) -> nil + * + * @par Lua example + * setStandardAnalogOutputRunstate(0,6) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setStandardAnalogOutputRunstate","params":[0,"None"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setStandardAnalogOutputRunstate(int index, + StandardOutputRunState runstate); + + /** + * \chinese + * 设置工具端模拟输出状态选择 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param runstate: 输出状态选择 + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setToolAnalogOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * arcs::common_interface::StandardOutputRunState) -> int + * + * @par Lua函数原型 + * setToolAnalogOutputRunstate(index: number, runstate: number) -> nil + * + * @par Lua示例 + * setToolAnalogOutputRunstate(0,1) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolAnalogOutputRunstate","params":[0,"None"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the runstate for tool analog output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param runstate: Output runstate selection + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setToolAnalogOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * arcs::common_interface::StandardOutputRunState) -> int + * + * @par Lua function prototype + * setToolAnalogOutputRunstate(index: number, runstate: number) -> nil + * + * @par Lua example + * setToolAnalogOutputRunstate(0,1) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolAnalogOutputRunstate","params":[0,"None"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setToolAnalogOutputRunstate(int index, StandardOutputRunState runstate); + + /** + * \chinese + * 获取标准模拟输出状态选择 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @return 标准模拟输出状态选择 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStandardAnalogOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int) -> + * arcs::common_interface::StandardOutputRunState + * + * @par Lua函数原型 + * getStandardAnalogOutputRunstate(index: number) -> number + * + * @par Lua示例 + * num = getStandardAnalogOutputRunstate(0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardAnalogOutputRunstate","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"None"} + * + * \endchinese + * \english + * Get the runstate for standard analog output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @return Standard analog output runstate selection + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStandardAnalogOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int) -> + * arcs::common_interface::StandardOutputRunState + * + * @par Lua function prototype + * getStandardAnalogOutputRunstate(index: number) -> number + * + * @par Lua example + * num = getStandardAnalogOutputRunstate(0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardAnalogOutputRunstate","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"None"} + * + * \endenglish + */ + StandardOutputRunState getStandardAnalogOutputRunstate(int index); + + /** + * \chinese + * 获取工具端模拟输出状态选择 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @return 工具端模拟输出状态选择 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolAnalogOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int) -> + * arcs::common_interface::StandardOutputRunState + * + * @par Lua函数原型 + * getToolAnalogOutputRunstate(index: number) -> number + * + * @par Lua示例 + * num = getToolAnalogOutputRunstate(0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolAnalogOutputRunstate","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"None"} + * + * \endchinese + * \english + * Get the runstate for tool analog output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @return Tool analog output runstate selection + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolAnalogOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int) -> + * arcs::common_interface::StandardOutputRunState + * + * @par Lua function prototype + * getToolAnalogOutputRunstate(index: number) -> number + * + * @par Lua example + * num = getToolAnalogOutputRunstate(0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolAnalogOutputRunstate","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"None"} + * + * \endenglish + */ + StandardOutputRunState getToolAnalogOutputRunstate(int index); + + /** + * \chinese + * 设置标准模拟输入的范围 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param domain: 输入的范围 + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setStandardAnalogInputDomain(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * int) -> int + * + * @par Lua函数原型 + * setStandardAnalogInputDomain(index: number, domain: number) -> nil + * + * @par Lua示例 + * setStandardAnalogInputDomain(0,1) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setStandardAnalogInputDomain","params":[0,8],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the range of standard analog input. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param domain: Input range + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setStandardAnalogInputDomain(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * int) -> int + * + * @par Lua function prototype + * setStandardAnalogInputDomain(index: number, domain: number) -> nil + * + * @par Lua example + * setStandardAnalogInputDomain(0,1) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setStandardAnalogInputDomain","params":[0,8],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setStandardAnalogInputDomain(int index, int domain); + + /** + * \chinese + * 设置工具端模拟输入的范围 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param domain: 输入的范围 + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setToolAnalogInputDomain(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * int) -> int + * + * @par Lua函数原型 + * setToolAnalogInputDomain(index: number, domain: number) -> nil + * + * @par Lua示例 + * setToolAnalogInputDomain(0,1) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolAnalogInputDomain","params":[0,8],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the range of tool analog input. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param domain: Input range + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setToolAnalogInputDomain(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * int) -> int + * + * @par Lua function prototype + * setToolAnalogInputDomain(index: number, domain: number) -> nil + * + * @par Lua example + * setToolAnalogInputDomain(0,1) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolAnalogInputDomain","params":[0,8],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setToolAnalogInputDomain(int index, int domain); + + /** + * \chinese + * 获取标准模式输入范围 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @return 标准模式输入范围 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStandardAnalogInputDomain(self: pyaubo_sdk.IoControl, arg0: int) -> int + * + * @par Lua函数原型 + * getStandardAnalogInputDomain(index: number) -> number + * + * @par Lua示例 + * num = getStandardAnalogInputDomain(0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardAnalogInputDomain","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get the domain of standard analog input. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @return Standard analog input domain + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStandardAnalogInputDomain(self: pyaubo_sdk.IoControl, arg0: int) -> int + * + * @par Lua function prototype + * getStandardAnalogInputDomain(index: number) -> number + * + * @par Lua example + * num = getStandardAnalogInputDomain(0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardAnalogInputDomain","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int getStandardAnalogInputDomain(int index); + + /** + * \chinese + * 获取工具端模式输入范围 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @return 工具端模式输入范围 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolAnalogInputDomain(self: pyaubo_sdk.IoControl, arg0: int) -> int + * + * @par Lua函数原型 + * getToolAnalogInputDomain(index: number) -> number + * + * @par Lua示例 + * num = getToolAnalogInputDomain(0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolAnalogInputDomain","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":10} + * + * \endchinese + * \english + * Get the domain of tool analog input. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @return Tool analog input domain + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolAnalogInputDomain(self: pyaubo_sdk.IoControl, arg0: int) -> int + * + * @par Lua function prototype + * getToolAnalogInputDomain(index: number) -> number + * + * @par Lua example + * num = getToolAnalogInputDomain(0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolAnalogInputDomain","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":10} + * + * \endenglish + */ + int getToolAnalogInputDomain(int index); + + /** + * \chinese + * 设置标准模拟输出的范围 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param domain: 输出的范围 + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setStandardAnalogOutputDomain(self: pyaubo_sdk.IoControl, arg0: int, + * arg1: int) -> int + * + * @par Lua函数原型 + * setStandardAnalogOutputDomain(index: number, domain: number) -> nil + * + * @par Lua示例 + * setStandardAnalogOutputDomain(0,1) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setStandardAnalogOutputDomain","params":[0,8],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the range of standard analog output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param domain: Output range + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setStandardAnalogOutputDomain(self: pyaubo_sdk.IoControl, arg0: int, + * arg1: int) -> int + * + * @par Lua function prototype + * setStandardAnalogOutputDomain(index: number, domain: number) -> nil + * + * @par Lua example + * setStandardAnalogOutputDomain(0,1) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setStandardAnalogOutputDomain","params":[0,8],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setStandardAnalogOutputDomain(int index, int domain); + + /** + * \chinese + * 设置工具端模拟输出范围 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param domain: 输出的范围 + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setToolAnalogOutputDomain(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * int) -> int + * + * @par Lua函数原型 + * setToolAnalogOutputDomain(index: number, domain: number) -> nil + * + * @par Lua示例 + * setToolAnalogOutputDomain(0,1) + * + * \endchinese + * \english + * Set the range of tool analog output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param domain: Output range + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setToolAnalogOutputDomain(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * int) -> int + * + * @par Lua function prototype + * setToolAnalogOutputDomain(index: number, domain: number) -> nil + * + * @par Lua example + * setToolAnalogOutputDomain(0,1) + * + * \endenglish + */ + int setToolAnalogOutputDomain(int index, int domain); + + /** + * \chinese + * 获取标准模拟输出范围 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @return 标准模拟输出范围 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStandardAnalogOutputDomain(self: pyaubo_sdk.IoControl, arg0: int) -> int + * + * @par Lua函数原型 + * getStandardAnalogOutputDomain(index: number) -> number + * + * @par Lua示例 + * num = getStandardAnalogOutputDomain(0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardAnalogOutputDomain","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get the domain of standard analog output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @return Standard analog output domain + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStandardAnalogOutputDomain(self: pyaubo_sdk.IoControl, arg0: int) -> int + * + * @par Lua function prototype + * getStandardAnalogOutputDomain(index: number) -> number + * + * @par Lua example + * num = getStandardAnalogOutputDomain(0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardAnalogOutputDomain","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int getStandardAnalogOutputDomain(int index); + + /** + * \chinese + * 获取工具端模拟输出范围 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @return 工具端模拟输出范围 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolAnalogOutputDomain(self: pyaubo_sdk.IoControl, arg0: int) -> int + * + * @par Lua函数原型 + * getToolAnalogOutputDomain(index: number) -> number + * + * @par Lua示例 + * num = getToolAnalogOutputDomain(0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolAnalogOutputDomain","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get the domain of tool analog output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @return Tool analog output domain + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolAnalogOutputDomain(self: pyaubo_sdk.IoControl, arg0: int) -> int + * + * @par Lua function prototype + * getToolAnalogOutputDomain(index: number) -> number + * + * @par Lua example + * num = getToolAnalogOutputDomain(0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolAnalogOutputDomain","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int getToolAnalogOutputDomain(int index); + + /** + * \chinese + * 设置工具端电源电压值(单位V) + * + * @param domain: 工具端电源电压值,可选三个档位,分别为0、12和24。\n + * 0表示0V, 12表示12V, 24表示24V。 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setToolVoltageOutputDomain(self: pyaubo_sdk.IoControl, arg0: int) -> int + * + * @par Lua函数原型 + * setToolVoltageOutputDomain(domain: number) -> nil + * + * @par Lua示例 + * setToolVoltageOutputDomain(24) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolVoltageOutputDomain","params":[24],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the tool voltage output value (unit: V) + * + * @param domain: Tool voltage output value, can be 0, 12, or 24.\n + * 0 means 0V, 12 means 12V, 24 means 24V. + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setToolVoltageOutputDomain(self: pyaubo_sdk.IoControl, arg0: int) -> int + * + * @par Lua function prototype + * setToolVoltageOutputDomain(domain: number) -> nil + * + * @par Lua example + * setToolVoltageOutputDomain(24) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolVoltageOutputDomain","params":[24],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setToolVoltageOutputDomain(int domain); + + /** + * \chinese + * 获取工具端电源电压值(单位V) + * + * @return 工具端电源电压值(单位V) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolVoltageOutputDomain(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getToolVoltageOutputDomain() -> number + * + * @par Lua示例 + * num = getToolVoltageOutputDomain() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolVoltageOutputDomain","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get the tool voltage output value (unit: V) + * + * @return Tool voltage output value (unit: V) + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolVoltageOutputDomain(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getToolVoltageOutputDomain() -> number + * + * @par Lua example + * num = getToolVoltageOutputDomain() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolVoltageOutputDomain","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int getToolVoltageOutputDomain(); + + /** + * \chinese + * 设置标准数字输出值 + * + * @param index: 表示IO口的管脚, + * @param value: 输出值 + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setStandardDigitalOutput(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * bool) -> int + * + * @par Lua函数原型 + * setStandardDigitalOutput(index: number, value: boolean) -> nil + * + * @par Lua示例 + * setStandardDigitalOutput(0,true) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setStandardDigitalOutput","params":[0,true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the value of a standard digital output. + * + * @param index: Indicates the IO pin. + * @param value: Output value. + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setStandardDigitalOutput(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * bool) -> int + * + * @par Lua function prototype + * setStandardDigitalOutput(index: number, value: boolean) -> nil + * + * @par Lua example + * setStandardDigitalOutput(0,true) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setStandardDigitalOutput","params":[0,true],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setStandardDigitalOutput(int index, bool value); + + /** + * \chinese + * 设置数字输出脉冲 + * + * @param index + * @param value + * @param duration + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setStandardDigitalOutputPulse(self: pyaubo_sdk.IoControl, arg0: int, + * arg1: bool, arg2: float) -> int + * + * @par Lua函数原型 + * setStandardDigitalOutputPulse(index: number, value: boolean, duration: + * number) -> nil + * + * @par Lua示例 + * setStandardDigitalOutputPulse(0,true,2.5) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setStandardDigitalOutputPulse","params":[0,true,0.5],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set digital output pulse. + * + * @param index + * @param value + * @param duration + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setStandardDigitalOutputPulse(self: pyaubo_sdk.IoControl, arg0: int, + * arg1: bool, arg2: float) -> int + * + * @par Lua function prototype + * setStandardDigitalOutputPulse(index: number, value: boolean, duration: + * number) -> nil + * + * @par Lua example + * setStandardDigitalOutputPulse(0,true,2.5) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setStandardDigitalOutputPulse","params":[0,true,0.5],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setStandardDigitalOutputPulse(int index, bool value, double duration); + + /** + * \chinese + * 设置工具端数字输出值 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param value: 数字输出值 + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setToolDigitalOutput(self: pyaubo_sdk.IoControl, arg0: int, arg1: bool) + * -> int + * + * @par Lua函数原型 + * setToolDigitalOutput(index: number, value: boolean) -> nil + * + * @par Lua示例 + * setToolDigitalOutput(0,true) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolDigitalOutput","params":[0,true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the value of tool digital output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param value: Output value. + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setToolDigitalOutput(self: pyaubo_sdk.IoControl, arg0: int, arg1: bool) + * -> int + * + * @par Lua function prototype + * setToolDigitalOutput(index: number, value: boolean) -> nil + * + * @par Lua example + * setToolDigitalOutput(0,true) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolDigitalOutput","params":[0,true],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setToolDigitalOutput(int index, bool value); + + /** + * \chinese + * 设置工具端数字输出脉冲 + * + * @param index + * @param value + * @param duration + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setToolDigitalOutputPulse(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * bool, arg2: float) -> int + * + * @par Lua函数原型 + * setToolDigitalOutputPulse(index: number, value: boolean, duration: + * number) -> nil + * + * @par Lua示例 + * setToolDigitalOutputPulse(0,true,2) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolDigitalOutputPulse","params":[0,true,0.5],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set tool digital output pulse. + * + * @param index + * @param value + * @param duration + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setToolDigitalOutputPulse(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * bool, arg2: float) -> int + * + * @par Lua function prototype + * setToolDigitalOutputPulse(index: number, value: boolean, duration: + * number) -> nil + * + * @par Lua example + * setToolDigitalOutputPulse(0,true,2) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolDigitalOutputPulse","params":[0,true,0.5],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setToolDigitalOutputPulse(int index, bool value, double duration); + + /** + * \chinese + * 设置可配置数字输出值 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param value: 数字输出值 + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setConfigurableDigitalOutput(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * bool) -> int + * + * @par Lua函数原型 + * setConfigurableDigitalOutput(index: number, value: boolean) -> nil + * + * @par Lua示例 + * setConfigurableDigitalOutput(0,true) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setConfigurableDigitalOutput","params":[0,true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the value of configurable digital output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param value: Output value. + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setConfigurableDigitalOutput(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * bool) -> int + * + * @par Lua function prototype + * setConfigurableDigitalOutput(index: number, value: boolean) -> nil + * + * @par Lua example + * setConfigurableDigitalOutput(0,true) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setConfigurableDigitalOutput","params":[0,true],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setConfigurableDigitalOutput(int index, bool value); + + /** + * \chinese + * 设置可配置数字输出脉冲 + * + * @param index + * @param value + * @param duration + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setConfigurableDigitalOutputPulse(self: pyaubo_sdk.IoControl, arg0: int, + * arg1: bool, arg2: float) -> int + * + * @par Lua函数原型 + * setConfigurableDigitalOutputPulse(index: number, value: boolean, + * duration: number) -> nil + * + * @par Lua示例 + * setConfigurableDigitalOutputPulse(0,true,2.3) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setConfigurableDigitalOutputPulse","params":[0,true,0.5],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set configurable digital output pulse. + * + * @param index + * @param value + * @param duration + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setConfigurableDigitalOutputPulse(self: pyaubo_sdk.IoControl, arg0: int, + * arg1: bool, arg2: float) -> int + * + * @par Lua function prototype + * setConfigurableDigitalOutputPulse(index: number, value: boolean, + * duration: number) -> nil + * + * @par Lua example + * setConfigurableDigitalOutputPulse(0,true,2.3) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setConfigurableDigitalOutputPulse","params":[0,true,0.5],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setConfigurableDigitalOutputPulse(int index, bool value, + double duration); + + /** + * \chinese + * 设置标准模拟输出值 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param value: 模拟输出值 + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setStandardAnalogOutput(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * float) -> int + * + * @par Lua函数原型 + * setStandardAnalogOutput(index: number, value: number) -> nil + * + * @par Lua示例 + * setStandardAnalogOutput(0,5.4) + * + * \endchinese + * \english + * Set the value of standard analog output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param value: Output value. + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setStandardAnalogOutput(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * float) -> int + * + * @par Lua function prototype + * setStandardAnalogOutput(index: number, value: number) -> nil + * + * @par Lua example + * setStandardAnalogOutput(0,5.4) + * + * \endenglish + */ + int setStandardAnalogOutput(int index, double value); + + /** + * \chinese + * 设置工具端模拟输出值 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param value: 模拟输出 + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setToolAnalogOutput(self: pyaubo_sdk.IoControl, arg0: int, arg1: float) + * -> int + * + * @par Lua函数原型 + * setToolAnalogOutput(index: number, value: number) -> nil + * + * @par Lua示例 + * setToolAnalogOutput(0,1.2) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolAnalogOutput","params":[0,0.5],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":13} + * + * \endchinese + * \english + * Set the value of tool analog output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param value: Output value. + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setToolAnalogOutput(self: pyaubo_sdk.IoControl, arg0: int, arg1: float) + * -> int + * + * @par Lua function prototype + * setToolAnalogOutput(index: number, value: number) -> nil + * + * @par Lua example + * setToolAnalogOutput(0,1.2) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolAnalogOutput","params":[0,0.5],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":13} + * + * \endenglish + */ + int setToolAnalogOutput(int index, double value); + + /** + * \chinese + * 获取标准数字输入值 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * + * @return 高电平返回true; 低电平返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStandardDigitalInput(self: pyaubo_sdk.IoControl, arg0: int) -> bool + * + * @par Lua函数原型 + * getStandardDigitalInput(index: number) -> boolean + * + * @par Lua示例 + * status = getStandardDigitalInput(0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalInput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endchinese + * \english + * Get the value of a standard digital input. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * + * @return Returns true for high level; false for low level. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStandardDigitalInput(self: pyaubo_sdk.IoControl, arg0: int) -> bool + * + * @par Lua function prototype + * getStandardDigitalInput(index: number) -> boolean + * + * @par Lua example + * status = getStandardDigitalInput(0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalInput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endenglish + */ + bool getStandardDigitalInput(int index); + + /** + * \chinese + * 获取所有的标准数字输入值 + * + * @return 所有的标准数字输入值 \n + * 例如,当返回值是2863267846时,换成2进制后是10101010101010100000000000000110。 + * 后16位就是所有的标准数字输入状态值, + * 最后一位表示DI00的输入状态值,倒数第二位表示DI01的输入状态值,以此类推。\n + * 1表示高电平状态,0表示低电平状态 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStandardDigitalInputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getStandardDigitalInputs() -> number + * + * @par Lua示例 + * num = getStandardDigitalInputs() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalInputs","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get all standard digital input values. + * + * @return All standard digital input values.\n + * For example, if the return value is 2863267846, its binary representation is 10101010101010100000000000000110. + * The lower 16 bits represent the status of all standard digital inputs, + * the least significant bit indicates the input status of DI00, the second least significant bit indicates DI01, and so on.\n + * 1 means high level, 0 means low level. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStandardDigitalInputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getStandardDigitalInputs() -> number + * + * @par Lua example + * num = getStandardDigitalInputs() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalInputs","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + uint32_t getStandardDigitalInputs(); + + /** + * \chinese + * 获取工具端数字输入值 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * + * @return 高电平返回true; 低电平返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolDigitalInput(self: pyaubo_sdk.IoControl, arg0: int) -> bool + * + * @par Lua函数原型 + * getToolDigitalInput(index: number) -> boolean + * + * @par Lua示例 + * status = getToolDigitalInput(0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalInput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endchinese + * \english + * Get the value of tool digital input. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * + * @return Returns true for high level; false for low level. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolDigitalInput(self: pyaubo_sdk.IoControl, arg0: int) -> bool + * + * @par Lua function prototype + * getToolDigitalInput(index: number) -> boolean + * + * @par Lua example + * status = getToolDigitalInput(0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalInput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endenglish + */ + bool getToolDigitalInput(int index); + + /** + * \chinese + * 获取所有的工具端数字输入值 + * + * @return 返回所有的工具端数字输入值 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolDigitalInputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getToolDigitalInputs() -> number + * + * @par Lua示例 + * num = getToolDigitalInputs() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalInputs","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get all tool digital input values. + * + * @return Returns all tool digital input values. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolDigitalInputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getToolDigitalInputs() -> number + * + * @par Lua example + * num = getToolDigitalInputs() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalInputs","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + uint32_t getToolDigitalInputs(); + + /** + * \chinese + * 获取可配置数字输入值 + * + * @note 可用于获取安全IO的输入值 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * + * @return 高电平返回true; 低电平返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getConfigurableDigitalInput(self: pyaubo_sdk.IoControl, arg0: int) -> bool + * + * @par Lua函数原型 + * getConfigurableDigitalInput(index: number) -> boolean + * + * @par Lua示例 + * status = getConfigurableDigitalInput(0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalInput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endchinese + * \english + * Get the value of configurable digital input. + * + * @note Can be used to get the value of safety IO. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * + * @return Returns true for high level; false for low level. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getConfigurableDigitalInput(self: pyaubo_sdk.IoControl, arg0: int) -> bool + * + * @par Lua function prototype + * getConfigurableDigitalInput(index: number) -> boolean + * + * @par Lua example + * status = getConfigurableDigitalInput(0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalInput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endenglish + */ + bool getConfigurableDigitalInput(int index); + + /** + * \chinese + * 获取所有的可配置数字输入值 + * + * @note 可用于获取安全IO的输入值 + * + * @return 所有的可配置数字输入值\n + * 例如,当返回值是2863267846时,换成2进制后是10101010101010100000000000000110。 + * 后16位就是所有的输入状态值, + * 最后一位表示管脚0的输入状态值,倒数第二位表示管脚1的输入状态值,以此类推。\n + * 1表示高电平状态,0表示低电平状态 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getConfigurableDigitalInputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getConfigurableDigitalInputs() -> number + * + * @par Lua示例 + * num = getConfigurableDigitalInputs() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalInputs","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get all configurable digital input values. + * + * @note Can be used to get the value of safety IO. + * + * @return All configurable digital input values.\n + * For example, if the return value is 2863267846, its binary representation is 10101010101010100000000000000110. + * The lower 16 bits represent the status of all input pins, + * the least significant bit indicates the input status of pin 0, the second least significant bit indicates pin 1, and so on.\n + * 1 means high level, 0 means low level. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getConfigurableDigitalInputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getConfigurableDigitalInputs() -> number + * + * @par Lua example + * num = getConfigurableDigitalInputs() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalInputs","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + uint32_t getConfigurableDigitalInputs(); + + /** + * \chinese + * 获取标准数字输出值 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * + * @return 高电平返回true; 低电平返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStandardDigitalOutput(self: pyaubo_sdk.IoControl, arg0: int) -> bool + * + * @par Lua函数原型 + * getStandardDigitalOutput(index: number) -> boolean + * + * @par Lua示例 + * status = getStandardDigitalOutput(0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalOutput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endchinese + * \english + * Get the value of a standard digital output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * + * @return Returns true for high level; false for low level. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStandardDigitalOutput(self: pyaubo_sdk.IoControl, arg0: int) -> bool + * + * @par Lua function prototype + * getStandardDigitalOutput(index: number) -> boolean + * + * @par Lua example + * status = getStandardDigitalOutput(0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalOutput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endenglish + */ + bool getStandardDigitalOutput(int index); + + /** + * \chinese + * 获取所有的标准数字输出值 + * + * @return 所有的标准数字输出值 \n + * 例如,当返回值是2863267846时,换成2进制后是10101010101010100000000000000110。 + * 后16位就是所有的标准数字输出状态值, + * 最后一位表示DI00的输出状态值,倒数第二位表示DI01的输出状态值,以此类推。\n + * 1表示高电平状态,0表示低电平状态. + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStandardDigitalOutputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getStandardDigitalOutputs() -> number + * + * @par Lua示例 + * num = getStandardDigitalOutputs() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalOutputs","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":69} + * + * \endchinese + * \english + * Get all standard digital output values. + * + * @return All standard digital output values.\n + * For example, if the return value is 2863267846, its binary representation is 10101010101010100000000000000110. + * The lower 16 bits represent the status of all standard digital outputs, + * the least significant bit indicates the output status of DO00, the second least significant bit indicates DO01, and so on.\n + * 1 means high level, 0 means low level. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStandardDigitalOutputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getStandardDigitalOutputs() -> number + * + * @par Lua example + * num = getStandardDigitalOutputs() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalOutputs","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":69} + * + * \endenglish + */ + uint32_t getStandardDigitalOutputs(); + + /** + * \chinese + * 获取工具端数字输出值 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * + * @return 高电平返回true; 低电平返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolDigitalOutput(self: pyaubo_sdk.IoControl, arg0: int) -> bool + * + * @par Lua函数原型 + * getToolDigitalOutput(index: number) -> boolean + * + * @par Lua示例 + * status = getToolDigitalOutput(0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalOutput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endchinese + * \english + * Get the value of tool digital output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * + * @return Returns true for high level; false for low level. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolDigitalOutput(self: pyaubo_sdk.IoControl, arg0: int) -> bool + * + * @par Lua function prototype + * getToolDigitalOutput(index: number) -> boolean + * + * @par Lua example + * status = getToolDigitalOutput(0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalOutput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endenglish + */ + bool getToolDigitalOutput(int index); + + /** + * \chinese + * 获取所有的工具端数字输出值 + * + * @return 所有的工具端数字输出值 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolDigitalOutputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getToolDigitalOutputs() -> number + * + * @par Lua示例 + * num = getToolDigitalOutputs() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalOutputs","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":9} + * + * \endchinese + * \english + * Get all tool digital output values. + * + * @return All tool digital output values. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolDigitalOutputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getToolDigitalOutputs() -> number + * + * @par Lua example + * num = getToolDigitalOutputs() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalOutputs","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":9} + * + * \endenglish + */ + uint32_t getToolDigitalOutputs(); + + /** + * \chinese + * 获取可配值数字输出值 + * + * @note 可用于获取安全IO的输出值 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * + * @return 高电平返回true; 低电平返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getConfigurableDigitalOutput(self: pyaubo_sdk.IoControl, arg0: int) -> + * bool + * + * @par Lua函数原型 + * getConfigurableDigitalOutput(index: number) -> boolean + * + * @par Lua示例 + * status = getConfigurableDigitalOutput(0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalOutput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endchinese + * \english + * Get the value of configurable digital output. + * + * @note Can be used to get the value of safety IO. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * + * @return Returns true for high level; false for low level. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getConfigurableDigitalOutput(self: pyaubo_sdk.IoControl, arg0: int) -> + * bool + * + * @par Lua function prototype + * getConfigurableDigitalOutput(index: number) -> boolean + * + * @par Lua example + * status = getConfigurableDigitalOutput(0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalOutput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endenglish + */ + bool getConfigurableDigitalOutput(int index); + + /** + * \chinese + * 获取所有的可配值数字输出值 + * + * @note 可用于获取安全IO的输出值 + * + * @return 所有的可配值数字输出\n + * 例如,当返回值是2863267846时,换成2进制后是10101010101010100000000000000110。 + * 后16位就是所有的输出值, + * 最后一位表示管脚0的输出状态值,倒数第二位表示管脚1的输出状态值,以此类推。\n + * 1表示高电平状态,0表示低电平状态. + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getConfigurableDigitalOutputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getConfigurableDigitalOutputs() -> number + * + * @par Lua示例 + * num = getConfigurableDigitalOutputs() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalOutputs","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1} + * + * \endchinese + * \english + * Get all configurable digital output values. + * + * @note Can be used to get the value of safety IO. + * + * @return All configurable digital output values.\n + * For example, if the return value is 2863267846, its binary representation is 10101010101010100000000000000110. + * The lower 16 bits represent the status of all output pins, + * the least significant bit indicates the output status of pin 0, the second least significant bit indicates pin 1, and so on.\n + * 1 means high level, 0 means low level. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getConfigurableDigitalOutputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getConfigurableDigitalOutputs() -> number + * + * @par Lua example + * num = getConfigurableDigitalOutputs() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalOutputs","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1} + * + * \endenglish + */ + uint32_t getConfigurableDigitalOutputs(); + + /** + * \chinese + * 获取标准模拟输入值 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * + * @return 标准模拟输入值 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStandardAnalogInput(self: pyaubo_sdk.IoControl, arg0: int) -> float + * + * @par Lua函数原型 + * getStandardAnalogInput(index: number) -> number + * + * @par Lua示例 + * getStandardAnalogInput(0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardAnalogInput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endchinese + * \english + * Get the value of standard analog input. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * + * @return Standard analog input value. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStandardAnalogInput(self: pyaubo_sdk.IoControl, arg0: int) -> float + * + * @par Lua function prototype + * getStandardAnalogInput(index: number) -> number + * + * @par Lua example + * getStandardAnalogInput(0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardAnalogInput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endenglish + */ + double getStandardAnalogInput(int index); + + /** + * \chinese + * 获取工具端模拟输入值 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * + * @return 工具端模拟输入值 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolAnalogInput(self: pyaubo_sdk.IoControl, arg0: int) -> float + * + * @par Lua函数原型 + * getToolAnalogInput(index: number) -> number + * + * @par Lua示例 + * num = getToolAnalogInput(0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolAnalogInput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endchinese + * \english + * Get the value of tool analog input. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * + * @return Tool analog input value. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolAnalogInput(self: pyaubo_sdk.IoControl, arg0: int) -> float + * + * @par Lua function prototype + * getToolAnalogInput(index: number) -> number + * + * @par Lua example + * num = getToolAnalogInput(0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolAnalogInput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endenglish + */ + double getToolAnalogInput(int index); + + /** + * \chinese + * 获取标准模拟输出值 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * + * @return 标准模拟输出值 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStandardAnalogOutput(self: pyaubo_sdk.IoControl, arg0: int) -> float + * + * @par Lua函数原型 + * getStandardAnalogOutput(index: number) -> number + * + * @par Lua示例 + * num = getStandardAnalogOutput(0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardAnalogOutput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endchinese + * \english + * Get the value of standard analog output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * + * @return Standard analog output value. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStandardAnalogOutput(self: pyaubo_sdk.IoControl, arg0: int) -> float + * + * @par Lua function prototype + * getStandardAnalogOutput(index: number) -> number + * + * @par Lua example + * num = getStandardAnalogOutput(0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardAnalogOutput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endenglish + */ + double getStandardAnalogOutput(int index); + + /** + * \chinese + * 获取工具端模拟输出值 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * + * @return 工具端模拟输出值 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolAnalogOutput(self: pyaubo_sdk.IoControl, arg0: int) -> float + * + * @par Lua函数原型 + * getToolAnalogOutput(index: number) -> number + * + * @par Lua示例 + * num = getToolAnalogOutput(0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolAnalogOutput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endchinese + * \english + * Get the value of tool analog output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * + * @return Tool analog output value. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolAnalogOutput(self: pyaubo_sdk.IoControl, arg0: int) -> float + * + * @par Lua function prototype + * getToolAnalogOutput(index: number) -> number + * + * @par Lua example + * num = getToolAnalogOutput(0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolAnalogOutput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endenglish + */ + double getToolAnalogOutput(int index); + + /** + * \chinese + * 获取联动输入数量 + * + * @return 联动输入数量 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStaticLinkInputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getStaticLinkInputNum() -> number + * + * @par Lua示例 + * num = getStaticLinkInputNum() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStaticLinkInputNum","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":8} + * + * \endchinese + * \english + * Get the number of static link inputs. + * + * @return Number of static link inputs. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStaticLinkInputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getStaticLinkInputNum() -> number + * + * @par Lua example + * num = getStaticLinkInputNum() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStaticLinkInputNum","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":8} + * + * \endenglish + */ + int getStaticLinkInputNum(); + + /** + * \chinese + * 获取联动输出数量 + * + * @return 联动输出数量 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStaticLinkOutputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getStaticLinkOutputNum() -> number + * + * @par Lua示例 + * num = getStaticLinkOutputNum() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStaticLinkOutputNum","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get the number of static link outputs. + * + * @return Number of static link outputs. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStaticLinkOutputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getStaticLinkOutputNum() -> number + * + * @par Lua example + * num = getStaticLinkOutputNum() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStaticLinkOutputNum","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int getStaticLinkOutputNum(); + + /** + * \chinese + * 获取所有的联动输入值 + * + * @return 所有的联动输入值\n + * 例如,当返回值是2863267846时,换成2进制后是10101010101010100000000000000110。 + * 后16位就是所有的联动输入状态值, + * 最后一位表示管脚0的输入状态值,倒数第二位表示管脚1的输入状态值,以此类推。\n + * 1表示高电平状态,0表示低电平状态. + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStaticLinkInputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getStaticLinkInputs() -> number + * + * @par Lua示例 + * num = getStaticLinkInputs() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStaticLinkInputs","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get all static link input values. + * + * @return All static link input values.\n + * For example, if the return value is 2863267846, its binary representation is 10101010101010100000000000000110. + * The lower 16 bits represent the status of all static link inputs, + * the least significant bit indicates the input status of pin 0, the second least significant bit indicates pin 1, and so on.\n + * 1 means high level, 0 means low level. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStaticLinkInputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getStaticLinkInputs() -> number + * + * @par Lua example + * num = getStaticLinkInputs() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStaticLinkInputs","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + uint32_t getStaticLinkInputs(); + + /** + * \chinese + * 获取所有的联动输出值 + * + * @return 返回所有的联动输出值 \n + * 例如,当返回值是2863267846时,换成2进制后是10101010101010100000000000000110。 + * 后16位就是所有的联动输出状态值, + * 最后一位表示管脚0的输出状态值,倒数第二位表示管脚1的输出状态值,以此类推。\n + * 1表示高电平状态,0表示低电平状态. + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStaticLinkOutputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getStaticLinkOutputs() -> number + * + * @par Lua示例 + * num = getStaticLinkOutputs() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStaticLinkOutputs","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get all static link output values. + * + * @return Returns all static link output values.\n + * For example, if the return value is 2863267846, its binary representation is 10101010101010100000000000000110. + * The lower 16 bits represent the status of all static link outputs, + * the least significant bit indicates the output status of pin 0, the second least significant bit indicates pin 1, and so on.\n + * 1 means high level, 0 means low level. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStaticLinkOutputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getStaticLinkOutputs() -> number + * + * @par Lua example + * num = getStaticLinkOutputs() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStaticLinkOutputs","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + uint32_t getStaticLinkOutputs(); + + /** + * \chinese + * 机器人是否配置了编码器 + * 集成编码器的编号为 0 + * + * @return 机器人配置编码器返回 true, 反之返回 false + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.hasEncoderSensor","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endchinese + * \english + * Whether the robot is equipped with an encoder. + * The integrated encoder number is 0. + * + * @return Returns true if the robot is equipped with an encoder, otherwise false. + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.hasEncoderSensor","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endenglish + */ + bool hasEncoderSensor(); + /** + * \chinese + * 设置集成编码器的解码方式 + * + * @param type + * 0-禁用编码器 + * 1-AB正交 + * 2-AB正交+Z + * 3-AB差分正交 + * 4-AB差分正交+Z差分 + * + * @param range_id + * 0 表示32位有符号编码器,范围为 [-2147483648, 2147483647] + * 1 表示8位无符号编码器,范围为 [0, 255] + * 2 表示16位无符号编码器,范围为 [0, 65535] + * 3 表示24位无符号编码器,范围为 [0, 16777215] + * 4 表示32位无符号编码器,范围为 [0, 4294967295] + * + * @return 成功返回0;失败返回错误码 + * AUBO_NO_ACCESS + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Set the decoding method of the integrated encoder. + * + * @param type + * 0 - Disable encoder + * 1 - AB quadrature + * 2 - AB quadrature + Z + * 3 - AB differential quadrature + * 4 - AB differential quadrature + Z differential + * + * @param range_id + * 0 is a 32-bit signed encoder, range [-2147483648, 2147483647] + * 1 is an 8-bit unsigned encoder, range [0, 255] + * 2 is a 16-bit unsigned encoder, range [0, 65535] + * 3 is a 24-bit unsigned encoder, range [0, 16777215] + * 4 is a 32-bit unsigned encoder, range [0, 4294967295] + * + * @return Returns 0 on success; error code on failure. + * AUBO_NO_ACCESS + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int setEncDecoderType(int type, int range_id); + + /** + * \chinese + * 设置集成编码器脉冲数 + * + * @param tick 脉冲数 + * + * @return 成功返回0;失败返回错误码 + * AUBO_NO_ACCESS + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Set the tick count of the integrated encoder. + * + * @param tick Tick count + * + * @return Returns 0 on success; error code on failure. + * AUBO_NO_ACCESS + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int setEncTickCount(int tick); + + /** + * \chinese + * 获取编码器的解码方式 + * + * @return 成功返回0;失败返回错误码 + * AUBO_NO_ACCESS + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getEncDecoderType","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get the decoder type of the encoder. + * + * @return Returns 0 on success; error code on failure. + * AUBO_NO_ACCESS + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getEncDecoderType","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int getEncDecoderType(); + + /** + * \chinese + * 获取脉冲数 + * + * @return 成功返回0;失败返回错误码 + * AUBO_NO_ACCESS + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getEncTickCount","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get the tick count + * + * @return Returns 0 on success; error code on failure. + * AUBO_NO_ACCESS + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getEncTickCount","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int getEncTickCount(); + + /** + * \chinese + * 防止在计数超出范围时计数错误 + * + * @param delta_count + * + * @return 成功返回0;失败返回错误码 + * AUBO_NO_ACCESS + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Prevent counting errors when the count exceeds the range + * + * @param delta_count + * + * @return Returns 0 on success; error code on failure. + * AUBO_NO_ACCESS + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int unwindEncDeltaTickCount(int delta_count); + + /** + * \chinese + * 获取末端按钮状态 + * + * @return 按下返回true; 否则返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolButtonStatus() -> bool + * + * @par Lua函数原型 + * getToolButtonStatus() -> boolean + * + * @par Lua示例 + * status = getToolButtonStatus() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolButtonStatus","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endchinese + * \english + * Get the status of the tool button. + * + * @return Returns true if pressed; otherwise false. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolButtonStatus() -> bool + * + * @par Lua function prototype + * getToolButtonStatus() -> boolean + * + * @par Lua example + * status = getToolButtonStatus() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolButtonStatus","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endenglish + */ + bool getToolButtonStatus(); + + /** + * \chinese + * 获取手柄按键状态 + * + * @note 获取手柄按键状态 + * + * @return 所有的手柄按键输入值\n + * 例如,当返回值是2863267846时,换成2进制后是10101010101010100000000000000110。 + * 后16位就是所有的输入状态值, + * 最后一位表示管脚0的输入状态值,倒数第二位表示管脚1的输入状态值,以此类推。\n + * 1表示高电平状态,0表示低电平状态 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getHandleIoStatus(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getHandleIoStatus() -> number + * + * @par Lua示例 + * num = getHandleIoStatus() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getHandleIoStatus","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get the status of handle buttons. + * + * @note Get the status of handle buttons. + * + * @return All handle button input values.\n + * For example, if the return value is 2863267846, its binary representation is 10101010101010100000000000000110. + * The lower 16 bits represent the status of all input pins, + * the least significant bit indicates the input status of pin 0, the second least significant bit indicates pin 1, and so on.\n + * 1 means high level, 0 means low level. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getHandleIoStatus(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getHandleIoStatus() -> number + * + * @par Lua example + * num = getHandleIoStatus() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getHandleIoStatus","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + uint32_t getHandleIoStatus(); + + /** + * \chinese + * 获取手柄类型 + * + * @return type + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getHandleType() -> int + * + * @par Lua函数原型 + * getHandleType() -> int + * + * @par Lua示例 + * int_num = getHandleType() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getHandleType","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get the handle type. + * + * @return type + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getHandleType() -> int + * + * @par Lua function prototype + * getHandleType() -> int + * + * @par Lua example + * int_num = getHandleType() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getHandleType","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int getHandleType(); + +protected: + void *d_; +}; +using IoControlPtr = std::shared_ptr; +} // namespace common_interface +} // namespace arcs + +#endif // AUBO_SDK_IO_CONTROL_INTERFACE_H diff --git a/third_party/AuboSdk/linux/include/aubo/robot/motion_control.h b/third_party/AuboSdk/linux/include/aubo/robot/motion_control.h new file mode 100644 index 00000000..2050f02e --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo/robot/motion_control.h @@ -0,0 +1,5937 @@ +/** @file motion_control.h + * \~chinese @brief 运动控制接口 + * \~english @brief Motion control interface + */ +#ifndef AUBO_SDK_MOTION_CONTROL_INTERFACE_H +#define AUBO_SDK_MOTION_CONTROL_INTERFACE_H + +#include +#include +#include + +#include +#include + +namespace arcs { +namespace common_interface { + +/** + * \chinese + * pathBuffer类型 + * + * 机器人运动被编程为位姿到位姿的运动,即从当前位置移动到新位置。两点之间的路径由机器人自动计算。 + * \endchinese + * \english + * + * pathBuffer Type + * + * The robot movements are programmed as pose-to-pose movements, that is move + * from the current position to a new position. The path between these two + * positions is then automatically calculated by the robot. + * \endenglish + */ + +enum PathBufferType +{ + PathBuffer_TOPPRA = 1, ///< \~chinese 1: toppra 时间最优路径规划 \~english + ///< 1: toppra time optimal path planning + PathBuffer_CubicSpline = + 2, ///< \~chinese 2: cubic_spline(录制的轨迹) \~english 2: cubic_spline + ///< (recorded trajectory) + + /// \~chinese 3: 关节B样条插值,最少三个点 \~english 3: Joint B-spline + /// interpolation, at least three points + /// \~chinese 废弃,建议用5替代,现在实际是关节空间 CUBIC_SPLINE \~english + /// Deprecated, use 5 instead, currently it is joint space CUBIC_SPLINE + PathBuffer_JointSpline = 3, + + /// \~chinese 4:关节B样条插值,最少三个点,但是传入的是笛卡尔空间位姿 + /// \~english 4: Joint B-spline interpolation, at least three points, but + /// the input is Cartesian space pose 废弃,建议用6替代,现在实际是关节空间 + /// CUBIC_SPLINE + PathBuffer_JointSplineC = 4, + + ///< \~chinese 5: 关节B样条插值,最少三个点 \~english 5: Joint B-spline + ///< interpolation, at least three points + PathBuffer_JointBSpline = 5, + + /// \~chinese 6:关节B样条插值,最少三个点,但是传入的是笛卡尔空间位姿 + /// \~english 6: Joint B-spline interpolation, at least three points, but + /// the input is Cartesian space pose + PathBuffer_JointBSplineC = 6, +}; + +/** + * MotionControl + */ +class ARCS_ABI_EXPORT MotionControl +{ +public: + MotionControl(); + virtual ~MotionControl(); + + /** + * \chinese + * 获取等效半径,单位 m + * moveLine/moveCircle时,末端姿态旋转的角度等效到末端位置移动 + * 可以通过 setEqradius 设置,默认为1 + * + * @return 返回等效半径 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getEqradius(self: pyaubo_sdk.MotionControl) -> float + * + * @par Lua函数原型 + * getEqradius() -> number + * + * @par Lua 示例 + * num = getEqradius() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getEqradius","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1.0} + * \endchinese + * \english + * Get the equivalent radius, in meters. + * When using moveLine/moveCircle, the rotation angle of the end effector's + * pose is converted to an equivalent end position movement. Can be set via + * setEqradius, default is 1. + * + * @return Returns the equivalent radius. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getEqradius(self: pyaubo_sdk.MotionControl) -> float + * + * @par Lua function prototype + * getEqradius() -> number + * + * @par Lua example + * num = getEqradius() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getEqradius","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1.0} + * \endenglish + */ + double getEqradius(); + + /** + * \chinese + * 设置等效半径,单位 m + * moveLine/moveCircle时,末端姿态旋转的角度等效到末端位置移动,数值越大,姿态旋转速度越快 + * + * @param eqradius 0表示只规划移动,姿态旋转跟随移动 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setEqradius","params":[0.8],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par Python函数原型 + * setEqradius(self: pyaubo_sdk.MotionControl, arg0: float) -> int + * + * @par Lua函数原型 + * setEqradius(eqradius: number) -> number + * + * @par Lua示例 + * num = setEqradius(1) + * + * \endchinese + * \english + * Set the equivalent radius, in meters. + * When using moveLine/moveCircle, the rotation angle of the end effector's + * pose is converted to an equivalent end position movement. The larger the + * value, the faster the posture rotation speed. + * + * @param eqradius 0 means only plan the movement, and the posture rotation + * follows the movement. + * + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setEqradius","params":[0.8],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par Python function prototype + * setEqradius(self: pyaubo_sdk.MotionControl, arg0: float) -> int + * + * @par Lua function prototype + * setEqradius(eqradius: number) -> number + * + * @par Lua example + * num = setEqradius(1) + * + * \endenglish + */ + int setEqradius(double eqradius); + + /** + * \chinese + * 动态调整机器人运行速度和加速度比例 (0., 1.] + * + * @param fraction 机器人运行速度和加速度比例 + * @return 成功返回0; 失败返回错误码 + * AUBO_INVL_ARGUMENT + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setSpeedFraction(self: pyaubo_sdk.MotionControl, arg0: float) -> int + * + * @par Lua函数原型 + * setSpeedFraction(fraction: number) -> nil + * + * @par Lua示例 + * setSpeedFraction(0.5) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setSpeedFraction","params":[0.8],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Dynamically adjust the robot's speed and acceleration ratio (0., 1.] + * + * @param fraction The ratio of robot speed and acceleration + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_INVL_ARGUMENT + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setSpeedFraction(self: pyaubo_sdk.MotionControl, arg0: float) -> int + * + * @par Lua function prototype + * setSpeedFraction(fraction: number) -> nil + * + * @par Lua example + * setSpeedFraction(0.5) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setSpeedFraction","params":[0.8],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setSpeedFraction(double fraction); + + /** + * \chinese + * 获取速度和加速度比例,默认为 1 + * 可以通过 setSpeedFraction 接口设置 + * + * @return 返回速度和加速度比例 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getSpeedFraction(self: pyaubo_sdk.MotionControl) -> float + * + * @par Lua函数原型 + * getSpeedFraction() -> number + * + * @par Lua示例 + * num = getSpeedFraction() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getSpeedFraction","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1.0} + * \endchinese + * \english + * Get the speed and acceleration ratio, default is 1. + * Can be set via setSpeedFraction interface. + * + * @return Returns the speed and acceleration ratio. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getSpeedFraction(self: pyaubo_sdk.MotionControl) -> float + * + * @par Lua function prototype + * getSpeedFraction() -> number + * + * @par Lua example + * num = getSpeedFraction() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getSpeedFraction","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1.0} + * \endenglish + */ + double getSpeedFraction(); + + /** + * \chinese + * 速度比例设置临界区,使能之后速度比例被强制设定为1. , + * 失能之后恢复之前的速度比例 + * + * @param enable + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Lua函数原型 + * speedFractionCritical() -> bool + * + * @par Lua示例 + * speedFractionCritical(true) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.speedFractionCritical","params":[true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Speed fraction critical section. When enabled, the speed fraction is + * forced to 1. When disabled, the previous speed fraction is restored. + * + * @param enable + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Lua function prototype + * speedFractionCritical() -> nil + * + * @par Lua example + * speedFractionCritical(true) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.speedFractionCritical","params":[true],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int speedFractionCritical(bool enable); + + /** + * \chinese + * 是否处于速度比例设置临界区 + * + * @return 处于速度比例设置临界区返回 true; 反之返回 false + * + * @throws arcs::common_interface::AuboException + * + * @par Lua函数原型 + * isSpeedFractionCritical() -> bool + * + * @par Lua示例 + * status = isSpeedFractionCritical() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.isSpeedFractionCritical","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":true} + * \endchinese + * \english + * Whether it is in the speed fraction critical section + * + * @return Returns true if in the speed fraction critical section; otherwise + * returns false + * + * @throws arcs::common_interface::AuboException + * + * @par Lua function prototype + * isSpeedFractionCritical() -> bool + * + * @par Lua example + * status = isSpeedFractionCritical() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.isSpeedFractionCritical","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":true} + * \endenglish + */ + bool isSpeedFractionCritical(); + + /** + * \chinese + * 是否处交融区 + * + * @return 处交融区返回 true; 反之返回 false + * + * @throws arcs::common_interface::AuboException + * + * @par Lua函数原型 + * isBlending() -> bool + * + * @par Lua示例 + * status = isBlending() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.isBlending","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * \endchinese + * \english + * Whether it is in the blending area + * + * @return Returns true if in the blending area; otherwise returns false + * + * @throws arcs::common_interface::AuboException + * + * @par Lua function prototype + * isBlending() -> bool + * + * @par Lua example + * status = isBlending() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.isBlending","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * \endenglish + */ + bool isBlending(); + + /** + * \chinese + * 设置偏移的最大速度和最大加速度 + * 仅对pathOffsetSet中 type=1 有效 + * @param v 最大速度 + * @param a 最大加速度 + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathOffsetLimits(self: pyaubo_sdk.MotionControl, arg0: float, arg1: + * float) -> int + * + * @par Lua函数原型 + * pathOffsetLimits(v: number, a: number) -> nil + * + * @par Lua示例 + * pathOffsetLimits(1.5,2.5) + * + * \endchinese + * \english + * Set the maximum speed and maximum acceleration for offset. + * Only valid when type=1 in pathOffsetSet. + * @param v Maximum speed + * @param a Maximum acceleration + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathOffsetLimits(self: pyaubo_sdk.MotionControl, arg0: float, arg1: + * float) -> int + * + * @par Lua function prototype + * pathOffsetLimits(v: number, a: number) -> nil + * + * @par Lua example + * pathOffsetLimits(1.5,2.5) + * + * \endenglish + */ + int pathOffsetLimits(double v, double a); + + /** + * \chinese + * 设置偏移的参考坐标系 + * 仅对pathOffsetSet中 type=1 有效 + * @param ref_coord 参考坐标系 0-基坐标系 1-TCP + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathOffsetCoordinate(self: pyaubo_sdk.MotionControl, arg0: int) -> float + * + * @par Lua函数原型 + * pathOffsetCoordinate(ref_coord: number) -> number + * + * @par Lua示例 + * num = pathOffsetCoordinate(0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathOffsetCoordinate","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set the reference coordinate system for offset. + * Only valid when type=1 in pathOffsetSet. + * @param ref_coord Reference coordinate system: 0-base coordinate, 1-TCP + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathOffsetCoordinate(self: pyaubo_sdk.MotionControl, arg0: int) -> float + * + * @par Lua function prototype + * pathOffsetCoordinate(ref_coord: number) -> number + * + * @par Lua example + * num = pathOffsetCoordinate(0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathOffsetCoordinate","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int pathOffsetCoordinate(int ref_coord); + + /** + * \chinese + * 路径偏移使能 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathOffsetEnable(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua函数原型 + * pathOffsetEnable() -> number + * + * @par Lua示例 + * num = pathOffsetEnable() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathOffsetEnable","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Enable path offset + * + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathOffsetEnable(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua function prototype + * pathOffsetEnable() -> number + * + * @par Lua example + * num = pathOffsetEnable() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathOffsetEnable","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int pathOffsetEnable(); + + /** + * \chinese + * 设置路径偏移 + * + * @param offset 在各方向的位姿偏移 + * @param type 运动类型 0-位置规划 1-速度规划 + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathOffsetSet(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * int) -> int + * + * @par Lua函数原型 + * pathOffsetSet(offset: table, type: number) -> nil + * + * @par Lua 示例 + * pathOffsetSet({ 0, 0, 0.1, 0, 0, 0 }, 0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathOffsetSet","params":[[0,0,0.01,0,0,0],0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set path offset + * + * @param offset Pose offset in each direction + * @param type Motion type 0-position planning 1-velocity planning + * @return Returns 0 on success; otherwise returns error code + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathOffsetSet(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * int) -> int + * + * @par Lua function prototype + * pathOffsetSet(offset: table, type: number) -> nil + * + * @par Lua example + * pathOffsetSet({ 0, 0, 0.1, 0, 0, 0 }, 0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathOffsetSet","params":[[0,0,0.01,0,0,0],0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int pathOffsetSet(const std::vector &offset, int type = 0); + + /** + * \chinese + * 路径偏移失能 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathOffsetDisable(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua函数原型 + * pathOffsetDisable() -> nil + * + * @par Lua示例 + * pathOffsetDisable() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathOffsetDisable","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Disable path offset + * + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathOffsetDisable(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua function prototype + * pathOffsetDisable() -> nil + * + * @par Lua example + * pathOffsetDisable() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathOffsetDisable","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int pathOffsetDisable(); + + /** + * \chinese + * @brief 监控轨迹偏移范围 + * @param min: 沿坐标轴负方向最大偏移量 + * @param max: 沿坐标轴正方向最大偏移量 + * @param strategy: 达到最大偏移量后监控策略 + *     0-禁用监控 + *     1-饱和限制,即维持最大姿态 + *     2-保护停止 + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathOffsetSupv(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * List[float], arg2: int) -> int + * + * @par Lua函数原型 + * pathOffsetSupv(min: table, max: table, strategy: number) -> number + * + * @par Lua示例 + * num = pathOffsetSupv({0,0,-0.2,0,0,0},{0,0,0.5,0,0,0},0) + * + * \endchinese + * \english + * @brief Monitor trajectory offset range + * @param min: Maximum offset in the negative direction of the coordinate + * axis + * @param max: Maximum offset in the positive direction of the coordinate + * axis + * @param strategy: Monitoring strategy after reaching the maximum offset + *     0 - Disable monitoring + *     1 - Saturation limit, i.e., maintain maximum pose + *     2 - Protective stop + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathOffsetSupv(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * List[float], arg2: int) -> int + * + * @par Lua function prototype + * pathOffsetSupv(min: table, max: table, strategy: number) -> number + * + * @par Lua example + * num = pathOffsetSupv({0,0,-0.2,0,0,0},{0,0,0.5,0,0,0},0) + * + * \endenglish + */ + int pathOffsetSupv(const std::vector &min, + const std::vector &max, int strategy); + + /** + * \chinese + * 关节偏移使能 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * jointOffsetEnable(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua函数原型 + * jointOffsetEnable() -> nil + * + * @par Lua示例 + * jointOffsetEnable() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.jointOffsetEnable","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Enable joint offset + * + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * jointOffsetEnable(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua function prototype + * jointOffsetEnable() -> nil + * + * @par Lua example + * jointOffsetEnable() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.jointOffsetEnable","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int jointOffsetEnable(); + + /** + * \chinese + * 设置关节偏移 + * + * @param offset 在各关节的位姿偏移 + * @param type + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * jointOffsetSet(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * int) -> int + * + * @par Lua函数原型 + * jointOffsetSet(offset: table, type: number) -> nil + * + * @par Lua示例 + * jointOffsetSet({0.1,0,0,0,0,0},1) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.jointOffsetSet","params":[[0.1,0,0,0,0],1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set joint offset + * + * @param offset Pose offset for each joint + * @param type + * @return Returns 0 on success; otherwise returns error code + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * jointOffsetSet(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * int) -> int + * + * @par Lua function prototype + * jointOffsetSet(offset: table, type: number) -> nil + * + * @par Lua example + * jointOffsetSet({0.1,0,0,0,0,0},1) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.jointOffsetSet","params":[[0.1,0,0,0,0],1],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int jointOffsetSet(const std::vector &offset, int type = 1); + + /** + * \chinese + * 关节偏移失能 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * jointOffsetDisable(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua函数原型 + * jointOffsetDisable() -> nil + * + * @par Lua示例 + * jointOffsetDisable() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.jointOffsetDisable","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Disable joint offset + * + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * jointOffsetDisable(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua function prototype + * jointOffsetDisable() -> nil + * + * @par Lua example + * jointOffsetDisable() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.jointOffsetDisable","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int jointOffsetDisable(); + + /** + * \chinese + * 获取已经入队的指令段(INST)数量,运动指令包括 + * moveJoint/moveLine/moveCircle 等运动指令以及 setPayload 等配置指令 + * + * 指令一般会在接口宏定义里面用 _INST 指示, 比如 moveJoint + * _INST(MotionControl, 5, moveJoint, q, a, v, blend_radius, duration) + * + * @return 已经入队的指令段数量 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getQueueSize(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua函数原型 + * getQueueSize() -> number + * + * @par Lua示例 + * num = getQueueSize() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getQueueSize","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get the number of enqueued instruction segments (INST), including motion + * instructions such as moveJoint/moveLine/moveCircle and configuration + * instructions such as setPayload. + * + * Instructions are generally indicated with _INST in macro definitions, for + * example: _INST(MotionControl, 5, moveJoint, q, a, v, blend_radius, + * duration) + * + * @return The number of enqueued instruction segments. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getQueueSize(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua function prototype + * getQueueSize() -> number + * + * @par Lua example + * num = getQueueSize() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getQueueSize","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int getQueueSize(); + + /** + * \chinese + * 获取已经入队的运动规划插补点数量 + * + * @return 已经入队的运动规划插补点数量 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getTrajectoryQueueSize(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua函数原型 + * getTrajectoryQueueSize() -> number + * + * @par Lua示例 + * num = getTrajectoryQueueSize() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getTrajectoryQueueSize","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Get the number of enqueued motion planning interpolation points + * + * @return The number of enqueued motion planning interpolation points + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getTrajectoryQueueSize(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua function prototype + * getTrajectoryQueueSize() -> number + * + * @par Lua example + * num = getTrajectoryQueueSize() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getTrajectoryQueueSize","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int getTrajectoryQueueSize(); + + /** + * \chinese + * 获取当前正在插补的运动指令段的ID + * + * @return 当前正在插补的运动指令段的ID + * @retval -1 表示轨迹队列为空 \n + * 像movePathBuffer运动中的buffer或者规划器(moveJoint和moveLine等)里的队列都属于轨迹队列 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getExecId(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua函数原型 + * getExecId() -> number + * + * @par Lua示例 + * num = getExecId() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getExecId","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":-1} + * + * \endchinese + * \english + * Get the ID of the currently interpolating motion instruction segment. + * + * @return The ID of the currently interpolating motion instruction segment. + * @retval -1 Indicates the trajectory queue is empty. \n + * Both the buffer in movePathBuffer motion and the queue in the planner + * (such as moveJoint and moveLine) belong to the trajectory queue. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getExecId(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua function prototype + * getExecId() -> number + * + * @par Lua example + * num = getExecId() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getExecId","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":-1} + * + * \endenglish + */ + int getExecId(); + + /** + * \chinese + * 获取指定ID的运动指令段的预期执行时间 + * + * @param id 运动指令段ID + * @return 返回预期执行时间 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getDuration(self: pyaubo_sdk.MotionControl, arg0: int) -> float + * + * @par Lua函数原型 + * getDuration(id: number) -> number + * + * @par Lua示例 + * num = getDuration(16) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getDuration","params":[16],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endchinese + * \english + * Get the expected execution duration of the motion segment with the + * specified ID. + * + * @param id Motion segment ID + * @return Returns the expected execution duration + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getDuration(self: pyaubo_sdk.MotionControl, arg0: int) -> float + * + * @par Lua function prototype + * getDuration(id: number) -> number + * + * @par Lua example + * num = getDuration(16) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getDuration","params":[16],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endenglish + */ + double getDuration(int id); + + /** + * \chinese + * 获取指定ID的运动指令段的剩余执行时间 + * + * @param id 运动指令段ID + * @return 返回剩余执行时间 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getMotionLeftTime(self: pyaubo_sdk.MotionControl, arg0: int) -> float + * + * @par Lua函数原型 + * getMotionLeftTime(id: number) -> number + * + * @par Lua示例 + * num = getMotionLeftTime(16) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getMotionLeftTime","params":[16],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * \endchinese + * \english + * Get the remaining execution time of the motion segment with the specified + * ID. + * + * @param id Motion segment ID + * @return Returns the remaining execution time + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getMotionLeftTime(self: pyaubo_sdk.MotionControl, arg0: int) -> float + * + * @par Lua function prototype + * getMotionLeftTime(id: number) -> number + * + * @par Lua example + * num = getMotionLeftTime(16) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getMotionLeftTime","params":[16],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * \endenglish + */ + double getMotionLeftTime(int id); + + /** + * \chinese + * StopMove 用于临时停止机器人和外部轴的运动以及相关工艺进程。如果调用 + * StartMove 指令,则运动和工艺进程将恢复。 + * + * 该指令可用于中断处理程序中,在发生中断时临时停止机器人。 + * + * @param quick true: 以最快速度在路径上停止机器人。未指定 quick + * 参数时,机器人将在路径上停止,但制动距离较长(与普通程序停止相同)。 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Lua函数原型 + * StopMove(quick: bool,all_tasks: bool) -> number + * + * @par Lua示例 + * num = StopMove(true,true) + * + * \endchinese + * \english + * StopMove is used to stop robot and external axes movements and any + * belonging process temporarily. If the instruction StartMove is given then + * the movement and process resumes. + * + * This instruction can, for example, be used in a trap routine to stop the + * robot temporarily when an interrupt occurs. + * + * @param quick true: Stops the robot on the path as fast as possible. + * Without the optional parameter \Quick, the robot stops on the path, but + * the braking distance is longer (same as for normal Program Stop). + * + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Lua function prototype + * StopMove(quick: bool,all_tasks: bool) -> number + * + * @par Lua example + * num = StopMove(true,true) + * + * \endenglish + */ + int stopMove(bool quick, bool all_tasks); + + /** + * \chinese + * StartMove 用于在以下情况下恢复机器人、外部轴的运动以及相关工艺进程: + * • 通过 StopMove 指令停止后。 + * • 执行 StorePath ... RestoPath 序列后。 + * • 发生异步运动错误(如 ERR_PATH_STOP)或特定工艺错误并在 ERROR + * 处理器中处理后。 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Lua函数原型 + * startMove() -> number + * + * @par Lua示例 + * num = startMove() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.startMove","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * StartMove is used to resume robot, external axes movement and belonging + * process after the movement has been stopped + * + * • by the instruction StopMove. + * • after execution of StorePath ... RestoPath sequence. + * • after asynchronously raised movements errors, such as ERR_PATH_STOP or + * specific process error after handling in the ERROR handler. + * + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Lua function prototype + * startMove() -> number + * + * @par Lua example + * num = startMove() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.startMove","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int startMove(); + + /** + * \chinese + * storePath + * + * @param keep_sync + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Lua函数原型 + * storePath(keep_sync: bool) -> number + * + * @par Lua示例 + * num = storePath() + * + * \endchinese + * \english + * storePath + * + * @param keep_sync + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Lua function prototype + * storePath(keep_sync: bool) -> number + * + * @par Lua example + * num = storePath() + * + * \endenglish + */ + int storePath(bool keep_sync); + + /** + * \chinese + * ClearPath (清除路径) 清除当前运动路径层级(基础层级或 StorePath + * 层级)上的所有运动路径。 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Lua函数原型 + * clearPath() -> number + * + * @par Lua示例 + * num = clearPath() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.clearPath","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * ClearPath clears the whole motion path on the current motion path level + * (base level or StorePath level). + * + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Lua function prototype + * clearPath() -> number + * + * @par Lua example + * num = clearPath() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.clearPath","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int clearPath(); + + /** + * \chinese + * restoPath + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Lua函数原型 + * restoPath() -> number + * + * @par Lua示例 + * num = restoPath() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.restoPath","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * restoPath + * + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Lua function prototype + * restoPath() -> number + * + * @par Lua example + * num restoPath() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.restoPath","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int restoPath(); + + /** + * \chinese + * 获取当前运动指令段的执行进度 + * + * @return 返回执行进度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getProgress(self: pyaubo_sdk.MotionControl) -> float + * + * @par Lua函数原型 + * getProgress() -> number + * + * @par Lua示例 + * num = getProgress() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getProgress","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endchinese + * \english + * Get the execution progress of the current motion instruction segment. + * + * @return Returns the execution progress. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getProgress(self: pyaubo_sdk.MotionControl) -> float + * + * @par Lua function prototype + * getProgress() -> number + * + * @par Lua example + * num = getProgress() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getProgress","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endenglish + */ + double getProgress(); + + /** + * \chinese + * 当工件安装在另外一台机器人的末端或者外部轴上时,指定其名字和安装位置 + * + * @note 暂未实现 + * + * @param module_name 控制模块名字 + * @param mounting_pose 抓取的相对位置, + * 如果是机器人,则相对于机器人末端中心点(非TCP点) + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setWorkObjectHold(self: pyaubo_sdk.MotionControl, arg0: str, arg1: + * List[float]) -> int + * + * @par Lua函数原型 + * setWorkObjectHold(module_name: string, mounting_pose: table) -> nil + * + * @par Lua示例 + * setWorkObjectHold("object",{0.2,0.1,-0.4,3.14,0,-1.57}) + * + * \endchinese + * \english + * Specify the name and mounting position when the workpiece is installed on + * the end of another robot or external axis. + * + * @note Not implemented yet + * + * @param module_name Name of the control module + * @param mounting_pose Relative position of the grasp, + * if it is a robot, it is relative to the robot's end center point (not the + * TCP point) + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setWorkObjectHold(self: pyaubo_sdk.MotionControl, arg0: str, arg1: + * List[float]) -> int + * + * @par Lua function prototype + * setWorkObjectHold(module_name: string, mounting_pose: table) -> nil + * + * @par Lua example + * setWorkObjectHold("object",{0.2,0.1,-0.4,3.14,0,-1.57}) + * + * \endenglish + */ + int setWorkObjectHold(const std::string &module_name, + const std::vector &mounting_pose); + + /** + * \chinese + * 获取工件安装信息 + * + * @note 暂未实现 + * + * @return 返回一个包含控制模块名字和安装位姿的元组 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getWorkObjectHold(self: pyaubo_sdk.MotionControl) -> Tuple[str, + * List[float]] + * + * @par Lua函数原型 + * getWorkObjectHold() -> table + * + * @par Lua示例 + * Object_table = getWorkObjectHold() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getWorkObjectHold","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":["",[]]} + * \endchinese + * \english + * getWorkObjectHold + * + * @note Not implemented yet + * + * @return Returns a tuple containing the control module name and mounting + * pose + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getWorkObjectHold(self: pyaubo_sdk.MotionControl) -> Tuple[str, + * List[float]] + * + * @par Lua function prototype + * getWorkObjectHold() -> table + * + * @par Lua example + * Object_table = getWorkObjectHold() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getWorkObjectHold","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":["",[]]} + * \endenglish + */ + std::tuple> getWorkObjectHold(); + + /** + * \chinese + * @note 获取暂停点关节位置 + * + * 常用于运行工程时发生碰撞后继续运动过程中(先通过resumeMoveJoint或resumeMoveLine运动到暂停位置,再恢复工程) + * + * @return 暂停关节位置 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getPauseJointPositions(self: pyaubo_sdk.MotionControl) -> List[float] + * + * @par Lua函数原型 + * getPauseJointPositions() -> table + * + * @par Lua示例 + * JointPositions = getPauseJointPositions() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getPauseJointPositions","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[8.2321e-13,-0.200999,1.33999,0.334999,1.206,-6.39383e-12]} + * \endchinese + * \english + * @note Get the joint positions at the pause point. + * + * Commonly used during process recovery after a collision occurs (first + * move to the pause position using resumeMoveJoint or resumeMoveLine, then + * resume the process). + * + * @return Pause joint positions + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getPauseJointPositions(self: pyaubo_sdk.MotionControl) -> List[float] + * + * @par Lua function prototype + * getPauseJointPositions() -> table + * + * @par Lua example + * JointPositions = getPauseJointPositions() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getPauseJointPositions","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[8.2321e-13,-0.200999,1.33999,0.334999,1.206,-6.39383e-12]} + * \endenglish + */ + std::vector getPauseJointPositions(); + + /** + * \chinese + * 设置继续运动参数 + * + * @param q 继续运动起始位置 + * @param move_type 0:关节空间 1:笛卡尔空间 + * @param blend_radius 交融半径 + * @param qdmax 关节运动最大速度(6维度数据) + * @param qddmax 关节运动最大加速度(6维度数据) + * @param vmax 直线运动最大线速度,角速度(2维度数据) + * @param amax 直线运动最大线加速度,角加速度(2维度数据) + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setResumeStartPoint(self: pyaubo_sdk.MotionControl, + * arg0:List[float],arg1: int, arg2: float,arg3: List[float], arg4: + * List[float],arg5:float,arg5:float) -> int + * + * @par Lua函数原型 + * setResumeStartPoint(q : table, move_type: number,blend_radius: + * number, qdmax: table, qddmax: + * table,vmax:number,amax:number) -> nilr + * + * @par Lua示例 + * setResumeStartPoint({0,0,0,0,0,0},1,1,{0,0,0,0,0,0},{0,0,0,0,0,0},{1,1},{1,1}) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setResumeStartPoint","params":[[0,0,0,0,0,0],1,1,[0,0,0,0,0,0],[0,0,0,0,0,0],1,1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set resume motion parameters + * + * @param q Resume start position + * @param move_type 0: Joint space, 1: Cartesian space + * @param blend_radius Blend radius + * @param qdmax Maximum joint speed (6 elements) + * @param qddmax Maximum joint acceleration (6 elements) + * @param vmax Maximum linear and angular speed for linear motion (2 + * elements) + * @param amax Maximum linear and angular acceleration for linear motion (2 + * elements) + * @return Returns 0 on success; otherwise returns error code + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setResumeStartPoint(self: pyaubo_sdk.MotionControl, + * arg0: List[float], arg1: int, arg2: float, arg3: List[float], arg4: + * List[float], arg5: float, arg6: float) -> int + * + * @par Lua function prototype + * setResumeStartPoint(q: table, move_type: number, blend_radius: + * number, qdmax: table, qddmax: + * table, vmax: number, amax: number) -> nil + * + * @par Lua example + * setResumeStartPoint({0,0,0,0,0,0},1,1,{0,0,0,0,0,0},{0,0,0,0,0,0},{1,1},{1,1}) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setResumeStartPoint","params":[[0,0,0,0,0,0],1,1,[0,0,0,0,0,0],[0,0,0,0,0,0],1,1],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setResumeStartPoint(const std::vector &q, int move_type, + double blend_radius, + const std::vector &qdmax, + const std::vector &qddmax, + const std::vector &vmax, + const std::vector &amax); + /** + * \chinese + * 获取继续运动模式 + * + * @return 0:继续运动起始点为暂停点 1:继续运动起始点为指定点 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getResumeMode(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua函数原型 + * getResumeMode() -> int + * + * @par Lua示例 + * num = getResumeMode() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getResumeMode","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endchinese + * \english + * Get resume motion mode + * + * @return 0: Resume start point is the pause point; 1: Resume start point + * is the specified point + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getResumeMode(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua function prototype + * getResumeMode() -> int + * + * @par Lua example + * num = getResumeMode() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getResumeMode","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endenglish + */ + int getResumeMode(); + + /** + * \chinese + * 设置伺服模式 + * 使用 setServoModeSelect 替代 + * + * @param enable 是否使能 + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setServoMode(self: pyaubo_sdk.MotionControl, arg0: bool) -> int + * + * @par Lua函数原型 + * setServoMode(enable: boolean) -> nil + * + * @par Lua示例 + * setServoMode(true) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setServoMode","params":[true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set servo mode + * Use setServoModeSelect instead + * + * @param enable Whether to enable + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setServoMode(self: pyaubo_sdk.MotionControl, arg0: bool) -> int + * + * @par Lua function prototype + * setServoMode(enable: boolean) -> nil + * + * @par Lua example + * setServoMode(true) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setServoMode","params":[true],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + ARCS_DEPRECATED int setServoMode(bool enable); + + /** + * \chinese + * 判断伺服模式是否使能 + * 使用 getServoModeSelect 替代 + * + * @return 已使能返回true,反之则返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * isServoModeEnabled(self: pyaubo_sdk.MotionControl) -> bool + * + * @par Lua函数原型 + * isServoModeEnabled() -> boolean + * + * @par Lua示例 + * Servo_status = isServoModeEnabled() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.isServoModeEnabled","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endchinese + * \english + * Determine whether the servo mode is enabled. + * Use getServoModeSelect instead. + * + * @return Returns true if enabled, otherwise returns false. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * isServoModeEnabled(self: pyaubo_sdk.MotionControl) -> bool + * + * @par Lua function prototype + * isServoModeEnabled() -> boolean + * + * @par Lua example + * Servo_status = isServoModeEnabled() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.isServoModeEnabled","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endenglish + */ + ARCS_DEPRECATED bool isServoModeEnabled(); + + /** + * \chinese + * 设置伺服运动模式 + * + * @param mode + * 0-退出伺服模式 + * 1-(截断式)规划伺服模式 + * 2-透传模式(直接下发) + * 3-透传模式(缓存) + * 4-1ms透传模式(缓存) + * 5-规划伺服模式 + * 伺服模式1添加路点后,会实时调整目标点和规划路线(当前的目标点被更新后,不能保证达到之前设定的目标点) + * 伺服模式5添加路点后,能保证经过所有目标点 + * @return + * + * @par Lua函数原型 + * setServoModeSelect(0) -> nil + * + * @par Lua示例 + * setServoModeSelect(0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setServoModeSelect","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set servo motion mode + * + * @param mode + * 0 - Exit servo mode + * 1 - Planning servo mode + * 2 - Transparent mode (direct send) + * 3 - Transparent mode (buffered) + * @return + * + * @par Lua function prototype + * setServoModeSelect(0) -> nil + * + * @par Lua example + * setServoModeSelect(0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setServoModeSelect","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setServoModeSelect(int mode); + + /** + * \chinese + * 获取伺服运动模式 + * + * @return + * + * @par Lua函数原型 + * getServoModeSelect() -> number + * + * @par Lua示例 + * num = getServoModeSelect() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getServoModeSelect","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get the servo motion mode + * + * @return + * + * @par Lua function prototype + * getServoModeSelect() -> number + * + * @par Lua example + * num = getServoModeSelect() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getServoModeSelect","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int getServoModeSelect(); + + /** + * \chinese + * 关节空间伺服 + * + * 目前可用参数只有 q 和 t; + * @param q 关节角, 单位 rad, + * @param a 加速度, 单位 rad/s^2, + * @param v 速度,单位 rad/s, + * @param t 运行时间,单位 s \n + * t 值越大,机器臂运动越慢,反之,运动越快; + * 该参数最优值为连续调用 servoJoint 接口的间隔时间。 + * @param lookahead_time 前瞻时间,单位 s \n + * 指定机器臂开始减速前要运动的时长,用前瞻时间来平滑轨迹[0.03, 0.2], + * 当 lookahead_time 小于一个控制周期时,越小则超调量越大, + * 该参数最优值为一个控制周期。 + * @param gain 比例增益 + * 跟踪目标位置的比例增益[100, 200], + * 用于控制运动的顺滑性和精度, + * 比例增益越大,到达目标位置的时间越长,超调量越小。 + * + * @retval 0 成功 + * @retval AUBO_BAD_STATE(1) 当前安全模式处于非 + * Normal、ReducedMode、Recovery 状态 + * @retval AUBO_QUEUE_FULL(2) 规划队列已满 + * @retval AUBO_BUSY(3) 上一条指令正在执行中 + * @retval -AUBO_BAD_STATE(-1) + * 可能的原因包括但不限于:线程已分离、线程被终止、task_id + * 未找到,或者当前机器人模式非 Running + * @retval -AUBO_TIMEOUT(-4) 调用接口超时 + * @retval -AUBO_INVL_ARGUMENT(-5) 轨迹位置超限或速度超限 + * @retval -AUBO_REQUEST_IGNORE(-13) 当前处于非 servo 模式 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * servoJoint(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float, arg3: float, arg4: float, arg5: float) -> int + * + * @par Lua函数原型 + * servoJoint(q: table, a: number, v: number, t: number, lookahead_time: + * number, gain: number) -> nil + * + * @par Lua示例 + * servoJoint({0,0,0,0,0,0},0,0,10,0,0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.servoJoint","params":[[0,0,0,0,0,0],0,0,10,0,0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":-13} + * + * \endchinese + * \english + * Joint space servo + * + * Currently only q and t parameters are available; + * @param q Joint angles, unit: rad + * @param a Acceleration, unit: rad/s^2 + * @param v Velocity, unit: rad/s + * @param t Execution time, unit: s \n + * The larger the t value, the slower the robot moves, and vice versa; + * The optimal value for this parameter is the interval time for continuous + * calls to the servoJoint interface. + * @param lookahead_time Lookahead time, unit: s \n + * Specifies the duration to move before the robot starts to decelerate, + * used to smooth the trajectory [0.03, 0.2]. When lookahead_time is less + * than one control cycle, the smaller it is, the greater the overshoot. The + * optimal value for this parameter is one control cycle. + * @param gain Proportional gain + * Proportional gain for tracking the target position [100, 200], + * used to control the smoothness and accuracy of the motion. + * The larger the proportional gain, the longer it takes to reach the target + * position, and the smaller the overshoot. + * + * @retval 0 Success + * @retval AUBO_BAD_STATE(1) The current safety mode is not Normal, + * ReducedMode, or Recovery + * @retval AUBO_QUEUE_FULL(2) Planning queue is full + * @retval AUBO_BUSY(3) The previous instruction is being executed + * @retval -AUBO_BAD_STATE(-1) + * Possible reasons include but are not limited to: thread has been + * detached, thread terminated, task_id not found, or the current robot mode + * is not Running + * @retval -AUBO_TIMEOUT(-4) Interface call timeout + * @retval -AUBO_INVL_ARGUMENT(-5) Trajectory position or velocity out of + * range + * @retval -AUBO_REQUEST_IGNORE(-13) Not in servo mode + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * servoJoint(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float, arg3: float, arg4: float, arg5: float) -> int + * + * @par Lua function prototype + * servoJoint(q: table, a: number, v: number, t: number, lookahead_time: + * number, gain: number) -> nil + * + * @par Lua example + * servoJoint({0,0,0,0,0,0},0,0,10,0,0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.servoJoint","params":[[0,0,0,0,0,0],0,0,10,0,0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":-13} + * + * \endenglish + */ + int servoJoint(const std::vector &q, double a, double v, double t, + double lookahead_time, double gain); + + /** + * \chinese + * 笛卡尔空间伺服 + * + * 目前可用参数只有 pose 和 t; + * @param pose 位姿, 单位 m, + * @param a 加速度, 单位 m/s^2, + * @param v 速度,单位 m/s, + * @param t 运行时间,单位 s \n + * t 值越大,机器臂运动越慢,反之,运动越快; + * 该参数最优值为连续调用 servoCartesian 接口的间隔时间。 + * @param lookahead_time 前瞻时间,单位 s \n + * 指定机器臂开始减速前要运动的时长,用前瞻时间来平滑轨迹[0.03, 0.2], + * 当 lookahead_time 小于一个控制周期时,越小则超调量越大, + * 该参数最优值为一个控制周期。 + * @param gain 比例增益 + * 跟踪目标位置的比例增益[100, 200], + * 用于控制运动的顺滑性和精度, + * 比例增益越大,到达目标位置的时间越长,超调量越小。 + * + * @retval 0 成功 + * @retval AUBO_BAD_STATE(1) 当前安全模式处于非 + * Normal、ReducedMode、Recovery 状态 + * @retval AUBO_QUEUE_FULL(2) 规划队列已满 + * @retval AUBO_BUSY(3) 上一条指令正在执行中 + * @retval -AUBO_BAD_STATE(-1) + * 可能的原因包括但不限于:线程已分离、线程被终止、task_id + * 未找到,或者当前机器人模式非 Running + * @retval -AUBO_TIMEOUT(-4) 调用接口超时 + * @retval -AUBO_INVL_ARGUMENT(-5) 轨迹位置超限或速度超限 + * @retval -AUBO_REQUEST_IGNORE(-13) 当前处于非 servo 模式 + * @retval -AUBO_IK_NO_CONVERGE(-23) 逆解计算不收敛,计算出错; + * @retval -AUBO_IK_OUT_OF_RANGE(-24) 逆解计算超出机器人最大限制; + * @retval AUBO_IK_CONFIG_DISMATCH(-25) 逆解输入配置存在错误; + * @retval -AUBO_IK_JACOBIAN_FAILED(-26) 逆解雅可比矩阵计算失败; + * @retval -AUBO_IK_NO_SOLU(-27) 目标点存在解析解,但均不满足选解条件; + * @retval -AUBO_IK_UNKOWN_ERROR(-28) 逆解返回未知类型错误; + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * servoCartesian(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float, arg3: float, arg4: float, arg5: float) -> int + * + * @par Lua函数原型 + * servoCartesian(pose: table, a: number, v: number, t: number, + * lookahead_time: number, gain: number) -> nil + * + * @par Lua示例 + * servoCartesian({0.58712,-0.15775,0.48703,2.76,0.344,1.432},0,0,10,0,0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.servoCartesian","params":[[0.58712,-0.15775,0.48703,2.76,0.344,1.432],0,0,10,0,0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":-13} + * \endchinese + * \english + * Cartesian space servo + * + * Currently, only pose and t parameters are available; + * @param pose Pose, unit: m + * @param a Acceleration, unit: m/s^2 + * @param v Velocity, unit: m/s + * @param t Execution time, unit: s \n + * The larger the t value, the slower the robot moves, and vice versa; + * The optimal value for this parameter is the interval time for continuous + * calls to the servoCartesian interface. + * @param lookahead_time Lookahead time, unit: s \n + * Specifies the duration to move before the robot starts to decelerate, + * used to smooth the trajectory [0.03, 0.2]. When lookahead_time is less + * than one control cycle, the smaller it is, the greater the overshoot. The + * optimal value for this parameter is one control cycle. + * @param gain Proportional gain + * Proportional gain for tracking the target position [100, 200], + * used to control the smoothness and accuracy of the motion, + * The larger the proportional gain, the longer it takes to reach the target + * position, and the smaller the overshoot. + * + * @retval 0 Success + * @retval AUBO_BAD_STATE(1) The current safety mode is not Normal, + * ReducedMode, or Recovery + * @retval AUBO_QUEUE_FULL(2) Planning queue is full + * @retval AUBO_BUSY(3) The previous instruction is being executed + * @retval -AUBO_BAD_STATE(-1) + * Possible reasons include but are not limited to: thread has been + * detached, thread terminated, task_id not found, or the current robot mode + * is not Running + * @retval -AUBO_TIMEOUT(-4) Interface call timeout + * @retval -AUBO_INVL_ARGUMENT(-5) Trajectory position or velocity out of + * range + * @retval -AUBO_REQUEST_IGNORE(-13) Not in servo mode + * @retval -AUBO_IK_NO_CONVERGE(-23) Inverse kinematics calculation does not + * converge, calculation error; + * @retval -AUBO_IK_OUT_OF_RANGE(-24) Inverse kinematics calculation exceeds + * robot maximum limits; + * @retval AUBO_IK_CONFIG_DISMATCH(-25) Inverse kinematics input + * configuration error; + * @retval -AUBO_IK_JACOBIAN_FAILED(-26) Inverse kinematics Jacobian + * calculation failed; + * @retval -AUBO_IK_NO_SOLU(-27) Analytical solution exists for the target + * point, but none meet the selection criteria; + * @retval -AUBO_IK_UNKOWN_ERROR(-28) Inverse kinematics returned an unknown + * error type; + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * servoCartesian(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float, arg3: float, arg4: float, arg5: float) -> int + * + * @par Lua function prototype + * servoCartesian(pose: table, a: number, v: number, t: number, + * lookahead_time: number, gain: number) -> nil + * + * @par Lua example + * servoCartesian({0.58712,-0.15775,0.48703,2.76,0.344,1.432},0,0,10,0,0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.servoCartesian","params":[[0.58712,-0.15775,0.48703,2.76,0.344,1.432],0,0,10,0,0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":-13} + * \endenglish + */ + int servoCartesian(const std::vector &pose, double a, double v, + double t, double lookahead_time, double gain); + + /** + * \chinese + * 伺服运动(带外部轴),用于执行离线轨迹、透传用户规划轨迹等 + * + * @param q + * @param extq + * @param t + * @param smooth_scale + * @param delay_sacle + * @return + * \endchinese + * \english + * Servo motion (with external axes), used for executing offline + * trajectories, pass-through user planned trajectories, etc. + * + * @param q + * @param extq + * @param t + * @param smooth_scale + * @param delay_sacle + * @return + * \endenglish + */ + int servoJointWithAxes(const std::vector &q, + const std::vector &extq, double a, double v, + double t, double lookahead_time, double gain); + + int servoJointWithAxisGroup(const std::vector &q, double a, + double v, double t, double lookahead_time, + double gain, const std::string &group_name, + const std::vector &extq); + + /** + * \chinese + * 伺服运动(带外部轴),用于执行离线轨迹、透传用户规划轨迹等 + * 与 servoJointWithAxes 区别在于接收笛卡尔空间位姿而不是关节角度 + * (由软件内部直接做逆解) + * + * @param pose + * @param extq + * @param t + * @param smooth_scale + * @param delay_sacle + * @return + * \endchinese + * \english + * Servo motion (with external axes), used for executing offline + * trajectories, pass-through user planned trajectories, etc. The difference + * from servoJointWithAxes is that it receives Cartesian poses instead of + * joint angles (inverse kinematics is performed internally by the + * software). + * + * @param pose + * @param extq + * @param t + * @param smooth_scale + * @param delay_sacle + * @return + * \endenglish + */ + int servoCartesianWithAxes(const std::vector &pose, + const std::vector &extq, double a, + double v, double t, double lookahead_time, + double gain); + + int servoCartesianWithAxisGroup(const std::vector &pose, double a, + double v, double t, double lookahead_time, + double gain, const std::string &group_name, + const std::vector &extq); + + /** + * \chinese + * 跟踪运动,用于执行离线轨迹、透传用户规划轨迹等 + * + * @param q + * @param smooth_scale + * @param delay_sacle + * @return + * + * @par Lua函数原型 + * trackJoint(q: table,t: number,smooth_scale: number,delay_sacle: number) + * -> nil + * + * @par Lua示例 + * trackJoint({0,0,0,0,0,0},0.01,0.5,1) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.trackJoint","params":[[0,0,0,0,0,0],0.01,0.5,1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Tracking motion, used for executing offline trajectories or passing + * through user-planned trajectories, etc. + * + * @param q + * @param smooth_scale + * @param delay_sacle + * @return + * + * @par Lua function prototype + * trackJoint(q: table,t: number,smooth_scale: number,delay_sacle: number) + * -> nil + * + * @par Lua example + * trackJoint({0,0,0,0,0,0},0.01,0.5,1) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.trackJoint","params":[[0,0,0,0,0,0],0.01,0.5,1],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int trackJoint(const std::vector &q, double t, double smooth_scale, + double delay_sacle); + + /** + * \chinese + * 跟踪运动,用于执行离线轨迹、透传用户规划轨迹等 + * 与 trackJoint 区别在于接收笛卡尔空间位姿而不是关节角度 + * (由软件内部直接做逆解) + * + * @param pose + * @param t + * @param smooth_scale + * @param delay_sacle + * @return + * + * @par Lua函数原型 + * trackCartesian(pose: table,t: number,smooth_scale: number,delay_sacle: + * number) -> nil + * + * @par Lua示例 + * trackCartesian({0.58712,-0.15775,0.48703,2.76,0.344,1.432},0.01,0.5,1) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.trackCartesian","params":[[0.58712,-0.15775,0.48703,2.76,0.344,1.432],0.01,0.5,1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Tracking motion, used for executing offline trajectories or passing + * through user-planned trajectories, etc. The difference from trackJoint is + * that it receives Cartesian poses instead of joint angles (inverse + * kinematics is performed internally by the software). + * + * @param pose + * @param t + * @param smooth_scale + * @param delay_sacle + * @return + * + * @par Lua function prototype + * trackCartesian(pose: table,t: number,smooth_scale: number,delay_sacle: + * number) -> nil + * + * @par Lua example + * trackCartesian({0.58712,-0.15775,0.48703,2.76,0.344,1.432},0.01,0.5,1) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.trackCartesian","params":[[0.58712,-0.15775,0.48703,2.76,0.344,1.432],0.01,0.5,1],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int trackCartesian(const std::vector &pose, double t, + double smooth_scale, double delay_sacle); + + /** + * \chinese + * 关节空间跟随 + * + * @note 暂未实现 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * followJoint(self: pyaubo_sdk.MotionControl, arg0: List[float]) -> int + * + * @par Lua函数原型 + * followJoint(q: table) -> nil + * + * @par Lua示例 + * followJoint({0,0,0,0,0,0}) + * + * \endchinese + * \english + * Joint space following + * + * @note Not implemented yet + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * followJoint(self: pyaubo_sdk.MotionControl, arg0: List[float]) -> int + * + * @par Lua function prototype + * followJoint(q: table) -> nil + * + * @par Lua example + * followJoint({0,0,0,0,0,0}) + * + * \endenglish + */ + int followJoint(const std::vector &q); + + /** + * \chinese + * 笛卡尔空间跟随 + * + * @note 暂未实现 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * followLine(self: pyaubo_sdk.MotionControl, arg0: List[float]) -> int + * + * @par Lua函数原型 + * followLine(pose: table) -> nil + * + * @par Lua示例 + * followLine({0.58712,-0.15775,0.48703,2.76,0.344,1.432}) + * + * \endchinese + * \english + * Cartesian space following + * + * @note Not implemented yet + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * followLine(self: pyaubo_sdk.MotionControl, arg0: List[float]) -> int + * + * @par Lua function prototype + * followLine(pose: table) -> nil + * + * @par Lua example + * followLine({0.58712,-0.15775,0.48703,2.76,0.344,1.432}) + * + * \endenglish + */ + int followLine(const std::vector &pose); + + /** + * \chinese + * 关节空间速度跟随 + * + * 当机械臂还没达到目标速度的时候,给一个新的目标速度,机械臂会立刻达到新的目标速度 + * + * @param qd 目标关节速度, 单位 rad/s + * @param a 主轴的加速度, 单位 rad/s^2 + * @param t 函数返回所需要的时间, 单位 s \n + * 如果 t = 0,当达到目标速度的时候,函数将返回; + * 反之,则经过 t 时间后,函数返回,不管是否达到目标速度。\n + * 如果没有达到目标速度,会减速到零。 + * 如果达到了目标速度就是按照目标速度匀速运动。 + * @retval 0 成功 + * @retval AUBO_BAD_STATE(1) 当前安全模式处于非 + * Normal、ReducedMode、Recovery 状态 + * @retval AUBO_BUSY(3) 上一条指令正在执行中 + * @retval -AUBO_BAD_STATE(-1) + * 可能的原因包括但不限于:线程已分离、线程被终止、task_id + * 未找到,或者当前机器人模式非 Running + * @retval -AUBO_TIMEOUT(-4) 调用接口超时 + * @retval -AUBO_INVL_ARGUMENT(-5) 参数数组qd的长度小于当前机器臂的自由度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * speedJoint(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float) -> int + * + * @par Lua函数原型 + * speedJoint(qd: table, a: number, t: number) -> nil + * + * @par Lua示例 + * speedJoint({0.2,0,0,0,0,0}, 1.5,10) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.speedJoint","params":[[0.2,0,0,0,0,0],1.5,100],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Joint space velocity following + * + * When the robot arm has not yet reached the target velocity, giving a new + * target velocity will cause the robot arm to immediately reach the new + * target velocity. + * + * @param qd Target joint velocity, unit: rad/s + * @param a Main axis acceleration, unit: rad/s^2 + * @param t Time required for the function to return, unit: s \n + * If t = 0, the function returns when the target velocity is reached; + * otherwise, the function returns after t seconds, regardless of whether + * the target velocity is reached.\n If the target velocity is not reached, + * it will decelerate to zero. If the target velocity is reached, it will + * move at a constant speed. + * @retval 0 Success + * @retval AUBO_BAD_STATE(1) The current safety mode is not Normal, + * ReducedMode, or Recovery + * @retval AUBO_BUSY(3) The previous instruction is being executed + * @retval -AUBO_BAD_STATE(-1) + * Possible reasons include but are not limited to: thread has been + * detached, thread terminated, task_id not found, or the current robot mode + * is not Running + * @retval -AUBO_TIMEOUT(-4) Interface call timeout + * @retval -AUBO_INVL_ARGUMENT(-5) The length of the qd array is less than + * the degrees of freedom of the current robot arm + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * speedJoint(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float) -> int + * + * @par Lua function prototype + * speedJoint(qd: table, a: number, t: number) -> nil + * + * @par Lua example + * speedJoint({0.2,0,0,0,0,0}, 1.5,10) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.speedJoint","params":[[0.2,0,0,0,0,0],1.5,100],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int speedJoint(const std::vector &qd, double a, double t); + + /** + * \chinese + * 关节空间速度跟随(机械臂运行工程时发生碰撞,通过此接口移动到安全位置) + * + * 当机械臂还没达到目标速度的时候,给一个新的目标速度,机械臂会立刻达到新的目标速度 + * + * @param qd 目标关节速度, 单位 rad/s + * @param a 主轴的加速度, 单位 rad/s^2 + * @param t 函数返回所需要的时间, 单位 s + * 如果 t = 0,当达到目标速度的时候,函数将返回; + * 反之,则经过 t 时间后,函数返回,不管是否达到目标速度。 + * 如果没有达到目标速度,会减速到零。 + * 如果达到了目标速度就是按照目标速度匀速运动。 + * @return 成功返回0; 失败返回错误码 + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * resumeSpeedJoint(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float) -> int + * + * @par Lua函数原型 + * resumeSpeedJoint(q: table, a: number, t: number) -> nil + * + * @par Lua示例 + * resumeSpeedJoint({0.2,0,0,0,0,0},1.5,10) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.resumeSpeedJoint","params":[[0.2,0,0,0,0,0],1.5,100],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":-1} + * \endchinese + * \english + * Joint space velocity following (used to move to a safe position after a + * collision during process execution) + * + * When the robot arm has not yet reached the target velocity, giving a new + * target velocity will cause the robot arm to immediately reach the new + * target velocity. + * + * @param qd Target joint velocity, unit: rad/s + * @param a Main axis acceleration, unit: rad/s^2 + * @param t Time required for the function to return, unit: s + * If t = 0, the function returns when the target velocity is reached; + * otherwise, the function returns after t seconds, regardless of whether + * the target velocity is reached. If the target velocity is not reached, it + * will decelerate to zero. If the target velocity is reached, it will move + * at a constant speed. + * @return Returns 0 on success; otherwise returns error code + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * resumeSpeedJoint(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float) -> int + * + * @par Lua function prototype + * resumeSpeedJoint(q: table, a: number, t: number) -> nil + * + * @par Lua example + * resumeSpeedJoint({0.2,0,0,0,0,0},1.5,10) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.resumeSpeedJoint","params":[[0.2,0,0,0,0,0],1.5,100],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":-1} + * \endenglish + */ + int resumeSpeedJoint(const std::vector &qd, double a, double t); + + /** + * \chinese + * 笛卡尔空间速度跟随 + * + * 当机械臂还没达到目标速度的时候,给一个新的目标速度,机械臂会立刻达到新的目标速度 + * + * @param xd 工具速度, 单位 m/s + * @param a 工具位置加速度, 单位 m/s^2 + * @param t 函数返回所需要的时间, 单位 s \n + * 如果 t = 0,当达到目标速度的时候,函数将返回; + * 反之,则经过 t 时间后,函数返回,不管是否达到目标速度。 + * 如果没有达到目标速度,会减速到零。 + * 如果达到了目标速度就是按照目标速度匀速运动。 + * @retval 0 成功 + * @retval AUBO_BAD_STATE(1) 当前安全模式处于非 + * Normal、ReducedMode、Recovery 状态 + * @retval AUBO_BUSY(3) 上一条指令正在执行中 + * @retval -AUBO_BAD_STATE(-1) + * 可能的原因包括但不限于:线程已分离、线程被终止、task_id + * 未找到,或者当前机器人模式非 Running + * @retval -AUBO_TIMEOUT(-4) 调用接口超时 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * speedLine(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: float, + * arg2: float) -> int + * + * @par Lua函数原型 + * speedLine(pose: table, a: number, t: number) -> nil + * + * @par Lua示例 + * speedLine({0.25,0,0,0,0,0},1.2,100) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.speedLine","params":[[0.25,0,0,0,0,0],1.2,100],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Cartesian space velocity following + * + * When the robot arm has not yet reached the target velocity, giving a new + * target velocity will cause the robot arm to immediately reach the new + * target velocity. + * + * @param xd Tool velocity, unit: m/s + * @param a Tool position acceleration, unit: m/s^2 + * @param t Time required for the function to return, unit: s \n + * If t = 0, the function returns when the target velocity is reached; + * otherwise, the function returns after t seconds, regardless of whether + * the target velocity is reached. If the target velocity is not reached, it + * will decelerate to zero. If the target velocity is reached, it will move + * at a constant speed. + * @retval 0 Success + * @retval AUBO_BAD_STATE(1) The current safety mode is not Normal, + * ReducedMode, or Recovery + * @retval AUBO_BUSY(3) The previous instruction is being executed + * @retval -AUBO_BAD_STATE(-1) + * Possible reasons include but are not limited to: thread has been + * detached, thread terminated, task_id not found, or the current robot mode + * is not Running + * @retval -AUBO_TIMEOUT(-4) Interface call timeout + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * speedLine(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: float, + * arg2: float) -> int + * + * @par Lua function prototype + * speedLine(pose: table, a: number, t: number) -> nil + * + * @par Lua example + * speedLine({0.25,0,0,0,0,0},1.2,100) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.speedLine","params":[[0.25,0,0,0,0,0],1.2,100],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int speedLine(const std::vector &xd, double a, double t); + + /** + * \chinese + * 笛卡尔空间速度跟随(机械臂运行工程时发生碰撞,通过此接口移动到安全位置) + * + * 当机械臂还没达到目标速度的时候,给一个新的目标速度,机械臂会立刻达到新的目标速度 + * + * @param xd 工具速度, 单位 m/s + * @param a 工具位置加速度, 单位 m/s^2 + * @param t 函数返回所需要的时间, 单位 s \n + * 如果 t = 0,当达到目标速度的时候,函数将返回; + * 反之,则经过 t 时间后,函数返回,不管是否达到目标速度。 + * 如果没有达到目标速度,会减速到零。 + * 如果达到了目标速度就是按照目标速度匀速运动。 + * @return 成功返回0; 失败返回错误码 + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * resumeSpeedLine(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float) -> int + * + * @par Lua函数原型 + * resumeSpeedLine(pose: table, a: number, t: number) -> nil + * + * @par Lua示例 + * resumeSpeedLine({0.25,0,0,0,0,0},1.2,100) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.resumeSpeedLine","params":[[0.25,0,0,0,0,0],1.2,100],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":-1} + * \endchinese + * \english + * Cartesian space velocity following (used to move to a safe position after + * a collision during process execution) + * + * When the robot arm has not yet reached the target velocity, giving a new + * target velocity will cause the robot arm to immediately reach the new + * target velocity. + * + * @param xd Tool velocity, unit: m/s + * @param a Tool position acceleration, unit: m/s^2 + * @param t Time required for the function to return, unit: s \n + * If t = 0, the function returns when the target velocity is reached; + * otherwise, the function returns after t seconds, regardless of whether + * the target velocity is reached. If the target velocity is not reached, it + * will decelerate to zero. If the target velocity is reached, it will move + * at a constant speed. + * @return Returns 0 on success; otherwise returns error code + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * resumeSpeedLine(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float) -> int + * + * @par Lua function prototype + * resumeSpeedLine(pose: table, a: number, t: number) -> nil + * + * @par Lua example + * resumeSpeedLine({0.25,0,0,0,0,0},1.2,100) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.resumeSpeedLine","params":[[0.25,0,0,0,0,0],1.2,100],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":-1} + * \endenglish + */ + int resumeSpeedLine(const std::vector &xd, double a, double t); + + /** + * \chinese + * 在关节空间做样条插值 + * + * @param q 关节角度,如果传入参数维度为0,表示样条运动结束 + * @param a 加速度, 单位 rad/s^2, + * 最大值可通过RobotConfig类中的接口getJointMaxAccelerations()来获取 + * @param v 速度, 单位 rad/s, + * 最大值可通过RobotConfig类中的接口getJointMaxSpeeds()来获取 + * @param duration + * @return 成功返回0; 失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * moveSpline(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float, arg3: float) -> int + * + * @par Lua函数原型 + * moveSpline(q: table, a: number, v: number, duration: number) -> nil + * + * @par Lua示例 + * moveSpline({-2.05177,-0.400292, 1.19625, 0.0285152, 1.57033, + * -2.28774},1.3,1.0,0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.moveSpline","params":[[0,0,0,0,0,0],1,1,0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Perform spline interpolation in joint space + * + * @param q Joint angles. If the input vector is of size 0, it indicates the + * end of the spline motion. + * @param a Acceleration, unit: rad/s^2. The maximum value can be obtained + * via RobotConfig::getJointMaxAccelerations(). + * @param v Velocity, unit: rad/s. The maximum value can be obtained via + * RobotConfig::getJointMaxSpeeds(). + * @param duration + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * moveSpline(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float, arg3: float) -> int + * + * @par Lua function prototype + * moveSpline(q: table, a: number, v: number, duration: number) -> nil + * + * @par Lua example + * moveSpline({-2.05177,-0.400292, 1.19625, 0.0285152, 1.57033, + * -2.28774},1.3,1.0,0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.moveSpline","params":[[0,0,0,0,0,0],1,1,0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int moveSpline(const std::vector &q, double a, double v, + double duration); + + /** + * \chinese + * 添加关节运动 + * + * @param q 关节角, 单位 rad + * @param a 加速度, 单位 rad/s^2, + * 最大值可通过RobotConfig类中的接口getJointMaxAccelerations()来获取 + * @param v 速度, 单位 rad/s, + * 最大值可通过RobotConfig类中的接口getJointMaxSpeeds()来获取 + * @param blend_radius 交融半径, 单位 m + * @param duration 运行时间,单位 s \n + * 通常当给定了速度和加速度,便能够确定轨迹的运行时间。 + * 如果想延长轨迹的运行时间,便要设置 duration 这个参数。 + * duration 可以延长轨迹运动的时间,但是不能缩短轨迹时间。\n + * 当 duration = 0的时候, + * 表示不指定运行时间,即没有明确完成运动的时间,将根据速度与加速度计算运行时间。 + * 如果duration不等于0,a 和 v 的值将被忽略。 + * @retval 0 成功 + * @retval AUBO_BAD_STATE(1) 当前安全模式处于非 + * Normal、ReducedMode、Recovery 状态 + * @retval AUBO_QUEUE_FULL(2) 规划队列已满 + * @retval AUBO_BUSY(3) 上一条指令正在执行中 + * @retval -AUBO_BAD_STATE(-1) + * 可能的原因包括但不限于:线程已分离、线程被终止、task_id + * 未找到,或者当前机器人模式非 Running + * @retval -AUBO_TIMEOUT(-4) 调用接口超时 + * @retval -AUBO_INVL_ARGUMENT(-5) 参数数组q的长度小于当前机器臂的自由度 + * @retval AUBO_REQUEST_IGNORE(13) 参数数组q的长度太短且无需在该点停留 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * moveJoint(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: float, + * arg2: float, arg3: float, arg4: float) -> int + * + * @par Lua函数原型 + * moveJoint(q: table, a: number, v: number, blend_radius: number, duration: + * number) -> nil + * + * @par Lua示例 + * moveJoint({-2.05177,-0.400292, 1.19625, 0.0285152, 1.57033, + * -2.28774},0.3,0.3,0,0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.moveJoint","params":[[-2.05177, + * -0.400292, 1.19625, 0.0285152, 1.57033, -2.28774],0.3,0.3,0,0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Add joint motion + * + * @param q Joint angles, unit: rad + * @param a Acceleration, unit: rad/s^2, + * The maximum value can be obtained via + * RobotConfig::getJointMaxAccelerations() + * @param v Velocity, unit: rad/s, + * The maximum value can be obtained via RobotConfig::getJointMaxSpeeds() + * @param blend_radius Blend radius, unit: m + * @param duration Execution time, unit: s \n + * Normally, when speed and acceleration are given, the trajectory duration + * can be determined. If you want to extend the trajectory duration, set the + * duration parameter. Duration can extend the trajectory time, but cannot + * shorten it.\n When duration = 0, it means the execution time is not + * specified, and the time will be calculated based on speed and + * acceleration. If duration is not 0, a and v values will be ignored. + * @retval 0 Success + * @retval AUBO_BAD_STATE(1) The current safety mode is not Normal, + * ReducedMode, or Recovery + * @retval AUBO_QUEUE_FULL(2) Planning queue is full + * @retval AUBO_BUSY(3) The previous instruction is being executed + * @retval -AUBO_BAD_STATE(-1) + * Possible reasons include but are not limited to: thread has been + * detached, thread terminated, task_id not found, or the current robot mode + * is not Running + * @retval -AUBO_TIMEOUT(-4) Interface call timeout + * @retval -AUBO_INVL_ARGUMENT(-5) The length of q is less than the degrees + * of freedom of the current robot arm + * @retval AUBO_REQUEST_IGNORE(13) The length of q is too short and there is + * no need to stop at that point + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * moveJoint(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: float, + * arg2: float, arg3: float, arg4: float) -> int + * + * @par Lua function prototype + * moveJoint(q: table, a: number, v: number, blend_radius: number, duration: + * number) -> nil + * + * @par Lua example + * moveJoint({-2.05177,-0.400292, 1.19625, 0.0285152, 1.57033, + * -2.28774},0.3,0.3,0,0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.moveJoint","params":[[-2.05177, + * -0.400292, 1.19625, 0.0285152, 1.57033, -2.28774],0.3,0.3,0,0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int moveJoint(const std::vector &q, double a, double v, + double blend_radius, double duration); + + /** + * \chinese + * 机器人与外部轴同步运动 + * + * @param group_name + * @param q + * @param a + * @param v + * @param blend_radius + * @param duration + * @return + * \endchinese + * \english + * Synchronous motion of robot and external axes + * + * @param group_name + * @param q + * @param a + * @param v + * @param blend_radius + * @param duration + * @return + * \endenglish + */ + int moveJointWithAxisGroup(const std::vector &q, double a, double v, + double blend_radius, double duration, + const std::string &group_name, + const std::vector &extq); + + /** + * \chinese + * 通过关节运动移动到暂停点的位置 + * + * @param q 关节角, 单位 rad + * @param a 加速度, 单位 rad/s^2 + * @param v 速度, 单位 rad/s + * @param duration 运行时间,单位 s \n + * 通常当给定了速度和加速度,便能够确定轨迹的运行时间。 + * 如果想延长轨迹的运行时间,便要设置 duration 这个参数。 + * duration 可以延长轨迹运动的时间,但是不能缩短轨迹时间。\n + * 当 duration = 0的时候, + * 表示不指定运行时间,即没有明确完成运动的时间,将根据速度与加速度计算运行时间。 + * 如果duration不等于0,a 和 v 的值将被忽略。 + * @return 成功返回0;失败返回错误码 + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * resumeMoveJoint(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float, arg3: float) -> int + * + * @par Lua函数原型 + * resumeMoveJoint(q: table, a: number, v: number, duration: number) -> nil + * + * @par Lua示例 + * resumeMoveJoint({-2.05177,-0.400292, 1.19625, 0.0285152, 1.57033, + * -2.28774},1.3,1.0,0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.resumeMoveJoint","params":[[-2.05177, + * -0.400292, 1.19625, 0.0285152, 1.57033, -2.28774],0.3,0.3,0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":-1} + * \endchinese + * \english + * Move to the pause point using joint motion. + * + * @param q Joint angles, unit: rad + * @param a Acceleration, unit: rad/s^2 + * @param v Velocity, unit: rad/s + * @param duration Execution time, unit: s \n + * Normally, when speed and acceleration are given, the trajectory duration + * can be determined. If you want to extend the trajectory duration, set the + * duration parameter. Duration can extend the trajectory time, but cannot + * shorten it.\n When duration = 0, it means the execution time is not + * specified, and the time will be calculated based on speed and + * acceleration. If duration is not 0, a and v values will be ignored. + * @return Returns 0 on success; otherwise returns error code + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * resumeMoveJoint(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float, arg3: float) -> int + * + * @par Lua function prototype + * resumeMoveJoint(q: table, a: number, v: number, duration: number) -> nil + * + * @par Lua example + * resumeMoveJoint({-2.05177,-0.400292, 1.19625, 0.0285152, 1.57033, + * -2.28774},1.3,1.0,0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.resumeMoveJoint","params":[[-2.05177, + * -0.400292, 1.19625, 0.0285152, 1.57033, -2.28774],0.3,0.3,0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":-1} + * \endenglish + */ + int resumeMoveJoint(const std::vector &q, double a, double v, + double duration); + + /** + * \chinese + * 添加直线运动 + * + * @param pose 目标位姿 + * @param a 加速度(如果位置变化小于1mm,姿态变化大于 1e-4 + * rad,此加速度会被作为角加速度,单位 rad/s^2.否则为线加速度,单位 m/s^2) + * 最大值可通过RobotConfig类中的接口getTcpMaxAccelerations()来获取 + * @param v 速度(如果位置变化小于1mm,姿态变化大于 1e-4 + * rad,此速度会被作为角速度,单位 rad/s.否则为线速度,单位 m/s) + * 最大值可通过RobotConfig类中的接口getTcpMaxSpeeds()来获取 + * @param blend_radius 交融半径,单位 m,值介于0.001和1之间 + * @param duration 运行时间,单位 s \n + * 通常当给定了速度和加速度,便能够确定轨迹的运行时间。 + * 如果想延长轨迹的运行时间,便要设置 duration 这个参数。 + * duration 可以延长轨迹运动的时间,但是不能缩短轨迹时间。\n + * 当 duration = 0的时候, + * 表示不指定运行时间,即没有明确完成运动的时间,将根据速度与加速度计算运行时间。 + * 如果duration不等于0,a 和 v 的值将被忽略。 + * @retval 0 成功 + * @retval AUBO_BAD_STATE(1) 当前安全模式处于非 + * Normal、ReducedMode、Recovery 状态 + * @retval AUBO_QUEUE_FULL(2) 轨迹队列已满 + * @retval AUBO_BUSY(3) 上一条指令正在执行中 + * @retval -AUBO_BAD_STATE(-1) + * 可能的原因包括但不限于:线程已分离、线程被终止、task_id + * 未找到,或者当前机器人模式非 Running + * @retval -AUBO_TIMEOUT(-4) 调用接口超时 + * @retval -AUBO_INVL_ARGUMENT(-5) 参数数组 pose + * 的长度小于当前机器臂的自由度 + * @retval AUBO_REQUEST_IGNORE(13) 参数数组 pose + * 路径长度太短且无需在该点停留 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * moveLine(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: float, + * arg2: float, arg3: float, arg4: float) -> int + * + * @par Lua函数原型 + * moveLine(pose: table, a: number, v: number, blend_radius: number, + * duration: number) -> nil + * + * @par Lua示例 + * moveLine({0.58815,0.0532,0.62391,2.46,0.479,1.619},1.3,1.0,0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.moveLine","params":[[0.58815,0.0532,0.62391,2.46,0.479,1.619],1.2,0.25,0,0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Add linear motion + * + * @param pose Target pose + * @param a Acceleration (if the position change is less than 1mm and the + * posture change is greater than 1e-4 rad, this acceleration is treated as + * angular acceleration in rad/s^2; otherwise, as linear acceleration in + * m/s^2). The maximum value can be obtained via + * RobotConfig::getTcpMaxAccelerations(). + * @param v Velocity (if the position change is less than 1mm and the + * posture change is greater than 1e-4 rad, this velocity is treated as + * angular velocity in rad/s; otherwise, as linear velocity in m/s). The + * maximum value can be obtained via RobotConfig::getTcpMaxSpeeds(). + * @param blend_radius Blend radius, unit: m, value between 0.001 and 1 + * @param duration Execution time, unit: s \n + * Normally, when speed and acceleration are given, the trajectory duration + * can be determined. If you want to extend the trajectory duration, set the + * duration parameter. Duration can extend the trajectory time, but cannot + * shorten it.\n When duration = 0, it means the execution time is not + * specified, and the time will be calculated based on speed and + * acceleration. If duration is not 0, a and v values will be ignored. + * @retval 0 Success + * @retval AUBO_BAD_STATE(1) The current safety mode is not Normal, + * ReducedMode, or Recovery + * @retval AUBO_QUEUE_FULL(2) Trajectory queue is full + * @retval AUBO_BUSY(3) The previous instruction is being executed + * @retval -AUBO_BAD_STATE(-1) Possible reasons include but are not limited + * to: thread has been detached, thread terminated, task_id not found, or + * the current robot mode is not Running + * @retval -AUBO_TIMEOUT(-4) Interface call timeout + * @retval -AUBO_INVL_ARGUMENT(-5) The length of the pose array is less than + * the degrees of freedom of the current robot arm + * @retval AUBO_REQUEST_IGNORE(13) The length of the pose array is too short + * and there is no need to stop at that point + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * moveLine(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: float, + * arg2: float, arg3: float, arg4: float) -> int + * + * @par Lua function prototype + * moveLine(pose: table, a: number, v: number, blend_radius: number, + * duration: number) -> nil + * + * @par Lua example + * moveLine({0.58815,0.0532,0.62391,2.46,0.479,1.619},1.3,1.0,0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.moveLine","params":[[0.58815,0.0532,0.62391,2.46,0.479,1.619],1.2,0.25,0,0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int moveLine(const std::vector &pose, double a, double v, + double blend_radius, double duration); + + /** + * \chinese + * 直线运动与外部轴同步运动 + * + * @param group_name 外部轴组名称 + * @param pose 目标位姿 + * @param a 加速度 + * @param v 速度 + * @param blend_radius 交融半径 + * @param duration 运行时间 + * @return + * \endchinese + * \english + * Linear motion synchronized with external axes + * + * @param group_name Name of the external axis group + * @param pose Target pose + * @param a Acceleration + * @param v Velocity + * @param blend_radius Blend radius + * @param duration Execution time + * @return + * \endenglish + */ + int moveLineWithAxisGroup(const std::vector &pose, double a, + double v, double blend_radius, double duration, + const std::string &group_name, + const std::vector &extq); + + /** + * \chinese + * 添加工艺运动 + * + * @param pose + * @param a + * @param v + * @param blend_radius + * @return 成功返回0;失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Lua函数原型 + * moveProcess(pose: table, a: number, v: number, blend_radius: number, + * duration: number) -> nil + * + * @par Lua示例 + * moveProcess({0.58815,0.0532,0.62391,2.46,0.479,1.619},1.2,0.25,0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.moveProcess","params":[[0.58815,0.0532,0.62391,2.46,0.479,1.619],1.2,0.25,0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Add process motion + * + * @param pose + * @param a + * @param v + * @param blend_radius + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Lua function prototype + * moveProcess(pose: table, a: number, v: number, blend_radius: number, + * duration: number) -> nil + * + * @par Lua example + * moveProcess({0.58815,0.0532,0.62391,2.46,0.479,1.619},1.2,0.25,0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.moveProcess","params":[[0.58815,0.0532,0.62391,2.46,0.479,1.619],1.2,0.25,0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int moveProcess(const std::vector &pose, double a, double v, + double blend_radius); + + /** + * \chinese + * 通过直线运动移动到暂停点的位置 + * + * @param pose 目标位姿 + * @param a 加速度, 单位 m/s^2 + * @param v 速度, 单位 m/s + * @param duration 运行时间,单位 s \n + * 通常当给定了速度和加速度,便能够确定轨迹的运行时间。 + * 如果想延长轨迹的运行时间,便要设置 duration 这个参数。 + * duration 可以延长轨迹运动的时间,但是不能缩短轨迹时间。\n + * 当 duration = 0的时候, + * 表示不指定运行时间,即没有明确完成运动的时间,将根据速度与加速度计算运行时间。 + * 如果duration不等于0,a 和 v 的值将被忽略。 + * @return 成功返回0;失败返回错误码 + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * resumeMoveLine(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float, arg3: float) -> int + * + * @par Lua函数原型 + * resumeMoveLine(pose: table, a: number, v: number,duration: number) -> nil + * + * @par Lua示例 + * resumeMoveLine({0.58815,0.0532,0.62391,2.46,0.479,1.619},1.2,0.25,0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.resumeMoveLine","params":[[0.58815,0.0532,0.62391,2.46,0.479,1.619],1.2,0.25,0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Move to the pause point using linear motion. + * + * @param pose Target pose + * @param a Acceleration, unit: m/s^2 + * @param v Velocity, unit: m/s + * @param duration Execution time, unit: s \n + * Normally, when speed and acceleration are given, the trajectory duration + * can be determined. If you want to extend the trajectory duration, set the + * duration parameter. Duration can extend the trajectory time, but cannot + * shorten it.\n When duration = 0, it means the execution time is not + * specified, and the time will be calculated based on speed and + * acceleration. If duration is not 0, a and v values will be ignored. + * @return Returns 0 on success; otherwise returns error code + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * resumeMoveLine(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float, arg3: float) -> int + * + * @par Lua function prototype + * resumeMoveLine(pose: table, a: number, v: number, duration: number) -> + * nil + * + * @par Lua example + * resumeMoveLine({0.58815,0.0532,0.62391,2.46,0.479,1.619},1.2,0.25,0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.resumeMoveLine","params":[[0.58815,0.0532,0.62391,2.46,0.479,1.619],1.2,0.25,0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int resumeMoveLine(const std::vector &pose, double a, double v, + double duration); + + /** + * \chinese + * 添加圆弧运动 + * + * @todo 可以由多段圆弧组成圆周运动 + * + * @param via_pose 圆弧运动途中点的位姿 + * @param end_pose 圆弧运动结束点的位姿 + * @param a 加速度(如果via_pose与上一个路点位置变化小于1mm,姿态变化大于 1e-4 + * rad, 此加速度会被作为角加速度,单位 rad/s^2.否则为线加速度,单位 m/s^2) + * @param v 速度(如果via_pose与上一个路点位置变化小于1mm, 姿态变化大于 1e-4 + * rad, 此速度会被作为角速度, 单位 rad / s.否则为线速度, 单位 m / s) + * @param blend_radius 交融半径,单位: m + * @param duration 运行时间,单位: s \n + * 通常当给定了速度和加速度,便能够确定轨迹的运行时间。 + * 如果想延长轨迹的运行时间,便要设置 duration 这个参数。 + * duration 可以延长轨迹运动的时间,但是不能缩短轨迹时间。\n + * 当 duration = 0 的时候, + * 表示不指定运行时间,即没有明确完成运动的时间,将根据速度与加速度计算运行时间。 + * 如果duration不等于0,a 和 v 的值将被忽略。 + * @return 成功返回0;失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * moveCircle(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * List[float], arg2: float, arg3: float, arg4: float, arg5: float) -> int + * + * @par Lua函数原型 + * moveCircle(via_pose: table, end_pose: table, a: number, v: number, + * blend_radius: number, duration: number) -> nil + * + * @par Lua示例 + * moveCircle({0.440164,-0.00249391,0.398658,2.45651,0,1.5708},{0.440164,0.166256,0.297599,2.45651,0,1.5708},1.2,0.25,0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.moveCircle","params":[[0.440164,-0.00249391,0.398658,2.45651,0,1.5708],[0.440164,0.166256,0.297599,2.45651,0,1.5708],1.2,0.25,0,0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Add circular arc motion + * + * @todo Can be composed of multiple arcs to form a circular motion + * + * @param via_pose The pose of the via point during the arc motion + * @param end_pose The pose of the end point of the arc motion + * @param a Acceleration (if the position change between via_pose and the + * previous waypoint is less than 1mm and the posture change is greater than + * 1e-4 rad, this acceleration is treated as angular acceleration in + * rad/s^2; otherwise, as linear acceleration in m/s^2) + * @param v Velocity (if the position change between via_pose and the + * previous waypoint is less than 1mm and the posture change is greater than + * 1e-4 rad, this velocity is treated as angular velocity in rad/s; + * otherwise, as linear velocity in m/s) + * @param blend_radius Blend radius, unit: m + * @param duration Execution time, unit: s \n + * Normally, when speed and acceleration are given, the trajectory duration + * can be determined. If you want to extend the trajectory duration, set the + * duration parameter. Duration can extend the trajectory time, but cannot + * shorten it.\n When duration = 0, it means the execution time is not + * specified, and the time will be calculated based on speed and + * acceleration. If duration is not 0, a and v values will be ignored. + * @return Returns 0 on success; otherwise returns error code + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * moveCircle(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * List[float], arg2: float, arg3: float, arg4: float, arg5: float) -> int + * + * @par Lua function prototype + * moveCircle(via_pose: table, end_pose: table, a: number, v: number, + * blend_radius: number, duration: number) -> nil + * + * @par Lua example + * moveCircle({0.440164,-0.00249391,0.398658,2.45651,0,1.5708},{0.440164,0.166256,0.297599,2.45651,0,1.5708},1.2,0.25,0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.moveCircle","params":[[0.440164,-0.00249391,0.398658,2.45651,0,1.5708],[0.440164,0.166256,0.297599,2.45651,0,1.5708],1.2,0.25,0,0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int moveCircle(const std::vector &via_pose, + const std::vector &end_pose, double a, double v, + double blend_radius, double duration); + + /** + * \chinese + * moveCircle 与外部轴同步运动 + * + * @param group_name 外部轴组名称 + * @param via_pose 圆弧运动途中点的位姿 + * @param end_pose 圆弧运动结束点的位姿 + * @param a 加速度 + * @param v 速度 + * @param blend_radius 交融半径 + * @param duration 运行时间 + * @return + * \endchinese + * \english + * moveCircle with external axes synchronized motion + * + * @param group_name Name of the external axis group + * @param via_pose The pose of the via point during the arc motion + * @param end_pose The pose of the end point of the arc motion + * @param a Acceleration + * @param v Velocity + * @param blend_radius Blend radius + * @param duration Execution time + * @return + * \endenglish + */ + int moveCircleWithAxisGroup(const std::vector &via_pose, + const std::vector &end_pose, double a, + double v, double blend_radius, double duration, + const std::string &group_name, + const std::vector &extq); + + /** + * \chinese + * 设置圆弧路径模式 + * + * @param mode 模式 \n + * 0:工具姿态相对于圆弧路径点坐标系保持不变 \n + * 1:姿态线性变化,绕着空间定轴转动,从起始点姿态变化到目标点姿态 \n + * 2:从起点姿态开始经过中间点姿态,变化到目标点姿态 + * @return 成功返回0;失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setCirclePathMode(self: pyaubo_sdk.MotionControl, arg0: int) -> int + * + * @par Lua函数原型 + * setCirclePathMode(mode: number) -> nil + * + * @par Lua示例 + * setCirclePathMode(1) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setCirclePathMode","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set circle path mode + * + * @param mode Mode \n + * 0: Tool orientation remains unchanged relative to the arc path point + * coordinate system \n 1: Orientation changes linearly, rotating around a + * fixed axis in space, from the start orientation to the target orientation + * \n 2: Orientation changes from the start orientation, through the via + * point orientation, to the target orientation + * @return Returns 0 on success; otherwise returns an error code + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setCirclePathMode(self: pyaubo_sdk.MotionControl, arg0: int) -> int + * + * @par Lua function prototype + * setCirclePathMode(mode: number) -> nil + * + * @par Lua example + * setCirclePathMode(1) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setCirclePathMode","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setCirclePathMode(int mode); + + /** + * \chinese + * 高级圆弧或者圆周运动 + * + * @param param 圆周运动参数 + * @return 成功返回0;失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * moveCircle2(self: pyaubo_sdk.MotionControl, arg0: + * arcs::common_interface::CircleParameters) -> int + * + * @par Lua函数原型 + * moveCircle2(param: table) -> nil + * + * @par Lua示例 + * moveCircle2({0.440164,-0.00249391,0.398658,2.45651,0,1.570},{0.440164,0.166256,0.297599,2.45651,0,1.5708},1.2,0.25,0,0,0,0,0,0) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.moveCircle2","params":[{"pose_via":[0.440164,-0.00249391,0.398658,2.45651,0,1.570], + * "pose_to":[0.440164,0.166256,0.297599,2.45651,0,1.5708],"a":1.2,"v":0.25,"blend_radius":0,"duration":0,"helix":0, + * "spiral":0,"direction":0,"loop_times":0}],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Advanced arc or circular motion + * + * @param param Circular motion parameters + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * moveCircle2(self: pyaubo_sdk.MotionControl, arg0: + * arcs::common_interface::CircleParameters) -> int + * + * @par Lua function prototype + * moveCircle2(param: table) -> nil + * + * @par Lua example + * moveCircle2({0.440164,-0.00249391,0.398658,2.45651,0,1.570},{0.440164,0.166256,0.297599,2.45651,0,1.5708},1.2,0.25,0,0,0,0,0,0) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.moveCircle2","params":[{"pose_via":[0.440164,-0.00249391,0.398658,2.45651,0,1.570], + * "pose_to":[0.440164,0.166256,0.297599,2.45651,0,1.5708],"a":1.2,"v":0.25,"blend_radius":0,"duration":0,"helix":0, + * "spiral":0,"direction":0,"loop_times":0}],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int moveCircle2(const CircleParameters ¶m); + + /** + * \chinese + * 新建一个路径点缓存 + * + * @param name 指定路径的名字 + * @param type 路径的类型 \n + * 1: toppra 时间最优路径规划 \n + * 2: cubic_spline(录制的轨迹) \n + * 3: 关节B样条插值,最少三个点 + * @param size 缓存区大小 + * @return 新建成功返回 AUBO_OK(0) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathBufferAlloc(self: pyaubo_sdk.MotionControl, arg0: str, arg1: int, + * arg2: int) -> int + * + * @par Lua函数原型 + * pathBufferAlloc(name: string, type: number, size: number) -> nil + * + * @par Lua示例 + * pathBufferAlloc("traje_name",5,100) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathBufferAlloc","params":["rec",2,3],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Create a new path point buffer + * + * @param name Name of the path + * @param type Type of the path \n + * 1: toppra time-optimal path planning \n + * 2: cubic_spline (recorded trajectory) \n + * 3: Joint B-spline interpolation, at least three points + * @param size Buffer size + * @return Returns AUBO_OK(0) on success + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathBufferAlloc(self: pyaubo_sdk.MotionControl, arg0: str, arg1: int, + * arg2: int) -> int + * + * @par Lua function prototype + * pathBufferAlloc(name: string, type: number, size: number) -> nil + * + * @par Lua exmaple + * pathBufferAlloc("traje_name",5,100) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathBufferAlloc","params":["rec",2,3],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int pathBufferAlloc(const std::string &name, int type, int size); + + /** + * \chinese + * 向路径缓存添加路点 + * + * @param name 路径缓存的名字 + * @param waypoints 路点 + * @return 成功返回0;失败返回错误码 + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathBufferAppend(self: pyaubo_sdk.MotionControl, arg0: str, arg1: + * List[List[float]]) -> int + * + * @par Lua函数原型 + * pathBufferAppend(name: string, waypoints: table) -> nil + * + * @par Lua示例 + * pathBufferAppend("traje_name",{{-0.000000,0.000009,-0.000001,0.000002,0.000002,0.000000},{-0.000001,0.000010,-0.000002,0.000000,0.000003,0.000002}}) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathBufferAppend","params":["rec",[[-0.000000,0.000009,-0.000001,0.000002,0.000002,0.000000],[-0.000001,0.000010,-0.000002,0.000000,0.000003,0.000002]]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Add waypoints to the path buffer + * + * @param name Name of the path buffer + * @param waypoints Waypoints + * @return Returns 0 on success; otherwise returns an error code + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathBufferAppend(self: pyaubo_sdk.MotionControl, arg0: str, arg1: + * List[List[float]]) -> int + * + * @par Lua function prototype + * pathBufferAppend(name: string, waypoints: table) -> nil + * + * @par Lua example + * pathBufferAppend("traje_name",{{-0.000000,0.000009,-0.000001,0.000002,0.000002,0.000000},{-0.000001,0.000010,-0.000002,0.000000,0.000003,0.000002}}) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathBufferAppend","params":["rec",[[-0.000000,0.000009,-0.000001,0.000002,0.000002,0.000000],[-0.000001,0.000010,-0.000002,0.000000,0.000003,0.000002]]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int pathBufferAppend(const std::string &name, + const std::vector> &waypoints); + + /** + * \chinese + * 计算、优化等耗时操作,传入的参数相同时不会重新计算 + * + * @param name 通过pathBufferAlloc新建的路径点缓存的名字 + * @param a 关节加速度限制,需要和机器人自由度大小相同,单位 rad/s^2 + * @param v 关节速度限制,需要和机器人自由度大小相同,单位 rad/s + * @param t 时间 \n + * pathBufferAlloc 这个接口分配内存的时候要指定类型, + * 根据pathBufferAlloc这个接口的类型:\n + * 类型为1时,表示运动持续时间\n + * 类型为2时,表示采样时间间隔\n + * 类型为3时:t表示运动持续时间\n + * 若 t=0, 则由使用软件内部默认的时间(推荐使用)\n + * 若 t!=0, t需要设置为 路径点数*相邻点时间间隔(points * + * interval,interval >= 0.01) + * @return 成功返回0;失败返回错误码 + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathBufferEval(self: pyaubo_sdk.MotionControl, arg0: str, arg1: + * List[float], arg2: List[float], arg3: float) -> int + * + * @par Lua函数原型 + * pathBufferEval(name: string, a: table, v: table, t: number) -> nil + * + * @par Lua示例 + * pathBufferEval("traje_name",{1,1,1,1,1,1},{1,1,1,1,1,1},0.02) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathBufferEval","params":["rec",[1,1,1,1,1,1],[1,1,1,1,1,1],0.02],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Perform computation and optimization (time-consuming operations). If the + * input parameters are the same, the calculation will not be repeated. + * + * @param name Name of the path point buffer created by pathBufferAlloc + * @param a Joint acceleration limits, must match the robot DOF, unit: + * rad/s^2 + * @param v Joint velocity limits, must match the robot DOF, unit: rad/s + * @param t Time \n + * When allocating memory with pathBufferAlloc, the type must be specified. + * According to the type in pathBufferAlloc:\n + * Type 1: t means motion duration\n + * Type 2: t means sampling interval\n + * Type 3: t means motion duration\n + * If t=0, the internal default time is used (recommended)\n + * If t!=0, t should be set to number_of_points * + * interval_between_points (interval >= 0.01) + * @return Returns 0 on success; otherwise returns an error code + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathBufferEval(self: pyaubo_sdk.MotionControl, arg0: str, arg1: + * List[float], arg2: List[float], arg3: float) -> int + * + * @par Lua function prototype + * pathBufferEval(name: string, a: table, v: table, t: number) -> nil + * + * @par Lua example + * pathBufferEval("traje_name",{1,1,1,1,1,1},{1,1,1,1,1,1},0.02) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathBufferEval","params":["rec",[1,1,1,1,1,1],[1,1,1,1,1,1],0.02],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int pathBufferEval(const std::string &name, const std::vector &a, + const std::vector &v, double t); + + /** + * \chinese + * 指定名字的buffer是否有效 + * + * buffer需要满足三个条件有效: \n + * 1、buffer存在,已经分配过内存 \n + * 2、传进buffer的点要大于等于buffer的大小 \n + * 3、要执行一次pathBufferEval + * + * @param name buffer的名字 + * @return 有效返回true; 无效返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathBufferValid(self: pyaubo_sdk.MotionControl, arg0: str) -> bool + * + * @par Lua函数原型 + * pathBufferValid(name: string) -> boolean + * + * @par Lua示例 + * buffer_status = pathBufferValid("traje_name") + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathBufferValid","params":["rec"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * \endchinese + * \english + * Whether the buffer with the specified name is valid + * + * The buffer must meet three conditions to be valid: \n + * 1. The buffer exists and memory has been allocated \n + * 2. The number of points passed into the buffer must be greater than or + * equal to the buffer size \n + * 3. pathBufferEval must be executed once + * + * @param name Name of the buffer + * @return Returns true if valid; false otherwise + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathBufferValid(self: pyaubo_sdk.MotionControl, arg0: str) -> bool + * + * @par Lua function prototype + * pathBufferValid(name: string) -> boolean + * + * @par Lua example + * buffer_status = pathBufferValid("traje_name") + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathBufferValid","params":["rec"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * \endenglish + */ + bool pathBufferValid(const std::string &name); + + /** + * \chinese + * 释放路径缓存 + * + * @param name 缓存路径的名字 + * @return 成功返回0;失败返回错误码 + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathBufferFree(self: pyaubo_sdk.MotionControl, arg0: str) -> int + * + * @par Lua函数原型 + * pathBufferFree(name: string) -> nil + * + * @par Lua示例 + * pathBufferFree("traje_name") + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathBufferFree","params":["rec"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":-5} + * + * \endchinese + * \english + * Release path buffer + * + * @param name Name of the path buffer + * @return Returns 0 on success; otherwise returns an error code + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathBufferFree(self: pyaubo_sdk.MotionControl, arg0: str) -> int + * + * @par Lua function prototype + * pathBufferFree(name: string) -> nil + * + * @par Lua example + * pathBufferFree("traje_name") + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathBufferFree","params":["rec"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":-5} + * + * \endenglish + */ + int pathBufferFree(const std::string &name); + + /** + * \chinese + * 关节空间路径滤波器 + * + * @brief pathBufferFilter + * + * @param name 缓存路径的名称 + * @param order 滤波器阶数(一般取2) + * @param fd 截止频率,越小越光滑,但是延迟会大(一般取3-20) + * @param fs 离散数据的采样频率(一般取20-500) + * + * @return 成功返回0 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathBufferFilter(self: pyaubo_sdk.MotionControl, arg0: str, arg1: int, + * arg2: float, arg3: float) -> int + * + * @par Lua函数原型 + * pathBufferFilter(name: string, order: number, fd: number, fs:number) -> + * nil + * + * @par Lua示例 + * pathBufferFilter("traje_name",2,5,125) + * + * \endchinese + * \english + * Joint space path filter + * + * @brief pathBufferFilter + * + * @param name Name of the path buffer + * @param order Filter order (usually 2) + * @param fd Cutoff frequency, the smaller the smoother but with more delay + * (usually 3-20) + * @param fs Sampling frequency of discrete data (usually 20-500) + * + * @return Returns 0 on success + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathBufferFilter(self: pyaubo_sdk.MotionControl, arg0: str, arg1: int, + * arg2: float, arg3: float) -> int + * + * @par Lua function prototype + * pathBufferFilter(name: string, order: number, fd: number, fs:number) -> + * nil + * + * @par Lua example + * pathBufferFilter("traje_name",2,5,125) + * + * \endenglish + */ + int pathBufferFilter(const std::string &name, int order, double fd, + double fs); + + /** + * \chinese + * 列出所有缓存路径的名字 + * + * @return 返回所有缓存路径的名字 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathBufferList(self: pyaubo_sdk.MotionControl) -> List[str] + * + * @par Lua函数原型 + * pathBufferList() -> table + * + * @par Lua示例 + * Buffer_table = pathBufferList() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathBufferList","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[]} + * + * \endchinese + * \english + * List all cached path names + * + * @return Returns all cached path names + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathBufferList(self: pyaubo_sdk.MotionControl) -> List[str] + * + * @par Lua function prototype + * pathBufferList() -> table + * + * @par Lua example + * Buffer_table = pathBufferList() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathBufferList","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[]} + * + * \endenglish + */ + std::vector pathBufferList(); + + /** + * \chinese + * 执行缓存的路径 + * + * @param name 缓存路径的名字 + * @return 成功返回0;失败返回错误码 + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * movePathBuffer(self: pyaubo_sdk.MotionControl, arg0: str) -> int + * + * @par Lua函数原型 + * movePathBuffer(name: string) -> nil + * + * @par Lua示例 + * movePathBuffer("traje_name") + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.movePathBuffer","params":["rec"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Execute the cached path + * + * @param name Name of the cached path + * @return Returns 0 on success; otherwise returns an error code + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * movePathBuffer(self: pyaubo_sdk.MotionControl, arg0: str) -> int + * + * @par Lua function prototype + * movePathBuffer(name: string) -> nil + * + * @par Lua example + * movePathBuffer("traje_name") + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.movePathBuffer","params":["rec"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int movePathBuffer(const std::string &name); + + /** + * \chinese + * 相贯线接口 + * + * @param pose 由三个示教位姿组成(首先需要运动到起始点,起始点的要求:过主圆柱 + * 柱体轴心且与子圆柱体轴线平行的平面与子圆柱体在底部的交点) + * p1:过子圆柱体轴线且与大圆柱体轴线平行的平面,与小圆柱体在左侧顶部的交点 + * p2:过子圆柱体轴线且与大圆柱体轴线平行的平面,与大圆柱体在左侧底部的交点 + * p3:过子圆柱体轴线且与大圆柱体轴线平行的平面,与大圆柱体在右侧底部的交点 + * @param v 速度 + * @param a 加速度 + * @param main_pipe_radius 主圆柱体半径 + * @param sub_pipe_radius 子圆柱体半径 + * @param normal_distance 两圆柱体轴线距离 + * @param normal_alpha 两圆柱体轴线的夹角 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * moveIntersection(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float, arg3: float, arg4: float, arg5: float, arg6: float) + * -> int + * + * @par Lua函数原型 + * moveIntersection(poses: table, a: number, v: number, + * main_pipe_radius: number, sub_pipe_radius: number, normal_distance: + * number, normal_alpha: number) -> nil \endchinese \english Intersection + * interface + * + * @param poses Consists of three taught poses (first, move to the starting + * point. The starting point requirement: the intersection of the plane + * passing through the main cylinder axis and parallel to the sub-cylinder + * axis with the sub-cylinder at the bottom) p1: Intersection of the plane + * passing through the sub-cylinder axis and parallel to the main cylinder + * axis with the sub-cylinder at the left top p2: Intersection of the plane + * passing through the sub-cylinder axis and parallel to the main cylinder + * axis with the main cylinder at the left bottom p3: Intersection of the + * plane passing through the sub-cylinder axis and parallel to the main + * cylinder axis with the main cylinder at the right bottom + * @param v Velocity + * @param a Acceleration + * @param main_pipe_radius Main cylinder radius + * @param sub_pipe_radius Sub cylinder radius + * @param normal_distance Distance between the two cylinder axes + * @param normal_alpha Angle between the two cylinder axes + * + * @return Returns 0 on success; otherwise returns an error code + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * moveIntersection(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float, arg3: float, arg4: float, arg5: float, arg6: float) + * -> int + * + * @par Lua function prototype + * moveIntersection(poses: table, a: number, v: number, + * main_pipe_radius: number, sub_pipe_radius: number, normal_distance: + * number, normal_alpha: number) -> nil \endenglish + */ + int moveIntersection(const std::vector> &poses, + double a, double v, double main_pipe_radius, + double sub_pipe_radius, double normal_distance, + double normal_alpha); + /** + * \chinese + * 关节空间停止运动 + * + * @param acc 关节加速度,单位: rad/s^2 + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * stopJoint(self: pyaubo_sdk.MotionControl, arg0: float) -> int + * + * @par Lua函数原型 + * stopJoint(acc: number) -> nil + * + * @par Lua示例 + * stopJoint(2) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.stopJoint","params":[31],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Stop motion in joint space + * + * @param acc Joint acceleration, unit: rad/s^2 + * @return Returns 0 on success; otherwise returns an error code + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * stopJoint(self: pyaubo_sdk.MotionControl, arg0: float) -> int + * + * @par Lua function prototype + * stopJoint(acc: number) -> nil + * + * @par Lua example + * stopJoint(2) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.stopJoint","params":[31],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int stopJoint(double acc); + + /** + * \chinese + * 关节空间停止运动(机械臂运行工程时发生碰撞,通过resumeSpeedJoint接口移动到安全位置后需要停止时调用此接口) + * + * @param acc 关节加速度,单位: rad/s^2 + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * resumeStopJoint(self: pyaubo_sdk.MotionControl, arg0: float) -> int + * + * @par Lua函数原型 + * resumeStopJoint(acc: number) -> nil + * + * @par Lua示例 + * resumeStopJoint(31) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.resumeStopJoint","params":[31],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":-1} + * + * \endchinese + * \english + * Stop motion in joint space (used after moving to a safe position via + * resumeSpeedJoint following a collision during process execution) + * + * @param acc Joint acceleration, unit: rad/s^2 + * @return Returns 0 on success; otherwise returns an error code + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * resumeStopJoint(self: pyaubo_sdk.MotionControl, arg0: float) -> int + * + * @par Lua function prototype + * resumeStopJoint(acc: number) -> nil + * + * @par Lua example + * resumeStopJoint(31) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.resumeStopJoint","params":[31],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":-1} + * + * \endenglish + */ + int resumeStopJoint(double acc); + + /** + * \chinese + * 停止 moveLine/moveCircle 等在笛卡尔空间的运动 + * + * @param acc 工具加速度, 单位: m/s^2 + * @param acc_rot + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * stopLine(self: pyaubo_sdk.MotionControl, arg0: float, arg1: float) -> int + * + * @par Lua函数原型 + * stopLine(acc: number, acc_rot: number) -> nil + * + * @par Lua示例 + * stopLine(10,10) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.stopLine","params":[10,10],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Stop motions in Cartesian space such as moveLine/moveCircle. + * + * @param acc Tool acceleration, unit: m/s^2 + * @param acc_rot + * @return Returns 0 on success; otherwise returns an error code + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * stopLine(self: pyaubo_sdk.MotionControl, arg0: float, arg1: float) -> int + * + * @par Lua function prototype + * stopLine(acc: number, acc_rot: number) -> nil + * + * @par Lua example + * stopLine(10,10) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.stopLine","params":[10,10],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int stopLine(double acc, double acc_rot); + + /** + * \chinese + * 笛卡尔空间停止运动(机械臂运行工程时发生碰撞,通过resumeSpeedLine接口移动到安全位置后需要停止时调用此接口) + * + * @param acc 位置加速度, 单位: m/s^2 + * @param acc_rot 姿态加速度,单位: rad/s^2 + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * resumeStopLine(self: pyaubo_sdk.MotionControl, arg0: float, arg1: float) + * -> int + * + * @par Lua函数原型 + * resumeStopLine(acc: number, acc_rot: number) -> nil + * + * @par Lua示例 + * resumeStopLine(10,10) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.resumeStopLine","params":[10,10],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":-1} + * + * \endchinese + * \english + * Stop motion in Cartesian space (used after moving to a safe position via + * resumeSpeedLine following a collision during process execution) + * + * @param acc Position acceleration, unit: m/s^2 + * @param acc_rot Orientation acceleration, unit: rad/s^2 + * @return Returns 0 on success; otherwise returns an error code + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * resumeStopLine(self: pyaubo_sdk.MotionControl, arg0: float, arg1: float) + * -> int + * + * @par Lua function prototype + * resumeStopLine(acc: number, acc_rot: number) -> nil + * + * @par Lua example + * resumeStopLine(10,10) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.resumeStopLine","params":[10,10],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":-1} + * + * \endenglish + */ + int resumeStopLine(double acc, double acc_rot); + + /** + * \chinese + * 开始摆动: weaveStart 和 weaveEnd 的 moveLine/moveCircle 将根据 params + * 进行摆动 + * + * @param params Json字符串用于定义摆动参数 + * { + * "type": , // "SINE" "SPIRAL" "TRIANGLE" "TRAPEZOIDAL" + * "step": , + * "amplitude": {,}, + * "hold_distance": {,}, + * "angle": + * "direction": + * } + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Start weaving: moveLine/moveCircle between weaveStart and weaveEnd will + * perform weaving according to params + * + * @param params Json string to define weaving parameters + * { + * "type": , // "SINE" "SPIRAL" "TRIANGLE" "TRAPEZOIDAL" + * "step": , + * "amplitude": {,}, + * "hold_distance": {,}, + * "angle": + * "direction": + * } + * @return Returns 0 on success; otherwise returns an error code + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int weaveStart(const std::string ¶ms); + + /** + * \chinese + * 结束摆动 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.weaveEnd","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * End weaving + * + * @return Returns 0 on success; otherwise returns an error code + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.weaveEnd","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int weaveEnd(); + + /** + * \chinese + * 设置未来路径上点的采样时间间隔 + * + * @param sample_time 采样时间间隔 单位: m/s^2 + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Set the sampling interval for points on the future path + * + * @param sample_time Sampling interval, unit: m/s^2 + * @return Returns 0 on success; otherwise returns an error code + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int setFuturePointSamplePeriod(double sample_time); + + /** + * \chinese + * 获取未来路径上的轨迹点 + * + * @return 路点(100ms * 10) + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getFuturePathPointsJoint","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[]} + * + * \endchinese + * \english + * Get trajectory points on the future path + * + * @return Waypoints (100ms * 10) + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getFuturePathPointsJoint","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[]} + * + * \endenglish + */ + std::vector> getFuturePathPointsJoint(); + + /** + * \chinese + * 设置传送带编码器参数 + * + * @param encoder_id 预留 + * @param tick_per_meter + * 线性传送带===>一米的脉冲值 + * 环形传送带===>一圈的脉冲值 + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setConveyorTrackEncoder(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua函数原型 + * setConveyorTrackEncoder(encoder_id: bumber,tick_per_meter: number) -> int + * + * @par Lua示例 + * num = setConveyorTrackEncoder(1,40000) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setConveyorTrackEncoder","params":[1,40000],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set conveyor encoder parameters + * + * @param encoder_id Reserved + * @param tick_per_meter + * Linear conveyor: pulses per meter + * Circular conveyor: pulses per revolution + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setConveyorTrackEncoder(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua function prototype + * setConveyorTrackEncoder(encoder_id: bumber,tick_per_meter: number) -> int + * + * @par Lua example + * num = setConveyorTrackEncoder(1,40000) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setConveyorTrackEncoder","params":[1,40000],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setConveyorTrackEncoder(int encoder_id, int tick_per_meter); + /** + * \chinese + * 圆形传送带跟随 + * + * @note 暂未实现 + * + * @param encoder_id + * 0-集成传感器 + * @param rotate_tool + * @return + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Circular conveyor tracking + * + * @note Not implemented yet + * + * @param encoder_id + * 0 - integrated sensor + * @param rotate_tool + * @return + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int conveyorTrackCircle(int encoder_id, const std::vector ¢er, + bool rotate_tool); + + /** + * \chinese + * 线性传送带跟随 + * + * @param encoder_id 预留 + * @param direction 传送带相对机器人基坐标系的移动方向 + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * conveyorTrackLine(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua函数原型 + * conveyorTrackLine -> int + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.conveyorTrackLine","params":[1,[1.0,0.0,0.0,0.0,0.0,0.0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Linear conveyor tracking + * + * @param encoder_id Reserved + * @param direction The movement direction of the conveyor relative to the + * robot base coordinate system + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * conveyorTrackLine(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua function prototype + * conveyorTrackLine -> int + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.conveyorTrackLine","params":[1,[1.0,0.0,0.0,0.0,0.0,0.0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int conveyorTrackLine(int encoder_id, const std::vector &direction); + + /** + * \chinese + * 终止传送带跟随 + * + * @param encoder_id 预留 + * @param a 预留 + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * conveyorTrackStop(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua函数原型 + * conveyorTrackStop -> int + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.conveyorTrackStop","params":[0,1.0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Stop conveyor tracking + * + * @param encoder_id Reserved + * @param a Reserved + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * conveyorTrackStop(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua function prototype + * conveyorTrackStop -> int + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.conveyorTrackStop","params":[0,1.0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int conveyorTrackStop(int encoder_id, double a); + + /** + * \chinese + * 切换传送带追踪物品 + * 如果当前物品正在处于跟踪状态,则将该物品出队,不再跟踪,返回true + * 如果没有物品正在处于跟踪状态,返回false + * + * @return + * + * @throws arcs::common_interface::AuboException + * + * @param encoder_id 预留 + * + * @par Python函数原型 + * conveyorTrackSwitch(self: pyaubo_sdk.MotionControl) -> bool + * + * @par Lua函数原型 + * conveyorTrackSwitch() -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.conveyorTrackSwitch","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endchinese + * \english + * Switch conveyor tracking item. + * If the current item is being tracked, it will be dequeued and no longer + * tracked, returning true. If no item is currently being tracked, returns + * false. + * + * @return + * + * @throws arcs::common_interface::AuboException + * + * @param encoder_id Reserved + * + * @par Python function prototype + * conveyorTrackSwitch(self: pyaubo_sdk.MotionControl) -> bool + * + * @par Lua function prototype + * conveyorTrackSwitch() -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.conveyorTrackSwitch","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endenglish + */ + bool conveyorTrackSwitch(int encoder_id); + + /** + * \chinese + * 传送带上是否有物品可以跟踪 + * @param encoder_id 预留 + * @return + * 如果队列第一个物品为跟踪状态,返回true + * 如果队列第一个物品不为跟踪状态,则对队列中其余物品进行是否在启动窗口内的判断 + * 超出启动窗口则出队,直到有物品处于启动窗口内,使其变为跟踪状态返回true, + * 队列中没有一个物品在启动窗口内返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * hasItemOnConveyorToTrack(self: pyaubo_sdk.MotionControl) -> bool + * + * @par Lua函数原型 + * hasItemOnConveyorToTrack() -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.hasItemOnConveyorToTrack","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":{true}} + * \endchinese + * \english + * Whether there is an item on the conveyor that can be tracked + * @param encoder_id Reserved + * @return + * If the first item in the queue is in tracking state, returns true. + * If the first item is not in tracking state, checks the rest of the queue + * for items within the start window. Items outside the start window are + * dequeued until an item is found within the window, which is then set to + * tracking state and returns true. If no item in the queue is within the + * start window, returns false. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * hasItemOnConveyorToTrack(self: pyaubo_sdk.MotionControl) -> bool + * + * @par Lua function prototype + * hasItemOnConveyorToTrack() -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.hasItemOnConveyorToTrack","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":{true}} + * \endenglish + */ + bool hasItemOnConveyorToTrack(int encoder_id); + + /** + * \chinese + * 增加传送带队列 + * + * @param encoder_id 预留 + * @param item_id 物品ID + * @param offset 当前物品点位相对于模板物品点位的偏移值 + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * conveyorTrackCreatItem(self: pyaubo_sdk.MotionControl, arg0: int, + * arg1:int, arg2: List[float]) -> int + * + * @par Lua函数原型 + * conveyorTrackCreatItem(encoder_id: number, item_id: number, offset: + * table) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.conveyorTrackCreatItem","params":[0,2, + * {0.0,0.0,0.0,0.0,0.0,0.0}],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * \endchinese + * \english + * Add an item to the conveyor queue + * + * @param encoder_id Reserved + * @param item_id Item ID + * @param offset Offset of the current item position relative to the + * template item position + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * conveyorTrackCreatItem(self: pyaubo_sdk.MotionControl, arg0: int, + * arg1:int, arg2: List[float]) -> int + * + * @par Lua function prototype + * conveyorTrackCreatItem(encoder_id: number, item_id: number, offset: + * table) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.conveyorTrackCreatItem","params":[0,2, + * {0.0,0.0,0.0,0.0,0.0,0.0}],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * \endenglish + */ + int conveyorTrackCreatItem(int encoder_id, int item_id, + const std::vector &offset); + /** + * \chinese + * 设置传送带跟踪的补偿值 + * + * @param encoder_id 预留 + * @param comp 传送带补偿值 + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setConveyorTrackCompensate(self: pyaubo_sdk.MotionControl, arg0: int, + * arg1: float) -> int + * + * @par Lua函数原型 + * setConveyorTrackCompensate(comp: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setConveyorTrackCompensate","params":[0, + * 0.1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set the compensation value for conveyor tracking + * + * @param encoder_id Reserved + * @param comp Conveyor compensation value + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setConveyorTrackCompensate(self: pyaubo_sdk.MotionControl, arg0: int, + * arg1: float) -> int + * + * @par Lua function prototype + * setConveyorTrackCompensate(comp: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setConveyorTrackCompensate","params":[0, + * 0.1],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setConveyorTrackCompensate(int encoder_id, double comp); + + /** + * \chinese + * 判断传送带与机械臂之间是否达到相对静止 + * + * @param encoder_id 预留 + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * isConveyorTrackSync(self: pyaubo_sdk.MotionControl, arg0: int) -> bool + * + * @par Lua函数原型 + * isConveyorTrackSync(encoder_id: number) -> bool + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.isConveyorTrackSync","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endchinese + * \english + * Determine whether the conveyor and the robot arm have reached relative + * rest + * + * @param encoder_id Reserved + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * isConveyorTrackSync(self: pyaubo_sdk.MotionControl, arg0: int) -> bool + * + * @par Lua function prototype + * isConveyorTrackSync(encoder_id: number) -> bool + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.isConveyorTrackSync","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endenglish + */ + bool isConveyorTrackSync(int encoder_id); + + /** + * \chinese + * 设置传送带跟踪的最大距离限制 + * + * @param encoder_id 预留 + * @param limit + * 传送带跟踪的最大距离限制,单位:米 + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setConveyorTrackLimit(self: pyaubo_sdk.MotionControl, arg0: int, arg1: + * double) -> int + * + * @par Lua函数原型 + * setConveyorTrackLimit(encoder_id: number, limit: number) -> int + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setConveyorTrackLimit","params":[0, + * 1.5],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set the maximum distance limit for conveyor tracking + * + * @param encoder_id Reserved + * @param limit + * Maximum distance limit for conveyor tracking, unit: meter + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setConveyorTrackLimit(self: pyaubo_sdk.MotionControl, arg0: int, arg1: + * double) -> int + * + * @par Lua function prototype + * setConveyorTrackLimit(encoder_id: number, limit: number) -> int + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setConveyorTrackLimit","params":[0, + * 1.5],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setConveyorTrackLimit(int encoder_id, double limit); + + /** + * \chinese + * 设置传送带跟踪的启动窗口 + * + * @param encoder_id 预留 + * @param min_window + * 启动窗口的起始位置,单位:米 + * @param max_window + * 启动窗口的结束位置,单位:米 + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setConveyorTrackStartWindow(self: pyaubo_sdk.MotionControl, arg0: int, + * arg1: double, arg2: double) -> int + * + * @par Lua函数原型 + * setConveyorTrackStartWindow(encoder_id: number, min_window: number, + * max_window: number) -> int + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setConveyorTrackStartWindow","params":[0, + * 0.2, 1.0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the start window for conveyor tracking + * + * @param encoder_id Reserved + * @param min_window + * Start position of the window, unit: meter + * @param max_window + * End position of the window, unit: meter + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setConveyorTrackStartWindow(self: pyaubo_sdk.MotionControl, arg0: int, + * arg1: double, arg2: double) -> int + * + * @par Lua function prototype + * setConveyorTrackStartWindow(encoder_id: number, min_window: number, + * max_window: number) -> int + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setConveyorTrackStartWindow","params":[0, + * 0.2, 1.0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setConveyorTrackStartWindow(int encoder_id, double window_min, + double window_max); + + /** + * \chinese + * 设置传送带示教位置到同步开关之间的距离 + * + * @param encoder_id 预留 + * @param offset + * 传送带示教位置到同步开关之间的距离,单位:米 + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setConveyorTrackSensorOffset(self: pyaubo_sdk.MotionControl, arg0: int, + * arg1: double) -> int + * + * @par Lua函数原型 + * setConveyorTrackSensorOffset(encoder_id: number, offset: number) -> int + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setConveyorTrackSensorOffset","params":[0, + * 0.2],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the distance from the conveyor teaching position to the sync switch + * + * @param encoder_id Reserved + * @param offset + * Distance from the conveyor teaching position to the sync switch, unit: + * meter + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setConveyorTrackSensorOffset(self: pyaubo_sdk.MotionControl, arg0: int, + * arg1: double) -> int + * + * @par Lua function prototype + * setConveyorTrackSensorOffset(encoder_id: number, offset: number) -> int + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setConveyorTrackSensorOffset","params":[0, + * 0.2],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setConveyorTrackSensorOffset(int encoder_id, double offset); + + /** + * \chinese + * 设置传送带同步分离,用于过滤掉同步开关中不需要的信号 + * + * @param encoder_id 预留 + * @param distance + * 从出现一个同步信号后到把一个新的同步信号接受为一个有效对象前走的最短距离,单位:米 + * @param time + * 从出现一个同步信号后到把一个新的同步信号接受为一个有效对象前走的最短时间,单位:秒 + * + * distance和time设置数值大于0即为生效 + * 当distance与time同时设置时,优先生效distance + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setConveyorTrackSyncSeparation(self: pyaubo_sdk.MotionControl, arg0: int, + * arg1: double, arg2: double) -> int + * + * @par Lua函数原型 + * setConveyorTrackSyncSeparation(encoder_id: number, distance: number, + * time: number) -> int + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setConveyorTrackSyncSeparation","params":[0, + * 0.05, 0.2],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set conveyor sync separation, used to filter out unwanted signals from + * the sync switch. + * + * @param encoder_id Reserved + * @param distance + * The minimum distance to travel after a sync signal appears before + * accepting a new sync signal as a valid object, unit: meter + * @param time + * The minimum time to elapse after a sync signal appears before accepting a + * new sync signal as a valid object, unit: second + * + * If distance and time are both set greater than 0, the setting takes + * effect. If both distance and time are set, distance takes precedence. + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setConveyorTrackSyncSeparation(self: pyaubo_sdk.MotionControl, arg0: int, + * arg1: double, arg2: double) -> int + * + * @par Lua function prototype + * setConveyorTrackSyncSeparation(encoder_id: number, distance: number, + * time: number) -> int + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setConveyorTrackSyncSeparation","params":[0, + * 0.05, 0.2],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setConveyorTrackSyncSeparation(int encoder_id, double distance, + double time); + + /** + * \chinese + * 传送带上工件的移动距离是否超过最大限值 + * + * @param encoder_id 预留 + * @return + * true : 移动距离超过了最大限值 + * false : 移动距离没有超过了最大限值 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * isConveyorTrackExceed(self: pyaubo_sdk.MotionControl, arg0: int) -> bool + * + * @par Lua函数原型 + * isConveyorTrackExceed(encoder_id: number) -> bool + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.isConveyorTrackExceed","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * \endchinese + * \english + * Whether the workpiece on the conveyor has moved beyond the maximum limit + * + * @param encoder_id Reserved + * @return + * true : The movement distance exceeds the maximum limit + * false : The movement distance does not exceed the maximum limit + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * isConveyorTrackExceed(self: pyaubo_sdk.MotionControl, arg0: int) -> bool + * + * @par Lua function prototype + * isConveyorTrackExceed(encoder_id: number) -> bool + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.isConveyorTrackExceed","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * \endenglish + */ + bool isConveyorTrackExceed(int encoder_id); + + /** + * \chinese + * 清空传动带队列中的所有对象 + * + * @param encoder_id 预留 + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * conveyorTrackClearItems(self: pyaubo_sdk.MotionControl, arg0: int) -> int + * + * @par Lua函数原型 + * conveyorTrackClearItems(encoder_id: number) -> int + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.conveyorTrackClearItems","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Clear all items in the conveyor queue + * + * @param encoder_id Reserved + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * conveyorTrackClearItems(self: pyaubo_sdk.MotionControl, arg0: int) -> int + * + * @par Lua function prototype + * conveyorTrackClearItems(encoder_id: number) -> int + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.conveyorTrackClearItems","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int conveyorTrackClearItems(int encoder_id); + + /** + * \chinese + * 获取传送带队列的编码器值 + * + * @param encoder_id 预留 + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getConveyorTrackQueue(self: pyaubo_sdk.MotionControl, arg0: int) -> + * List[int] + * @par Lua函数原型 + * getConveyorTrackQueue(encoder_id: number) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getConveyorTrackQueue","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":{[-500,-200,150,-50]}} + * \endchinese + * \english + * Get encoder values of the conveyor queue + * + * @param encoder_id Reserved + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getConveyorTrackQueue(self: pyaubo_sdk.MotionControl, arg0: int) -> + * List[int] + * @par Lua function prototype + * getConveyorTrackQueue(encoder_id: number) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getConveyorTrackQueue","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":{[-500,-200,150,-50]}} + * \endenglish + */ + std::vector getConveyorTrackQueue(int encoder_id); + /** + * \chinese + * 获取下一个跟踪的传送带物品的id + * + * @param encoder_id 预留 + * @return + * 返回物品id,没有next item返回 -1 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getConveyorTrackNextItem(self: pyaubo_sdk.MotionControl, arg0: int) -> + * int + * @par Lua函数原型 + * getConveyorTrackNextItem(encoder_id: number) -> int + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getConveyorTrackNextItem","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":{10}} + * \endchinese + * \english + * Get the ID of the next item on the conveyor to be tracked + * + * @param encoder_id Reserved + * @return + * Returns the item ID; returns -1 if there is no next item + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getConveyorTrackNextItem(self: pyaubo_sdk.MotionControl, arg0: int) -> + * int + * @par Lua function prototype + * getConveyorTrackNextItem(encoder_id: number) -> int + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getConveyorTrackNextItem","params":[0],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":{10}} + * \endenglish + */ + + int getConveyorTrackNextItem(int encoder_id); + + /** + * \chinese + * 螺旋线运动 + * + * @param param 封装的参数 + * @param blend_radius + * @param v + * @param a + * @param t + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.moveSpiral", + * "params":[{"spiral":0.005,"helix":0.005,"angle":18.84,"plane":0,"frame":[0,0,0,0,0,0]},0,0.25,1.2,0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Spiral motion + * + * @param param Encapsulated parameters + * @param blend_radius + * @param v + * @param a + * @param t + * @return Returns 0 on success; otherwise returns an error code + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.moveSpiral", + * "params":[{"spiral":0.005,"helix":0.005,"angle":18.84,"plane":0,"frame":[0,0,0,0,0,0]},0,0.25,1.2,0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int moveSpiral(const SpiralParameters ¶m, double blend_radius, double v, + double a, double t); + + /** + * \chinese + * 获取前瞻段数 + * + * @return 返回前瞻段数 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getLookAheadSize(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua函数原型 + * getLookAheadSize() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getLookAheadSize","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1} + * + * \endchinese + * \english + * Get look-ahead segment size + * + * @return Returns the look-ahead segment size + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getLookAheadSize(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua function prototype + * getLookAheadSize() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getLookAheadSize","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1} + * + * \endenglish + */ + int getLookAheadSize(); + + /** + * \chinese + * 设置前瞻段数 + * 1.对于有较高速度平稳性要求的任务,如数控加工,涂胶,焊接等匀速需求,较长的前瞻段数可以提供更优的速度规划,产生的运动会更加平滑; + * 2.对于快速响应的抓取类任务,更倾向于较短的前瞻段数,以提高反应速度,但可能因为进给的路径不够及时导致速度波动很大. + * + * @return 成功返回0 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setLookAheadSize(self: pyaubo_sdk.MotionControl, arg0: int) -> int + * + * @par Lua函数原型 + * setLookAheadSize(eqradius: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setLookAheadSize","params":[1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set look-ahead segment size + * 1. For tasks requiring high speed smoothness, such as CNC machining, + * gluing, welding, etc., a longer look-ahead segment size can provide + * better speed planning and smoother motion. + * 2. For fast-response tasks such as picking, a shorter look-ahead segment + * size is preferred to improve response speed, but may cause large speed + * fluctuations due to insufficiently timely path feeding. + * + * @return Returns 0 on success + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setLookAheadSize(self: pyaubo_sdk.MotionControl, arg0: int) -> int + * + * @par Lua function prototype + * setLookAheadSize(eqradius: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setLookAheadSize","params":[1],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setLookAheadSize(int size); + + /** + * \chinese + * 更新摆动过程中的频率和振幅 + * + * @param params Json字符串用于定义摆动参数 + * { + * "frequency": , + * "amplitude": {,} + * } + * + * @return 成功返回0 + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Update frequency and amplitude during weaving process + * + * @param params Json string used to define weaving parameters + * { + * "frequency": , + * "amplitude": {,} + * } + * + * @return Returns 0 on success + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int weaveUpdateParameters(const std::string ¶ms); + + /** + * \chinese + * 设置关节电流环刚度系数 + * + * @param stiffness 各个关节刚度系数,百分比。[0 -> 1],值越大,表现为越硬。 + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * enableJointSoftServo(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> + * int + * + * @par Lua函数原型 + * enableJointSoftServo(stiffness: table) -> int + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.enableJointSoftServo","params":[[0.0,0.0,0.0,0.0,0.0,0.0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set joint current loop stiffness coefficient + * + * @param stiffness Stiffness coefficient for each joint, as a percentage [0 + * -> 1]. The larger the value, the stiffer the joint. + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * enableJointSoftServo(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> + * int + * + * @par Lua function prototype + * enableJointSoftServo(stiffness: table) -> int + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.enableJointSoftServo","params":[[0.0,0.0,0.0,0.0,0.0,0.0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int enableJointSoftServo(const std::vector &stiffness); + + /** + * \chinese + * 关闭关节电流环刚度系数 + * + * @return 返回0表示成功,其他为错误码 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * disableJointSoftServo(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua函数原型 + * disableJointSoftServo() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.disableJointSoftServo","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1} + * \endchinese + * \english + * Disable joint current loop stiffness coefficient + * + * @return Returns 0 on success, otherwise error code + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * disableJointSoftServo(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua function prototype + * disableJointSoftServo() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.disableJointSoftServo","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1} + * \endenglish + */ + int disableJointSoftServo(); + + /** + * \chinese + * 判断关节电流环刚度系数是否使能 + * + * @return 已使能返回true,反之则返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * isJointSoftServoEnabled(self: pyaubo_sdk.MotionControl) -> bool + * + * @par Lua函数原型 + * isJointSoftServoEnabled() -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.isJointSoftServoEnabled","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1} + * \endchinese + * \english + * Determine whether the joint current loop stiffness coefficient is + * enabled. + * + * @return Returns true if enabled, otherwise returns false. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * isJointSoftServoEnabled(self: pyaubo_sdk.MotionControl) -> bool + * + * @par Lua function prototype + * isJointSoftServoEnabled() -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.isJointSoftServoEnabled","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1} + * \endenglish + */ + bool isJointSoftServoEnabled(); + + /** + * \chinese + * 打开振动抑制 + * + * @param omega 振动抑制频率,长度一般为笛卡尔维度或关节自由度.为0时关闭抑制 + * \n + * @param zeta 振动抑制阻尼比,长度一般为笛卡尔维度或关节自由度.为0时关闭抑制 + * \n + * @param level + * 振动抑制等级(1~3),等级越高抑制效果越明显响应速度相应变慢.等级0关闭振动抑制 + * \n + * @retval 0 成功 + * @retval AUBO_BAD_STATE(1) 当前安全模式处于非 + * Normal、ReducedMode、Recovery 状态 + * @retval AUBO_QUEUE_FULL(2) 规划队列已满 + * @retval AUBO_BUSY(3) 上一条指令正在执行中 + * @retval -AUBO_BAD_STATE(-1) + * 可能的原因包括但不限于:线程已分离、线程被终止、task_id + * 未找到,或者当前机器人模式非 Running + * @retval -AUBO_TIMEOUT(-4) 调用接口超时 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * enableVibrationSuppress(self: pyaubo_sdk.MotionControl, arg0: + * list[float], arg1: list[float], arg2: int) -> int + * + * @par Lua函数原型 + * enableVibrationSuppress(omega: table, zeta: table, level: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.enableVibrationSuppress","params":[[0.5,0.5,0.5,0.5,0.5,0.5],[0.5,0.5,0.5,0.5,0.5,0.5],2],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + */ + int enableVibrationSuppress(const std::vector &omega, + const std::vector &zeta, int level); + /** + * \chinese + * 关闭振动抑制 + * + * @return 已使能返回true,反之则返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * disbaleVibrationSuppress(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua函数原型 + * disbaleVibrationSuppress() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.disbaleVibrationSuppress","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1} + * \endchinese + */ + int disbaleVibrationSuppress(); + + /** + * \chinese + * 设置时间最优算法 默认关闭 + * + * @param enable + * + * @throws arcs::common_interface::AuboException + * + * @par Lua函数原型 + * setTimeOptimalEnable() -> bool + * + * @par Lua示例 + * setTimeOptimalEnable(true) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setTimeOptimalEnable","params":[true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * + * @param enable + * + * @throws arcs::common_interface::AuboException + * + * @par Lua function prototype + * setTimeOptimalEnable() -> number + * + * @par Lua example + * setTimeOptimalEnable(true) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setTimeOptimalEnable","params":[true],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setTimeOptimalEnable(bool enable); + + /** + * \chinese + * 获取时间最优算法状态: + * true - 开启 + * false - 关闭 + * + * @return 返回时间最优算法状态 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * isTimeOptimalEnabled(self: pyaubo_sdk.MotionControl) -> float + * + * @par Lua函数原型 + * isTimeOptimalEnabled() -> number + * + * @par Lua 示例 + * num = isTimeOptimalEnabled() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.isTimeOptimalEnabled","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1.0} + * \endchinese + * \english + * Get the time optimal algorithm state: + * true - enable + * false - disable + * + * @return Returns the time optimal algorithm state + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * isTimeOptimalEnabled(self: pyaubo_sdk.MotionControl) -> bool + * + * @par Lua function prototype + * isTimeOptimalEnabled() -> boolean + * + * @par Lua example + * flag = isTimeOptimalEnabled() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.isTimeOptimalEnabled","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":true} + * \endenglish + */ + bool isTimeOptimalEnabled(); + +protected: + void *d_; +}; +using MotionControlPtr = std::shared_ptr; +} // namespace common_interface +} // namespace arcs + +#endif // AUBO_SDK_MOTION_CONTROL_INTERFACE_H diff --git a/third_party/AuboSdk/linux/include/aubo/robot/robot_algorithm.h b/third_party/AuboSdk/linux/include/aubo/robot/robot_algorithm.h new file mode 100644 index 00000000..88833a1e --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo/robot/robot_algorithm.h @@ -0,0 +1,1394 @@ +/** @file robot_algorithm.h + * @brief 机器人算法相关的对外接口 + */ +#ifndef AUBO_SDK_ROBOT_ALGORITHM_INTERFACE_H +#define AUBO_SDK_ROBOT_ALGORITHM_INTERFACE_H + +#include +#include +#include +#include + +#include +#include + +namespace arcs { +namespace common_interface { + +// clang-format off + +/** + * \chinese + * 机器人算法相关的对外接口 + * \endchinese + * \english + * Interfaces related to robot algorithms + * \endenglish + */ + +class ARCS_ABI_EXPORT RobotAlgorithm +{ +public: + RobotAlgorithm(); + virtual ~RobotAlgorithm(); + + /** + * \chinese + * 力传感器标定算法(三点标定法) + * + * @param force 力数据 + * @param q 关节角度 + * @return 标定结果 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * calibrateTcpForceSensor(self: pyaubo_sdk.RobotAlgorithm, arg0: + * List[List[float]], arg1: List[List[float]]) -> Tuple[List[float], + * List[float], float, List[float]] + * + * @par Lua函数原型 + * calibrateTcpForceSensor(force: table, q: table) -> table + * + * @par Lua示例 + * cal_table = calibrateTcpForceSensor({10.0,10.0,10.0,-1.2,-1.2,-1.2}, {3.083,1.227,1.098,0.670,-1.870,-0.397}) + * + * \endchinese + * \english + * Force sensor calibration algorithm (three-point calibration method) + * + * @param force Force data + * @param q Joint angles + * @return Calibration result + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * calibrateTcpForceSensor(self: pyaubo_sdk.RobotAlgorithm, arg0: + * List[List[float]], arg1: List[List[float]]) -> Tuple[List[float], + * List[float], float, List[float]] + * + * @par Lua function prototype + * calibrateTcpForceSensor(force: table, q: table) -> table + * + * @par Lua example + * cal_table = calibrateTcpForceSensor({10.0,10.0,10.0,-1.2,-1.2,-1.2}, {3.083,1.227,1.098,0.670,-1.870,-0.397}) + * + * \endenglish + */ + ForceSensorCalibResult calibrateTcpForceSensor( + const std::vector> &forces, + const std::vector> &poses); + + /** + * \chinese + * 力传感器标定算法(三点标定法) + * @param forces + * @param poses + * @return force_offset, com, mass, angle error + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Force sensor calibration algorithm (three-point calibration method) + * @param forces + * @param poses + * @return force_offset, com, mass, angle error + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + ForceSensorCalibResultWithError calibrateTcpForceSensor2( + const std::vector> &forces, + const std::vector> &poses); + + /** + * \chinese + * 力传感器偏置标定算法 + * + * @param force 力数据 + * @param poses 位姿 + * @param mass 质量, 单位: kg + * @param cog 重心, 单位: m, 形式为(CoGx, CoGy, CoGz) + * @return 标定结果 + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Force sensor offset calibration algorithm + * + * @param forces Force data + * @param poses + * @param m Mass, unit: kg + * @param cog Center of gravity, unit: m, format (CoGx, CoGy, CoGz) + * @return Calibration result + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + ResultWithErrno calibrateTcpForceSensor3( + const std::vector> &forces, + const std::vector> &poses, const double &mass, + const std::vector&cog); + + /** + * \chinese + * 基于电流的负载辨识算法接口 + * + * 需要采集空载时运行激励轨迹的位置、速度、电流以及带负载时运行激励轨迹的位置、速度、电流 + * + * @param data_file_no_payload + * 空载时运行激励轨迹各关节数据的文件路径(.csv格式),共18列,依次为6个关节位置、6个关节速度、6个关节电流 + * @param data_file_with_payload + * 带负载运行激励轨迹各关节数据的文件路径(.csv格式),共18列,依次为6个关节位置、6个关节速度、6个关节电流 + * @return 辨识的结果 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * payloadIdentify(self: pyaubo_sdk.RobotAlgorithm, arg0: List[List[float]], + * arg1: List[List[float]]) -> Tuple[List[float], List[float], float, + * List[float]] + * + * @par Lua函数原型 + * payloadIdentify(data_with_payload: table, data_with_payload: table) -> + * table + * \endchinese + * \english + * Payload identification algorithm interface based on current + * + * Requires collecting position, velocity, and current data when running the excitation trajectory without load, as well as with load. + * + * @param data_file_no_payload + * File path of joint data when running the excitation trajectory without load (.csv format), 18 columns in total: 6 joint positions, 6 joint velocities, 6 joint currents + * @param data_file_with_payload + * File path of joint data when running the excitation trajectory with load (.csv format), 18 columns in total: 6 joint positions, 6 joint velocities, 6 joint currents + * @return Identification result + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * payloadIdentify(self: pyaubo_sdk.RobotAlgorithm, arg0: List[List[float]], + * arg1: List[List[float]]) -> Tuple[List[float], List[float], float, + * List[float]] + * + * @par Lua function prototype + * payloadIdentify(data_with_payload: table, data_with_payload: table) -> + * table + * \endenglish + */ + int payloadIdentify(const std::string &data_file_no_payload, + const std::string &data_file_with_payload); + + /** + * \chinese + * 新版基于电流的负载辨识算法接口 + * + * 需要采集带载时运行最少三个点的位置、速度、加速度、电流、温度、末端传感器数据、底座数据 + * + * @param data + * 带负载的各关节数据的文件路径(.csv格式),共42列,末端传感器数据、底座数据默认为0 + * @return 辨识的结果 + * \endchinese + * \english + * New version of payload identification algorithm interface based on current + * + * Requires collecting at least three points of position, velocity, acceleration, current, temperature, end sensor data, and base data when running with load + * + * @param data + * File path of joint data with load (.csv format), 42 columns in total, end sensor data and base data default to 0 + * @return Identification result + * \endenglish + */ + int payloadIdentify1(const std::string &file_name); + + /** + * \chinese + * 负载辨识是否计算完成 + * @return 完成返回0; 正在进行中返回1; 计算失败返回<0; + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.payloadCalculateFinished","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Whether payload identification calculation is finished + * @return 0 if finished; 1 if in progress; <0 if failed; + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.payloadCalculateFinished","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int payloadCalculateFinished(); + + /** + * \chinese + * 获取负载辨识结果 + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.getPayloadIdentifyResult","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,[],[],[]]} + * + * \endchinese + * \english + * Get the result of payload identification + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.getPayloadIdentifyResult","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,[],[],[]]} + * + * \endenglish + */ + Payload getPayloadIdentifyResult(); + + /** + * \chinese + * 关节摩擦力模型辨识算法接口 + * + * @param q 关节角度 + * @param qd 关节速度 + * @param qdd 关节加速度 + * @param temp 关节温度 + * @return 是否辨识成功 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * frictionModelIdentify(self: pyaubo_sdk.RobotAlgorithm, arg0: + * List[List[float]], arg1: List[List[float]], arg2: List[List[float]], + * arg3: List[List[float]]) -> bool + * + * @par Lua函数原型 + * frictionModelIdentify(q: table, qd: table, qdd: table, temp: table) -> + * boolean + * + * @par Lua示例 + * Identify_result = frictionModelIdentify({3.083,1.227,1.098,0.670,-1.870,-0.397}, + * {10.0,10.0,10.0,10.0,10.0,10.0},{20.0,20.0,20.0,20.0,20.0,20.0},{30.0,30.0,30.0,30.0,30.0,30.0}) + * + * \endchinese + * \english + * Joint friction model identification algorithm interface + * + * @param q Joint positions + * @param qd Joint velocities + * @param qdd Joint accelerations + * @param temp Joint temperatures + * @return Whether identification succeeded + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * frictionModelIdentify(self: pyaubo_sdk.RobotAlgorithm, arg0: + * List[List[float]], arg1: List[List[float]], arg2: List[List[float]], + * arg3: List[List[float]]) -> bool + * + * @par Lua function prototype + * frictionModelIdentify(q: table, qd: table, qdd: table, temp: table) -> + * boolean + * + * @par Lua example + * Identify_result = frictionModelIdentify({3.083,1.227,1.098,0.670,-1.870,-0.397}, + * {10.0,10.0,10.0,10.0,10.0,10.0},{20.0,20.0,20.0,20.0,20.0,20.0},{30.0,30.0,30.0,30.0,30.0,30.0}) + * + * \endenglish + */ + bool frictionModelIdentify(const std::vector> &q, + const std::vector> &qd, + const std::vector> &qdd, + const std::vector> &temp); + + /** + * \chinese + * 工件坐标系标定算法接口(需要在调用之前正确的设置机器人的TCP偏移) + * 输入多组关节角度和标定类型,输出工件坐标系位姿(相对于机器人基坐标系) + * + * @param q 关节角度 + * @param type 标定类型 + * @return 计算结果(工件坐标系位姿)以及错误代码 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * calibWorkpieceCoordinatePara(self: pyaubo_sdk.RobotAlgorithm, arg0: + * List[List[float]], arg1: int) -> Tuple[List[float], int] + * + * @par Lua函数原型 + * calibWorkpieceCoordinatePara(q: table, type: number) -> table, number + * + * @par Lua示例 + * coord_pose,coord_num = calibWorkpieceCoordinatePara({3.083,1.227,1.098,0.670,-1.870,-0.397},1) + * + * \endchinese + * \english + * Workpiece coordinate calibration algorithm interface (requires correct TCP offset set before calling) + * Input multiple sets of joint angles and calibration type, output workpiece coordinate pose (relative to robot base) + * + * @param q Joint angles + * @param type Calibration type + * @return Calculation result (workpiece coordinate pose) and error code + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * calibWorkpieceCoordinatePara(self: pyaubo_sdk.RobotAlgorithm, arg0: + * List[List[float]], arg1: int) -> Tuple[List[float], int] + * + * @par Lua function prototype + * calibWorkpieceCoordinatePara(q: table, type: number) -> table, number + * + * @par Lua example + * coord_pose,coord_num = calibWorkpieceCoordinatePara({3.083,1.227,1.098,0.670,-1.870,-0.397},1) + * + * \endenglish + */ + ResultWithErrno calibWorkpieceCoordinatePara( + const std::vector> &q, int type); + + /** + * \chinese + * 动力学正解 + * + * @param q 关节角 + * @param torqs + * @return 计算结果以及错误代码 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * forwardDynamics(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float], arg1: + * List[float]) -> Tuple[List[float], int] + * + * @par Lua函数原型 + * forwardDynamics(q: table, torqs: table) -> table, number + * + * @par Lua示例 + * Dynamics, fk_result = forwardDynamics({3.083,1.227,1.098,0.670,-1.870,-0.397},{0.0,0.0,0.0,0.0,0.0,0.0}) + * + * \endchinese + * \english + * Forward dynamics + * + * @param q Joint angles + * @param torqs + * @return Calculation result and error code + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * forwardDynamics(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float], arg1: + * List[float]) -> Tuple[List[float], int] + * + * @par Lua function prototype + * forwardDynamics(q: table, torqs: table) -> table, number + * + * @par Lua example + * Dynamics, fk_result = forwardDynamics({3.083,1.227,1.098,0.670,-1.870,-0.397},{0.0,0.0,0.0,0.0,0.0,0.0}) + * + * \endenglish + */ + ResultWithErrno forwardDynamics(const std::vector &q, + const std::vector &torqs); + + /** + * \chinese + * 动力学正解,基于给定的TCP偏移 + * + * @param q 关节角 + * @param torqs + * @param tcp_offset TCP偏移 + * @return 计算结果以及错误代码,同forwardDynamics + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * forwardDynamics(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float], arg1: + * List[float], arg2: List[float]) -> Tuple[List[float], int] + * + * @par Lua函数原型 + * forwardDynamics1(q: table, torqs: table, tcp_offset: table) -> table, number + * + * @par Lua示例 + * Dynamics, fk_result = forwardDynamics1({3.083,1.227,1.098,0.670,-1.870,-0.397},{0.0,0.0,0.0,0.0,0.0,0.0},{0.0,0.13201,0.03879,0,0,0}) + * + * \endchinese + * \english + * Forward dynamics based on the given TCP offset + * + * @param q Joint angles + * @param torqs + * @param tcp_offset TCP offset + * @return Calculation result and error code, same as forwardDynamics + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * forwardDynamics(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float], arg1: + * List[float], arg2: List[float]) -> Tuple[List[float], int] + * + * @par Lua function prototype + * forwardDynamics1(q: table, torqs: table, tcp_offset: table) -> table, number + * + * @par Lua example + * Dynamics, fk_result = forwardDynamics1({3.083,1.227,1.098,0.670,-1.870,-0.397},{0.0,0.0,0.0,0.0,0.0,0.0},{0.0,0.13201,0.03879,0,0,0}) + * + * \endenglish + */ + ResultWithErrno forwardDynamics1(const std::vector &q, + const std::vector &torqs, + const std::vector &tcp_offset); + + /** + * \chinese + * 运动学正解, 基于激活的TCP偏移(最近的通过 setTcpOffset 设置的参数) + * 输入关节角度,输出TCP位姿 + * + * @param q 关节角 + * @return TCP位姿和正解结果是否有效 + * 返回值的第一个参数为正解结果,第二个为正解错误码,错误码返回值列表如下 + * 0 - 成功 + * -1 - 机械臂状态不对(未初始化完成,可尝试再次调用) + * -5 - 输入的关节角无效(维度错误) + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * forwardKinematics(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float]) -> + * Tuple[List[float], int] + * + * @par Lua函数原型 + * forwardKinematics(q: table) -> table, number + * + * @par Lua示例 + * pose, fk_result = forwardKinematics({3.083,1.227,1.098,0.670,-1.870,-0.397}) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.forwardKinematics","params":[[3.083688522170976,1.2273215976885394,1.098072739631141,0.6705738810610149,-1.870715392248607,-0.39708546603119627]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[[0.7137448715395925,0.08416057568819092,0.6707994191515292,2.4599818776908724,0.4789772388601265,1.6189630435878408],0]} + * \endchinese + * \english + * Forward kinematics, based on the activated TCP offset (the most recently set via setTcpOffset) + * Input joint angles, output TCP pose + * + * @param q Joint angles + * @return TCP pose and whether the result is valid + * The first parameter of the return value is the forward kinematics result, the second is the error code. Error codes are as follows: + * 0 - Success + * -1 - The status of the robot is incorrect (not initialized yet, you can try calling it again) + * -5 - The input joint angles is invalid (dimension error) + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * forwardKinematics(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float]) -> + * Tuple[List[float], int] + * + * @par Lua function prototype + * forwardKinematics(q: table) -> table, number + * + * @par Lua example + * pose, fk_result = forwardKinematics({3.083,1.227,1.098,0.670,-1.870,-0.397}) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.forwardKinematics","params":[[3.083688522170976,1.2273215976885394,1.098072739631141,0.6705738810610149,-1.870715392248607,-0.39708546603119627]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[[0.7137448715395925,0.08416057568819092,0.6707994191515292,2.4599818776908724,0.4789772388601265,1.6189630435878408],0]} + * \endenglish + */ + ResultWithErrno forwardKinematics(const std::vector &q); + + /** + * \chinese + * 运动学正解 + * 输入关节角度,输出TCP位姿 + * @param q 关节角 + * @param tcp_offset tcp偏移 + * @return TCP位姿和正解结果是否有效 + * 返回值的第一个参数为正解结果,第二个为正解错误码,错误码返回值列表如下 + * 0 - 成功 + * -1 - 机械臂状态不对(未初始化完成,可尝试再次调用) + * -5 - 输入的关节角或tcp偏移无效(维度错误) + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * forwardKinematics(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float], + * arg1: List[float]) -> Tuple[List[float], int] + * + * @par Lua函数原型 + * forwardKinematics1(q: table, tcp_offset: table) -> table, number + * + * @par Lua示例 + * pose, fk_result = forwardKinematics1({3.083,1.227,1.098,0.670,-1.870,-0.397},{0.0,0.13201,0.03879,0,0,0}) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.forwardKinematics1","params":[[3.083688522170976,1.2273215976885394,1.098072739631141,0.6705738810610149,-1.870715392248607,-0.39708546603119627],[0.0, + * 0.13201,0.03879,0,0,0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[[0.7137636726659518,0.0837705432006433,0.6710022027216355,2.459981877690872,0.4789772388601267,1.6189630435878408],0]} + * + * @since 0.24.1 + * \endchinese + * \english + * Forward kinematics + * Input joint angles, output TCP pose + * + * @param q Joint angles + * @param tcp_offset TCP offset + * @return TCP pose and whether the result is valid + * The first parameter of the return value is the forward kinematics result, the second is the error code. Error codes are as follows: + * 0 - Success + * -1 - The status of the robot is incorrect (not initialized yet, you can try calling it again) + * -5 - The input joint angles or tcp offset is invalid (dimension error) + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * forwardKinematics(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float], + * arg1: List[float]) -> Tuple[List[float], int] + * + * @par Lua function prototype + * forwardKinematics1(q: table, tcp_offset: table) -> table, number + * + * @par Lua example + * pose, fk_result = forwardKinematics1({3.083,1.227,1.098,0.670,-1.870,-0.397},{0.0,0.13201,0.03879,0,0,0}) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.forwardKinematics1","params":[[3.083688522170976,1.2273215976885394,1.098072739631141,0.6705738810610149,-1.870715392248607,-0.39708546603119627],[0.0, + * 0.13201,0.03879,0,0,0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[[0.7137636726659518,0.0837705432006433,0.6710022027216355,2.459981877690872,0.4789772388601267,1.6189630435878408],0]} + * + * @since 0.24.1 + * \endenglish + */ + ResultWithErrno forwardKinematics1(const std::vector &q, + const std::vector &tcp_offset); + + /** + * \chinese + * 运动学正解(忽略 TCP 偏移值) + * + * @param q 关节角 + * @return 法兰盘中心位姿和正解结果是否有效 + * 返回值的第一个参数为正解结果,第二个为正解错误码,错误码返回值列表如下 + * 0 - 成功 + * -1 - 机械臂状态不对(未初始化完成,可尝试再次调用) + * -5 - 输入的关节角无效(维度错误) + * + * @throws arcs::common_interface::AuboException + * + * @par Lua函数原型 + * forwardToolKinematics(q: table) -> table, number + * + * @par Lua示例 + * pose, fk_result = forwardToolKinematics({3.083,1.227,1.098,0.670,-1.870,-0.397}) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.forwardToolKinematics","params":[[3.083688522170976,1.2273215976885394,1.098072739631141,0.6705738810610149,-1.870715392248607,-0.39708546603119627]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[[0.5881351149440136,0.05323734739426938,0.623922550656701,2.4599818776908724,0.4789772388601265,1.6189630435878408],0]} + * \endchinese + * \english + * Forward kinematics (ignoring TCP offset) + * + * @param q Joint angles + * @return Flange center pose and whether the result is valid + * The first parameter of the return value is the forward kinematics result, the second is the error code. Error codes are as follows: + * 0 - Success + * -1 - The status of the robot is incorrect (not initialized yet, you can try calling it again) + * -5 - The input joint angles is invalid (dimension error) + * + * @par Lua function prototype + * forwardToolKinematics(q: table) -> table, number + * + * @par Lua example + * pose, fk_result = forwardToolKinematics({3.083,1.227,1.098,0.670,-1.870,-0.397}) + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.forwardToolKinematics","params":[[3.083688522170976,1.2273215976885394,1.098072739631141,0.6705738810610149,-1.870715392248607,-0.39708546603119627]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[[0.5881351149440136,0.05323734739426938,0.623922550656701,2.4599818776908724,0.4789772388601265,1.6189630435878408],0]} + * \endenglish + */ + ResultWithErrno forwardToolKinematics(const std::vector &q); + + /** + * \chinese + * 运动学正解, 基于激活的TCP偏移(最近的通过 setTcpOffset 设置的参数) + * 输入关节角度,输出各连杆位姿 + * + * @param q 关节角 + * @return 各个连杆位姿和正解结果是否有效 + * 返回值的第一个参数为正解结果,第二个为正解错误码,错误码返回值列表如下 + * 0 - 成功 + * -1 - 机械臂状态不对(未初始化完成,可尝试再次调用) + * -5 - 输入的关节角无效(维度错误) + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * forwardKinematicsAll(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float]) -> + * Tuple[List[List[float]], int] + * + * @par Lua函数原型 + * forwardKinematicsAll(q: table) -> table, number + * + * @par Lua示例 + * poses, fk_result = forwardKinematicsAll({3.083,1.227,1.098,0.670,-1.870,-0.397}) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.forwardKinematicsAll","params":{"q":[-7.32945e-11,-0.261799,1.74533,0.436332,1.5708,-2.14136e-10]},"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[[[0.0010004,0.0,0.122,0.0,0.0,3.141592653589793], + * [0.0010003999910823934,-0.12166795404953117,0.12205392567412496,1.5690838552993878,-1.3089969602251492,0.0016541204887245322], + * [0.10659809449330016,-0.12166124765791932,0.5161518260534821,-1.5718540206872664,0.43633111081725523,-0.002370419930605744], + * [0.4482255342315581,-0.1226390142692,0.3568490758201224,-0.000788980482890453,1.5665204619271216,-1.5719618592940798], + * [0.5519603828181741,-0.12282266347465487,0.35639753697117343,1.5707938201843654,0.0042721909279596635,1.569044569428874], + * [0.5513243939877184,-0.12401224959696328,0.2615193425222568,-3.1349118101994096,0.004272190926529066,1.569044569643007], + * [0.7494883076798231,-0.025647479212994567,-0.04023458911333461,-3.1349118101994096,0.004272190926529066,1.569044569643007]],0]} + * \endchinese + * \english + * Forward kinematics, based on the activated TCP offset (the most recently set via setTcpOffset) + * Input joint angles, output links poses + * + * @param q Joint angles + * @return links poses and whether the result is valid + * The first parameter of the return value is the forward kinematics result, the second is the error code. Error codes are as follows: + * 0 - Success + * -1 - The status of the robot is incorrect (not initialized yet, you can try calling it again) + * -5 - The input joint angles is invalid (dimension error) + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * forwardKinematicsAll(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float]) -> + * Tuple[List[List[float]], int] + * + * @par Lua function prototype + * forwardKinematicsAll(q: table) -> table, number + * + * @par Lua example + * pose, fk_result = forwardKinematicsAll({3.083,1.227,1.098,0.670,-1.870,-0.397}) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.forwardKinematicsAll","params":{"q":[-7.32945e-11,-0.261799,1.74533,0.436332,1.5708,-2.14136e-10]},"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[[[0.0010004,0.0,0.122,0.0,0.0,3.141592653589793], + * [0.0010003999910823934,-0.12166795404953117,0.12205392567412496,1.5690838552993878,-1.3089969602251492,0.0016541204887245322], + * [0.10659809449330016,-0.12166124765791932,0.5161518260534821,-1.5718540206872664,0.43633111081725523,-0.002370419930605744], + * [0.4482255342315581,-0.1226390142692,0.3568490758201224,-0.000788980482890453,1.5665204619271216,-1.5719618592940798], + * [0.5519603828181741,-0.12282266347465487,0.35639753697117343,1.5707938201843654,0.0042721909279596635,1.569044569428874], + * [0.5513243939877184,-0.12401224959696328,0.2615193425222568,-3.1349118101994096,0.004272190926529066,1.569044569643007], + * [0.7494883076798231,-0.025647479212994567,-0.04023458911333461,-3.1349118101994096,0.004272190926529066,1.569044569643007]],0]} + * \endenglish + */ + ResultWithErrno1 forwardKinematicsAll(const std::vector &q); + + /** + * \chinese + * 运动学逆解 + * 输入TCP位姿和参考关节角度,输出关节角度 + * + * @param qnear 参考关节角 + * @param pose TCP位姿 + * @return 关节角和逆解结果是否有效 + * 返回值的第一个参数为逆解结果,第二个为逆解错误码,错误码返回列表如下 + * 0 - 成功 + * -1 - 机械臂状态不对(未初始化完成,可尝试再次调用) + * -5 - 输入的参考关节角或TCP位姿无效(维度错误) + * -23 - 逆解计算不收敛,计算出错 + * -24 - 逆解计算超出机器人最大限制 + * -25 - 逆解输入配置存在错误 + * -26 - 逆解雅可比矩阵计算失败 + * -27 - 目标点存在解析解,但均不满足选解条件 + * -28 - 逆解返回未知类型错误 + * 若错误码非0,则返回值的第一个参数为输入参考关节角qnear + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * inverseKinematics(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float], + * arg1: List[float]) -> Tuple[List[float], int] + * + * @par Lua函数原型 + * inverseKinematics(qnear: table, pose: table) -> table, int + * + * @par Lua示例 + * joint,ik_result = inverseKinematics({0,0,0,0,0,0},{0.81665,-0.20419,0.43873,-3.135,0.004,1.569}) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.inverseKinematics","params":[[0,0,0,0,0,0],[0.71374,0.08417,0.6708,2.46,0.479,1.619]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[[3.083688522170976,1.2273215976885394,1.098072739631141,0.6705738810610149,-1.870715392248607,-0.39708546603119627],0]} + * \endchinese + * \english + * Inverse kinematics + * Input TCP pose and reference joint angles, output joint angles + * + * @param qnear Reference joint angles + * @param pose TCP pose + * @return Joint angles and whether the inverse kinematics result is valid + * The first parameter of the return value is the inverse kinematics result, the second is the error code. Error codes are as follows: + * 0 - Success + * -1 - The status of the robot is incorrect (not initialized yet, you can try calling it again) + * -5 - The input reference joint angles or tcp pose is invalid (dimension error) + * -23 - Inverse kinematics calculation does not converge, calculation error + * -24 - Inverse kinematics calculation exceeds robot limits + * -25 - Inverse kinematics input configuration error + * -26 - Inverse kinematics Jacobian calculation failed + * -27 - Analytical solution exists but none satisfy the selection criteria + * -28 - Unknown error in inverse kinematics + * If the error code is not 0, the first parameter of the return value is the input reference joint angles qnear + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * inverseKinematics(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float], + * arg1: List[float]) -> Tuple[List[float], int] + * + * @par Lua function prototype + * inverseKinematics(qnear: table, pose: table) -> table, int + * + * @par Lua example + * joint,ik_result = inverseKinematics({0,0,0,0,0,0},{0.81665,-0.20419,0.43873,-3.135,0.004,1.569}) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.inverseKinematics","params":[[0,0,0,0,0,0],[0.71374,0.08417,0.6708,2.46,0.479,1.619]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[[3.083688522170976,1.2273215976885394,1.098072739631141,0.6705738810610149,-1.870715392248607,-0.39708546603119627],0]} + * \endenglish + */ + ResultWithErrno inverseKinematics(const std::vector &qnear, + const std::vector &pose); + + /** + * \chinese + * 运动学逆解 + * 输入TCP位姿和参考关节角度,输出关节角度 + * + * @param qnear 参考关节角 + * @param pose TCP位姿 + * @param tcp_offset TCP偏移 + * @return 关节角和逆解结果是否有效,同 inverseKinematics + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * inverseKinematics1(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float], + * arg1: List[float], arg2: List[float]) -> Tuple[List[float], int] + * + * @par Lua函数原型 + * inverseKinematics1(qnear: table, pose: table, tcp_offset: table) -> table, int + * + * @par Lua示例 + * joint,ik_result = inverseKinematics1({0,0,0,0,0,0},{0.81665,-0.20419,0.43873,-3.135,0.004,1.569},{0.04,-0.035,0.1,0,0,0}) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.inverseKinematics1","params":[[0,0,0,0,0,0],[0.71374,0.08417,0.6708,2.46,0.479,1.619],[0.0, + * 0.13201,0.03879,0,0,0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[[3.084454549595208,1.2278265883747776,1.0986586440159576,0.6708221281915528,-1.8712459848518375,-0.3965111476861782],0]} + * \endchinese + * \english + * Inverse kinematics + * Input TCP pose and reference joint angles, output joint angles + * + * @param qnear Reference joint angles + * @param pose TCP pose + * @param tcp_offset TCP offset + * @return Joint angles and whether the result is valid, same as inverseKinematics + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * inverseKinematics1(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float], + * arg1: List[float], arg2: List[float]) -> Tuple[List[float], int] + * + * @par Lua function prototype + * inverseKinematics1(qnear: table, pose: table, tcp_offset: table) -> table, int + * + * @par Lua example + * joint,ik_result = inverseKinematics1({0,0,0,0,0,0},{0.81665,-0.20419,0.43873,-3.135,0.004,1.569},{0.04,-0.035,0.1,0,0,0}) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.inverseKinematics1","params":[[0,0,0,0,0,0],[0.71374,0.08417,0.6708,2.46,0.479,1.619],[0.0, + * 0.13201,0.03879,0,0,0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[[3.084454549595208,1.2278265883747776,1.0986586440159576,0.6708221281915528,-1.8712459848518375,-0.3965111476861782],0]} + * \endenglish + */ + ResultWithErrno inverseKinematics1(const std::vector &qnear, + const std::vector &pose, + const std::vector &tcp_offset); + + /** + * \chinese + * 求出所有的逆解, 基于激活的 TCP 偏移 + * + * @param pose TCP位姿 + * @return 关节角和逆解结果是否有效 + * 返回的错误码同inverseKinematics + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.inverseKinematicsAll","params":[[0.71374,0.08417,0.6708,2.46,0.479,1.619]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[[[3.083688522170976,1.2273215976885394,1.098072739631141,0.6705738810610149,-1.870715392248607,-0.39708546603119627], + * [3.081056801097411,0.17985038037652645,-1.0991717292664145,-0.4806460200109001,-1.869182975312333,-0.402066016835411], + * [0.4090095277807992,-0.1623365054641728,1.081775890307679,0.26993250263224805,0.9738255833642309,0.000572556627720845], + * [0.4116449425067969,-1.1931664523907126,-1.0822709833775688,-0.8665964106161371,0.9732141569888207,0.006484919654891586]],0]} + * \endchinese + * \english + * Solve all inverse kinematics solutions based on the activated TCP offset + * + * @param pose TCP pose + * @return Joint angles and whether the result is valid + * The returned error code is the same as inverseKinematics + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.inverseKinematicsAll","params":[[0.71374,0.08417,0.6708,2.46,0.479,1.619]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[[[3.083688522170976,1.2273215976885394,1.098072739631141,0.6705738810610149,-1.870715392248607,-0.39708546603119627], + * [3.081056801097411,0.17985038037652645,-1.0991717292664145,-0.4806460200109001,-1.869182975312333,-0.402066016835411], + * [0.4090095277807992,-0.1623365054641728,1.081775890307679,0.26993250263224805,0.9738255833642309,0.000572556627720845], + * [0.4116449425067969,-1.1931664523907126,-1.0822709833775688,-0.8665964106161371,0.9732141569888207,0.006484919654891586]],0]} + * \endenglish + */ + ResultWithErrno1 inverseKinematicsAll(const std::vector &pose); + + /** + * \chinese + * 求出所有的逆解, 基于提供的 TCP 偏移 + * + * @param pose TCP位姿 + * @param tcp_offset TCP偏移 + * @return 关节角和逆解结果是否有效,同 inverseKinematicsAll + * 返回的错误码同inverseKinematics + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.inverseKinematicsAll1","params":[[0.71374,0.08417,0.6708,2.46,0.479,1.619],[0.0, + * 0.13201,0.03879,0,0,0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[[[3.084454549595208,1.2278265883747776,1.0986586440159576,0.6708221281915528,-1.8712459848518375,-0.3965111476861782], + * [3.0818224058231602,0.17980369843203092,-1.0997576631122077,-0.48102131527371267,-1.8697135490338517,-0.40149459722060593], + * [0.40972960018231047,-0.16226026285489026,1.0823403816496,0.2700204411869427,0.9734251963887868,0.0012903686498106507], + * [0.41236549588802296,-1.193621392918341,-1.0828346680836718,-0.8671097369314354,0.972815367289568,0.007206851371073478]],0]} + * \endchinese + * \english + * Solve all inverse kinematics solutions based on the provided TCP offset + * + * @param pose TCP pose + * @param tcp_offset TCP offset + * @return Joint angles and whether the result is valid, same as inverseKinematicsAll + * The returned error code is the same as inverseKinematics + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.inverseKinematicsAll1","params":[[0.71374,0.08417,0.6708,2.46,0.479,1.619],[0.0, + * 0.13201,0.03879,0,0,0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[[[3.084454549595208,1.2278265883747776,1.0986586440159576,0.6708221281915528,-1.8712459848518375,-0.3965111476861782], + * [3.0818224058231602,0.17980369843203092,-1.0997576631122077,-0.48102131527371267,-1.8697135490338517,-0.40149459722060593], + * [0.40972960018231047,-0.16226026285489026,1.0823403816496,0.2700204411869427,0.9734251963887868,0.0012903686498106507], + * [0.41236549588802296,-1.193621392918341,-1.0828346680836718,-0.8671097369314354,0.972815367289568,0.007206851371073478]],0]} + * \endenglish + */ + ResultWithErrno1 inverseKinematicsAll1( + const std::vector &pose, const std::vector &tcp_offset); + + /** + * \chinese + * 运动学逆解(忽略 TCP 偏移值) + * + * @param qnear 参考关节角 + * @param pose 法兰盘中心的位姿 + * @return 关节角和逆解结果是否有效 + * 返回值的第一个参数为逆解结果,第二个为逆解错误码,错误码返回列表如下 + * 0 - 成功 + * -1 - 机械臂状态不对(未初始化完成,可尝试再次调用) + * -5 - 输入的参考关节角或位姿无效(维度错误) + * + * @throws arcs::common_interface::AuboException + * + * @par Lua函数原型 + * inverseToolKinematics(qnear: table, pose: table) -> table, int + * + * @par Lua示例 + * joint, ik_result = inverseToolKinematics({0,0,0,0,0,0},{0.58815,0.0532,0.62391,2.46,0.479,1.619}) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.inverseToolKinematics","params":[[0,0,0,0,0,0],[0.58815,0.0532,0.62391,2.46,0.479,1.619]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[[3.083609363838651,1.22736129158332,1.098095443698268,0.6705395395487186,-1.8706605026855632,-0.39714507002376465],0]} + * \endchinese + * \english + * Inverse kinematics (ignoring TCP offset) + * + * @param qnear Reference joint angles + * @param pose Flange center pose + * @return Joint angles and whether the result is valid + * The first parameter of the return value is the inverse kinematics result, the second is the error code. Error codes are as follows: + * 0 - Success + * -1 - The status of the robot is incorrect (not initialized yet, you can try calling it again) + * -5 - The input reference joint angles or pose is invalid (dimension error) + * @throws arcs::common_interface::AuboException + * + * @par Lua function prototype + * inverseToolKinematics(qnear: table, pose: table) -> table, int + * + * @par Lua example + * joint, ik_result = inverseToolKinematics({0,0,0,0,0,0},{0.58815,0.0532,0.62391,2.46,0.479,1.619}) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.inverseToolKinematics","params":[[0,0,0,0,0,0],[0.58815,0.0532,0.62391,2.46,0.479,1.619]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[[3.083609363838651,1.22736129158332,1.098095443698268,0.6705395395487186,-1.8706605026855632,-0.39714507002376465],0]} + * \endenglish + */ + ResultWithErrno inverseToolKinematics(const std::vector &qnear, + const std::vector &pose); + + /** + * \chinese + * 运动学逆解(忽略 TCP 偏移值) + * + * @param qnear 参考关节角 + * @param pose 法兰盘中心的位姿 + * @return 关节角和逆解结果是否有效 + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.inverseToolKinematicsAll","params":[[0.58815,0.0532,0.62391,2.46,0.479,1.619]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[[[3.083609363838651,1.22736129158332,1.098095443698268,0.6705395395487186,-1.8706605026855632,-0.39714507002376465], + * [3.0809781797426523,0.17987122696706134,-1.0991932793263717,-0.4807053707530958,-1.8691282890274434,-0.40212516672751814], + * [0.40892195618737215,-0.16235398607358653,1.081812753177426,0.27003586475871766,0.9738744130114284,0.00048462518316674287], + * [0.41155633414333076,-1.1932173012004512,-1.082306542045813,-0.8665312056504818,0.9732632365861417,0.0063958311601771175]],0]} + * \endchinese + * \english + * Inverse kinematics (ignoring TCP offset) + * + * @param qnear Reference joint angles + * @param pose Flange center pose + * @return Joint angles and whether the result is valid + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.inverseToolKinematicsAll","params":[[0.58815,0.0532,0.62391,2.46,0.479,1.619]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[[[3.083609363838651,1.22736129158332,1.098095443698268,0.6705395395487186,-1.8706605026855632,-0.39714507002376465], + * [3.0809781797426523,0.17987122696706134,-1.0991932793263717,-0.4807053707530958,-1.8691282890274434,-0.40212516672751814], + * [0.40892195618737215,-0.16235398607358653,1.081812753177426,0.27003586475871766,0.9738744130114284,0.00048462518316674287], + * [0.41155633414333076,-1.1932173012004512,-1.082306542045813,-0.8665312056504818,0.9732632365861417,0.0063958311601771175]],0]} + * \endenglish + */ + ResultWithErrno1 inverseToolKinematicsAll(const std::vector &pose); + + /** + * \chinese + * 求解movej之间的轨迹点 + * + * @param q1 movej的起点 + * @param r1 在q1处的交融半径 + * @param q2 movej的终点 + * @param r2 在q2处的交融半径 + * @param d 采样距离 + * @return q1~q2 之间笛卡尔空间离散轨迹点(x,y,z,rx,ry,rz)集合 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathMovej(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float], arg1: + * float, arg2: List[float], arg3: float, arg4: float) -> List[List[float]] + * + * @par Lua函数原型 + * pathMovej(q1: table, r1: number, q2: table, r2: number, d: number) -> + * table, number + * + * @par Lua示例 + * path , num = pathMovej({0.0,-0.2618,1.7453,0.4364,1.5711,0.0},0.25,{0.3234,-0.5405,1.5403,0.5881,1.2962,0.7435},0.03,0.2) + * + * \endchinese + * \english + * Solve the trajectory points between movej + * + * @param q1 Start point of movej + * @param r1 Blend radius at q1 + * @param q2 End point of movej + * @param r2 Blend radius at q2 + * @param d Sampling distance + * @return Discrete trajectory points (x, y, z, rx, ry, rz) between q1 and q2 in Cartesian space + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathMovej(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float], arg1: + * float, arg2: List[float], arg3: float, arg4: float) -> List[List[float]] + * + * @par Lua function prototype + * pathMovej(q1: table, r1: number, q2: table, r2: number, d: number) -> + * table, number + * + * @par Lua example + * path , num = pathMovej({0.0,-0.2618,1.7453,0.4364,1.5711,0.0},0.25,{0.3234,-0.5405,1.5403,0.5881,1.2962,0.7435},0.03,0.2) + * + * \endenglish + */ + std::vector> pathMovej(const std::vector &q1, + double r1, + const std::vector &q2, + double r2, double d); + /** + * \chinese + * 计算机械臂末端的雅克比矩阵 + * + * @param q 关节角 + * @param base_or_end 参考坐标系为基坐标系(或者末端坐标系) + * true: 在 base 下描述 + * false: 在 末端坐标系 下描述 + * @return 雅克比矩阵是否有效 + * 返回值的第一个参数为该构型下对应的雅克比矩阵,第二个为逆解错误码 + * 此接口的错误码返回值在0.28.1-rc.21 0.29.0-alpha.25版本之后做了修改。 + * 此前逆解错误时返回 30082 ,修改后错误码返回列表如下 + * 0 - 成功 + * -23 - 逆解计算不收敛,计算出错 + * -24 - 逆解计算超出机器人最大限制 + * -25 - 逆解输入配置存在错误 + * -26 - 逆解雅可比矩阵计算失败 + * -27 - 目标点存在解析解,但均不满足选解条件 + * -28 - 逆解返回未知类型错误 + * 若错误码非0,则返回值的第一个参数为输入参考关节角qnear + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * calJacobian(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float], + * arg1: bool) -> Tuple[List[float], int] + * + * @par Lua函数原型 + * calJacobian(q: table, base_or_end: boolean) -> table + * + * @par Lua示例 + * calJ_result = calJacobian({0.58815,0.0532,0.62391,2.46,0.479,1.619},true) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.calcJacobian","params":[[0.58815,0.0532,0.62391,2.46,0.479,1.619],true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[[0.20822779551242535,-0.5409416184208162,0.2019786999613013,0.061264982268770196,-0.026269884327316487, + * 0.10131708699859962,0.26388933410019777,-0.36074292664199115,0.1346954733416397,0.04085636647597124,-0.07244204452918337,0.0708466286633346, + * 0.0,0.10401808481666497,-0.12571344758923886,-0.07741290545882097,0.18818543519232858,0.04628646442706299,0.0,0.5548228314607867, + * -0.5548228314607868,0.5548228314607868,-0.7901273140338193,0.37230961532208007,0.0,-0.8319685244586092,0.8319685244586091,-0.8319685244586091, + * -0.5269197820578843,-0.8184088260676008,1.0,3.749399456654644e-33,-6.512048180336603e-18,1.0956823467534067e-16,-0.31313634553301894, + * 0.43771285536682175],0]} + * \endchinese + * \english + * Calculate the Jacobian matrix at the robot end-effector + * + * @param q Joint angles + * @param base_or_end Reference frame: base (or end-effector) + * true: described in base frame + * false: described in end-effector frame + * @return Whether the Jacobian matrix is valid + * The first parameter of the return value is the Jacobian matrix for this configuration, the second is the error code. + * The error code list was updated after versions 0.28.1-rc.21 and 0.29.0-alpha.25. + * Previously, inverse kinematics errors returned 30082. The updated error codes are: + * 0 - Success + * -23 - Inverse kinematics calculation does not converge, calculation error + * -24 - Inverse kinematics calculation exceeds robot limits + * -25 - Inverse kinematics input configuration error + * -26 - Inverse kinematics Jacobian calculation failed + * -27 - Analytical solution exists but none satisfy the selection criteria + * -28 - Unknown error in inverse kinematics + * If the error code is not 0, the first parameter of the return value is the input reference joint angles qnear + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * calJacobian(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float], + * arg1: bool) -> Tuple[List[float], int] + * + * @par Lua function prototype + * calJacobian(q: table, base_or_end: boolean) -> table + * + * @par Lua example + * calJ_result = calJacobian({0.58815,0.0532,0.62391,2.46,0.479,1.619},true) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.calcJacobian","params":[[0.58815,0.0532,0.62391,2.46,0.479,1.619],true],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[[0.20822779551242535,-0.5409416184208162,0.2019786999613013,0.061264982268770196,-0.026269884327316487, + * 0.10131708699859962,0.26388933410019777,-0.36074292664199115,0.1346954733416397,0.04085636647597124,-0.07244204452918337,0.0708466286633346, + * 0.0,0.10401808481666497,-0.12571344758923886,-0.07741290545882097,0.18818543519232858,0.04628646442706299,0.0,0.5548228314607867, + * -0.5548228314607868,0.5548228314607868,-0.7901273140338193,0.37230961532208007,0.0,-0.8319685244586092,0.8319685244586091,-0.8319685244586091, + * -0.5269197820578843,-0.8184088260676008,1.0,3.749399456654644e-33,-6.512048180336603e-18,1.0956823467534067e-16,-0.31313634553301894, + * 0.43771285536682175],0]} + * \endenglish + */ + ResultWithErrno calcJacobian(const std::vector &q, + bool base_or_end); + + /** + * \chinese + * 求解交融的轨迹点 + * + * @param type + * 0-movej 和 movej + * 1-movej 和 movel + * 2-movel 和 movej + * 3-movel 和 movel + * @param q_start 交融前路径的起点 + * @param q_via 交融点 + * @param q_to 交融后路径的终点 + * @param r 在q_via处的交融半径 + * @param d 采样距离 + * @return q_via处的交融段笛卡尔空间离散轨迹点(x,y,z)集合 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathBlend3Points(self: pyaubo_sdk.RobotAlgorithm, arg0: int, arg1: + * List[float], arg2: List[float], arg3: List[float], arg4: float, arg5: + * float) -> List[List[float]] + * + * @par Lua函数原型 + * pathBlend3Points(type: number, q_start: table, q_via: table, q_to: table, + * r: number, d: number) -> table, number + * + * @par Lua示例 + * q_via , num = pathBlend3Points(1,{0.58815,0.0532,0.62391,2.46,0.479,1.619},{0.0,-0.2618,1.7453,0.4364,1.5711,0.0}, + * {0.3234,-0.5405,1.5403,0.5881,1.2962,0.7435},0.25,0.02) + * + * \endchinese + * \english + * Solve the blended trajectory points + * + * @param type + * 0-movej and movej + * 1-movej and movel + * 2-movel and movej + * 3-movel and movel + * @param q_start Start point before blending + * @param q_via Blending point + * @param q_to End point after blending + * @param r Blend radius at q_via + * @param d Sampling distance + * @return Discrete trajectory points (x, y, z) of the blend segment at q_via in Cartesian space + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathBlend3Points(self: pyaubo_sdk.RobotAlgorithm, arg0: int, arg1: + * List[float], arg2: List[float], arg3: List[float], arg4: float, arg5: + * float) -> List[List[float]] + * + * @par Lua function prototype + * pathBlend3Points(type: number, q_start: table, q_via: table, q_to: table, + * r: number, d: number) -> table, number + * + * @par Lua example + * q_via , num = pathBlend3Points(1,{0.58815,0.0532,0.62391,2.46,0.479,1.619},{0.0,-0.2618,1.7453,0.4364,1.5711,0.0}, + * {0.3234,-0.5405,1.5403,0.5881,1.2962,0.7435},0.25,0.02) + * + * \endenglish + */ + std::vector> pathBlend3Points( + int type, const std::vector &q_start, + const std::vector &q_via, const std::vector &q_to, + double r, double d); + + /** + * \chinese + * 生成用于负载辨识的激励轨迹 + * 此接口内部调用pathBufferAppend + * 将离线轨迹存入buffer中,后续可通过movePathBuffer运行离线轨迹 + * @param name 轨迹名字 + * @param traj_conf 各关节轨迹的限制条件 + * traj_conf.move_axis: 运动的轴 + * 由于实际用户现场可能不希望在负载辨识时控制机械臂多关节大幅度运动,故最好选用traj_conf.move_axis=LoadIdentifyMoveAxis::Joint_4_6; + * traj_conf.init_joint: + * 运动初始关节角,为了避免关节5接近零位时的奇异问题,应设置traj_conf.init_joint[4]的绝对值不小于0.3(rad),接近1.57(rad)为宜。其余关节的关节角可任意设置 + * traj_conf.lower_joint_bound, traj_conf.upper_joint_bound: + * 关节角上下限,维度应与config.move_axis维度保持一致,推荐设置upper_joint_bound为2,lower_joint_bound为-2 + * config.max_velocity, config.max_acceleration: + * 关节角速度角加速度限制,维度应与config.move_axis维度保持一致,出于安全和驱动器跟随性能的考虑,推荐设置max_velocity=3,max_acceleration=5 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Generate excitation trajectory for payload identification + * This interface internally calls pathBufferAppend + * The offline trajectory is stored in the buffer, and can be executed later via movePathBuffer + * @param name Trajectory name + * @param traj_conf Joint trajectory constraints + * traj_conf.move_axis: Moving axes + * Since users may not want large multi-joint movements during payload identification, it is recommended to use traj_conf.move_axis=LoadIdentifyMoveAxis::Joint_4_6; + * traj_conf.init_joint: + * Initial joint angles. To avoid singularity issues near joint 5 zero position, set abs(traj_conf.init_joint[4]) >= 0.3(rad), preferably close to 1.57(rad). Other joints can be set arbitrarily. + * traj_conf.lower_joint_bound, traj_conf.upper_joint_bound: + * Joint angle limits, dimensions should match config.move_axis. Recommended: upper_joint_bound=2, lower_joint_bound=-2 + * config.max_velocity, config.max_acceleration: + * Joint velocity and acceleration limits, dimensions should match config.move_axis. For safety and driver performance, recommended: max_velocity=3, max_acceleration=5 + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int generatePayloadIdentifyTraj(const std::string &name, + const TrajConfig &traj_conf); + /** + * \chinese + * 负载辨识轨迹是否生成完成 + * + * @return 完成返回0; 正在进行中返回1; 计算失败返回<0; + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.payloadIdentifyTrajGenFinished","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Whether payload identification trajectory generation is finished + * + * @return 0 if finished; 1 if in progress; <0 if failed; + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.payloadIdentifyTrajGenFinished","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int payloadIdentifyTrajGenFinished(); + + /** + * \chinese + * 求解 moveS 的轨迹点 + * + * @brief pathMoveS + * @param qs 样条轨迹生成点集合 + * @param d 采样距离 + * @return + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Solve the trajectory points for moveS + * + * @brief pathMoveS + * @param qs Spline trajectory generation point set + * @param d Sampling distance + * @return + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + std::vector> pathMoveS( + const std::vector> &qs, double d); + + /** + * \chinese + * 振动抑制参数辨识算法接口 + * + * @param q 当前关节角度 + * @param qd 当前关节速度 + * @param target_q 目标关节角度 + * @param target_qd 关节速度 + * @param target_qdd 关节加速度 + * @param tool_offset 工具TCP信息 + * @param omega 振动频率 + * @param zeta 振动阻尼比 + * @return 振动抑制参数和是否辨识成功 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * calibVibrationParams(self: pyaubo_sdk.RobotAlgorithm, arg0: + * List[List[float]], arg1: List[List[float]], arg2: List[List[float]], arg3: List[List[float]], + * arg4: List[List[float]], arg5: List[float]) -> list[list[float]],int + * + * @par Lua函数原型 + * calibVibrationParams(q: table,qd: table, target_q: table, target_qd: table, + * target_qdd: table, tool_offset: table, omega: table, zeta: table) -> table,number + * \endchinese + */ + ResultWithErrno1 calibVibrationParams(const std::vector> &q, + const std::vector> &qd, + const std::vector> &target_q, + const std::vector> &target_qd, + const std::vector> &target_qdd, + const std::vector &tool_offset); + +protected: + void *d_; +}; +using RobotAlgorithmPtr = std::shared_ptr; + +} // namespace common_interface +} // namespace arcs + +#endif // AUBO_SDK_ROBOT_ALGORITHM_INTERFACE_H diff --git a/third_party/AuboSdk/linux/include/aubo/robot/robot_config.h b/third_party/AuboSdk/linux/include/aubo/robot/robot_config.h new file mode 100644 index 00000000..62f223ac --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo/robot/robot_config.h @@ -0,0 +1,3306 @@ +/** @file robot_config.h + * @brief 获取机器人配置接口,如获取DH参数、碰撞等级、安装位姿等等 + */ +#ifndef AUBO_SDK_ROBOT_CONFIG_H +#define AUBO_SDK_ROBOT_CONFIG_H + +#include +#include + +#include +#include + +namespace arcs { +namespace common_interface { + +class ARCS_ABI_EXPORT RobotConfig +{ +public: + RobotConfig(); + virtual ~RobotConfig(); + + /** + * \chinese + * 获取机器人的名字 + * + * @return 返回机器人的名字 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getName(self: pyaubo_sdk.RobotConfig) -> str + * + * @par Lua函数原型 + * getName() -> string + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getName","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"rob1"} + * \endchinese + * \english + * Get the robot's name. + * + * @return The robot's name. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getName(self: pyaubo_sdk.RobotConfig) -> str + * + * @par Lua function prototype + * getName() -> string + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getName","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"rob1"} + * \endenglish + */ + std::string getName(); + + /** + * \chinese + * 获取机器人的自由度(从硬件抽象层读取) + * + * @return 返回机器人的自由度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getDof(self: pyaubo_sdk.RobotConfig) -> int + * + * @par Lua函数原型 + * getDof() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getDof","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":6} + * \endchinese + * \english + * Get the robot's degrees of freedom (from the hardware abstraction layer). + * + * @return The robot's degrees of freedom. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getDof(self: pyaubo_sdk.RobotConfig) -> int + * + * @par Lua function prototype + * getDof() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getDof","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":6} + * \endenglish + */ + int getDof(); + + /** + * \chinese + * 获取机器人的伺服控制周期(从硬件抽象层读取) + * + * @return 机器人的伺服控制周期 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getCycletime(self: pyaubo_sdk.RobotConfig) -> float + * + * @par Lua函数原型 + * getCycletime() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getCycletime","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.005} + * \endchinese + * \english + * Get the robot's servo control cycle time (from the hardware abstraction + * layer). + * + * @return The robot's servo control cycle time. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getCycletime(self: pyaubo_sdk.RobotConfig) -> float + * + * @par Lua function prototype + * getCycletime() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getCycletime","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.005} + * \endenglish + */ + double getCycletime(); + + /** + * \chinese + * 预设缓速模式下的速度缩减比例 + * + * @param level 缓速等级 1, 2 + * @param fraction + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setSlowDownFraction","params":[1,0.8],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set the speed reduction ratio for the preset slow-down mode. + * + * @param level Slow-down level 1, 2 + * @param fraction + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setSlowDownFraction","params":[1,0.8],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setSlowDownFraction(int level, double fraction); + + /** + * \chinese + * 获取预设的缓速模式下的速度缩减比例 + * + * @param level 缓速等级 1, 2 + * @return 返回预设的缓速模式下的速度缩减比例 + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getSlowDownFraction","params":[1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.5} + * \endchinese + * \english + * Get the speed reduction ratio for the preset slow-down mode. + * + * @param level Slow-down level 1, 2 + * @return The speed reduction ratio for the preset slow-down mode. + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getSlowDownFraction","params":[1],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.5} + * \endenglish + */ + double getSlowDownFraction(int level); + + /** + * \chinese + * 获取默认的工具端加速度,单位m/s^2 + * + * @return 默认的工具端加速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getDefaultToolAcc(self: pyaubo_sdk.RobotConfig) -> float + * + * @par Lua函数原型 + * getDefaultToolAcc() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getDefaultToolAcc","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * \endchinese + * \english + * Get the default tool acceleration, in m/s^2. + * + * @return The default tool acceleration. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getDefaultToolAcc(self: pyaubo_sdk.RobotConfig) -> float + * + * @par Lua function prototype + * getDefaultToolAcc() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getDefaultToolAcc","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * \endenglish + */ + double getDefaultToolAcc(); + + /** + * \chinese + * 获取默认的工具端速度,单位m/s + * + * @return 默认的工具端速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getDefaultToolSpeed(self: pyaubo_sdk.RobotConfig) -> float + * + * @par Lua函数原型 + * getDefaultToolSpeed() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getDefaultToolSpeed","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * \endchinese + * \english + * Get the default tool speed, in m/s. + * + * @return The default tool speed. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getDefaultToolSpeed(self: pyaubo_sdk.RobotConfig) -> float + * + * @par Lua function prototype + * getDefaultToolSpeed() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getDefaultToolSpeed","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * \endenglish + */ + double getDefaultToolSpeed(); + + /** + * \chinese + * 获取默认的关节加速度,单位rad/s^2 + * + * @return 默认的关节加速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getDefaultJointAcc(self: pyaubo_sdk.RobotConfig) -> float + * + * @par Lua函数原型 + * getDefaultJointAcc() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getDefaultJointAcc","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * \endchinese + * \english + * Get the default joint acceleration, in rad/s^2. + * + * @return The default joint acceleration. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getDefaultJointAcc(self: pyaubo_sdk.RobotConfig) -> float + * + * @par Lua function prototype + * getDefaultJointAcc() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getDefaultJointAcc","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * \endenglish + */ + double getDefaultJointAcc(); + + /** + * \chinese + * 获取默认的关节速度,单位rad/s + * + * @return 默认的关节速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getDefaultJointSpeed(self: pyaubo_sdk.RobotConfig) -> float + * + * @par Lua函数原型 + * getDefaultJointSpeed() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getDefaultJointSpeed","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * \endchinese + * \english + * Get the default joint speed, in rad/s. + * + * @return The default joint speed. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getDefaultJointSpeed(self: pyaubo_sdk.RobotConfig) -> float + * + * @par Lua function prototype + * getDefaultJointSpeed() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getDefaultJointSpeed","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * \endenglish + */ + double getDefaultJointSpeed(); + + /** + * \chinese + * 获取机器人类型代码 + * + * @return 机器人类型代码 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getRobotType(self: pyaubo_sdk.RobotConfig) -> str + * + * @par Lua函数原型 + * getRobotType() -> string + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getRobotType","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"aubo_i5H"} + * \endchinese + * \english + * Get the robot type code. + * + * @return The robot type code. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getRobotType(self: pyaubo_sdk.RobotConfig) -> str + * + * @par Lua function prototype + * getRobotType() -> string + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getRobotType","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"aubo_i5H"} + * \endenglish + */ + std::string getRobotType(); + + /** + * \chinese + * 获取机器人子类型代码 + * + * @return 机器人子类型代码 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getRobotSubType(self: pyaubo_sdk.RobotConfig) -> str + * + * @par Lua函数原型 + * getRobotSubType() -> string + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getRobotSubType","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"B0"} + * \endchinese + * \english + * Get the robot sub-type code. + * + * @return The robot sub-type code. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getRobotSubType(self: pyaubo_sdk.RobotConfig) -> str + * + * @par Lua function prototype + * getRobotSubType() -> string + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getRobotSubType","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"B0"} + * \endenglish + */ + std::string getRobotSubType(); + + /** + * \chinese + * 获取控制柜类型代码 + * + * @return 控制柜类型代码 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getControlBoxType(self: pyaubo_sdk.RobotConfig) -> str + * + * @par Lua函数原型 + * getControlBoxType() -> string + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getControlBoxType","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"cb_ISStation"} + * \endchinese + * \english + * Get the control box type code. + * + * @return The control box type code. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getControlBoxType(self: pyaubo_sdk.RobotConfig) -> str + * + * @par Lua function prototype + * getControlBoxType() -> string + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getControlBoxType","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"cb_ISStation"} + * \endenglish + */ + std::string getControlBoxType(); + + /** + * \chinese + * 设置安装位姿(机器人的基坐标系相对于世界坐标系) world->base + * + * 一般在多机器人系统中使用,默认为 [0,0,0,0,0,0] + * + * @param pose 安装位姿 + * @return 成功返回0; 失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setMountingPose(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int + * + * @par Lua函数原型 + * setMountingPose(pose: table) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setMountingPose","params":[[0.0,0.0,0.0,0.0,0.0,0.0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set the mounting pose (robot base coordinate system relative to world + * coordinate system) world->base + * + * Typically used in multi-robot systems, default is [0,0,0,0,0,0] + * + * @param pose Mounting pose + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setMountingPose(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int + * + * @par Lua function prototype + * setMountingPose(pose: table) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setMountingPose","params":[[0.0,0.0,0.0,0.0,0.0,0.0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setMountingPose(const std::vector &pose); + + /** + * \chinese + * 获取安装位姿(机器人的基坐标系相对于世界坐标系) + * + * @return 安装位姿 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getMountingPose(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getMountingPose() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getMountingPose","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the mounting pose (robot base coordinate system relative to world + * coordinate system) + * + * @return Mounting pose + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getMountingPose(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getMountingPose() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getMountingPose","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getMountingPose(); + + /** + * \chinese + * 将机器人绑定到一个坐标系,如果这个坐标系是运动的,那机器人也会跟着运动 + * 应用于地轨或者龙门 + * 这个函数调用的时候 frame 和 ROBOTBASE 的相对关系就固定了 + * \endchinese + * \english + * Attach the robot base to a coordinate frame. If this frame moves, the + * robot will move accordingly. Used for applications like ground rails or + * gantries. When this function is called, the relationship between the + * frame and ROBOTBASE is fixed. \endenglish + */ + int attachRobotBaseTo(const std::string &frame); + std::string getRobotBaseParent(); + + /** + * \chinese + * 设置工件数据,编程点位都是基于工件坐标系 + * \endchinese + * \english + * Set work object data. All programmed points are based on the work object + * coordinate system. \endenglish + */ + + int setWorkObjectData(const WObjectData &wobj); + + /** + * \chinese + * 设置碰撞灵敏度等级 + * 数值越大越灵敏 + * + * @param level 碰撞灵敏度等级 + * 0: 关闭碰撞检测功能 + * 1~9: 碰撞灵敏等级 + * @return 成功返回0; 失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setCollisionLevel(self: pyaubo_sdk.RobotConfig, arg0: int) -> int + * + * @par Lua函数原型 + * setCollisionLevel(level: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setCollisionLevel","params":[6],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set the collision sensitivity level. + * The higher the value, the more sensitive. + * + * @param level Collision sensitivity level + * 0: Disable collision detection + * 1~9: Collision sensitivity levels + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setCollisionLevel(self: pyaubo_sdk.RobotConfig, arg0: int) -> int + * + * @par Lua function prototype + * setCollisionLevel(level: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setCollisionLevel","params":[6],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setCollisionLevel(int level); + + /** + * \chinese + * 获取碰撞灵敏度等级 + * + * @return 碰撞灵敏度等级 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getCollisionLevel(self: pyaubo_sdk.RobotConfig) -> int + * + * @par Lua函数原型 + * getCollisionLevel() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getCollisionLevel","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":6} + * \endchinese + * \english + * Get the collision sensitivity level. + * + * @return Collision sensitivity level. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getCollisionLevel(self: pyaubo_sdk.RobotConfig) -> int + * + * @par Lua function prototype + * getCollisionLevel() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getCollisionLevel","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":6} + * \endenglish + */ + int getCollisionLevel(); + + /** + * \chinese + * 设置碰撞停止类型 + * + * @param type 类型 \n + * 0: 碰撞后浮动,即碰撞之后进入拖动示教模式 \n + * 1: 碰撞后静止 \n + * 2: 碰撞后抱闸 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setCollisionStopType(self: pyaubo_sdk.RobotConfig, arg0: int) -> int + * + * @par Lua函数原型 + * setCollisionStopType(type: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setCollisionStopType","params":[1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set the collision stop type. + * + * @param type Type \n + * 0: Floating after collision, i.e., enters freedrive mode after collision + * \n 1: Stop after collision \n 2: Brake after collision + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setCollisionStopType(self: pyaubo_sdk.RobotConfig, arg0: int) -> int + * + * @par Lua function prototype + * setCollisionStopType(type: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setCollisionStopType","params":[1],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setCollisionStopType(int type); + + /** + * \chinese + * 获取碰撞停止类型 + * + * @return 返回碰撞停止类型 \n + * 0: 碰撞后浮动,即碰撞之后进入拖动示教模式 \n + * 1: 碰撞后静止 \n + * 2: 碰撞后抱闸 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getCollisionStopType(self: pyaubo_sdk.RobotConfig) -> int + * + * @par Lua函数原型 + * getCollisionStopType() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getCollisionStopType","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1} + * + * \endchinese + * \english + * Get the collision stop type. + * + * @return The collision stop type. \n + * 0: Floating after collision, i.e., enters freedrive mode after collision + * \n 1: Stop after collision \n 2: Brake after collision + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getCollisionStopType(self: pyaubo_sdk.RobotConfig) -> int + * + * @par Lua function prototype + * getCollisionStopType() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getCollisionStopType","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1} + * + * \endenglish + */ + int getCollisionStopType(); + + /** + * \chinese + * 设置机器人的原点位置 + * + * @param positions 关节角度 + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setHomePosition","params":[[0.0,-0.2617993877991494,1.74532925199433,0.4363323129985824,1.570796326794897,0.0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set the robot's home position. + * + * @param positions Joint angles + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setHomePosition","params":[[0.0,-0.2617993877991494,1.74532925199433,0.4363323129985824,1.570796326794897,0.0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setHomePosition(const std::vector &positions); + + /** + * \chinese + * 获取机器人的原点位置 + * + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getHomePosition","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,-0.2617993877991494,1.74532925199433,0.4363323129985824,1.570796326794897,0.0]} + * \endchinese + * \english + * Get the robot's home position. + * + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getHomePosition","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,-0.2617993877991494,1.74532925199433,0.4363323129985824,1.570796326794897,0.0]} + * \endenglish + */ + std::vector getHomePosition(); + + /** + * \chinese + * 设置拖动阻尼 + * + * @param damp 阻尼 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setFreedriveDamp(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int + * + * @par Lua函数原型 + * setFreedriveDamp(damp: table) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setFreedriveDamp","params":[[0.5,0.5,0.5,0.5,0.5,0.5]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set freedrive damping. + * + * @param damp Damping values. + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setFreedriveDamp(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int + * + * @par Lua function prototype + * setFreedriveDamp(damp: table) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setFreedriveDamp","params":[[0.5,0.5,0.5,0.5,0.5,0.5]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setFreedriveDamp(const std::vector &damp); + + /** + * \chinese + * 获取拖动阻尼 + * + * @return 拖动阻尼 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getFreedriveDamp(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getFreedriveDamp() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getFreedriveDamp","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.5,0.5,0.5,0.5,0.5,0.5]} + * \endchinese + * \english + * Get freedrive damping. + * + * @return Freedrive damping values. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getFreedriveDamp(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getFreedriveDamp() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getFreedriveDamp","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.5,0.5,0.5,0.5,0.5,0.5]} + * \endenglish + */ + std::vector getFreedriveDamp(); + + /** + * \chinese + * 设置混合拖动阻尼 + * + * @param damp 阻尼 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setHandguidDamp(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int + * + * @par Lua函数原型 + * setHandguidDamp(damp: table) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setHandguidDamp","params":[[0.5,0.5,0.5,0.5,0.5,0.5]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set handguiding damping. + * + * @param damp damping coef. + * + * @return return 0 for success;return rror code for failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setHandguidDamp(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int + * + * @par Lua function prototype + * setHandguidDamp(damp: table) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setHandguidDamp","params":[[0.5,0.5,0.5,0.5,0.5,0.5]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setHandguidDamp(const std::vector &damp); + + /** + * \chinese + * 获取混合拖动阻尼 + * + * @return 拖动阻尼 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getHandguidDamp(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getHandguidDamp() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getHandguidDamp","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.5,0.5,0.5,0.5,0.5,0.5]} + * \endchinese + * \english + * Get handguiding damping. + * + * @return handguuiding damping + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getHandguidDamp(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua fuunction prototype + * getHandguidDamp() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getHandguidDamp","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.5,0.5,0.5,0.5,0.5,0.5]} + * \endenglish + */ + std::vector getHandguidDamp(); + + /** + * \chinese + * 获取机器人DH参数 + * alpha a d theta beta + * + * @param real 读取真实参数(理论值+补偿值)或者理论参数 + * @return 返回机器人DH参数 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getKinematicsParam(self: pyaubo_sdk.RobotConfig, arg0: bool) -> Dict[str, + * List[float]] + * + * @par Lua函数原型 + * getKinematicsParam(real: boolean) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getKinematicsParam","params":[true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":{"a":[0.0,-0.0001255999959539622,0.4086348000024445,0.3757601999930339,-0.00018950000230688602,3.7000001611886546e-05], + * "alpha":[0.0,-1.5701173967707458,3.1440308735524347,3.14650750358636,-1.5703093767832055,1.5751177669179182],"beta":[0.0,0.0,0.0,0.0,0.0,0.0], + * "d":[0.122,0.12154769999941345,-4.769999941345304e-05,4.769999941345304e-05,0.10287890000385232,0.116], + * "theta":[3.141592653589793,-1.5707963267948966,0.0,-1.5707963267948966,0.0,0.0]}} + * \endchinese + * \english + * Get the robot's DH parameters: alpha, a, d, theta, beta. + * + * @param real Read real parameters (theoretical + compensation) or + * theoretical parameters. + * @return Returns the robot's DH parameters. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getKinematicsParam(self: pyaubo_sdk.RobotConfig, arg0: bool) -> Dict[str, + * List[float]] + * + * @par Lua function prototype + * getKinematicsParam(real: boolean) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getKinematicsParam","params":[true],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":{"a":[0.0,-0.0001255999959539622,0.4086348000024445,0.3757601999930339,-0.00018950000230688602,3.7000001611886546e-05], + * "alpha":[0.0,-1.5701173967707458,3.1440308735524347,3.14650750358636,-1.5703093767832055,1.5751177669179182],"beta":[0.0,0.0,0.0,0.0,0.0,0.0], + * "d":[0.122,0.12154769999941345,-4.769999941345304e-05,4.769999941345304e-05,0.10287890000385232,0.116], + * "theta":[3.141592653589793,-1.5707963267948966,0.0,-1.5707963267948966,0.0,0.0]}} + * \endenglish + */ + std::unordered_map> getKinematicsParam( + bool real); + + /** + * \chinese + * 获取指定温度下的DH参数补偿值:alpha a d theta beta + * + * @param ref_temperature 参考温度 ℃,默认20℃ + * @return 返回DH参数补偿值 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getKinematicsCompensate(self: pyaubo_sdk.RobotConfig, arg0: float) -> + * Dict[str, List[float]] + * + * @par Lua函数原型 + * getKinematicsCompensate(ref_temperature: number) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getKinematicsCompensate","params":[20],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":{"a":[0.0,-0.0001255999959539622,0.0006348000024445355,-0.0002398000069661066,-0.00018950000230688602,3.7000001611886546e-05], + * "alpha":[0.0,0.000678930024150759,0.002438219962641597,0.0049148499965667725,0.00048695001169107854,0.004321440123021603], + * "beta":[0.0,0.0,0.0,0.0,0.0,0.0],"d":[0.0,4.769999941345304e-05,-4.769999941345304e-05,4.769999941345304e-05,0.0003789000038523227,0.0], + * "theta":[0.0,0.0,0.0,0.0,0.0,0.0]}} + * \endchinese + * \english + * Get DH parameter compensation values (alpha, a, d, theta, beta) at the + * specified temperature. + * + * @param ref_temperature Reference temperature in ℃, default is 20℃ + * @return Returns DH parameter compensation values. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getKinematicsCompensate(self: pyaubo_sdk.RobotConfig, arg0: float) -> + * Dict[str, List[float]] + * + * @par Lua function prototype + * getKinematicsCompensate(ref_temperature: number) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getKinematicsCompensate","params":[20],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":{"a":[0.0,-0.0001255999959539622,0.0006348000024445355,-0.0002398000069661066,-0.00018950000230688602,3.7000001611886546e-05], + * "alpha":[0.0,0.000678930024150759,0.002438219962641597,0.0049148499965667725,0.00048695001169107854,0.004321440123021603], + * "beta":[0.0,0.0,0.0,0.0,0.0,0.0],"d":[0.0,4.769999941345304e-05,-4.769999941345304e-05,4.769999941345304e-05,0.0003789000038523227,0.0], + * "theta":[0.0,0.0,0.0,0.0,0.0,0.0]}} + * \endenglish + */ + std::unordered_map> + getKinematicsCompensate(double ref_temperature); + + /** + * \chinese + * 设置标准 DH 补偿到机器人 + * + * @param param + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Set standard DH compensation to the robot. + * + * @param param + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int setKinematicsCompensate( + const std::unordered_map> ¶m); + + /** + * \chinese + * 设置需要保存到接口板底座的参数 + * + * @param param 补偿数据 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setPersistentParameters(self: pyaubo_sdk.RobotConfig, arg0: str) -> int + * + * @par Lua函数原型 + * setPersistentParameters(param: string) -> nil + * + * \endchinese + * \english + * Set parameters to be saved to the interface board base. + * + * @param param Compensation data. + * + * @return Returns 0 on success; error code on failure. + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setPersistentParameters(self: pyaubo_sdk.RobotConfig, arg0: str) -> int + * + * @par Lua function prototype + * setPersistentParameters(param: string) -> nil + * + * \endenglish + */ + int setPersistentParameters(const std::string ¶m); + + /** + * \chinese + * 设置硬件抽象层自定义参数 + * 目的是为了做不同硬件之间的兼容 + * + * @param param 自定义参数 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Set custom parameters for the hardware abstraction layer. + * The purpose is to ensure compatibility between different hardware. + * + * @param param Custom parameters. + * + * @return Returns 0 on success; error code on failure. + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int setHardwareCustomParameters(const std::string ¶m); + + /** + * \chinese + * 获取硬件抽象层自定义参数 + * + * @param + * @return 返回硬件抽象层自定义的参数 + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Get custom parameters from the hardware abstraction layer. + * + * @param + * @return Returns custom parameters from the hardware abstraction layer. + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + std::string getHardwareCustomParameters(const std::string ¶m); + + /** + * \chinese + * 设置机器人关节零位 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setRobotZero(self: pyaubo_sdk.RobotConfig) -> int + * + * @par Lua函数原型 + * setRobotZero() -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setRobotZero","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set the robot joint zero position. + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setRobotZero(self: pyaubo_sdk.RobotConfig) -> int + * + * @par Lua function prototype + * setRobotZero() -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setRobotZero","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setRobotZero(); + + /** + * \chinese + * 获取可用的末端力矩传感器的名字 + * + * @return 返回可用的末端力矩传感器的名字 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getTcpForceSensorNames(self: pyaubo_sdk.RobotConfig) -> List[str] + * + * @par Lua函数原型 + * getTcpForceSensorNames() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getTcpForceSensorNames","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[]} + * + * \endchinese + * \english + * Get the names of available TCP force sensors. + * + * @return Returns the names of available TCP force sensors. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getTcpForceSensorNames(self: pyaubo_sdk.RobotConfig) -> List[str] + * + * @par Lua function prototype + * getTcpForceSensorNames() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getTcpForceSensorNames","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[]} + * + * \endenglish + */ + std::vector getTcpForceSensorNames(); + + /** + * \chinese + * 设置末端力矩传感器 + * 如果存在内置的末端力矩传感器,默认将使用内置的力矩传感器 + * + * @param name 末端力矩传感器的名字 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * selectTcpForceSensor(self: pyaubo_sdk.RobotConfig, arg0: str) -> int + * + * @par Lua函数原型 + * selectTcpForceSensor(name: string) -> nil + * \endchinese + * \english + * Set the TCP force sensor. + * If there is a built-in TCP force sensor, the built-in sensor will be used + * by default. + * + * @param name Name of the TCP force sensor. + * + * @return Returns 0 on success; error code on failure. + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * selectTcpForceSensor(self: pyaubo_sdk.RobotConfig, arg0: str) -> int + * + * @par Lua function prototype + * selectTcpForceSensor(name: string) -> nil + * \endenglish + */ + int selectTcpForceSensor(const std::string &name); + + /** + * \chinese + * 设置传感器安装位姿 + * + * @param sensor_pose 传感器安装位姿 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Set the sensor mounting pose. + * + * @param sensor_pose Sensor mounting pose + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int setTcpForceSensorPose(const std::vector &sensor_pose); + + /** + * \chinese + * 获取传感器安装位姿 + * + * @return 传感器安装位姿 + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getTcpForceSensorPose","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the sensor mounting pose. + * + * @return Sensor mounting pose. + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getTcpForceSensorPose","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getTcpForceSensorPose(); + + /** + * \chinese + * 是否安装了末端力矩传感器 + * + * @return 安装返回true; 没有安装返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * hasTcpForceSensor(self: pyaubo_sdk.RobotConfig) -> bool + * + * @par Lua函数原型 + * hasTcpForceSensor() -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.hasTcpForceSensor","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endchinese + * \english + * Whether a TCP force sensor is installed. + * + * @return Returns true if installed; false otherwise. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * hasTcpForceSensor(self: pyaubo_sdk.RobotConfig) -> bool + * + * @par Lua function prototype + * hasTcpForceSensor() -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.hasTcpForceSensor","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endenglish + */ + bool hasTcpForceSensor(); + + /** + * \chinese + * 设置末端力矩偏移 + * + * @param force_offset 末端力矩偏移 + * @return 成功返回0; 失败返回错误码 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setTcpForceOffset(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int + * + * @par Lua函数原型 + * setTcpForceOffset(force_offset: table) -> nil + * + * \endchinese + * \english + * Set the TCP force/torque offset. + * + * @param force_offset TCP force/torque offset + * @return Returns 0 on success; error code on failure + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setTcpForceOffset(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int + * + * @par Lua function prototype + * setTcpForceOffset(force_offset: table) -> nil + * + * \endenglish + */ + int setTcpForceOffset(const std::vector &force_offset); + + /** + * \chinese + * 获取末端力矩偏移 + * + * @return 返回末端力矩偏移 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getTcpForceOffset(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getTcpForceOffset() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getTcpForceOffset","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the TCP force/torque offset. + * + * @return Returns the TCP force/torque offset. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getTcpForceOffset(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getTcpForceOffset() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getTcpForceOffset","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getTcpForceOffset(); + + /** + * \chinese + * 获取可用的底座力矩传感器的名字 + * + * @return 返回可用的底座力矩传感器的名字 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getBaseForceSensorNames(self: pyaubo_sdk.RobotConfig) -> List[str] + * + * @par Lua函数原型 + * getBaseForceSensorNames() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getBaseForceSensorNames","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[]} + * + * \endchinese + * \english + * Get the names of available base force sensors. + * + * @return Returns the names of available base force sensors. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getBaseForceSensorNames(self: pyaubo_sdk.RobotConfig) -> List[str] + * + * @par Lua function prototype + * getBaseForceSensorNames() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getBaseForceSensorNames","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[]} + * + * \endenglish + */ + std::vector getBaseForceSensorNames(); + + /** + * \chinese + * 设置底座力矩传感器 + * 如果存在内置的底座力矩传感器,默认将使用内置的力矩传感器 + * + * @param name 底座力矩传感器的名字 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * selectBaseForceSensor(self: pyaubo_sdk.RobotConfig, arg0: str) -> int + * + * @par Lua函数原型 + * selectBaseForceSensor(name: string) -> nil + * \endchinese + * \english + * Set the base force sensor. + * If there is a built-in base force sensor, the built-in sensor will be + * used by default. + * + * @param name Name of the base force sensor. + * + * @return Returns 0 on success; error code on failure. + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * selectBaseForceSensor(self: pyaubo_sdk.RobotConfig, arg0: str) -> int + * + * @par Lua function prototype + * selectBaseForceSensor(name: string) -> nil + * \endenglish + */ + int selectBaseForceSensor(const std::string &name); + + /** + * \chinese + * 是否安装了底座力矩传感器 + * + * @return 安装返回true;没有安装返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * hasBaseForceSensor(self: pyaubo_sdk.RobotConfig) -> bool + * + * @par Lua函数原型 + * hasBaseForceSensor() -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.hasBaseForceSensor","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endchinese + * \english + * Whether a base force sensor is installed. + * + * @return Returns true if installed; false otherwise. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * hasBaseForceSensor(self: pyaubo_sdk.RobotConfig) -> bool + * + * @par Lua function prototype + * hasBaseForceSensor() -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.hasBaseForceSensor","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endenglish + */ + bool hasBaseForceSensor(); + + /** + * \chinese + * 设置底座力矩偏移 + * + * @param force_offset 底座力矩偏移 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setBaseForceOffset(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> + * int + * + * @par Lua函数原型 + * setBaseForceOffset(force_offset: table) -> nil + * \endchinese + * \english + * Set the base force/torque offset. + * + * @param force_offset Base force/torque offset + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setBaseForceOffset(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> + * int + * + * @par Lua function prototype + * setBaseForceOffset(force_offset: table) -> nil + * \endenglish + */ + int setBaseForceOffset(const std::vector &force_offset); + + /** + * \chinese + * 获取底座力矩偏移 + * + * @return 返回底座力矩偏移 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getBaseForceOffset(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getBaseForceOffset() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getBaseForceOffset","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[]} + * + * \endchinese + * \english + * Get the base force/torque offset. + * + * @return Returns the base force/torque offset. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getBaseForceOffset(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getBaseForceOffset() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getBaseForceOffset","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[]} + * + * \endenglish + */ + std::vector getBaseForceOffset(); + + /** + * \chinese + * 获取安全参数校验码 CRC32 + * + * @return 返回安全参数校验码 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getSafetyParametersCheckSum(self: pyaubo_sdk.RobotConfig) -> int + * + * @par Lua函数原型 + * getSafetyParametersCheckSum() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getSafetyParametersCheckSum","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":2033397241} + * + * \endchinese + * \english + * Get the safety parameter checksum CRC32. + * + * @return Returns the safety parameter checksum. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getSafetyParametersCheckSum(self: pyaubo_sdk.RobotConfig) -> int + * + * @par Lua function prototype + * getSafetyParametersCheckSum() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getSafetyParametersCheckSum","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":2033397241} + * + * \endenglish + */ + uint32_t getSafetyParametersCheckSum(); + + /** + * \chinese + * 发起确认安全配置参数请求: + * 将安全配置参数写入到安全接口板flash或文件 + * + * @param parameters 安全配置参数 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * confirmSafetyParameters(self: pyaubo_sdk.RobotConfig, arg0: + * arcs::common_interface::RobotSafetyParameterRange) -> int + * + * @par Lua函数原型 + * + * \endchinese + * \english + * Initiate a request to confirm safety configuration parameters: + * Write safety configuration parameters to the safety interface board flash + * or file. + * + * @param parameters Safety configuration parameters. + * + * @return Returns 0 on success; error code on failure. + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * confirmSafetyParameters(self: pyaubo_sdk.RobotConfig, arg0: + * arcs::common_interface::RobotSafetyParameterRange) -> int + * + * @par Lua function prototype + * + * \endenglish + */ + int confirmSafetyParameters(const RobotSafetyParameterRange ¶meters); + + /** + * \chinese + * 计算安全参数的 CRC32 校验值 + * + * @return crc32 + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Calculate the CRC32 checksum of safety parameters. + * + * @return crc32 + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + uint32_t calcSafetyParametersCheckSum( + const RobotSafetyParameterRange ¶meters); + + /** + * \chinese + * 获取关节最大位置(物理极限) + * + * @return 返回关节最大位置 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointMaxPositions(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getJointMaxPositions() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getJointMaxPositions","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[6.283185307179586,6.283185307179586,6.283185307179586,6.283185307179586,6.283185307179586,6.283185307179586]} + * \endchinese + * \english + * Get the joint maximum positions (physical limits). + * + * @return Returns the joint maximum positions. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointMaxPositions(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getJointMaxPositions() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getJointMaxPositions","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[6.283185307179586,6.283185307179586,6.283185307179586,6.283185307179586,6.283185307179586,6.283185307179586]} + * \endenglish + */ + std::vector getJointMaxPositions(); + + /** + * \chinese + * 获取关节最小位置(物理极限) + * + * @return 返回关节最小位置 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointMinPositions(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getJointMinPositions() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getJointMinPositions","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[-6.283185307179586,-6.283185307179586,-6.283185307179586,-6.283185307179586,-6.283185307179586,-6.283185307179586]} + * \endchinese + * \english + * Get the joint minimum positions (physical limits). + * + * @return Returns the joint minimum positions. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointMinPositions(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getJointMinPositions() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getJointMinPositions","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[-6.283185307179586,-6.283185307179586,-6.283185307179586,-6.283185307179586,-6.283185307179586,-6.283185307179586]} + * \endenglish + */ + std::vector getJointMinPositions(); + + /** + * \chinese + * 获取关节最大速度(物理极限) + * + * @return 返回关节最大速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointMaxSpeeds(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getJointMaxSpeeds() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getJointMaxSpeeds","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[3.892084231947355,3.892084231947355,3.892084231947355,3.1066860685499065,3.1066860685499065,3.1066860685499065]} + * \endchinese + * \english + * Get the joint maximum speeds (physical limits). + * + * @return Returns the joint maximum speeds. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointMaxSpeeds(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getJointMaxSpeeds() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getJointMaxSpeeds","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[3.892084231947355,3.892084231947355,3.892084231947355,3.1066860685499065,3.1066860685499065,3.1066860685499065]} + * \endenglish + */ + std::vector getJointMaxSpeeds(); + + /** + * \chinese + * 获取关节最大加速度(物理极限) + * + * @return 返回关节最大加速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointMaxAccelerations(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getJointMaxAccelerations() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getJointMaxAccelerations","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[31.104877758314785,31.104877758314785,31.104877758314785,20.73625684294463,20.73625684294463,20.73625684294463]} + * \endchinese + * \english + * Get the joint maximum accelerations (physical limits). + * + * @return Returns the joint maximum accelerations. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointMaxAccelerations(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getJointMaxAccelerations() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getJointMaxAccelerations","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[31.104877758314785,31.104877758314785,31.104877758314785,20.73625684294463,20.73625684294463,20.73625684294463]} + * \endenglish + */ + std::vector getJointMaxAccelerations(); + + /** + * \chinese + * 获取TCP最大速度(物理极限) + * + * @return 返回TCP最大速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getTcpMaxSpeeds(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getTcpMaxSpeeds() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getTcpMaxSpeeds","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[2.0,5.0]} + * \endchinese + * \english + * Get the TCP maximum speed (physical limits). + * + * @return Returns the TCP maximum speed. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getTcpMaxSpeeds(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getTcpMaxSpeeds() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getTcpMaxSpeeds","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[2.0,5.0]} + * \endenglish + */ + std::vector getTcpMaxSpeeds(); + + /** + * \chinese + * 获取TCP最大加速度(物理极限) + * + * @return 返回TCP最大加速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getTcpMaxAccelerations(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getTcpMaxAccelerations() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getTcpMaxAccelerations","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[10.0,10.0]} + * + * \endchinese + * \english + * Get the TCP maximum acceleration (physical limits). + * + * @return Returns the TCP maximum acceleration. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getTcpMaxAccelerations(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getTcpMaxAccelerations() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getTcpMaxAccelerations","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[10.0,10.0]} + * \endenglish + */ + std::vector getTcpMaxAccelerations(); + + /** + * \chinese + * 设置机器人安装姿态 + * + * @param gravity 安装姿态 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setGravity(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int + * + * @par Lua函数原型 + * setGravity(gravity: table) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setGravity","params":[[0.0,0.0,-9.87654321]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set the robot installation attitude (gravity vector). + * + * @param gravity Installation attitude (gravity vector) + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setGravity(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int + * + * @par Lua function prototype + * setGravity(gravity: table) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setGravity","params":[[0.0,0.0,-9.87654321]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setGravity(const std::vector &gravity); + + /** + * \chinese + * 获取机器人的安装姿态 + * + * 如果机器人底座安装了姿态传感器,则从传感器读取数据,否则按照用户设置 + * + * @return 返回安装姿态 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getGravity(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getGravity() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getGravity","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,-9.87654321]} + * + * \endchinese + * \english + * Get the robot's installation attitude (gravity vector). + * + * If the robot base is equipped with an attitude sensor, data is read from + * the sensor; otherwise, the user setting is used. + * + * @return Returns the installation attitude. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getGravity(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getGravity() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getGravity","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,-9.87654321]} + * + * \endenglish + */ + std::vector getGravity(); + + /** + * \chinese + * 设置当前的TCP偏移 + * + * TCP偏移表示形式为(x,y,z,rx,ry,rz)。 + * 其中x、y、z是工具中心点(TCP)在基坐标系下相对于法兰盘中心的位置偏移,单位是m。 + * rx、ry、rz是工具中心点(TCP)在基坐标系下相对于法兰盘中心的的姿态偏移,是ZYX欧拉角,单位是rad。 + * + * @param offset 当前的TCP偏移,形式为(x,y,z,rx,ry,rz) + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setTcpOffset(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int + * + * @par Lua函数原型 + * setTcpOffset(offset: table) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setTcpOffset","params":[[0.0,0.0,0.0,0.0,0.0,0.0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set the current TCP offset. + * + * The TCP offset is represented as (x, y, z, rx, ry, rz). + * x, y, z are the position offsets of the Tool Center Point (TCP) relative + * to the flange center in the base coordinate system, in meters. rx, ry, rz + * are the orientation offsets of the TCP relative to the flange center in + * the base coordinate system, as ZYX Euler angles in radians. + * + * @param offset The current TCP offset, in the form (x, y, z, rx, ry, rz) + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setTcpOffset(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int + * + * @par Lua function prototype + * setTcpOffset(offset: table) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setTcpOffset","params":[[0.0,0.0,0.0,0.0,0.0,0.0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setTcpOffset(const std::vector &offset); + + /** + * \chinese + * 获取当前的TCP偏移 + * + * TCP偏移表示形式为(x,y,z,rx,ry,rz)。 + * 其中x、y、z是工具中心点(TCP)在基坐标系下相对于法兰盘中心的位置偏移,单位是m。 + * rx、ry、rz是工具中心点(TCP)在基坐标系下相对于法兰盘中心的的姿态偏移,是ZYX欧拉角,单位是rad。 + * + * @return 当前的TCP偏移,形式为(x,y,z,rx,ry,rz) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getTcpOffset(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getTcpOffset() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getTcpOffset","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the current TCP offset. + * + * The TCP offset is represented as (x, y, z, rx, ry, rz). + * x, y, z are the position offsets of the Tool Center Point (TCP) relative + * to the flange center in the base coordinate system, in meters. rx, ry, rz + * are the orientation offsets of the TCP relative to the flange center in + * the base coordinate system, as ZYX Euler angles in radians. + * + * @return The current TCP offset, in the form (x, y, z, rx, ry, rz) + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getTcpOffset(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getTcpOffset() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getTcpOffset","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getTcpOffset(); + + /** + * \chinese + * 设置工具端质量、质心及惯量 + * + * @param m 工具端质量 + * @param com 质心 + * @param inertial 惯量 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setToolInertial(self: pyaubo_sdk.RobotConfig, arg0: float, arg1: + * List[float], arg2: List[float]) -> int + * + * @par Lua函数原型 + * setToolInertial(m: number, com: table, inertial: table) -> nil + * \endchinese + * \english + * Set tool mass, center of mass, and inertia. + * + * @param m Tool mass + * @param com Center of mass + * @param inertial Inertia + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setToolInertial(self: pyaubo_sdk.RobotConfig, arg0: float, arg1: + * List[float], arg2: List[float]) -> int + * + * @par Lua function prototype + * setToolInertial(m: number, com: table, inertial: table) -> nil + * \endenglish + */ + int setToolInertial(double m, const std::vector &com, + const std::vector &inertial); + + /** + * \chinese + * 设置有效负载 + * + * @param m 质量, 单位: kg + * @param cog 重心, 单位: m, 形式为(CoGx, CoGy, CoGz) + * @param aom 力矩轴的方向, 单位: rad, 形式为(rx, ry, rz) + * @param inertia 惯量, 单位: kg*m^2, 形式为(Ixx, Iyy, Izz, Ixy, Ixz, + * Iyz)或(Ixx, Ixy, Ixz, Iyx, Iyy, Iyz, Izx, Izy, Izz) + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setPayload(self: pyaubo_sdk.RobotConfig, arg0: float, arg1: List[float], + * arg2: List[float], arg3: List[float]) -> int + * + * @par Lua函数原型 + * setPayload(m: number, cog: table, aom: table, inertia: table) -> nil + * + * @par Lua示例 + * setPayload(3, {0,0,0}, {0,0,0}, {0,0,0,0,0,0,0,0,0}) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setPayload","params":[3,[0,0,0],[0,0,0],[0,0,0,0,0,0,0,0,0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set the payload. + * + * @param m Mass, unit: kg + * @param cog Center of gravity, unit: m, format (CoGx, CoGy, CoGz) + * @param aom Axis of moment, unit: rad, format (rx, ry, rz) + * @param inertia Inertia, unit: kg*m^2, format (Ixx, Iyy, Izz, Ixy, Ixz, + * Iyz) or (Ixx, Ixy, Ixz, Iyx, Iyy, Iyz, Izx, Izy, Izz) + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setPayload(self: pyaubo_sdk.RobotConfig, arg0: float, arg1: List[float], + * arg2: List[float], arg3: List[float]) -> int + * + * @par Lua function prototype + * setPayload(m: number, cog: table, aom: table, inertia: table) -> nil + * + * @par Lua example + * setPayload(3, {0,0,0}, {0,0,0}, {0,0,0,0,0,0,0,0,0}) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setPayload","params":[3,[0,0,0],[0,0,0],[0,0,0,0,0,0,0,0,0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setPayload(double m, const std::vector &cog, + const std::vector &aom, + const std::vector &inertia); + + /** + * \chinese + * 获取有效负载 + * + * @return 有效负载. + * 第一个元素表示质量, 单位: kg; + * 第二个元素表示重心, 单位: m, 形式为(CoGx, CoGy, CoGz); + * 第三个元素表示力矩轴的方向, 单位: rad, 形式为(rx, ry, rz); + * 第四个元素表示惯量, 单位: kg*m^2, 形式为(Ixx, Iyy, Izz, Ixy, Ixz, Iyz) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getPayload(self: pyaubo_sdk.RobotConfig) -> Tuple[float, List[float], + * List[float], List[float]] + * + * @par Lua函数原型 + * getPayload() -> number, table, table, table + * + * @par Lua示例 + * m, cog, aom, inertia = getPayload() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getPayload","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[3.0,[0.0,0.0,0.0],[0.0,0.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0]]} + * \endchinese + * \english + * Get the payload. + * + * @return The payload. + * The first element is the mass in kg; + * The second element is the center of gravity in meters, format (CoGx, + * CoGy, CoGz); The third element is the axis of moment in radians, format + * (rx, ry, rz); The fourth element is the inertia in kg*m^2, format (Ixx, + * Iyy, Izz, Ixy, Ixz, Iyz) + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getPayload(self: pyaubo_sdk.RobotConfig) -> Tuple[float, List[float], + * List[float], List[float]] + * + * @par Lua function prototype + * getPayload() -> number, table, table, table + * + * @par Lua example + * m, cog, aom, inertia = getPayload() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getPayload","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[3.0,[0.0,0.0,0.0],[0.0,0.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0]]} + * \endenglish + */ + Payload getPayload(); + + /** + * \chinese + * 末端位姿是否在安全范围之内 + * + * @param pose 末端位姿 + * @return 在安全范围内返回true; 反之返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * toolSpaceInRange(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> bool + * + * @par Lua函数原型 + * toolSpaceInRange(pose: table) -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.toolSpaceInRange","params":[[0.58712, + * -0.15775, 0.48703, 2.76, 0.344, 1.432]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":true} + * \endchinese + * \english + * Whether the end-effector pose is within the safety range. + * + * @param pose End-effector pose + * @return Returns true if within the safety range; otherwise returns false + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * toolSpaceInRange(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> bool + * + * @par Lua function prototype + * toolSpaceInRange(pose: table) -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.toolSpaceInRange","params":[[0.58712, + * -0.15775, 0.48703, 2.76, 0.344, 1.432]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":true} + * \endenglish + */ + bool toolSpaceInRange(const std::vector &pose); + + /** + * \chinese + * 发起固件升级请求,控制器软件将进入固件升级模式 + * + * @param fw 固件升级路径。该路径的格式为: 固件安装包路径\#升级节点列表。 + * 其中固件安装包路径和升级节点列表以井号(#)分隔,升级节点以逗号(,)分隔。 + * 如果节点名称后带有!,则表示强制(不带版本校验)升级该节点; + * 反之,则表示带校验版本地升级节点, + * 即在升级该节点前,会先判断当前版本和目标版本是否相同,如果相同就不升级该节点。\n + * 可以根据实际需求灵活设置需要升级的节点。\n + * 例如, + * /tmp/firmware_update-1.0.42-rc.5+2347b0d.firm\#master_mcu!,slace_mcu!, + * base!,tool!,joint1!,joint2!,joint3!,joint4!,joint5!,joint6! + * 表示强制升级接口板主板、接口板从板、基座、工具和6个关节(joint1至joint6)。\n + * all表示所有的节点,例如 + * /tmp/firm_XXX.firm\#all 表示带校验版本地升级全部节点, + * /tmp/firm_XXX.firm\#all!表示强制升级全部节点 + * + * @return 指令下发成功返回0; 失败返回错误码。 \n + * -AUBO_BAD_STATE: 运行时(RuntimeMachine)的当前状态不是Stopped, + * 固件升级请求被拒绝。AUBO_BAD_STATE的值是1。 \n + * -AUBO_TIMEOUT: 超时。AUBO_TIMEOUT的值是4。 \n + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * firmwareUpdate(self: pyaubo_sdk.RobotConfig, arg0: str) -> int + * + * @par Lua函数原型 + * firmwareUpdate(fw: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.firmwareUpdate","params":["/tmp/firmware_update-1.0.42-rc.12+3e33eac.firm#master_mcu"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Initiate a firmware upgrade request. The controller software will enter + * firmware upgrade mode. + * + * @param fw Firmware upgrade path. The format is: firmware package + * path\#upgrade node list. The firmware package path and node list are + * separated by a hash (#), and nodes are separated by commas (,). If a node + * name ends with !, it means to force upgrade (without version check) that + * node; otherwise, the node will be upgraded only if the current version + * differs from the target version. You can flexibly specify which nodes to + * upgrade as needed. For example, + * /tmp/firmware_update-1.0.42-rc.5+2347b0d.firm#master_mcu!,slace_mcu!,base!,tool!,joint1!,joint2!,joint3!,joint4!,joint5!,joint6! + * means to force upgrade the interface board main, interface board slave, + * base, tool, and joints 1-6. "all" means all nodes, e.g. + * /tmp/firm_XXX.firm#all means upgrade all nodes with version check, + * /tmp/firm_XXX.firm#all! means force upgrade all nodes. + * + * @return Returns 0 if the command is sent successfully; otherwise, returns + * an error code. -AUBO_BAD_STATE: The current state of the RuntimeMachine + * is not Stopped, so the firmware upgrade request is rejected. + * AUBO_BAD_STATE = 1. -AUBO_TIMEOUT: Timeout. AUBO_TIMEOUT = 4. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * firmwareUpdate(self: pyaubo_sdk.RobotConfig, arg0: str) -> int + * + * @par Lua function prototype + * firmwareUpdate(fw: string) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.firmwareUpdate","params":["/tmp/firmware_update-1.0.42-rc.12+3e33eac.firm#master_mcu"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int firmwareUpdate(const std::string &fw); + + /** + * \chinese + * 获取当前的固件升级的进程 + * + * @return 当前的固件升级进程。 \n + * 第一个元素表示步骤名称。如果是failed,则表示固件升级失败 \n + * 第二个元素表示升级的进度(0~1),完成之后,返回("", 1) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getFirmwareUpdateProcess(self: pyaubo_sdk.RobotConfig) -> Tuple[str, + * float] + * + * @par Lua函数原型 + * getFirmwareUpdateProcess() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getFirmwareUpdateProcess","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[" ",0.0]} + * + * \endchinese + * \english + * Get the current firmware upgrade process. + * + * @return The current firmware upgrade process. \n + * The first element is the step name. If it is "failed", the firmware + * upgrade failed. \n The second element is the upgrade progress (0~1). When + * finished, returns ("", 1) + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getFirmwareUpdateProcess(self: pyaubo_sdk.RobotConfig) -> Tuple[str, + * float] + * + * @par Lua function prototype + * getFirmwareUpdateProcess() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getFirmwareUpdateProcess","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[" ",0.0]} + * + * \endenglish + */ + std::tuple getFirmwareUpdateProcess(); + + /** + * \chinese + * 获取关节最大位置(当前正在使用的限制值) + * + * @return 返回关节最大位置(当前正在使用的限制值) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getLimitJointMaxPositions(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getLimitJointMaxPositions() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getLimitJointMaxPositions","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[6.2831854820251465,6.2831854820251465,6.2831854820251465,6.2831854820251465,6.2831854820251465,6.2831854820251465]} + * \endchinese + * \english + * Get the joint maximum positions (currently used limit values). + * + * @return Returns the joint maximum positions (currently used limit + * values). + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getLimitJointMaxPositions(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getLimitJointMaxPositions() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getLimitJointMaxPositions","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[6.2831854820251465,6.2831854820251465,6.2831854820251465,6.2831854820251465,6.2831854820251465,6.2831854820251465]} + * \endenglish + */ + std::vector getLimitJointMaxPositions(); + + /** + * \chinese + * 获取关节最小位置(当前正在使用的限制值) + * + * @return 返回关节最小位置(当前正在使用的限制值) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getLimitJointMinPositions(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getLimitJointMinPositions() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getLimitJointMinPositions","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[-6.2831854820251465,-6.2831854820251465,-6.2831854820251465,-6.2831854820251465,-6.2831854820251465,-6.2831854820251465]} + * \endchinese + * \english + * Get the joint minimum positions (currently used limit values). + * + * @return Returns the joint minimum positions (currently used limit + * values). + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getLimitJointMinPositions(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getLimitJointMinPositions() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getLimitJointMinPositions","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[-6.2831854820251465,-6.2831854820251465,-6.2831854820251465,-6.2831854820251465,-6.2831854820251465,-6.2831854820251465]} + * \endenglish + */ + std::vector getLimitJointMinPositions(); + + /** + * \chinese + * 获取关节最大速度(当前正在使用的限制值) + * + * @return 返回关节最大速度(当前正在使用的限制值) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getLimitJointMaxSpeeds(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getLimitJointMaxSpeeds() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getLimitJointMaxSpeeds","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[3.8920841217041016,3.8920841217041016,3.8920841217041016,3.1066861152648926,3.1066861152648926,3.1066861152648926]} + * \endchinese + * \english + * Get the joint maximum speeds (currently used limit values). + * + * @return Returns the joint maximum speeds (currently used limit values). + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getLimitJointMaxSpeeds(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getLimitJointMaxSpeeds() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getLimitJointMaxSpeeds","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[3.8920841217041016,3.8920841217041016,3.8920841217041016,3.1066861152648926,3.1066861152648926,3.1066861152648926]} + * \endenglish + */ + std::vector getLimitJointMaxSpeeds(); + + /** + * \chinese + * 获取关节最大加速度(当前正在使用的限制值) + * + * @return 返回关节最大加速度(当前正在使用的限制值) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getLimitJointMaxAccelerations(self: pyaubo_sdk.RobotConfig) -> + * List[float] + * + * @par Lua函数原型 + * getLimitJointMaxAccelerations() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getLimitJointMaxAccelerations","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[31.104877758314785,31.104877758314785,31.104877758314785,20.73625684294463,20.73625684294463,20.73625684294463]} + * \endchinese + * \english + * Get the joint maximum accelerations (currently used limit values). + * + * @return Returns the joint maximum accelerations (currently used limit + * values). + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getLimitJointMaxAccelerations(self: pyaubo_sdk.RobotConfig) -> + * List[float] + * + * @par Lua function prototype + * getLimitJointMaxAccelerations() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getLimitJointMaxAccelerations","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[31.104877758314785,31.104877758314785,31.104877758314785,20.73625684294463,20.73625684294463,20.73625684294463]} + * \endenglish + */ + std::vector getLimitJointMaxAccelerations(); + + /** + * \chinese + * 获取TCP最大速度(当前正在使用的限制值) + * + * @return 返回TCP最大速度(当前正在使用的限制值) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getLimitTcpMaxSpeed(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getLimitTcpMaxSpeed() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getLimitTcpMaxSpeed","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":2.0} + * \endchinese + * \english + * Get the TCP maximum speed (currently used limit value). + * + * @return Returns the TCP maximum speed (currently used limit value). + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getLimitTcpMaxSpeed(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getLimitTcpMaxSpeed() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getLimitTcpMaxSpeed","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":2.0} + * \endenglish + */ + double getLimitTcpMaxSpeed(); + + /** + * \chinese + * 获取当前安全停止的类型 + * + * @return 返回当前安全停止的类型 + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getSafeguardStopType","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"None"} + * \endchinese + * \english + * Get the current safeguard stop type. + * + * @return Returns the current safeguard stop type. + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getSafeguardStopType","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"None"} + * \endenglish + */ + SafeguedStopType getSafeguardStopType(); + + /** + * \chinese + * 按位获取完整的安全停止触发源 + * + * @return 返回所有安全停止触发源 + * + * 安全停止的原因: + * 手动模式下可配置安全IO触发的安全停止 - 1<<0 + * 自动模式下可配置安全IO触发的安全停止 - 1<<1 + * 控制柜SI输入触发的安全停止 - 1<<2 + * 示教器三态开关触发的安全停止 - 1<<3 + * 自动切手动触发的安全停止 - 1<<4 + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getSafeguardStopSource","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Get the complete safeguard stop source as a bitmask. + * + * @return Returns all safeguard stop sources. + * + * Reasons for safeguard stop: + * Safeguard stop triggered by configurable safety IO in manual mode - 1<<0 + * Safeguard stop triggered by configurable safety IO in automatic mode - + * 1<<1 Safeguard stop triggered by control box SI input - 1<<2 Safeguard + * stop triggered by teach pendant three-position switch - 1<<3 Safeguard + * stop triggered by switching from auto to manual - 1<<4 + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getSafeguardStopSource","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int getSafeguardStopSource(); + + /** + * \chinese + * 按位获取完整的机器人紧急停止触发源 + * + * @return 返回所有机器人紧急停止触发源 + * + * 紧急停止的原因: + * 控制柜紧急停止按钮触发 - 1<<0 + * 示教器紧急停止按钮触发 - 1<<1 + * 手柄紧急停止按钮触发 - 1<<2 + * 固定IO紧急停止触发 - 1<<3 + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getRobotEmergencyStopSource","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Get the complete robot emergency stop source as a bitmask. + * + * @return Returns all robot emergency stop sources. + * + * Reasons for emergency stop: + * Emergency stop triggered by control box button - 1<<0 + * Emergency stop triggered by teach pendant button - 1<<1 + * Emergency stop triggered by handle button - 1<<2 + * Emergency stop triggered by fixed IO - 1<<3 + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getRobotEmergencyStopSource","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int getRobotEmergencyStopSource(); + + /** + * \chinese + * 获取工具端力矩传感器的名字 + * + * @return 当前工具端力矩传感器名字 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getSelectedTcpForceSensorName(self: pyaubo_sdk.RobotConfig) -> str + * + * @par Lua函数原型 + * getSelectedTcpForceSensorName() -> str + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getSelectedTcpForceSensorName","params":[],"id":1} + * \endchinese + * \english + * Get the name of the selected TCP force sensor. + * + * @return The name of the currently selected TCP force sensor. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getSelectedTcpForceSensorName(self: pyaubo_sdk.RobotConfig) -> str + * + * @par Lua function prototype + * getSelectedTcpForceSensorName() -> str + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getSelectedTcpForceSensorName","params":[],"id":1} + * \endenglish + */ + std::string getSelectedTcpForceSensorName(); + + /** + * \chinese + * 添加焊枪动力学参数 + * + * @param m 质量, 单位: kg + * @param cog 质心, 单位: m, 形式为(CoGx, CoGy, CoGz) + * @param inertia 惯性张量, 单位: kg*m^2, 形式为(Ixx, Iyy, Izz, Ixy, + * Ixz, Iyz)或(Ixx, Ixy, Ixz, Iyx, Iyy, Iyz, Izx, Izy, Izz) + * @return 成功返回0; 失败返回错误码 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * attachWeldingGun(self: pyaubo_sdk.RobotConfig, arg0: float, arg1: + * List[float], arg2: List[float]) -> int + * + * @par Lua函数原型 + * attachWeldingGun(m: number, cog: table, inertia: table) -> nil + * + * @par Lua示例 + * attachWeldingGun(3, {0,0,0}, {0,0,0,0,0,0,0,0,0}) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.attachWeldingGun","params":[3,[0,0,0],[0,0,0,0,0,0,0,0,0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + */ + int attachWeldingGun(double m, const std::vector &cog, + const std::vector &inertia); + /** + * \chinese + * 设置碰撞阈值 + * + * @param threshold 碰撞阈值 + * @return 成功返回0; 失败返回错误码 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setCollisionThreshold(self: pyaubo_sdk.RobotConfig, arg0: List[float]) + * -> int + * + * @par Lua函数原型 + * setCollisionThreshold(threshold: table) -> nil + * + * @par Lua示例 + * setCollisionThreshold({99.0, + * 114.0, + * 103.0, 56.0, 51.0, 60.0,54.6111111, 66.22222222, 59.66666667, 28.94444444, + * 27.05555556, 30.11111111,19.1, 28.0, 25.0, 7.3, 7.9, 6.2}) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setCollisionThreshold","params":[[99.0, + * 114.0, + * 103.0, 56.0, 51.0, 60.0,54.6111111, 66.22222222, 59.66666667, 28.94444444, + * 27.05555556, 30.11111111,19.1, 28.0, 25.0, 7.3, 7.9, 6.2]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Enable optimized collision force. + * + * @param threshold + * @return Returns 0 on success; error code on failure. + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setCollisionThreshold","params":[[99.0, + * 114.0, + * 103.0, 56.0, 51.0, 60.0,54.6111111, 66.22222222, 59.66666667, 28.94444444, + * 27.05555556, 30.11111111,19.1, 28.0, 25.0, 7.3, 7.9, 6.2]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"None"} + * \endenglish + */ + int setCollisionThreshold(const std::vector &threshold); + + /** + * \chinese + * 获取碰撞阈值 + * + * @return 碰撞阈值 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getCollisionThreshold(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getCollisionThreshold() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getCollisionThreshold","params":[99.0, + * 114.0, 103.0, 56.0, 51.0, 60.0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1} + * \endchinese + * \english + * Get collision threshold. + * + * @return collision threshold. + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getCollisionThreshold","params":[[99.0, + * 114.0, + * 103.0, 56.0, 51.0, 60.0,54.6111111, 66.22222222, 59.66666667, 28.94444444, + * 27.05555556, 30.11111111,19.1, 28.0, 25.0, 7.3, 7.9, 6.2]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"None"} + * \endenglish + */ + std::vector getCollisionThreshold(); + +protected: + void *d_; +}; +using RobotConfigPtr = std::shared_ptr; + +} // namespace common_interface +} // namespace arcs +#endif // AUBO_SDK_ROBOT_CONFIG_H diff --git a/third_party/AuboSdk/linux/include/aubo/robot/robot_manage.h b/third_party/AuboSdk/linux/include/aubo/robot/robot_manage.h new file mode 100644 index 00000000..cb6ded5f --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo/robot/robot_manage.h @@ -0,0 +1,1461 @@ +/** @file robot_manage.h + * @brief 机器人管理接口,如上电、启动、拖动示教模式等 + */ +#ifndef AUBO_SDK_ROBOT_CONTROL_INTERFACE_H +#define AUBO_SDK_ROBOT_CONTROL_INTERFACE_H + +#include +#include + +#include +#include + +namespace arcs { +namespace common_interface { + +class ARCS_ABI_EXPORT RobotManage +{ +public: + RobotManage(); + virtual ~RobotManage(); + + /** + * \chinese + * 发起机器人上电请求 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * poweron(self: pyaubo_sdk.RobotManage) -> int + * + * @par Lua函数原型 + * poweron() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.poweron","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++ 实例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->poweron(); + * @endcode + * + * \endchinese + * + * \english + * Initiate robot power-on request + * + * @return Returns 0 on success; error code on failure + * AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * poweron(self: pyaubo_sdk.RobotManage) -> int + * + * @par Lua function prototype + * poweron() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.poweron","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->poweron(); + * @endcode + * \endenglish + */ + int poweron(); + + /** + * \chinese + * 发起机器人启动请求 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * startup(self: pyaubo_sdk.RobotManage) -> int + * + * @par Lua函数原型 + * startup() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.startup","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->startup(); + * @endcode + * \endchinese + * + * \english + * Initiate robot startup request + * + * @return Returns 0 on success; error code on failure + * AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * startup(self: pyaubo_sdk.RobotManage) -> int + * + * @par Lua function prototype + * startup() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.startup","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->startup(); + * @endcode + * \endenglish + */ + int startup(); + + /** + * \chinese + * 发起机器人松开刹车请求 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * releaseRobotBrake(self: pyaubo_sdk.RobotManage) -> int + * + * @par Lua函数原型 + * releaseRobotBrake() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.releaseRobotBrake","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->releaseRobotBrake(); + * @endcode + * \endchinese + * + * \english + * Initiate robot brake release request + * + * @return Returns 0 on success; error code on failure + * AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * releaseRobotBrake(self: pyaubo_sdk.RobotManage) -> int + * + * @par Lua function prototype + * releaseRobotBrake() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.releaseRobotBrake","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->releaseRobotBrake(); + * @endcode + * \endenglish + */ + int releaseRobotBrake(); + + /** + * \chinese + * 发起机器人刹车请求 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * lockRobotBrake(self: pyaubo_sdk.RobotManage) -> int + * + * @par Lua函数原型 + * lockRobotBrake() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.lockRobotBrake","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->lockRobotBrake(); + * @endcode + * \endchinese + * + * \english + * Initiate robot brake lock request + * + * @return Returns 0 on success; error code on failure + * AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * lockRobotBrake(self: pyaubo_sdk.RobotManage) -> int + * + * @par Lua function prototype + * lockRobotBrake() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.lockRobotBrake","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->lockRobotBrake(); + * @endcode + * \endenglish + */ + int lockRobotBrake(); + + /** + * \chinese + * 发起机器人断电请求 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * poweroff(self: pyaubo_sdk.RobotManage) -> int + * + * @par Lua函数原型 + * poweroff() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.poweroff","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->poweroff(); + * @endcode + * \endchinese + * + * \english + * Initiate robot power-off request + * + * @return Returns 0 on success; error code on failure + * AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * poweroff(self: pyaubo_sdk.RobotManage) -> int + * + * @par Lua function prototype + * poweroff() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.poweroff","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->poweroff(); + * @endcode + * \endenglish + */ + int poweroff(); + + /** + * \chinese + * 发起机器人反向驱动请求 + * + * @param enable + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * backdrive(self: pyaubo_sdk.RobotManage, arg0: bool) -> int + * + * @par Lua函数原型 + * backdrive(enable: boolean) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.backdrive","params":[false],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->backdrive(true); + * @endcode + * \endchinese + * + * \english + * Initiate robot backdrive request + * + * @param enable + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * backdrive(self: pyaubo_sdk.RobotManage, arg0: bool) -> int + * + * @par Lua function prototype + * backdrive(enable: boolean) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.backdrive","params":[false],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->backdrive(true); + * @endcode + * \endenglish + */ + int backdrive(bool enable); + + /** + * \chinese + * 发起机器人自由驱动请求 + * 接口在软件版本 0.31.x 后已废弃,使用 handguideMode 接口替换 + * handguideMode({1,1,1,1,1}, {0,0,0,0,0,0}) + * + * @param enable + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * freedrive(self: pyaubo_sdk.RobotManage, arg0: bool) -> int + * + * @par Lua函数原型 + * freedrive(enable: boolean) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.freedrive","params":[true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->freedrive(true); + * @endcode + * \endchinese + * + * \english + * Initiate robot freedrive request + * This interface is deprecated after software version 0.31.x, use handguideMode instead: + * handguideMode({1,1,1,1,1}, {0,0,0,0,0,0}) + * + * @param enable + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * freedrive(self: pyaubo_sdk.RobotManage, arg0: bool) -> int + * + * @par Lua function prototype + * freedrive(enable: boolean) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.freedrive","params":[true],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->freedrive(true); + * @endcode + * \endenglish + */ + int freedrive(bool enable); + + /** + * \chinese + * 高阶拖动示教 + * + * @param freeAxes 可以拖动的轴 0-不能拖动 1-可以拖动 + * @param feature 如果维度为0,代表基于 TCP 坐标系拖动 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endchinese + * + * \english + * Advanced hand-guiding mode + * + * @param freeAxes Axes that can be moved: 0-cannot move, 1-can move + * @param feature If the dimension is 0, it means hand-guiding based on the TCP coordinate system + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int handguideMode(const std::vector &freeAxes, + const std::vector &feature); + + /** + * \chinese + * 退出拖动示教 + * + * @note 暂未实现 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endchinese + * + * \english + * Exit hand-guiding mode + * + * @note Not implemented yet + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int exitHandguideMode(); + + /** + * \chinese + * 获取拖动示教器的状态(是否处于奇异空间) + * + * @note 暂未实现 + * + * @return + * • 0 - 正常操作. + * • 1 - 接近奇异空间. + * • 2 - 极其接近奇异点,将产生较大的拖动阻尼. + * + * @throws arcs::common_interface::AuboException + * \endchinese + * + * \english + * Get the status of the hand-guiding device (whether it is in a singular space) + * + * @note Not implemented yet + * + * @return + * • 0 - Normal operation. + * • 1 - Approaching singular space. + * • 2 - Extremely close to a singularity, large hand-guiding damping will occur. + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int getHandguideStatus(); + + /** + * \chinese + * 获取拖动示教器触发源 + * + * @note 暂未实现 + * + * @return + * + * @throws arcs::common_interface::AuboException + * \endchinese + * + * \english + * Get the trigger source of the hand-guiding device + * + * @note Not implemented yet + * + * @return + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int getHandguideTrigger(); + + /** + * \chinese + * 获取拖动示教使能状态 + * + * @return 使能返回true; 失能返回false + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.isHandguideEnabled","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endchinese + * \english + * Get the hand-guiding enable status + * + * @return Returns true if enabled; false if disabled + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.isHandguideEnabled","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endenglish + */ + bool isHandguideEnabled(); + + /** + * \chinese + * 发起机器人进入/退出仿真模式请求 + * + * @param enable + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setSim(self: pyaubo_sdk.RobotManage, arg0: bool) -> int + * + * @par Lua函数原型 + * setSim(enable: boolean) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.setSim","params":[true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->setSim(true); + * @endcode + * \endchinese + * + * \english + * Initiate robot enter/exit simulation mode request + * + * @param enable + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setSim(self: pyaubo_sdk.RobotManage, arg0: bool) -> int + * + * @par Lua function prototype + * setSim(enable: boolean) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.setSim","params":[true],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->setSim(true); + * @endcode + * \endenglish + */ + int setSim(bool enable); + + /** + * \chinese + * 设置机器人操作模式 + * + * @param mode 操作模式 + * + * @return 成功返回0; 失败返回错误码 + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setOperationalMode(self: pyaubo_sdk.RobotManage, arg0: + * arcs::common_interface::OperationalModeType) -> int + * + * @par Lua函数原型 + * setOperationalMode(mode: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.setOperationalMode","params":["Manual"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->setOperationalMode(OperationalModeType::Automatic); + * @endcode + * \endchinese + * \english + * Set the robot operational mode + * + * @param mode Operational mode + * + * @return Returns 0 on success; error code on failure + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setOperationalMode(self: pyaubo_sdk.RobotManage, arg0: + * arcs::common_interface::OperationalModeType) -> int + * + * @par Lua function prototype + * setOperationalMode(mode: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.setOperationalMode","params":["Manual"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->setOperationalMode(OperationalModeType::Automatic); + * @endcode + * \endenglish + */ + int setOperationalMode(OperationalModeType mode); + + /** + * \chinese + * 获取机器人操作模式 + * + * @return 机器人操作模式 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getOperationalMode(self: pyaubo_sdk.RobotManage) -> arcs::common_interface::OperationalModeType + * + * @par Lua函数原型 + * getOperationalMode() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.getOperationalMode","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"Manual"} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * OperationalModeType mode = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->getOperationalMode(); + * @endcode + * \endchinese + * \english + * Get the robot operational mode + * + * @return Robot operational mode + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getOperationalMode(self: pyaubo_sdk.RobotManage) -> arcs::common_interface::OperationalModeType + * + * @par Lua function prototype + * getOperationalMode() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.getOperationalMode","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"Manual"} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * OperationalModeType mode = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->getOperationalMode(); + * @endcode + * \endenglish + */ + OperationalModeType getOperationalMode(); + + /** + * \chinese + * 获取控制模式 + * + * @return 控制模式 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getRobotControlMode(self: pyaubo_sdk.RobotManage) -> arcs::common_interface::RobotControlModeType + * + * @par Lua函数原型 + * getRobotControlMode() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.getRobotControlMode","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"Position"} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * RobotControlModeType mode = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->getRobotControlMode(); + * @endcode + * \endchinese + * \english + * Get the control mode + * + * @return Control mode + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getRobotControlMode(self: pyaubo_sdk.RobotManage) -> arcs::common_interface::RobotControlModeType + * + * @par Lua function prototype + * getRobotControlMode() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.getRobotControlMode","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"Position"} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * RobotControlModeType mode = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->getRobotControlMode(); + * @endcode + * \endenglish + */ + RobotControlModeType getRobotControlMode(); + + /** + * \chinese + * 是否使能了拖动示教模式 + * + * @return 使能返回true; 反之返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * isFreedriveEnabled(self: pyaubo_sdk.RobotManage) -> bool + * + * @par Lua函数原型 + * isFreedriveEnabled() -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.isFreedriveEnabled","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * bool isEnabled = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->isFreedriveEnabled(); + * @endcode + * \endchinese + * \english + * Whether the freedrive mode is enabled + * + * @return Returns true if enabled; otherwise returns false + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * isFreedriveEnabled(self: pyaubo_sdk.RobotManage) -> bool + * + * @par Lua function prototype + * isFreedriveEnabled() -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.isFreedriveEnabled","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * bool isEnabled = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->isFreedriveEnabled(); + * @endcode + * \endenglish + */ + bool isFreedriveEnabled(); + + /** + * \chinese + * 是否使能了反向驱动模式 + * + * @return 使能返回true; 反之返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * isBackdriveEnabled(self: pyaubo_sdk.RobotManage) -> bool + * + * @par Lua函数原型 + * isBackdriveEnabled() -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.isBackdriveEnabled","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * bool isEnabled = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->isBackdriveEnabled(); + * @endcode + * \endchinese + * \english + * Whether the backdrive mode is enabled + * + * @return Returns true if enabled; otherwise returns false + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * isBackdriveEnabled(self: pyaubo_sdk.RobotManage) -> bool + * + * @par Lua function prototype + * isBackdriveEnabled() -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.isBackdriveEnabled","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * bool isEnabled = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->isBackdriveEnabled(); + * @endcode + * \endenglish + */ + bool isBackdriveEnabled(); + + /** + * \chinese + * 是否使能了仿真模式 + * + * @return 使能返回true; 反之返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * isSimulationEnabled(self: pyaubo_sdk.RobotManage) -> bool + * + * @par Lua函数原型 + * isSimulationEnabled() -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.isSimulationEnabled","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":true} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * bool isEnabled = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->isSimulationEnabled(); + * @endcode + * \endchinese + * \english + * Whether the simulation mode is enabled + * + * @return Returns true if enabled; otherwise returns false + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * isSimulationEnabled(self: pyaubo_sdk.RobotManage) -> bool + * + * @par Lua function prototype + * isSimulationEnabled() -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.isSimulationEnabled","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":true} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * bool isEnabled = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->isSimulationEnabled(); + * @endcode + * \endenglish + */ + bool isSimulationEnabled(); + + /** + * \chinese + * 清除防护停机,包括碰撞停机 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setUnlockProtectiveStop(self: pyaubo_sdk.RobotManage) -> int + * + * @par Lua函数原型 + * setUnlockProtectiveStop() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.setUnlockProtectiveStop","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->setUnlockProtectiveStop(); + * @endcode + * \endchinese + * \english + * Clear protective stop, including collision stop + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setUnlockProtectiveStop(self: pyaubo_sdk.RobotManage) -> int + * + * @par Lua function prototype + * setUnlockProtectiveStop() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.setUnlockProtectiveStop","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->setUnlockProtectiveStop(); + * @endcode + * \endenglish + */ + int setUnlockProtectiveStop(); + + /** + * \chinese + * 重置安全接口板,一般在机器人断电之后需要重置时调用,比如机器人急停、故障等之后 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * restartInterfaceBoard(self: pyaubo_sdk.RobotManage) -> int + * + * @par Lua函数原型 + * restartInterfaceBoard() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.restartInterfaceBoard","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->restartInterfaceBoard(); + * @endcode + * \endchinese + * \english + * Reset the safety interface board, usually called after the robot is powered off and needs to be reset, such as after emergency stop or fault. + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * restartInterfaceBoard(self: pyaubo_sdk.RobotManage) -> int + * + * @par Lua function prototype + * restartInterfaceBoard() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.restartInterfaceBoard","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->restartInterfaceBoard(); + * @endcode + * \endenglish + */ + int restartInterfaceBoard(); + + /** + * \chinese + * 开始实时轨迹的记录 + * + * @param file_name + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Start real-time trajectory recording + * + * @param file_name + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int startRecord(const std::string &file_name); + + /** + * \chinese + * 停止实时记录 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.stopRecord","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Stop real-time recording + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.stopRecord","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int stopRecord(); + + /** + * \chinese + * 暂停实时记录 + * + * @param pause + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.pauseRecord","params":[true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Pause real-time recording + * + * @param pause + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.pauseRecord","params":[true],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int pauseRecord(bool pause); + + /** + * \chinese + * 发起机器人进入/退出联动模式请求, + * 只有操作模式为自动或者无时,才能使能联动模式 + * + * @param enable + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BUSY + * AUBO_REQUEST_IGNORE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setLinkModeEnable(self: pyaubo_sdk.RobotManage, arg0: bool) -> int + * + * @par Lua函数原型 + * setLinkModeEnable(enable: boolean) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.setLinkModeEnable","params":[true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->setLinkModeEnable(true); + * @endcode + * \endchinese + * \english + * Initiate robot enter/exit link mode request. + * Link mode can only be enabled when the operation mode is Automatic or None. + * + * @param enable + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_REQUEST_IGNORE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setLinkModeEnable(self: pyaubo_sdk.RobotManage, arg0: bool) -> int + * + * @par Lua function prototype + * setLinkModeEnable(enable: boolean) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.setLinkModeEnable","params":[true],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->setLinkModeEnable(true); + * @endcode + * \endenglish + */ + int setLinkModeEnable(bool enable); + + /** + * \chinese + * 是否使能了联动模式,联动模式下用户可以通过外部IO控制机器人(用户可以对IO的功能进行配置) + * + * @return 使能返回true; 反之返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * isLinkModeEnabled(self: pyaubo_sdk.RobotManage) -> bool + * + * @par Lua函数原型 + * isLinkModeEnabled() -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.isLinkModeEnabled","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * bool isEnabled = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->isLinkModeEnabled(); + * @endcode + * \endchinese + * \english + * Whether the link mode is enabled. In link mode, users can control the robot via external IO (users can configure the IO functions). + * + * @return Returns true if enabled; otherwise returns false + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * isLinkModeEnabled(self: pyaubo_sdk.RobotManage) -> bool + * + * @par Lua function prototype + * isLinkModeEnabled() -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.isLinkModeEnabled","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * bool isEnabled = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->isLinkModeEnabled(); + * @endcode + * \endenglish + */ + bool isLinkModeEnabled(); + + /** + * \chinese + * 手动触发生成诊断文件 + * + * @return 指令下发成功返回0; 失败返回错误码。 \n + * -AUBO_BAD_STATE: 运行时(RuntimeMachine)的当前状态不是Stopped, + * 固件升级请求被拒绝。AUBO_BAD_STATE的值是1。 \n + * -AUBO_TIMEOUT: 超时。AUBO_TIMEOUT的值是4。 \n + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * generateDiagnoseFile(self: pyaubo_sdk.RobotManage, arg0: str) -> int + * + * @par Lua函数原型 + * generateDiagnoseFile(reason: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.generateDiagnoseFile","params":["reason"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * bool isEnabled = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->generateDiagnoseFile("reason"); + * @endcode + * \endchinese + * \english + * Manually trigger the generation of a diagnostic file + * + * @return Returns 0 if the command is successfully issued; error code on failure. \n + * -AUBO_BAD_STATE: The current state of the RuntimeMachine is not Stopped, + * the firmware upgrade request is rejected. The value of AUBO_BAD_STATE is 1. \n + * -AUBO_TIMEOUT: Timeout. The value of AUBO_TIMEOUT is 4. \n + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * generateDiagnoseFile(self: pyaubo_sdk.RobotManage, arg0: str) -> int + * + * @par Lua function prototype + * generateDiagnoseFile(reason: string) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.generateDiagnoseFile","params":["reason"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * bool isEnabled = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->generateDiagnoseFile("reason"); + * @endcode + * \endenglish + */ + int generateDiagnoseFile(const std::string &reason); + +protected: + void *d_; +}; +using RobotManagePtr = std::shared_ptr; +} // namespace common_interface +} // namespace arcs + +#endif // AUBO_SDK_ROBOT_CONTROL_INTERFACE_H diff --git a/third_party/AuboSdk/linux/include/aubo/robot/robot_state.h b/third_party/AuboSdk/linux/include/aubo/robot/robot_state.h new file mode 100644 index 00000000..71be2e8e --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo/robot/robot_state.h @@ -0,0 +1,2485 @@ +/** @file robot_state.h + * @brief 获取机器人状态接口,如关节速度、关节角度、固件/硬件版本 + */ +#ifndef AUBO_SDK_ROBOT_STATE_INTERFACE_H +#define AUBO_SDK_ROBOT_STATE_INTERFACE_H + +#include + +#include +#include + +namespace arcs { +namespace common_interface { + +class ARCS_ABI_EXPORT RobotState +{ +public: + RobotState(); + virtual ~RobotState(); + + /** + * \chinese + * 获取机器人的模式状态 + * + * @return 机器人的模式状态 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getRobotModeType(self: pyaubo_sdk.RobotState) -> + * arcs::common_interface::RobotModeType + * + * @par Lua函数原型 + * getRobotModeType() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getRobotModeType","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"Running"} + * + *\endchinese + *\english + * Get the robot mode state + * + * @return The robot's mode state + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getRobotModeType(self: pyaubo_sdk.RobotState) -> + * arcs::common_interface::RobotModeType + * + * @par Lua function prototype + * getRobotModeType() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getRobotModeType","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"Running"} + *\endenglish + */ + + RobotModeType getRobotModeType(); + + /** + * \chinese + * 获取安全模式 + * + * @return 安全模式 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getSafetyModeType(self: pyaubo_sdk.RobotState) -> + * arcs::common_interface::SafetyModeType + * + * @par Lua函数原型 + * getSafetyModeType() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getSafetyModeType","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"Normal"} + * \endchinese + * \english + * Get the safety mode + * + * @return The safety mode + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getSafetyModeType(self: pyaubo_sdk.RobotState) -> + * arcs::common_interface::SafetyModeType + * + * @par Lua function prototype + * getSafetyModeType() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getSafetyModeType","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"Normal"} + * \endenglish + */ + SafetyModeType getSafetyModeType(); + + /** + * \chinese + * 获取机器人通电状态 + * + * @return 机器人通电返回 true; 反之返回 false + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.isPowerOn","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":true} + * \endchinese + * \english + * Get the robot power-on state + * + * @return Returns true if the robot is powered on; otherwise returns false + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.isPowerOn","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":true} + * \endenglish + */ + bool isPowerOn(); + + /** + * \chinese + * 机器人是否已经停止下来 + * + * @return 停止返回true; 反之返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * isSteady(self: pyaubo_sdk.RobotState) -> bool + * + * @par Lua函数原型 + * isSteady() -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.isSteady","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":true} + * \endchinese + * \english + * Whether the robot has stopped + * + * @return Returns true if stopped; otherwise returns false + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * isSteady(self: pyaubo_sdk.RobotState) -> bool + * + * @par Lua function prototype + * isSteady() -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.isSteady","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":true} + * \endenglish + */ + bool isSteady(); + + /** + * \chinese + * 机器人是否发生了碰撞 + * + * @return 发生碰撞返回 true; 反之返回 false + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.isCollisionOccurred","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * \endchinese + * \english + * Whether a collision has occurred + * + * @return Returns true if a collision occurred; otherwise returns false + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.isCollisionOccurred","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * \endenglish + */ + bool isCollisionOccurred(); + + /** + * \chinese + * 机器人是否已经在安全限制之内 + * + * @return 在安全限制之内返回true; 反之返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * isWithinSafetyLimits(self: pyaubo_sdk.RobotState) -> bool + * + * @par Lua函数原型 + * isWithinSafetyLimits() -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.isWithinSafetyLimits","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":true} + * \endchinese + * \english + * Whether the robot is within safety limits + * + * @return Returns true if within safety limits; otherwise returns false + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * isWithinSafetyLimits(self: pyaubo_sdk.RobotState) -> bool + * + * @par Lua function prototype + * isWithinSafetyLimits() -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.isWithinSafetyLimits","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":true} + * \endenglish + */ + bool isWithinSafetyLimits(); + + /** + * \chinese + * 获取当前的TCP位姿,其 TCP 偏移可以通过 getActualTcpOffset 获取 + * + * 位姿表示形式为(x,y,z,rx,ry,rz)。 + * 其中x、y、z是工具中心点(TCP)在基坐标系下的位置,单位是m。 + * rx、ry、rz是工具中心点(TCP)在基坐标系下的姿态,是ZYX欧拉角,单位是rad。 + * + * @return TCP的位姿,形式为(x,y,z,rx,ry,rz) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getTcpPose(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getTcpPose() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpPose","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.41777839846910425,-0.13250000000000012,0.20928451364415995,3.1415792312578987,0.0,1.5707963267948963]} + * \endchinese + * \english + * Get the current TCP pose. The TCP offset can be obtained by getActualTcpOffset. + * + * The pose is represented as (x, y, z, rx, ry, rz). + * x, y, z are the position of the Tool Center Point (TCP) in the base coordinate system, in meters. + * rx, ry, rz are the orientation of the TCP in the base coordinate system, as ZYX Euler angles in radians. + * + * @return The TCP pose, in the form (x, y, z, rx, ry, rz) + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getTcpPose(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getTcpPose() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpPose","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.41777839846910425,-0.13250000000000012,0.20928451364415995,3.1415792312578987,0.0,1.5707963267948963]} + * \endenglish + */ + std::vector getTcpPose(); + + /** + * \chinese + * 获取当前的 TCP 偏移,也就是 getTcpPose 返回的 pose 用到的 TCP 偏移 + * + * @return 当前的 TCP 偏移 + * \endchinese + * \english + * Get the current TCP offset, which is the TCP offset used by the pose returned from getTcpPose + * + * @return The current TCP offset + * \endenglish + */ + std::vector getActualTcpOffset(); + + /** + * \chinese + * 获取下一个目标路点 + * 注意与 getTcpTargetPose 的区别,此处定义存在歧义,命名需要优化 + * + * 位姿表示形式为(x,y,z,rx,ry,rz)。 + * 其中x、y、z是工具中心点(TCP)在基坐标系下的目标位置,单位是m。 + * rx、ry、rz是工具中心点(TCP)在基坐标系下的目标姿态,是ZYX欧拉角,单位是rad。 + * + * @return 当前目标位姿,形式为(x,y,z,rx,ry,rz) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getTargetTcpPose(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getTargetTcpPose() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTargetTcpPose","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.4173932217619493,-0.13250000000000012,0.43296496133045825,3.141577313781914,0.0,1.5707963267948963]} + * \endchinese + * \english + * Get the next target waypoint. + * Note the difference from getTcpTargetPose; the definition here is ambiguous and the naming needs improvement. + * + * The pose is represented as (x, y, z, rx, ry, rz). + * x, y, z are the target position of the Tool Center Point (TCP) in the base coordinate system, in meters. + * rx, ry, rz are the target orientation of the TCP in the base coordinate system, as ZYX Euler angles in radians. + * + * @return The current target pose, in the form (x, y, z, rx, ry, rz) + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getTargetTcpPose(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getTargetTcpPose() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTargetTcpPose","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.4173932217619493,-0.13250000000000012,0.43296496133045825,3.141577313781914,0.0,1.5707963267948963]} + * \endenglish + */ + std::vector getTargetTcpPose(); + + /** + * \chinese + * 获取工具端的位姿(不带TCP偏移) + * + * 位姿表示形式为(x,y,z,rx,ry,rz)。 + * 其中x、y、z是法兰盘中心在基坐标系下的目标位置,单位是m。 + * rx、ry、rz是法兰盘中心在基坐标系下的目标姿态,是ZYX欧拉角,单位是rad。 + * + * @return 工具端的位姿,形式为(x,y,z,rx,ry,rz) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolPose(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getToolPose() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getToolPose","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.41777820858878617,-0.13250000000000012,0.20928410288421018,3.141579231257899,0.0,1.5707963267948963]} + * \endchinese + * \english + * Get the tool pose (without TCP offset) + * + * The pose is represented as (x, y, z, rx, ry, rz). + * x, y, z are the target position of the flange center in the base coordinate system, in meters. + * rx, ry, rz are the target orientation of the flange center in the base coordinate system, as ZYX Euler angles in radians. + * + * @return The tool pose, in the form (x, y, z, rx, ry, rz) + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolPose(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getToolPose() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getToolPose","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.41777820858878617,-0.13250000000000012,0.20928410288421018,3.141579231257899,0.0,1.5707963267948963]} + * \endenglish + */ + std::vector getToolPose(); + + /** + * \chinese + * 获取TCP速度 + * + * @return TCP速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getTcpSpeed(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getTcpSpeed() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpSpeed","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the TCP speed + * + * @return TCP speed + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getTcpSpeed(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getTcpSpeed() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpSpeed","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getTcpSpeed(); + + /** + * \chinese + * 获取TCP的力/力矩 + * + * @return TCP的力/力矩 + * + * @par Python函数原型 + * getTcpForce(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getTcpForce() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpForce","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the TCP force/torque + * + * @return TCP force/torque + * + * @par Python function prototype + * getTcpForce(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getTcpForce() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpForce","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getTcpForce(); + + /** + * \chinese + * 获取肘部的位置 + * + * @return 肘部的位置 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getElbowPosistion(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getElbowPosistion() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getElbowPosistion","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.07355755887512408,-0.1325,0.43200874126125227,-1.5707963267948968,0.433006344376404,0.0]} + * \endchinese + * \english + * Get the position of the elbow + * + * @return The position of the elbow + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getElbowPosistion(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getElbowPosistion() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getElbowPosistion","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.07355755887512408,-0.1325,0.43200874126125227,-1.5707963267948968,0.433006344376404,0.0]} + * \endenglish + */ + std::vector getElbowPosistion(); + + /** + * \chinese + * 获取肘部速度 + * + * @return 肘部速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getElbowVelocity(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getElbowVelocity() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getElbowVelocity","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the elbow velocity + * + * @return Elbow velocity + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getElbowVelocity(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getElbowVelocity() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getElbowVelocity","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getElbowVelocity(); + + /** + * \chinese + * 获取基座力/力矩 + * + * @return 基座力/力矩 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getBaseForce(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getBaseForce() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getBaseForce","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the base force/torque + * + * @return Base force/torque + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getBaseForce(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getBaseForce() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getBaseForce","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getBaseForce(); + + /** + * \chinese + * 获取上一次发送的TCP目标位姿 + * + * @return TCP目标位姿 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getTcpTargetPose(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getTcpTargetPose() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpTargetPose","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.41777829240862013,-0.13250000000000012,0.2092832117232601,3.1415812372223217,0.0,1.5707963267948963]} + * \endchinese + * \english + * Get the last sent TCP target pose + * + * @return TCP target pose + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getTcpTargetPose(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getTcpTargetPose() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpTargetPose","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.41777829240862013,-0.13250000000000012,0.2092832117232601,3.1415812372223217,0.0,1.5707963267948963]} + * \endenglish + */ + std::vector getTcpTargetPose(); + + /** + * \chinese + * 获取TCP目标速度 + * + * @return TCP目标速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getTcpTargetSpeed(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getTcpTargetSpeed() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpTargetSpeed","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the TCP target speed + * + * @return TCP target speed + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getTcpTargetSpeed(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getTcpTargetSpeed() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpTargetSpeed","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getTcpTargetSpeed(); + + /** + * \chinese + * 获取TCP目标力/力矩 + * + * @return TCP目标力/力矩 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getTcpTargetForce(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getTcpTargetForce() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpTargetForce","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the TCP target force/torque + * + * @return TCP target force/torque + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getTcpTargetForce(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getTcpTargetForce() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpTargetForce","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getTcpTargetForce(); + + /** + * \chinese + * 获取机械臂关节标志 + * + * @return 机械臂关节标志 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointState(self: pyaubo_sdk.RobotState) -> + * List[arcs::common_interface::JointStateType] + * + * @par Lua函数原型 + * getJointState() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointState","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":["Running","Running","Running","Running","Running","Running"]} + * \endchinese + * \english + * Get the joint state of the manipulator + * + * @return Joint state of the manipulator + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointState(self: pyaubo_sdk.RobotState) -> + * List[arcs::common_interface::JointStateType] + * + * @par Lua function prototype + * getJointState() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointState","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":["Running","Running","Running","Running","Running","Running"]} + * \endenglish + */ + std::vector getJointState(); + + /** + * \chinese + * 获取关节的伺服状态 + * + * @return 关节的伺服状态 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointServoMode(self: pyaubo_sdk.RobotState) -> + * List[arcs::common_interface::JointServoModeType] + * + * @par Lua函数原型 + * getJointServoMode() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointServoMode","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":["Position","Position","Position","Position","Position","Position"]} + * \endchinese + * \english + * Get the servo state of the joints + * + * @return The servo state of the joints + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointServoMode(self: pyaubo_sdk.RobotState) -> + * List[arcs::common_interface::JointServoModeType] + * + * @par Lua function prototype + * getJointServoMode() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointServoMode","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":["Position","Position","Position","Position","Position","Position"]} + * \endenglish + */ + std::vector getJointServoMode(); + + /** + * \chinese + * 获取机械臂关节角度 + * + * @return 机械臂关节角度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointPositions(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getJointPositions() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointPositions","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,-0.26199241371495835,1.7418102574563423,0.4330197667082982,1.5707963267948966,0.0]} + * \endchinese + * \english + * Get the joint positions of the manipulator + * + * @return Joint positions of the manipulator + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointPositions(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getJointPositions() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointPositions","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,-0.26199241371495835,1.7418102574563423,0.4330197667082982,1.5707963267948966,0.0]} + * \endenglish + */ + std::vector getJointPositions(); + + /** + * \chinese + * 获取机械臂历史关节角度 + * + * @param steps 步数 + * @return 机械臂历史关节角度 + * \endchinese + * \english + * Get the historical joint positions of the manipulator + * + * @param steps Number of steps + * @return Historical joint positions of the manipulator + * \endenglish + */ + std::vector getJointPositionsHistory(int steps); + + /** + * \chinese + * 获取机械臂关节速度 + * + * @return 机械臂关节速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointSpeeds(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getJointSpeeds() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointSpeeds","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the joint speeds of the manipulator + * + * @return Joint speeds of the manipulator + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointSpeeds(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getJointSpeeds() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointSpeeds","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getJointSpeeds(); + + /** + * \chinese + * 获取机械臂关节加速度 + * + * @return 机械臂关节加速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointAccelerations(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getJointAccelerations() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointAccelerations","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the joint accelerations of the manipulator + * + * @return Joint accelerations of the manipulator + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointAccelerations(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getJointAccelerations() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointAccelerations","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getJointAccelerations(); + + /** + * \chinese + * 获取机械臂关节力矩 + * + * @return 机械臂关节力矩 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointTorqueSensors(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getJointTorqueSensors() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointTorqueSensors","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,6275.367736816406,-7704.2816162109375,3586.9766235351563,503.0364990234375,1506.0882568359375]} + * \endchinese + * \english + * Get the joint torques of the manipulator + * + * @return Joint torques of the manipulator + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointTorqueSensors(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getJointTorqueSensors() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointTorqueSensors","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,6275.367736816406,-7704.2816162109375,3586.9766235351563,503.0364990234375,1506.0882568359375]} + * \endenglish + */ + std::vector getJointTorqueSensors(); + + /** + * \chinese + * 获取机械臂关节接触力矩(外力距) + * + * @return 机械臂关节接触力矩 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointContactTorques(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getJointContactTorques() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointContactTorques","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the joint contact torques (external torques) of the manipulator + * + * @return Joint contact torques of the manipulator + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointContactTorques(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getJointContactTorques() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointContactTorques","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getJointContactTorques(); + + /** + * \chinese + * 获取底座力传感器读数 + * + * @return 底座力传感器读数 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getBaseForceSensor(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getBaseForceSensor() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getBaseForceSensor","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the base force sensor readings + * + * @return Base force sensor readings + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getBaseForceSensor(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getBaseForceSensor() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getBaseForceSensor","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getBaseForceSensor(); + + /** + * \chinese + * 获取TCP力传感器读数 + * + * @return TCP力传感器读数 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getTcpForceSensors(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getTcpForceSensors() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpForceSensors","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the TCP force sensor readings + * + * @return TCP force sensor readings + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getTcpForceSensors(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getTcpForceSensors() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpForceSensors","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getTcpForceSensors(); + + /** + * \chinese + * 获取机械臂关节电流 + * + * @return 机械臂关节电流 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointCurrents(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getJointCurrents() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointCurrents","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,1.25885009765625,-1.5289306640625,0.71868896484375,0.1007080078125,0.3021240234375]} + * \endchinese + * \english + * Get the joint currents of the manipulator + * + * @return Joint currents of the manipulator + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointCurrents(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getJointCurrents() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointCurrents","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,1.25885009765625,-1.5289306640625,0.71868896484375,0.1007080078125,0.3021240234375]} + * \endenglish + */ + std::vector getJointCurrents(); + + /** + * \chinese + * 获取机械臂关节电压 + * + * @return 机械臂关节电压 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointVoltages(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getJointVoltages() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointVoltages","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[2.0,2.5,3.0,2.0,2.5,2.0]} + * \endchinese + * \english + * Get the joint voltages of the manipulator + * + * @return Joint voltages of the manipulator + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointVoltages(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getJointVoltages() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointVoltages","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[2.0,2.5,3.0,2.0,2.5,2.0]} + * \endenglish + */ + std::vector getJointVoltages(); + + /** + * \chinese + * 获取机械臂关节温度 + * + * @return 机械臂关节温度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointTemperatures(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getJointTemperatures() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointTemperatures","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[38.0,38.0,38.0,39.0,38.0,39.0]} + * \endchinese + * \english + * Get the joint temperatures of the manipulator + * + * @return Joint temperatures of the manipulator + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointTemperatures(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getJointTemperatures() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointTemperatures","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[38.0,38.0,38.0,39.0,38.0,39.0]} + * \endenglish + */ + std::vector getJointTemperatures(); + + /** + * \chinese + * 获取关节全球唯一ID + * + * @return 关节全球唯一ID + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointUniqueIds(self: pyaubo_sdk.RobotState) -> List[str] + * + * @par Lua函数原型 + * getJointUniqueIds() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointUniqueIds","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":["00800020ffffffff31405153","00800020ffffffff3e3f5153","00800020ffffffff414b5153","00800020ffffffff31065153","00800020ffffffff41535153","00800020ffffffff41545153"]} + * \endchinese + * \english + * Get the globally unique IDs of the joints + * + * @return Globally unique IDs of the joints + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointUniqueIds(self: pyaubo_sdk.RobotState) -> List[str] + * + * @par Lua function prototype + * getJointUniqueIds() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointUniqueIds","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":["00800020ffffffff31405153","00800020ffffffff3e3f5153","00800020ffffffff414b5153","00800020ffffffff31065153","00800020ffffffff41535153","00800020ffffffff41545153"]} + * \endenglish + */ + std::vector getJointUniqueIds(); + + /** + * \chinese + * 获取关节固件版本 + * + * @return 关节固件版本 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointFirmwareVersions(self: pyaubo_sdk.RobotState) -> List[int] + * + * @par Lua函数原型 + * getJointFirmwareVersions() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointFirmwareVersions","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[1000010,1000010,1000010,1000010,1000010,1000010]} + * \endchinese + * \english + * Get the joint firmware versions + * + * @return Joint firmware versions + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointFirmwareVersions(self: pyaubo_sdk.RobotState) -> List[int] + * + * @par Lua function prototype + * getJointFirmwareVersions() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointFirmwareVersions","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[1000010,1000010,1000010,1000010,1000010,1000010]} + * \endenglish + */ + std::vector getJointFirmwareVersions(); + + /** + * \chinese + * 获取关节硬件版本 + * + * @return 关节硬件版本 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointHardwareVersions(self: pyaubo_sdk.RobotState) -> List[int] + * + * @par Lua函数原型 + * getJointHardwareVersions() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointHardwareVersions","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[1000000,1000000,1004000,1004000,1004000,1004000]} + * \endchinese + * \english + * Get the joint hardware versions + * + * @return Joint hardware versions + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointHardwareVersions(self: pyaubo_sdk.RobotState) -> List[int] + * + * @par Lua function prototype + * getJointHardwareVersions() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointHardwareVersions","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[1000000,1000000,1004000,1004000,1004000,1004000]} + * \endenglish + */ + std::vector getJointHardwareVersions(); + + /** + * \chinese + * 获取MasterBoard全球唯一ID + * + * @return MasterBoard全球唯一ID + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getMasterBoardUniqueId(self: pyaubo_sdk.RobotState) -> str + * + * @par Lua函数原型 + * getMasterBoardUniqueId() -> string + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getMasterBoardUniqueId","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"001e0044510f343037323637"} + * \endchinese + * \english + * Get the globally unique ID of the MasterBoard + * + * @return Globally unique ID of the MasterBoard + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getMasterBoardUniqueId(self: pyaubo_sdk.RobotState) -> str + * + * @par Lua function prototype + * getMasterBoardUniqueId() -> string + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getMasterBoardUniqueId","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"001e0044510f343037323637"} + * \endenglish + */ + std::string getMasterBoardUniqueId(); + + /** + * \chinese + * 获取MasterBoard固件版本 + * + * @return MasterBoard固件版本 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getMasterBoardFirmwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua函数原型 + * getMasterBoardFirmwareVersion() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getMasterBoardFirmwareVersion","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1000004} + * \endchinese + * \english + * Get the MasterBoard firmware version + * + * @return MasterBoard firmware version + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getMasterBoardFirmwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua function prototype + * getMasterBoardFirmwareVersion() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getMasterBoardFirmwareVersion","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1000004} + * \endenglish + */ + int getMasterBoardFirmwareVersion(); + /** + * \chinese + * 获取MasterBoard硬件版本 + * + * @return MasterBoard硬件版本 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getMasterBoardHardwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua函数原型 + * getMasterBoardHardwareVersion() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getMasterBoardHardwareVersion","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1000000} + * \endchinese + * \english + * Get the MasterBoard hardware version + * + * @return MasterBoard hardware version + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getMasterBoardHardwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua function prototype + * getMasterBoardHardwareVersion() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getMasterBoardHardwareVersion","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1000000} + * \endenglish + */ + int getMasterBoardHardwareVersion(); + + /** + * \chinese + * 获取SlaveBoard全球唯一ID + * + * @return SlaveBoard全球唯一ID + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getSlaveBoardUniqueId(self: pyaubo_sdk.RobotState) -> str + * + * @par Lua函数原型 + * getSlaveBoardUniqueId() -> string + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getSlaveBoardUniqueId","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"736572630080000000000000"} + * \endchinese + * \english + * Get the globally unique ID of the SlaveBoard + * + * @return Globally unique ID of the SlaveBoard + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getSlaveBoardUniqueId(self: pyaubo_sdk.RobotState) -> str + * + * @par Lua function prototype + * getSlaveBoardUniqueId() -> string + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getSlaveBoardUniqueId","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"736572630080000000000000"} + * \endenglish + */ + std::string getSlaveBoardUniqueId(); + + /** + * \chinese + * 获取SlaveBoard固件版本 + * + * @return SlaveBoard固件版本 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getSlaveBoardFirmwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua函数原型 + * getSlaveBoardFirmwareVersion() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getSlaveBoardFirmwareVersion","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Get the SlaveBoard firmware version + * + * @return SlaveBoard firmware version + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getSlaveBoardFirmwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua function prototype + * getSlaveBoardFirmwareVersion() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getSlaveBoardFirmwareVersion","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int getSlaveBoardFirmwareVersion(); + + /** + * \chinese + * 获取SlaveBoard硬件版本 + * + * @return SlaveBoard硬件版本 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getSlaveBoardHardwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua函数原型 + * getSlaveBoardHardwareVersion() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getSlaveBoardHardwareVersion","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":6030098} + * \endchinese + * \english + * Get the SlaveBoard hardware version + * + * @return SlaveBoard hardware version + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getSlaveBoardHardwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua function prototype + * getSlaveBoardHardwareVersion() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getSlaveBoardHardwareVersion","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":6030098} + * \endenglish + */ + int getSlaveBoardHardwareVersion(); + + /** + * \chinese + * 获取工具端全球唯一ID + * + * @return 工具端全球唯一ID + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolUniqueId(self: pyaubo_sdk.RobotState) -> str + * + * @par Lua函数原型 + * getToolUniqueId() -> string + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getToolUniqueId","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"397d4e5331541252314d3042"} + * \endchinese + * \english + * Get the globally unique ID of the tool + * + * @return Globally unique ID of the tool + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolUniqueId(self: pyaubo_sdk.RobotState) -> str + * + * @par Lua function prototype + * getToolUniqueId() -> string + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getToolUniqueId","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"397d4e5331541252314d3042"} + * \endenglish + */ + std::string getToolUniqueId(); + + /** + * \chinese + * 获取工具端固件版本 + * + * @return 工具端固件版本 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolFirmwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua函数原型 + * getToolFirmwareVersion() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getToolFirmwareVersion","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1001003} + * \endchinese + * \english + * Get the tool firmware version + * + * @return Tool firmware version + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolFirmwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua function prototype + * getToolFirmwareVersion() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getToolFirmwareVersion","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1001003} + * \endenglish + */ + int getToolFirmwareVersion(); + + /** + * \chinese + * 获取工具端硬件版本 + * + * @return 工具端硬件版本 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolHardwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua函数原型 + * getToolHardwareVersion() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getToolHardwareVersion","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1000000} + * \endchinese + * \english + * Get the tool hardware version + * + * @return Tool hardware version + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolHardwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua function prototype + * getToolHardwareVersion() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getToolHardwareVersion","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1000000} + * \endenglish + */ + int getToolHardwareVersion(); + + /** + * \chinese + * 获取末端通信模式 + * + * @return 末端通信模式 + * 0: 表示无串口 + * 1: 表示只有串口 + * 2: 表示带力传感器和串口 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolCommMode(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua函数原型 + * getToolCommMode() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getToolCommMode","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1} + * \endchinese + * \english + * Get the tool communication mode + * + * @return Tool communication mode + * 0: No serial port + * 1: Serial port only + * 2: With force sensor and serial port + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolCommMode(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua function prototype + * getToolCommMode() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getToolCommMode","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1} + * \endenglish + */ + int getToolCommMode(); + + /** + * \chinese + * 获取底座全球唯一ID + * + * @return 底座全球唯一ID + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getPedestalUniqueId(self: pyaubo_sdk.RobotState) -> str + * + * @par Lua函数原型 + * getPedestalUniqueId() -> string + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getPedestalUniqueId","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"205257533543065248544339"} + * \endchinese + * \english + * Get the globally unique ID of the pedestal + * + * @return Globally unique ID of the pedestal + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getPedestalUniqueId(self: pyaubo_sdk.RobotState) -> str + * + * @par Lua function prototype + * getPedestalUniqueId() -> string + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getPedestalUniqueId","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"205257533543065248544339"} + * \endenglish + */ + std::string getPedestalUniqueId(); + + /** + * \chinese + * 获取底座固件版本 + * + * @return 底座固件版本 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getPedestalFirmwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua函数原型 + * getPedestalFirmwareVersion() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getPedestalFirmwareVersion","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1000004} + * \endchinese + * \english + * Get the pedestal firmware version + * + * @return Pedestal firmware version + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getPedestalFirmwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua function prototype + * getPedestalFirmwareVersion() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getPedestalFirmwareVersion","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1000004} + * \endenglish + */ + int getPedestalFirmwareVersion(); + + /** + * \chinese + * 获取底座硬件版本 + * + * @return 底座硬件版本 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getPedestalHardwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua函数原型 + * getPedestalHardwareVersion() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getPedestalHardwareVersion","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1007000} + * \endchinese + * \english + * Get the pedestal hardware version + * + * @return Pedestal hardware version + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getPedestalHardwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua function prototype + * getPedestalHardwareVersion() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getPedestalHardwareVersion","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1007000} + * \endenglish + */ + int getPedestalHardwareVersion(); + + /** + * \chinese + * 获取机械臂关节目标位置角度 + * + * @return 机械臂关节目标位置角度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointTargetPositions(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getJointTargetPositions() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointTargetPositions","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,-0.2619944355631239,1.7418124015308052,0.4330219266665035,1.5707963267948966,0.0]} + * \endchinese + * \english + * Get the target joint positions (angles) of the manipulator + * + * @return Target joint positions (angles) of the manipulator + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointTargetPositions(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getJointTargetPositions() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointTargetPositions","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,-0.2619944355631239,1.7418124015308052,0.4330219266665035,1.5707963267948966,0.0]} + * \endenglish + */ + std::vector getJointTargetPositions(); + + /** + * \chinese + * 获取机械臂关节目标速度 + * + * @return 机械臂关节目标速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointTargetSpeeds(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getJointTargetSpeeds() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointTargetSpeeds","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.00024227101509399773,0.0016521760307419697,0.0026521060731088397,0.0,0.0]} + * \endchinese + * \english + * Get the target joint speeds of the manipulator + * + * @return Target joint speeds of the manipulator + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointTargetSpeeds(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getJointTargetSpeeds() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointTargetSpeeds","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.00024227101509399773,0.0016521760307419697,0.0026521060731088397,0.0,0.0]} + * \endenglish + */ + std::vector getJointTargetSpeeds(); + + /** + * \chinese + * 获取机械臂关节目标加速度 + * + * @return 机械臂关节目标加速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointTargetAccelerations(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getJointTargetAccelerations() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointTargetAccelerations","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,-0.6737932929246071,-12.610253240108449,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the target joint accelerations of the manipulator + * + * @return Target joint accelerations of the manipulator + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointTargetAccelerations(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getJointTargetAccelerations() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointTargetAccelerations","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,-0.6737932929246071,-12.610253240108449,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getJointTargetAccelerations(); + + /** + * \chinese + * 获取机械臂关节目标力矩 + * + * @return 机械臂关节目标力矩 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointTargetTorques(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getJointTargetTorques() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointTargetTorques","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the target joint torques of the manipulator + * + * @return Target joint torques of the manipulator + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointTargetTorques(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getJointTargetTorques() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointTargetTorques","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getJointTargetTorques(); + + /** + * \chinese + * 获取机械臂关节目标电流 + * + * @return 机械臂关节目标电流 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointTargetCurrents(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getJointTargetCurrents() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointTargetCurrents","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the target joint currents of the manipulator + * + * @return Target joint currents of the manipulator + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointTargetCurrents(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getJointTargetCurrents() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointTargetCurrents","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getJointTargetCurrents(); + + /** + * \chinese + * 获取控制柜温度 + * + * @return 控制柜温度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getControlBoxTemperature(self: pyaubo_sdk.RobotState) -> float + * + * @par Lua函数原型 + * getControlBoxTemperature() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getControlBoxTemperature","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":25.0} + * \endchinese + * \english + * Get the control box temperature + * + * @return Control box temperature + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getControlBoxTemperature(self: pyaubo_sdk.RobotState) -> float + * + * @par Lua function prototype + * getControlBoxTemperature() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getControlBoxTemperature","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":25.0} + * \endenglish + */ + double getControlBoxTemperature(); + + /** + * \chinese + * 获取控制柜湿度 + * + * @return 控制柜湿度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getControlBoxHumidity(self: pyaubo_sdk.RobotState) -> float + * + * @par Lua函数原型 + * getControlBoxHumidity() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getControlBoxHumidity","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":20.0} + * \endchinese + * \english + * Get the control box humidity + * + * @return Control box humidity + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getControlBoxHumidity(self: pyaubo_sdk.RobotState) -> float + * + * @par Lua function prototype + * getControlBoxHumidity() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getControlBoxHumidity","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":20.0} + * \endenglish + */ + double getControlBoxHumidity(); + + /** + * \chinese + * 获取母线电压 + * + * @return 母线电压 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getMainVoltage(self: pyaubo_sdk.RobotState) -> float + * + * @par Lua函数原型 + * getMainVoltage() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getMainVoltage","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":52.75} + * \endchinese + * \english + * Get the main bus voltage + * + * @return Main bus voltage + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getMainVoltage(self: pyaubo_sdk.RobotState) -> float + * + * @par Lua function prototype + * getMainVoltage() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getMainVoltage","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":52.75} + * \endenglish + */ + double getMainVoltage(); + + /** + * \chinese + * 获取母线电流 + * + * @return 母线电流 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getMainCurrent(self: pyaubo_sdk.RobotState) -> float + * + * @par Lua函数原型 + * getMainCurrent() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getMainCurrent","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.3204345703125} + * \endchinese + * \english + * Get the main bus current + * + * @return Main bus current + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getMainCurrent(self: pyaubo_sdk.RobotState) -> float + * + * @par Lua function prototype + * getMainCurrent() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getMainCurrent","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.3204345703125} + * \endenglish + */ + double getMainCurrent(); + + /** + * \chinese + * 获取机器人电压 + * + * @return 机器人电压 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getRobotVoltage(self: pyaubo_sdk.RobotState) -> float + * + * @par Lua函数原型 + * getRobotVoltage() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getRobotVoltage","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":52.75} + * \endchinese + * \english + * Get the robot voltage + * + * @return Robot voltage + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getRobotVoltage(self: pyaubo_sdk.RobotState) -> float + * + * @par Lua function prototype + * getRobotVoltage() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getRobotVoltage","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":52.75} + * \endenglish + */ + double getRobotVoltage(); + + /** + * \chinese + * 获取机器人电流 + * + * @return 机器人电流 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getRobotCurrent(self: pyaubo_sdk.RobotState) -> float + * + * @par Lua函数原型 + * getRobotCurrent() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getRobotCurrent","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.3204345703125} + * \endchinese + * \english + * Get the robot current + * + * @return Robot current + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getRobotCurrent(self: pyaubo_sdk.RobotState) -> float + * + * @par Lua function prototype + * getRobotCurrent() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getRobotCurrent","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.3204345703125} + * \endenglish + */ + double getRobotCurrent(); + + /** + * \chinese + * 获取机器人缓速等级 + * + * @return 机器人缓速等级 + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getSlowDownLevel","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Get the robot slow down level + * + * @return Robot slow down level + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getSlowDownLevel","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int getSlowDownLevel(); + + /** + * \chinese + * 获取末端力传感器通信状态 + * + * @param name 力传感器名称,与 selectTcpForceSensor 的参数一致 + * @return 通信正常返回 true; 反之返回 false + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpForceSensorStatus","params":["tool.KWR75A"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Get the communication status of the tool force sensor + * + * @param name force sensor name, it is consistent with the parameters of + * 'selectTcpForceSensor' + * @return Returns true if communication is normal; otherwise returns false + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getSlowDownLevel","params":["tool.KWR75A"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + bool getTcpForceSensorStatus(const std::string &name); + +protected: + void *d_; +}; +using RobotStatePtr = std::shared_ptr; +} // namespace common_interface +} // namespace arcs +#endif // AUBO_SDK_ROBOT_STATE_INTERFACE_H diff --git a/third_party/AuboSdk/linux/include/aubo/robot_interface.h b/third_party/AuboSdk/linux/include/aubo/robot_interface.h new file mode 100644 index 00000000..445d7132 --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo/robot_interface.h @@ -0,0 +1,373 @@ +/** @file robot_interface.h + * @brief 机器人API 接口 + */ +#ifndef AUBO_SDK_ROBOT_INTERFACE_H +#define AUBO_SDK_ROBOT_INTERFACE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace arcs { +namespace common_interface { + +class ARCS_ABI_EXPORT RobotInterface +{ +public: + RobotInterface(); + virtual ~RobotInterface(); + /** + * \chinese + * 获取RobotConfig接口 + * + * @return RobotConfigPtr对象的指针 + * + * @par Python函数原型 + * getRobotConfig(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::RobotConfig + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * RobotConfigPtr ptr = + * rpc_cli->getRobotInterface(robot_name)->getRobotConfig(); + * @endcode + * \endchinese + * \english + * Get RobotConfig interface + * + * @return Pointer to RobotConfig object + * + * @par Python function prototype + * getRobotConfig(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::RobotConfig + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * RobotConfigPtr ptr = + * rpc_cli->getRobotInterface(robot_name)->getRobotConfig(); + * @endcode + * \endenglish + */ + + RobotConfigPtr getRobotConfig(); + + /** + * \chinese + * 获取运动规划接口 + * + * @return MotionControlPtr对象的指针 + * + * @par Python函数原型 + * getMotionControl(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::MotionControl + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * MotionControlPtr ptr = + * rpc_cli->getRobotInterface(robot_name)->getMotionControl(); + * @endcode + * \endchinese + * \english + * Get motion planning interface + * + * @return Pointer to MotionControl object + * + * @par Python function prototype + * getMotionControl(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::MotionControl + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * MotionControlPtr ptr = + * rpc_cli->getRobotInterface(robot_name)->getMotionControl(); + * @endcode + * \endenglish + */ + MotionControlPtr getMotionControl(); + + /** + * \chinese + * 获取力控接口 + * + * @return ForceControlPtr对象的指针 + * + * @par Python函数原型 + * getForceControl(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::ForceControl + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * ForceControlPtr ptr = + * rpc_cli->getRobotInterface(robot_name)->getForceControl(); + * @endcode + * \endchinese + * \english + * Get force control interface + * + * @return Pointer to ForceControl object + * + * @par Python function prototype + * getForceControl(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::ForceControl + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * ForceControlPtr ptr = + * rpc_cli->getRobotInterface(robot_name)->getForceControl(); + * @endcode + * \endenglish + */ + ForceControlPtr getForceControl(); + + /** + * \chinese + * 获取IO控制的接口 + * + * @return IoControlPtr对象的指针 + * + * @par Python函数原型 + * getIoControl(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::IoControl + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * IoControlPtr ptr = + * rpc_cli->getRobotInterface(robot_name)->getIoControl(); + * @endcode + * \endchinese + * \english + * Get IO control interface + * + * @return Pointer to IoControl object + * + * @par Python function prototype + * getIoControl(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::IoControl + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * IoControlPtr ptr = + * rpc_cli->getRobotInterface(robot_name)->getIoControl(); + * @endcode + * \endenglish + */ + IoControlPtr getIoControl(); + + /** + * \chinese + * 获取同步运动接口 + * + * @return SyncMovePtr对象的指针 + * + * @par Python函数原型 + * getSyncMove(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::SyncMove + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * SyncMovePtr ptr = rpc_cli->getRobotInterface(robot_name)->getSyncMove(); + * @endcode + * \endchinese + * \english + * Get synchronized motion interface + * + * @return Pointer to SyncMove object + * + * @par Python function prototype + * getSyncMove(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::SyncMove + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * SyncMovePtr ptr = rpc_cli->getRobotInterface(robot_name)->getSyncMove(); + * @endcode + * \endenglish + */ + SyncMovePtr getSyncMove(); + + /** + * \chinese + * 获取机器人实用算法接口 + * + * @return RobotAlgorithmPtr对象的指针 + * + * @par Python函数原型 + * getRobotAlgorithm(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::RobotAlgorithm + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * RobotAlgorithmPtr ptr = + * rpc_cli->getRobotInterface(robot_name)->getRobotAlgorithm(); + * @endcode + * \endchinese + * \english + * Get robot utility algorithm interface + * + * @return Pointer to RobotAlgorithm object + * + * @par Python function prototype + * getRobotAlgorithm(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::RobotAlgorithm + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * RobotAlgorithmPtr ptr = + * rpc_cli->getRobotInterface(robot_name)->getRobotAlgorithm(); + * @endcode + * \endenglish + */ + RobotAlgorithmPtr getRobotAlgorithm(); + + /** + * \chinese + * 获取机器人管理接口(上电、启动、停止等) + * + * @return RobotManagePtr对象的指针 + * + * @par Python函数原型 + * getRobotManage(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::RobotManage + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * RobotManagePtr ptr = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage(); + * @endcode + * \endchinese + * \english + * Get robot management interface (power on, start, stop, etc.) + * + * @return Pointer to RobotManage object + * + * @par Python function prototype + * getRobotManage(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::RobotManage + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * RobotManagePtr ptr = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage(); + * @endcode + * \endenglish + */ + RobotManagePtr getRobotManage(); + + /** + * \chinese + * 获取机器人状态接口 + * + * @return RobotStatePtr对象的指针 + * + * @par Python函数原型 + * getRobotState(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::RobotState + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * RobotStatePtr ptr = + * rpc_cli->getRobotInterface(robot_name)->getRobotState(); + * @endcode + * \endchinese + * \english + * Get robot state interface + * + * @return Pointer to RobotState object + * + * @par Python function prototype + * getRobotState(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::RobotState + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * RobotStatePtr ptr = + * rpc_cli->getRobotInterface(robot_name)->getRobotState(); + * @endcode + * \endenglish + */ + RobotStatePtr getRobotState(); + + /** + * \chinese + * 获取告警信息接口 + * + * @return TracePtr对象的指针 + * + * @par Python函数原型 + * getTrace(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::Trace + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * TracePtr ptr = rpc_cli->getRobotInterface(robot_name)->getTrace(); + * @endcode + * \endchinese + * \english + * Get alarm information interface + * + * @return Pointer to Trace object + * + * @par Python function prototype + * getTrace(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::Trace + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * TracePtr ptr = rpc_cli->getRobotInterface(robot_name)->getTrace(); + * @endcode + * \endenglish + */ + TracePtr getTrace(); + +protected: + void *d_; +}; +using RobotInterfacePtr = std::shared_ptr; + +} // namespace common_interface +} // namespace arcs + +#endif // AUBO_SDK_ROBOT_INTERFACE_H diff --git a/third_party/AuboSdk/linux/include/aubo/runtime_machine.h b/third_party/AuboSdk/linux/include/aubo/runtime_machine.h new file mode 100644 index 00000000..ec3b3aaf --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo/runtime_machine.h @@ -0,0 +1,1492 @@ +/** @file runtime_machine.h + * @brief Script interpreter runtime interface, + * allows pausing the script interpreter and setting/removing breakpoints. + */ +#ifndef AUBO_SDK_RUNTIME_MACHINE_INTERFACE_H +#define AUBO_SDK_RUNTIME_MACHINE_INTERFACE_H + +#include +#include +#include + +namespace arcs { +namespace common_interface { + +/** + * The RuntimeMachine class + */ +class ARCS_ABI_EXPORT RuntimeMachine +{ +public: + RuntimeMachine(); + virtual ~RuntimeMachine(); + + /** + * \chinese + * 返回 task_id + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.newTask","params":[false],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":26} + * \endchinese + * \english + * Returns the task_id + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.newTask","params":[false],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":26} + * \endenglish + */ + int newTask(bool daemon = false); + + /** + * \chinese + * 删除 task,会终止正在执行的运动 + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.deleteTask","params":[26],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Delete a task, which will terminate any ongoing motion. + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.deleteTask","params":[26],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int deleteTask(int tid); + + /** + * \chinese + * 等待 task 自然结束 + * + * @param tid + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.detachTask","params":[26],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Wait for the task to finish naturally + * + * @param tid + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.detachTask","params":[26],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int detachTask(int tid); + + /** + * \chinese + * 判断任务是否存活 + * + * @param tid + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.isTaskAlive","params":[26],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endchinese + * \english + * Check if the task is alive + * + * @param tid + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.isTaskAlive","params":[26],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endenglish + */ + bool isTaskAlive(int tid); + + /** + * \chinese + * 获取任务中缓存的指令的数量 + * + * @param tid + * @return + * \endchinese + * \english + * Get the number of cached instructions in the task + * + * @param tid + * @return + * \endenglish + */ + int getTaskQueueSize(int tid); + + /** + * \chinese + * 切换当前线程,切换之后接下来的指令将被插入切换后的线程中 + * + * @param tid + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.switchTask","params":[26],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Switch the current thread. After switching, subsequent instructions will + * be inserted into the switched thread. + * + * @param tid + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.switchTask","params":[26],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int switchTask(int tid); + + /** + * \chinese + * 标记记下来的指令的行号和注释 + * + * @param lineno + * @param comment + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.setLabel","params":[5,"moveJoint"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Mark the line number and comment of the recorded instruction + * + * @param lineno + * @param comment + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.setLabel","params":[5,"moveJoint"],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setLabel(int lineno, const std::string &comment); + + /** + * \chinese + * 向aubo_control日志中添加注释 + * 使用 setLabel 替换 + * + * @param tid 指令的线程ID + * @param lineno 行号 + * @param comment 注释 + * @return + * + * @par Python函数原型 + * setPlanContext(self: pyaubo_sdk.RuntimeMachine, arg0: int, arg1: int, + * arg2: str) -> int + * + * @par Lua函数原型 + * setPlanContext(tid: number, lineno: number, comment: string) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.setPlanContext","params":[26,3,"moveJoint"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Add a comment to the aubo_control log + * Use setLabel instead + * + * @param tid Thread ID of the instruction + * @param lineno Line number + * @param comment Comment + * @return + * + * @par Python function prototype + * setPlanContext(self: pyaubo_sdk.RuntimeMachine, arg0: int, arg1: int, + * arg2: str) -> int + * + * @par Lua function prototype + * setPlanContext(tid: number, lineno: number, comment: string) -> number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.setPlanContext","params":[26,3,"moveJoint"],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + ARCS_DEPRECATED int setPlanContext(int tid, int lineno, + const std::string &comment); + + /** + * \chinese + * 空操作 + * + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.nop","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * No operation + * + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.nop","params":[],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int nop(); + + /** + * \chinese + * 获取耗时的接口(INST)执行状态, 如 setPersistentParameters + * + * @return 指令名字, 执行状态 + * 执行状态: EXECUTING/FINISHED + * + * @par Python函数原型 + * getExecutionStatus(self: pyaubo_sdk.RuntimeMachine) -> Tuple[str, str, + * int] + * + * @par Lua函数原型 + * getExecutionStatus() -> string, string, number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.getExecutionStatus","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":["confirmSafetyParameters","FINISHED"]} + * + * \endchinese + * \english + * Get the execution status of time-consuming interfaces (INST), such as + * setPersistentParameters + * + * @return Instruction name, execution status + * Execution status: EXECUTING/FINISHED + * + * @par Python function prototype + * getExecutionStatus(self: pyaubo_sdk.RuntimeMachine) -> Tuple[str, str, + * int] + * + * @par Lua function prototype + * getExecutionStatus() -> string, string, number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.getExecutionStatus","params":[],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":["confirmSafetyParameters","FINISHED"]} + * + * \endenglish + */ + std::tuple getExecutionStatus(); + std::tuple getExecutionStatus1(); + + /** + * \chinese + * 跳转到指定行号 + * + * @param lineno + * @return + * + * @par Python函数原型 + * gotoLine(self: pyaubo_sdk.RuntimeMachine, arg0: int) -> int + * + * @par Lua函数原型 + * gotoLine(lineno: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.gotoLine","params":[10],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Jump to the specified line number + * + * @param lineno + * @return + * + * @par Python function prototype + * gotoLine(self: pyaubo_sdk.RuntimeMachine, arg0: int) -> int + * + * @par Lua function prototype + * gotoLine(lineno: number) -> number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.gotoLine","params":[10],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int gotoLine(int lineno); + + /** + * \chinese + * 获取当前运行上下文 + * + * @param tid 任务编号 + * 如果指定(不是-1),返回对应任务的运行上下文;如果不指定(是-1),返回正在运行的线程的运行上下文 + * + * @return + * + * @par Python函数原型 + * getPlanContext(self: pyaubo_sdk.RuntimeMachine) -> Tuple[int, int, str] + * + * @par Lua函数原型 + * getPlanContext() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.getPlanContext","params":[-1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[-1,0,""]} + * + * \endchinese + * \english + * Get the current runtime context + * + * @param tid Task ID + * If specified (not -1), returns the runtime context of the corresponding + * task; if not specified (is -1), returns the runtime context of the + * currently running thread + * + * @return + * + * @par Python function prototype + * getPlanContext(self: pyaubo_sdk.RuntimeMachine) -> Tuple[int, int, str] + * + * @par Lua function prototype + * getPlanContext() -> number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.getPlanContext","params":[-1],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":[-1,0,""]} + * + * \endenglish + */ + std::tuple getPlanContext(int tid = -1); + + /** + * \chinese + * 获取提前运行规划器的上下文信息 + * + * @param tid 任务编号 + * 如果指定(不是-1),返回对应任务运行规划器的上下文信息;如果不指定(是-1),返回正在运行的线程运行规划器的上下文信息 + * + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.getAdvancePlanContext","params":[-1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[-1,-1,""]} + * + * \endchinese + * \english + * Get the context information of the advance planner + * + * @param tid Task ID + * If specified (not -1), returns the context information of the advance + * planner for the corresponding task; if not specified (is -1), returns the + * context information of the advance planner for the currently running + * thread + * + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.getAdvancePlanContext","params":[-1],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":[-1,-1,""]} + * + * \endenglish + */ + std::tuple getAdvancePlanContext(int tid = -1); + + /** + * \chinese + * 获取AdvanceRun的程序指针 + * + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.getAdvancePtr","params":[-1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":-1} + * + * \endchinese + * \english + * Get the program pointer of AdvanceRun + * + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.getAdvancePtr","params":[-1],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":-1} + * + * \endenglish + */ + int getAdvancePtr(int tid = -1); + + /** + * \chinese + * 获取机器人运动的程序指针 + * + * @param tid 任务编号 + * 如果指定(不是-1),返回对应任务的程序指针;如果不指定(是-1),返回正在运行线程的程序指针 + * + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.getMainPtr","params":[-1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":-1} + * + * \endchinese + * \english + * Get the program pointer of robot motion + * + * @param tid Task ID + * If specified (not -1), returns the program pointer of the corresponding + * task; if not specified (is -1), returns the program pointer of the + * currently running thread + * + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.getMainPtr","params":[-1],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":-1} + * + * \endenglish + */ + int getMainPtr(int tid = -1); + + /** + * \chinese + * 获取最近解释过的指令指针 + * + * @param tid + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.getInterpPtr","params":[26],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":-1} + * + * \endchinese + * \english + * Get the pointer of the most recently interpreted instruction + * + * @param tid + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.getInterpPtr","params":[26],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":-1} + * + * \endenglish + */ + int getInterpPtr(int tid); + + /** + * \chinese + * 加载本地工程文件 + * Lua 脚本,只需要给出文件名字,不需要后缀,需要从 ${ARCS_WS}/program + * 目录中查找 + * + * @param program + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.loadProgram","params":["demo"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Load a local project file. + * For Lua scripts, only the file name is required (no extension), and it + * will be searched in the ${ARCS_WS}/program directory. + * + * @param program + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.loadProgram","params":["demo"],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int loadProgram(const std::string &program); + + /** + * \chinese + * 预加载工程文件 + * + * @param index 0~99 工程索引号 + * @param program 工程名字 + * @return + * \endchinese + * \english + * Preload project file + * + * @param index Project index number (0~99) + * @param program Project name + * @return + * \endenglish + */ + int preloadProgram(int index, const std::string &program); + + /** + * \chinese + * 获取预加载工程文件名字,如果没有加载或者超出索引范围则返回空字符串 + * + * @param index 0~99 工程索引号 + * @return 工程文件名字 + * \endchinese + * \english + * Get the name of the preloaded project file. Returns an empty string if + * not loaded or index is out of range. + * + * @param index Project index number (0~99) + * @return Project file name + * \endenglish + */ + std::string getPreloadProgram(int index); + + /** + * \chinese + * 清除所有已预加载的工程文件 + * 调用此方法将释放所有通过 preloadProgram + * 预加载的工程索引及其关联的工程名称 + * + * @return 成功返回0; + * \endchinese + * \english + * Clear all preloaded project files. + * Calling this method will release all project indices and their associated + * program names that were previously preloaded via preloadProgram. + * + * @return Returns 0 on success; + * \endenglish + */ + int clearPreloadPrograms(); + + /** + * \chinese + * 运行已经加载的工程文件 + * + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.runProgram","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Run the already loaded project file + * + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.runProgram","params":[],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int runProgram(); + + /** + * \chinese + * 开始运行时 + * + * @return + * + * @par Python函数原型 + * start(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua函数原型 + * start() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.start","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Start the runtime + * + * @return + * + * @par Python function prototype + * start(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua function prototype + * start() -> number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.start","params":[],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int start(); + + /** + * \chinese + * 停止运行时即脚本运行,无法停止运行时状态为 Stopped 时的机器人运动 + * + * 如果考虑停止机器人所有运动,可以调用 RuntimeMachine::abort 接口 + * + * @return + * + * @par Python函数原型 + * stop(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua函数原型 + * stop() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.stop","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Stop the runtime, i.e., stop script execution. Cannot stop robot motion + * when the runtime state is Stopped. + * + * If you want to stop all robot motion, use the RuntimeMachine::abort + * interface. + * + * @return + * + * @par Python function prototype + * stop(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua function prototype + * stop() -> number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.stop","params":[],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int stop(); + + /** + * \chinese + * 终止机器人运行. + * + * 如果只是考虑停止运行时,可以调用 RuntimeMachine::stop 接口 + * + * 如果脚本运行时处于 Running 状态,则终止运行时;如果运行时处于 Stopped + * 且机器人正在移动,则停止机器人移动;如果此时力控开启了,则机器人停止力控 + * + * @return + * + * @par Python函数原型 + * abort(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua函数原型 + * abort() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.abort","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Abort robot operation. + * + * If you only want to stop the runtime, you can call the + * RuntimeMachine::stop interface. + * + * If the script runtime is in the Running state, aborts the runtime; if the + * runtime is Stopped and the robot is moving, stops the robot motion; if + * force control is enabled, stops force control. + * + * @return + * + * @par Python function prototype + * abort(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua function prototype + * abort() -> number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.abort","params":[],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int abort(); + + /** + * \chinese + * 暂停解释器 + * + * @return + * + * @par Python函数原型 + * pause(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua函数原型 + * pause() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.pause","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Pause the interpreter + * + * @return + * + * @par Python function prototype + * pause(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua function prototype + * pause() -> number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.pause","params":[],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int pause(); + + /** + * \chinese + * 单步运行 + * + * @return + * + * @par Python函数原型 + * step(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua函数原型 + * step() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.step","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Execute a single step + * + * @return + * + * @par Python function prototype + * step(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua function prototype + * step() -> number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.step","params":[],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int step(); + + /** + * \chinese + * 恢复解释器 + * + * @return + * + * @par Python函数原型 + * resume(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua函数原型 + * resume() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.resume","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Resume the interpreter + * + * @return + * + * @par Python function prototype + * resume(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua function prototype + * resume() -> number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.resume","params":[],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int resume(); + + /** + * \chinese + * 恢复解释器(不检查当前点和暂停点距离) + * + * @return + * + * @par Python函数原型 + * arbitraryResume(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua函数原型 + * arbitraryResume() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.arbitraryResume","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Resume the interpreter + * + * @return + * + * @par Python function prototype + * arbitraryResume(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua function prototype + * arbitraryResume() -> number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.arbitraryResume","params":[],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int arbitraryResume(); + + /** + * \chinese + * 恢复解释器之前等待恢复前之前的序列完成 + * + * @param wait + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.setResumeWait","params":[true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Wait for the previous sequence to complete before resuming the + * interpreter + * + * @param wait + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.setResumeWait","params":[true],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setResumeWait(bool wait); + + /** + * \chinese + * 获取规划器的状态 + * + * @return + * + * @par Python函数原型 + * getStatus(self: pyaubo_sdk.RuntimeMachine) -> + * arcs::common_interface::RuntimeState + * + * @par Lua函数原型 + * getStatus() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.getStatus","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"Running"} + * + * \endchinese + * \english + * Get the status of the planner + * + * @return + * + * @par Python function prototype + * getStatus(self: pyaubo_sdk.RuntimeMachine) -> + * arcs::common_interface::RuntimeState + * + * @par Lua function prototype + * getStatus() -> number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.getStatus","params":[],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":"Running"} + * + * \endenglish + */ + ARCS_DEPRECATED RuntimeState getStatus(); + RuntimeState getRuntimeState(); + + /** + * \chinese + * 设置断点 + * + * @param lineno + * @return + * + * @par Python函数原型 + * setBreakPoint(self: pyaubo_sdk.RuntimeMachine, arg0: int) -> int + * + * @par Lua函数原型 + * setBreakPoint(lineno: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.setBreakPoint","params":[15],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set a breakpoint + * + * @param lineno + * @return + * + * @par Python function prototype + * setBreakPoint(self: pyaubo_sdk.RuntimeMachine, arg0: int) -> int + * + * @par Lua function prototype + * setBreakPoint(lineno: number) -> number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.setBreakPoint","params":[15],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setBreakPoint(int lineno); + + /** + * \chinese + * 移除断点 + * + * @param lineno + * @return + * + * @par Python函数原型 + * removeBreakPoint(self: pyaubo_sdk.RuntimeMachine, arg0: int) -> int + * + * @par Lua函数原型 + * removeBreakPoint(lineno: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.removeBreakPoint","params":[15],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Remove a breakpoint + * + * @param lineno + * @return + * + * @par Python function prototype + * removeBreakPoint(self: pyaubo_sdk.RuntimeMachine, arg0: int) -> int + * + * @par Lua function prototype + * removeBreakPoint(lineno: number) -> number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.removeBreakPoint","params":[15],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int removeBreakPoint(int lineno); + + /** + * \chinese + * 清除所有断点 + * + * @return + * + * @par Python函数原型 + * clearBreakPoints(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua函数原型 + * clearBreakPoints() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.clearBreakPoints","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Clear all breakpoints + * + * @return + * + * @par Python function prototype + * clearBreakPoints(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua function prototype + * clearBreakPoints() -> number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.clearBreakPoints","params":[],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int clearBreakPoints(); + + /** + * \chinese + * 定时器开始 + * + * @param name + * @return + * + * @par Python函数原型 + * timerStart(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int + * + * @par Lua函数原型 + * timerStart(name: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.timerStart","params":["timer"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Start the timer + * + * @param name + * @return + * + * @par Python function prototype + * timerStart(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int + * + * @par Lua function prototype + * timerStart(name: string) -> nil + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.timerStart","params":["timer"],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int timerStart(const std::string &name); + + /** + * \chinese + * 定时器结束 + * + * @param name + * @return + * + * @par Python函数原型 + * timerStop(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int + * + * @par Lua函数原型 + * timerStop(name: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.timerStop","params":["timer"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Stop the timer + * + * @param name + * @return + * + * @par Python function prototype + * timerStop(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int + * + * @par Lua function prototype + * timerStop(name: string) -> nil + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.timerStop","params":["timer"],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int timerStop(const std::string &name); + + /** + * \chinese + * 定时器重置 + * + * @param name + * @return + * + * @par Python函数原型 + * timerReset(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int + * + * @par Lua函数原型 + * timerReset(name: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.timerReset","params":["timer"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Reset the timer + * + * @param name + * @return + * + * @par Python function prototype + * timerReset(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int + * + * @par Lua function prototype + * timerReset(name: string) -> nil + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.timerReset","params":["timer"],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int timerReset(const std::string &name); + + /** + * \chinese + * 定时器删除 + * + * @param name + * @return + * + * @par Python函数原型 + * timerDelete(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int + * + * @par Lua函数原型 + * timerDelete(name: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.timerDelete","params":["timer"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Delete the timer + * + * @param name + * @return + * + * @par Python function prototype + * timerDelete(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int + * + * @par Lua function prototype + * timerDelete(name: string) -> nil + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.timerDelete","params":["timer"],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int timerDelete(const std::string &name); + + /** + * \chinese + * 获取定时器数值 + * + * @param name + * @return + * + * @par Python函数原型 + * getTimer(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> float + * + * @par Lua函数原型 + * getTimer(name: string) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.getTimer","params":["timer"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":25.409769612} + * + * \endchinese + * \english + * Get the timer value + * + * @param name + * @return + * + * @par Python function prototype + * getTimer(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> float + * + * @par Lua function prototype + * getTimer(name: string) -> number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.getTimer","params":["timer"],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":25.409769612} + * + * \endenglish + */ + double getTimer(const std::string &name); + + /** + * \chinese + * 开始配置触发 + * + * @param distance + * @param delay + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.triggBegin","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Start configuring trigger + * + * @param distance + * @param delay + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.triggBegin","params":[],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int triggBegin(double distance, double delay); + + /** + * \chinese + * 终止配置触发 + * + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.triggEnd","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * End configuring trigger + * + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.triggEnd","params":[],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int triggEnd(); + + /** + * \chinese + * 返回自动分配的中断号 + * + * @param distance + * @param delay + * @param intnum + * @return + * \endchinese + * \english + * Returns the automatically assigned interrupt number + * + * @param distance + * @param delay + * @param intnum + * @return + * \endenglish + */ + int triggInterrupt(double distance, double delay); + + /** + * \chinese + * 获取所有的中断号列表 + * + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.getTriggInterrupts","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[]} + * + * \endchinese + * \english + * Get the list of all interrupt numbers + * + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.getTriggInterrupts","params":[],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":[]} + * + * \endenglish + */ + std::vector getTriggInterrupts(); + +protected: + void *d_; +}; + +using RuntimeMachinePtr = std::shared_ptr; + +} // namespace common_interface +} // namespace arcs +#endif // AUBO_SDK_RUNTIME_MACHINE_H diff --git a/third_party/AuboSdk/linux/include/aubo/serial.h b/third_party/AuboSdk/linux/include/aubo/serial.h new file mode 100644 index 00000000..679a21fc --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo/serial.h @@ -0,0 +1,396 @@ +/** @file serial.h + * @brief 串口通信 + */ +#ifndef AUBO_SDK_SERIAL_INTERFACE_H +#define AUBO_SDK_SERIAL_INTERFACE_H + +#include +#include + +#include +#include + +namespace arcs { +namespace common_interface { + +class ARCS_ABI_EXPORT Serial +{ +public: + Serial(); + virtual ~Serial(); + + /** + * \chinese + * 打开TCP/IP以太网通信串口 + * + * @param device 设备名 + * @param baud 波特率 + * @param stop_bits 停止位 + * @param even 校验位 + * @param serial_name 串口名称 + * @return 返回值 + * + * @par Python函数原型 + * serialOpen(self: pyaubo_sdk.Serial, arg0: str, arg1: int, arg2: float, + * arg3: int, arg4: str) -> int + * + * @par Lua函数原型 + * serialOpen(device: string, baud: number, stop_bits: number, even: number, + * serial_name: string) -> nil + * \endchinese + * \english + * Open TCP/IP ethernet communication serial + * + * @param device + * @param baud + * @param stop_bits + * @param even + * @param serial_name + * @return + * + * @par Python function prototype + * serialOpen(self: pyaubo_sdk.Serial, arg0: str, arg1: int, arg2: float, + * arg3: int, arg4: str) -> int + * + * @par Lua function prototype + * serialOpen(device: string, baud: number, stop_bits: number, even: number, + * serial_name: string) -> nil + * \endenglish + */ + + int serialOpen(const std::string &device, int baud, float stop_bits, + int even, const std::string &serial_name = "serial_0"); + + /** + * \chinese + * 关闭TCP/IP串口通信 + * 关闭与服务器的串口连接。 + * + * @param serial_name 串口名称 + * @return 返回值 + * + * @par Python函数原型 + * serialClose(self: pyaubo_sdk.Serial, arg0: str) -> int + * + * @par Lua函数原型 + * serialClose(serial_name: string) -> nil + * \endchinese + * \english + * Close TCP/IP serial communication + * Close down the serial connection to the server. + * + * @param serial_name + * @return + * + * @par Python function prototype + * serialClose(self: pyaubo_sdk.Serial, arg0: str) -> int + * + * @par Lua function prototype + * serialClose(serial_name: string) -> nil + * \endenglish + */ + int serialClose(const std::string &serial_name = "serial_0"); + + /** + * \chinese + * 从串口读取指定数量的字节。字节为网络字节序。一次最多可读取30个值。 + * + * @param variable 变量 + * @param serial_name 串口名称 + * @return 返回值 + * + * @par Python函数原型 + * serialReadByte(self: pyaubo_sdk.Serial, arg0: str, arg1: str) -> int + * + * @par Lua函数原型 + * serialReadByte(variable: string, serial_name: string) -> number + * \endchinese + * \english + * Reads a number of bytes from the serial. Bytes are in network byte + * order. A maximum of 30 values can be read in one command. + * + * @param variable + * @param serial_name + * @return + * + * @par Python function prototype + * serialReadByte(self: pyaubo_sdk.Serial, arg0: str, arg1: str) -> int + * + * @par Lua function prototype + * serialReadByte(variable: string, serial_name: string) -> number + * \endenglish + */ + int serialReadByte(const std::string &variable, + const std::string &serial_name = "serial_0"); + + /** + * \chinese + * 从串口读取指定数量的字节。字节为网络字节序。一次最多可读取30个值。 + * 返回读取到的数字列表(int列表,长度=number+1)。 + * + * @param number 读取的字节数 + * @param variable 变量 + * @param serial_name 串口名称 + * @return 返回值 + * + * @par Python函数原型 + * serialReadByteList(self: pyaubo_sdk.Serial, arg0: int, arg1: str, arg2: str) -> int + * + * @par Lua函数原型 + * serialReadByteList(number: number, variable: string, serial_name: string) -> number + * \endchinese + * \english + * Reads a number of bytes from the serial. Bytes are in network byte + * order. A maximum of 30 values can be read in one command. + * A list of numbers read (list of ints, length=number+1) + * + * @param number Number of bytes to read + * @param variable + * @param serial_name Serial port name + * @return Return value + * + * @par Python function prototype + * serialReadByteList(self: pyaubo_sdk.Serial, arg0: int, arg1: str, arg2: str) -> int + * + * @par Lua function prototype + * serialReadByteList(number: number, variable: string, serial_name: string) -> number + * \endenglish + */ + int serialReadByteList(int number, const std::string &variable, + const std::string &serial_name = "serial_0"); + + /** + * \chinese + * 从串口读取所有数据,并将数据作为字符串返回。 + * 字节为网络字节序。 + * + * 可选参数 "prefix" 和 "suffix" 用于指定从串口提取的内容。 + * "prefix" 指定提取子串(消息)的起始位置。直到 "prefix" 结束的数据会被忽略并从串口移除。 + * "suffix" 指定提取子串(消息)的结束位置。串口中 "suffix" 之后的剩余数据会被保留。 + * 例如,如果串口服务器发送字符串 "noise>hello<",控制器可以通过设置 prefix=">" 和 suffix="<" 来接收 "hello"。 + * 通过使用 "prefix" 和 "suffix",还可以一次向控制器发送多条字符串,因为 "suffix" 定义了消息的结束位置。 + * 例如发送 ">hello<>world<" + * + * @param variable 变量 + * @param serial_name 串口名称 + * @param prefix 前缀 + * @param suffix 后缀 + * @param interpret_escape 是否解释转义字符 + * @return 返回值 + * + * @par Python函数原型 + * serialReadString(self: pyaubo_sdk.Serial, arg0: str, arg1: str, arg2: str, arg3: str, arg4: bool) -> int + * + * @par Lua函数原型 + * serialReadString(variable: string, serial_name: string, prefix: string, suffix: string, interpret_escape: boolean) -> number + * \endchinese + * \english + * Reads all data from the serial and returns the data as a string. + * Bytes are in network byte order. + * + * The optional parameters "prefix" and "suffix", can be used to express + * what is extracted from the serial. The "prefix" specifies the start + * of the substring (message) extracted from the serial. The data up to + * the end of the "prefix" will be ignored and removed from the serial. + * The "suffix" specifies the end of the substring (message) extracted + * from the serial. Any remaining data on the serial, after the "suffix", + * will be preserved. E.g. if the serial server sends a string + * "noise>hello<", the controller can receive the "hello" by calling this + * script function with the prefix=">" and suffix="<". By using the + * "prefix" and "suffix" it is also possible send multiple string to the + * controller at once, because the suffix defines where the message ends. + * E.g. sending ">hello<>world<" + * + * @param variable + * @param serial_name + * @param prefix + * @param suffix + * @param interpret_escape + * @return + * + * @par Python function prototype + * serialReadString(self: pyaubo_sdk.Serial, arg0: str, arg1: str, arg2: str, arg3: str, arg4: bool) -> int + * + * @par Lua function prototype + * serialReadString(variable: string, serial_name: string, prefix: string, suffix: string, interpret_escape: boolean) -> number + * \endenglish + */ + int serialReadString(const std::string &variable, + const std::string &serial_name = "serial_0", + const std::string &prefix = "", + const std::string &suffix = "", + bool interpret_escape = false); + + /** + * \chinese + * 发送一个字节到服务器 + * 通过串口发送字节 。不期望有响应。可用于发送特殊的ASCII字符;10为换行符,2为文本开始,3为文本结束。 + * + * @param value 字节值 + * @param serial_name 串口名称 + * @return 返回值 + * + * @par Python函数原型 + * serialSendByte(self: pyaubo_sdk.Serial, arg0: str, arg1: str) -> int + * + * @par Lua函数原型 + * serialSendByte(value: string, serial_name: string) -> nil + * \endchinese + * \english + * Sends a byte to the server + * Sends the byte through the serial. Expects no response. Can + * be used to send special ASCII characters; 10 is newline, 2 is start of + * text, 3 is end of text. + * + * @param value + * @param serial_name + * @return + * + * @par Python function prototype + * serialSendByte(self: pyaubo_sdk.Serial, arg0: str, arg1: str) -> int + * + * @par Lua function prototype + * serialSendByte(value: string, serial_name: string) -> nil + * \endenglish + */ + int serialSendByte(char value, const std::string &serial_name = "serial_0"); + + /** + * \chinese + * 发送一个整数(int32_t)到服务器 + * 通过串口发送整数 。以网络字节序发送。不期望有响应。 + * + * @param value 整数值 + * @param serial_name 串口名称 + * @return 返回值 + * + * @par Python函数原型 + * serialSendInt(self: pyaubo_sdk.Serial, arg0: int, arg1: str) -> int + * + * @par Lua函数原型 + * serialSendInt(value: number, serial_name: string) -> nil + * \endchinese + * \english + * Sends an int (int32_t) to the server + * Sends the int through the serial. Send in network byte order. + * Expects no response. + * + * @param value + * @param serial_name + * @return + * + * @par Python function prototype + * serialSendInt(self: pyaubo_sdk.Serial, arg0: int, arg1: str) -> int + * + * @par Lua function prototype + * serialSendInt(value: number, serial_name: string) -> nil + * \endenglish + */ + int serialSendInt(int value, const std::string &serial_name = "serial_0"); + + /** + * \chinese + * 发送带有换行符的字符串到服务器 + * 以ASCII编码通过串口发送字符串,并在末尾添加换行符。不期望有响应。 + * + * @param str 字符串 + * @param serial_name 串口名称 + * @return 返回值 + * + * @par Python函数原型 + * serialSendLine(self: pyaubo_sdk.Serial, arg0: str, arg1: str) -> int + * + * @par Lua函数原型 + * serialSendLine(str: string, serial_name: string) -> nil + * \endchinese + * \english + * Sends a string with a newline character to the server + * Sends the string through the serial in ASCII coding, appending a newline at the end. Expects no response. + * + * @param str + * @param serial_name + * @return + * + * @par Python function prototype + * serialSendLine(self: pyaubo_sdk.Serial, arg0: str, arg1: str) -> int + * + * @par Lua function prototype + * serialSendLine(str: string, serial_name: string) -> nil + * \endenglish + */ + int serialSendLine(const std::string &str, + const std::string &serial_name = "serial_0"); + + /** + * \chinese + * 发送字符串到服务器 + * 以ASCII编码通过串口发送字符串。不期望有响应。 + * + * @param str 字符串 + * @param serial_name 串口名称 + * @return 返回值 + * + * @par Python函数原型 + * serialSendString(self: pyaubo_sdk.Serial, arg0: str, arg1: str) -> int + * + * @par Lua函数原型 + * serialSendString(str: string, serial_name: string) -> nil + * \endchinese + * \english + * Sends a string to the server + * Sends the string through the serial in ASCII coding. Expects no + * response. + * + * @param str + * @param serial_name + * @return + * + * @par Python function prototype + * serialSendString(self: pyaubo_sdk.Serial, arg0: str, arg1: str) -> int + * + * @par Lua function prototype + * serialSendString(str: string, serial_name: string) -> nil + * \endenglish + */ + int serialSendString(const std::string &str, + const std::string &serial_name = "serial_0"); + + /** + * \chinese + * + * @param is_check 是否校验 + * @param str 字符串数组 + * @param serial_name 串口名称 + * @return 返回值 + * + * @par Python函数原型 + * serialSendAllString(self: pyaubo_sdk.Serial, arg0: bool, arg1: List[str], arg2: str) -> int + * + * @par Lua函数原型 + * serialSendAllString(is_check: boolean, str: table, serial_name: string) -> nil + * \endchinese + * \english + * + * @param is_check Whether to check + * @param str Array of strings + * @param serial_name Serial port name + * @return Return value + * + * @par Python function prototype + * serialSendAllString(self: pyaubo_sdk.Serial, arg0: bool, arg1: List[str], arg2: str) -> int + * + * @par Lua function prototype + * serialSendAllString(is_check: boolean, str: table, serial_name: string) -> nil + * \endenglish + */ + int serialSendAllString(bool is_check, const std::vector &str, + const std::string &serial_name = "serial_0"); + +protected: + void *d_; +}; +using SerialPtr = std::shared_ptr; + +} // namespace common_interface +} // namespace arcs +#endif diff --git a/third_party/AuboSdk/linux/include/aubo/socket.h b/third_party/AuboSdk/linux/include/aubo/socket.h new file mode 100644 index 00000000..e8d297a5 --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo/socket.h @@ -0,0 +1,627 @@ +/** @file socket.h + * @brief socket通信 + */ +#ifndef AUBO_SDK_SOCKET_INTERFACE_H +#define AUBO_SDK_SOCKET_INTERFACE_H + +#include +#include + +#include +#include + +namespace arcs { +namespace common_interface { + +class ARCS_ABI_EXPORT Socket +{ +public: + Socket(); + virtual ~Socket(); + + /** + * \english + * Open TCP/IP ethernet communication socket + * + * Instruction + * + * @param address + * @param port + * @param socket_name + * @return + * + * @par Python function prototype + * socketOpen(self: pyaubo_sdk.Socket, arg0: str, arg1: int, arg2: str) -> int + * + * @par Lua function prototype + * socketOpen(address: string, port: number, socket_name: string) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Socket.socketOpen","params":["172.16.26.248",8000,"socket_0"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + * \chinese + * 打开TCP/IP以太网通信socket + * + * 指令 + * + * @param address 地址 + * @param port 端口 + * @param socket_name 套接字名称 + * @return 返回值 + * + * @par Python函数原型 + * socketOpen(self: pyaubo_sdk.Socket, arg0: str, arg1: int, arg2: str) -> int + * + * @par Lua函数原型 + * socketOpen(address: string, port: number, socket_name: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Socket.socketOpen","params":["172.16.26.248",8000,"socket_0"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + */ + int socketOpen(const std::string &address, int port, + const std::string &socket_name = "socket_0"); + + /** + * \english + * Closes TCP/IP socket communication + * Closes down the socket connection to the server. + * + * Instruction + * + * @param socket_name + * @return + * + * @par Python function prototype + * socketClose(self: pyaubo_sdk.Socket, arg0: str) -> int + * + * @par Lua function prototype + * socketClose(socket_name: string) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Socket.socketClose","params":["socket_0"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + * \chinese + * 关闭TCP/IP socket 通信 + * 关闭与服务器的 socket 连接。 + * + * 指令 + * + * @param socket_name 套接字名称 + * @return 返回值 + * + * @par Python函数原型 + * socketClose(self: pyaubo_sdk.Socket, arg0: str) -> int + * + * @par Lua函数原型 + * socketClose(socket_name: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Socket.socketClose","params":["socket_0"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + */ + int socketClose(const std::string &socket_name = "socket_0"); + + /** + * \english + * Reads a number of ascii formatted floats from the socket. A maximum + * of 30 values can be read in one command. + * A list of numbers read (list of floats, length=number+1) + * + * Result will be stored in a register named reg_key. Use getFloatVec + * to retrieve data + * + * @param number + * @param variable + * @param socket_name + * @return + * + * @par Python function prototype + * socketReadAsciiFloat(self: pyaubo_sdk.Socket, arg0: int, arg1: str, arg2: + * str) -> int + * + * @par Lua function prototype + * socketReadAsciiFloat(number: number, variable: string, socket_name: + * string) -> number + * \endenglish + * \chinese + * 从socket读取指定数量的ASCII格式浮点数。一次最多可读取30个值。 + * 读取到的数字列表(浮点数列表,长度=number+1) + * + * 结果将存储在名为reg_key的寄存器中。使用getFloatVec获取数据 + * + * @param number 数量 + * @param variable 变量名 + * @param socket_name 套接字名称 + * @return 返回值 + * + * @par Python函数原型 + * socketReadAsciiFloat(self: pyaubo_sdk.Socket, arg0: int, arg1: str, arg2: + * str) -> int + * + * @par Lua函数原型 + * socketReadAsciiFloat(number: number, variable: string, socket_name: + * string) -> number + * \endchinese + */ + int socketReadAsciiFloat(int number, const std::string &variable, + const std::string &socket_name = "socket_0"); + + /** + * \english + * Reads a number of 32 bit integers from the socket. Bytes are in + * network byte order. A maximum of 30 values can be read in one + * command. + * A list of numbers read (list of ints, length=number+1) + * + * Instruction + * + * std::vector + * + * @param number + * @param variable + * @param socket_name + * @return + * + * @par Python function prototype + * socketReadBinaryInteger(self: pyaubo_sdk.Socket, arg0: int, arg1: str, + * arg2: str) -> int + * + * @par Lua function prototype + * socketReadBinaryInteger(number: number, variable: string, socket_name: + * string) -> number + * \endenglish + * \chinese + * 从socket读取指定数量的32位整数。字节为网络字节序。一次最多可读取30个值。 + * 读取到的数字列表(整数列表,长度=number+1) + * + * 指令 + * + * std::vector + * + * @param number 数量 + * @param variable 变量名 + * @param socket_name 套接字名称 + * @return 返回值 + * + * @par Python函数原型 + * socketReadBinaryInteger(self: pyaubo_sdk.Socket, arg0: int, arg1: str, + * arg2: str) -> int + * + * @par Lua函数原型 + * socketReadBinaryInteger(number: number, variable: string, socket_name: + * string) -> number + * \endchinese + */ + int socketReadBinaryInteger(int number, const std::string &variable, + const std::string &socket_name = "socket_0"); + + /** + * \english + * Reads a number of bytes from the socket. Bytes are in network byte + * order. A maximum of 30 values can be read in one command. + * A list of numbers read (list of ints, length=number+1) + * + * Instruction + * + * std::vector + * + * @param number + * @param variable + * @param socket_name + * @return + * + * @par Python function prototype + * socketReadByteList(self: pyaubo_sdk.Socket, arg0: int, arg1: str, arg2: + * str) -> int + * + * @par Lua function prototype + * socketReadByteList(number: number, variable: string, socket_name: string) + * -> number + * \endenglish + * \chinese + * 从socket读取指定数量的字节。字节为网络字节序。一次最多可读取30个值。 + * 读取到的数字列表(整数列表,长度=number+1) + * + * 指令 + * + * std::vector + * + * @param number 数量 + * @param variable 变量名 + * @param socket_name 套接字名称 + * @return 返回值 + * + * @par Python函数原型 + * socketReadByteList(self: pyaubo_sdk.Socket, arg0: int, arg1: str, arg2: + * str) -> int + * + * @par Lua函数原型 + * socketReadByteList(number: number, variable: string, socket_name: string) + * -> number + * \endchinese + */ + int socketReadByteList(int number, const std::string &variable, + const std::string &socket_name = "socket_0"); + + /** + * \english + * Reads all data from the socket and returns the data as a string. + * Bytes are in network byte order. + * + * The optional parameters "prefix" and "suffix", can be used to express + * what is extracted from the socket. The "prefix" specifies the start + * of the substring (message) extracted from the socket. The data up to + * the end of the "prefix" will be ignored and removed from the socket. + * The "suffix" specifies the end of the substring (message) extracted + * from the socket. Any remaining data on the socket, after the "suffix", + * will be preserved. E.g. if the socket server sends a string + * "noise>hello<", the controller can receive the "hello" by calling this + * script function with the prefix=">" and suffix="<". By using the + * "prefix" and "suffix" it is also possible send multiple string to the + * controller at once, because the suffix defines where the message ends. + * E.g. sending ">hello<>world<" + * + * Instruction + * + * std::string + * + * @param variable + * @param socket_name + * @param prefix + * @param suffix + * @param interpret_escape + * @return + * + * @par Python function prototype + * socketReadString(self: pyaubo_sdk.Socket, arg0: str, arg1: str, arg2: + * str, arg3: str, arg4: bool) -> int + * + * @par Lua function prototype + * socketReadString(variable: string, socket_name: string, prefix: string, + * suffix: string, interpret_escape: boolean) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Socket.socketReadString","params":["camera","socket_0","","",false],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + * \chinese + * 从socket读取所有数据并将其作为字符串返回。 + * 字节为网络字节序。 + * + * 可选参数"prefix"和"suffix"可用于指定从socket中提取的内容。 + * "prefix"指定提取子字符串(消息)的起始位置。直到"prefix"结尾的数据将被忽略并从socket中移除。 + * "suffix"指定提取子字符串(消息)的结束位置。"suffix"之后的任何剩余数据将保留在socket中。 + * 例如,如果socket服务器发送字符串"noise>hello<",控制器可以通过调用此脚本函数并设置prefix=">"和suffix="<"来接收"hello"。 + * 通过使用"prefix"和"suffix",还可以一次向控制器发送多条字符串,因为"suffix"定义了消息的结束位置。例如发送">hello<>world<" + * + * 指令 + * + * std::string + * + * @param variable 变量名 + * @param socket_name 套接字名称 + * @param prefix 前缀 + * @param suffix 后缀 + * @param interpret_escape 是否解释转义字符 + * @return 返回值 + * + * @par Python函数原型 + * socketReadString(self: pyaubo_sdk.Socket, arg0: str, arg1: str, arg2: + * str, arg3: str, arg4: bool) -> int + * + * @par Lua函数原型 + * socketReadString(variable: string, socket_name: string, prefix: string, + * suffix: string, interpret_escape: boolean) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Socket.socketReadString","params":["camera","socket_0","","",false],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + */ + int socketReadString(const std::string &variable, + const std::string &socket_name = "socket_0", + const std::string &prefix = "", + const std::string &suffix = "", + bool interpret_escape = false); + + /** + * \english + * Reads all data from the socket and returns the data as a vector of chars. + * + * Instruction + * std::vector + * + * @param variable + * @param socket_name + * @return + * + * @par Python function prototype + * socketReadAllString(self: pyaubo_sdk.Socket, arg0: str, arg1: str) -> int + * + * @par Lua function prototype + * socketReadAllString(variable: string, socket_name: string) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Socket.socketReadAllString","params":["camera","socket_0"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + * \chinese + * 从socket读取所有数据并将其作为char向量返回。 + * + * 指令 + * std::vector + * + * @param variable 变量名 + * @param socket_name 套接字名称 + * @return 返回值 + * + * @par Python函数原型 + * socketReadAllString(self: pyaubo_sdk.Socket, arg0: str, arg1: str) -> int + * + * @par Lua函数原型 + * socketReadAllString(variable: string, socket_name: string) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Socket.socketReadAllString","params":["camera","socket_0"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + */ + int socketReadAllString(const std::string &variable, + const std::string &socket_name = "socket_0"); + + /** + * \english + * Sends a byte to the server + * Sends the byte through the socket. Expects no response. Can + * be used to send special ASCII characters; 10 is newline, 2 is start of + * text, 3 is end of text. + * + * Instruction + * + * @param value + * @param socket_name + * @return + * + * @par Python function prototype + * socketSendByte(self: pyaubo_sdk.Socket, arg0: str, arg1: str) -> int + * + * @par Lua function prototype + * socketSendByte(value: string, socket_name: string) -> nil + * + * \endenglish + * \chinese + * 发送一个字节到服务器 + * 通过socket发送字节,不期望响应。可用于发送特殊ASCII字符;10为换行符,2为文本开始,3为文本结束。 + * + * 指令 + * + * @param value 字节值 + * @param socket_name 套接字名称 + * @return 返回值 + * + * @par Python函数原型 + * socketSendByte(self: pyaubo_sdk.Socket, arg0: str, arg1: str) -> int + * + * @par Lua函数原型 + * socketSendByte(value: string, socket_name: string) -> nil + * + * \endchinese + */ + int socketSendByte(char value, const std::string &socket_name = "socket_0"); + + /** + * \english + * Sends an int (int32_t) to the server + * Sends the int through the socket. Send in network byte order. + * Expects no response + * + * Instruction + * + * @param value + * @param socket_name + * @return + * + * @par Python function prototype + * socketSendInt(self: pyaubo_sdk.Socket, arg0: int, arg1: str) -> int + * + * @par Lua function prototype + * socketSendInt(value: number, socket_name: string) -> nil + * + * \endenglish + * \chinese + * 发送一个int(int32_t)到服务器 + * 通过socket发送int ,以网络字节序发送。不期望响应。 + * + * 指令 + * + * @param value 整数值 + * @param socket_name 套接字名称 + * @return 返回值 + * + * @par Python函数原型 + * socketSendInt(self: pyaubo_sdk.Socket, arg0: int, arg1: str) -> int + * + * @par Lua函数原型 + * socketSendInt(value: number, socket_name: string) -> nil + * + * \endchinese + */ + int socketSendInt(int value, const std::string &socket_name = "socket_0"); + + /** + * \english + * Sends a string with a newline character to the server + * Sends the string through the socket in ASCII coding. Expects no + * response. + * + * Instruction + * + * @param str + * @param socket_name + * @return + * + * @par Python function prototype + * socketSendLine(self: pyaubo_sdk.Socket, arg0: str, arg1: str) -> int + * + * @par Lua function prototype + * socketSendLine(str: string, socket_name: string) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Socket.socketSendLine","params":["abcd","socket_0"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + * \chinese + * 发送带有换行符的字符串到服务器. + * 通过socket以ASCII编码发送字符串,不期望响应。 + * + * 指令 + * + * @param str 字符串 + * @param socket_name 套接字名称 + * @return 返回值 + * + * @par Python函数原型 + * socketSendLine(self: pyaubo_sdk.Socket, arg0: str, arg1: str) -> int + * + * @par Lua函数原型 + * socketSendLine(str: string, socket_name: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Socket.socketSendLine","params":["abcd","socket_0"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + */ + int socketSendLine(const std::string &str, + const std::string &socket_name = "socket_0"); + + /** + * \english + * Sends a string to the server + * Sends the string through the socket in ASCII coding. Expects no + * response. + * + * Instruction + * + * @param str + * @param socket_name + * @return + * + * @par Python function prototype + * socketSendString(self: pyaubo_sdk.Socket, arg0: str, arg1: str) -> int + * + * @par Lua function prototype + * socketSendString(str: string, socket_name: string) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Socket.socketSendString","params":["abcd","socket_0"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + * \chinese + * 发送字符串到服务器 + * 通过socket以ASCII编码发送字符串,不期望响应。 + * + * 指令 + * + * @param str 字符串 + * @param socket_name 套接字名称 + * @return 返回值 + * + * @par Python函数原型 + * socketSendString(self: pyaubo_sdk.Socket, arg0: str, arg1: str) -> int + * + * @par Lua函数原型 + * socketSendString(str: string, socket_name: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Socket.socketSendString","params":["abcd","socket_0"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + */ + int socketSendString(const std::string &str, + const std::string &socket_name = "socket_0"); + + /** + * \english + * Sends all data in the given vector of chars to the server. + * + * @param is_check Whether to check the sending status + * @param str The data to send as a vector of chars + * @param socket_name The name of the socket + * @return Status code + * + * @par Python function prototype + * socketSendAllString(self: pyaubo_sdk.Socket, arg0: bool, arg1: List[str], arg2: str) -> int + * + * @par Lua function prototype + * socketSendAllString(is_check: boolean, str: table, socket_name: string) -> nil + * \endenglish + * \chinese + * 发送给定char向量中的所有数据到服务器。 + * + * @param is_check 是否检查发送状态 + * @param str 要发送的数据,char向量 + * @param socket_name 套接字名称 + * @return 状态码 + * + * @par Python函数原型 + * socketSendAllString(self: pyaubo_sdk.Socket, arg0: bool, arg1: List[str], arg2: str) -> int + * + * @par Lua函数原型 + * socketSendAllString(is_check: boolean, str: table, socket_name: string) -> nil + * \endchinese + */ + int socketSendAllString(bool is_check, const std::vector &str, + const std::string &socket_name = "socket_0"); + + /** + * \~chinese 检测 socket 连接是否成功 \~english Check if the socket is connected + * @brief socketHasConnected + * @param socket_name + * + * @return + * + * @par Python函数原型 + * socketHasConnected(self: pyaubo_sdk.Socket, arg0: str) -> bool + * + * @par Lua函数原型 + * socketHasConnected(socket_name: string) -> boolean + */ + bool socketHasConnected(const std::string &socket_name = "socket_0"); + +protected: + void *d_; +}; +using SocketPtr = std::shared_ptr; + +} // namespace common_interface +} // namespace arcs +#endif diff --git a/third_party/AuboSdk/linux/include/aubo/sync_move.h b/third_party/AuboSdk/linux/include/aubo/sync_move.h new file mode 100644 index 00000000..ec28922f --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo/sync_move.h @@ -0,0 +1,980 @@ +/** @file sync_move.h + * @brief 同步运行 + * + * 1. Independent movements + * If the different task programs, and their robots, work independently, no + * synchronization or coordination is needed. Each task program is then + * written as if it was the program for a single robot system. + * + * 2. Semi coordinated movements + * Several robots can work with the same work object, without synchronized + * movements, as long as the work object is not moving. + * A positioner can move the work object when the robots are not coordinated + * to it, and the robots can be coordinated to the work object when it is not + * moving. Switching between moving the object and coordinating the robots is + * called semi coordinated movements. + * + * 3. Coordinated synchronized movements + * Several robots can work with the same moving work object. + * The positioner or robot that holds the work object and the robots that work + * with the work object must have synchronized movements. This means that the + * RAPID task programs, that handle one mechanical unit each, execute their + * move instructions simultaneously. + */ +#ifndef AUBO_SDK_SYNC_MOVE_INTERFACE_H +#define AUBO_SDK_SYNC_MOVE_INTERFACE_H + +#include +#include +#include +#include +#include + +namespace arcs { +namespace common_interface { + +typedef std::unordered_set TaskSet; +class ARCS_ABI_EXPORT SyncMove +{ +public: + SyncMove(); + virtual ~SyncMove(); + + /** + *\chinese + * syncMoveOn 用于启动同步运动模式。 + * + * syncMoveOn 指令会等待其他任务程序。当所有任务程序都到达 syncMoveOn 时, + * 它们将继续以同步运动模式执行。不同任务程序中的移动指令将同时执行, + * 直到执行 syncMoveOff 指令为止。在 syncMoveOn 指令之前必须编程一个停止点。 + * + * @param syncident + * @param taskset + * @return + * + * @par Python函数原型 + * syncMoveOn(self: pyaubo_sdk.SyncMove, arg0: str, arg1: Set[str]) -> int + * + * @par Lua函数原型 + * syncMoveOn(syncident: string, taskset: table) -> nil + * @endcoe + * \endchinese + * \english + * syncMoveOn is used to start synchronized movement mode. + * + * A syncMoveOn instruction will wait for the other task programs. When + * all task programs have reached the syncMoveOn, they will continue + * their execution in synchronized movement mode. The move instructions + * in the different task programs are executed simultaneously, until the + * instruction syncMoveOff is executed. + * A stop point must be programmed before the syncMoveOn instruction. + * + * @param syncident + * @param taskset + * @return + * + * @par Python function prototype + * syncMoveOn(self: pyaubo_sdk.SyncMove, arg0: str, arg1: Set[str]) -> int + * + * @par Lua function prototype + * syncMoveOn(syncident: string, taskset: table) -> nil + * @endcoe + * \endenglish + */ + int syncMoveOn(const std::string &syncident, const TaskSet &taskset); + + /** + * \chinese + * 设置同步路径段的ID + * 在同步运动模式下,所有同时执行的移动指令必须全部编程为圆角区(corner zones)或全部为停止点(stop points)。 + * 这意味着具有相同ID的移动指令要么全部带有圆角区,要么全部带有停止点。 + * 如果在各自的任务程序中同步执行的移动指令中,一个带有圆角区而另一个带有停止点,则会发生错误。 + * 同步执行的移动指令可以有不同大小的圆角区(例如,一个使用z10,另一个使用z50)。 + * + * @param id + * @return + * + * @par Python函数原型 + * syncMoveSegment(self: pyaubo_sdk.SyncMove, arg0: int) -> bool + * + * @par Lua函数原型 + * syncMoveSegment(id: number) -> boolean + * @endcoe + * \endchinese + * \english + * Set the ID for the synchronized path segment. + * In synchronized movements mode, all or none of the simultaneous move instructions must be programmed with corner zones. + * This means that move instructions with the same ID must either all have corner zones, or all have stop points. + * If a move instruction with a corner zone and a move instruction with a stop point are synchronously executed in their respective task program, an error will occur. + * Synchronously executed move instructions can have corner zones of different sizes (e.g. one uses z10 and one uses z50). + * + * @param id + * @return + * + * @par Python prototype + * syncMoveSegment(self: pyaubo_sdk.SyncMove, arg0: int) -> bool + * + * @par Lua prototype + * syncMoveSegment(id: number) -> boolean + * @endcoe + * \endenglish + */ + bool syncMoveSegment(int id); + + /** + * \chinese + * syncMoveOff 用于结束同步运动模式。 + * + * syncMoveOff 指令会等待其他任务程序。当所有任务程序都到达 syncMoveOff 时, + * 它们将继续以非同步模式执行。在 syncMoveOff 指令之前必须编程一个停止点。 + * + * @param syncident + * @return + * + * @par Python函数原型 + * syncMoveOff(self: pyaubo_sdk.SyncMove, arg0: str) -> int + * + * @par Lua函数原型 + * syncMoveOff(syncident: string) -> nil + * @endcoe + * \endchinese + * \english + * syncMoveOff is used to end synchronized movement mode. + * + * A syncMoveOff instruction will wait for the other task programs. When + * all task programs have reached the syncMoveOff, they will continue + * their execution in unsynchronized mode. + * A stop point must be programmed before the syncMoveOff instruction. + * + * @param syncident + * @return + * + * @par Python prototype + * syncMoveOff(self: pyaubo_sdk.SyncMove, arg0: str) -> int + * + * @par Lua prototype + * syncMoveOff(syncident: string) -> nil + * @endcoe + * \endenglish + */ + int syncMoveOff(const std::string &syncident); + + /** + * \chinese + * syncMoveUndo 用于关闭同步运动,即使不是所有其他任务程序都执行了 syncMoveUndo 指令。 + * + * syncMoveUndo 主要用于 UNDO 处理程序。当程序指针从过程移动时,syncMoveUndo 用于关闭同步。 + * + * @return + * + * @par Python函数原型 + * syncMoveUndo(self: pyaubo_sdk.SyncMove) -> int + * + * @par Lua函数原型 + * syncMoveUndo() -> nil + * @endcoe + * \endchinese + * \english + * syncMoveUndo is used to turn off synchronized movements, even if not + * all the other task programs execute the syncMoveUndo instruction. + * + * syncMoveUndo is intended for UNDO handlers. When the program + * pointer is moved from the procedure, syncMoveUndo is used to turn off + * the synchronization. + * + * @return + * + * @par Python prototype + * syncMoveUndo(self: pyaubo_sdk.SyncMove) -> int + * + * @par Lua prototype + * syncMoveUndo() -> nil + * @endcoe + * \endenglish + */ + int syncMoveUndo(); + + /** + * \chinese + * waitSyncTasks 用于在程序中的特定点同步多个任务程序。 + * + * waitSyncTasks 指令会等待其他任务程序。当所有任务程序都到达 waitSyncTasks 指令时, + * 它们将继续执行。 + * + * @param syncident + * @param taskset + * @return + * + * @par Python函数原型 + * waitSyncTasks(self: pyaubo_sdk.SyncMove, arg0: str, arg1: Set[str]) -> int + * + * @par Lua函数原型 + * waitSyncTasks(syncident: string, taskset: table) -> nil + * @endcoe + * \endchinese + * \english + * waitSyncTasks is used to synchronize several task programs at a specific + * point in the program. + * + * A waitSyncTasks instruction will wait for the other task programs. When all + * task programs have reached the waitSyncTasks instruction, they will continue + * their execution. + * + * @param syncident + * @param taskset + * @return + * + * @par Python prototype + * waitSyncTasks(self: pyaubo_sdk.SyncMove, arg0: str, arg1: Set[str]) -> int + * + * @par Lua prototype + * waitSyncTasks(syncident: string, taskset: table) -> nil + * @endcoe + * \endenglish + */ + int waitSyncTasks(const std::string &syncident, const TaskSet &taskset); + + /** + * \chinese + * isSyncMoveOn 用于判断机械单元组是否处于同步运动模式。 + * + * 不控制任何机械单元的任务可以通过该函数判断参数“使用机械单元组”中定义的机械单元是否处于同步运动模式。 + * + * @return + * + * @par Python函数原型 + * isSyncMoveOn(self: pyaubo_sdk.SyncMove) -> bool + * + * @par Lua函数原型 + * isSyncMoveOn() -> boolean + * \endchinese + * \english + * isSyncMoveOn is used to tell if the mechanical unit group is in synchronized movement mode. + * + * A task that does not control any mechanical unit can find out if the mechanical units defined in the parameter Use Mechanical Unit Group are in synchronized movement mode. + * + * @return + * + * @par Python prototype + * isSyncMoveOn(self: pyaubo_sdk.SyncMove) -> bool + * + * @par Lua prototype + * isSyncMoveOn() -> boolean + * \endenglish + */ + bool isSyncMoveOn(); + + /** + * \chinese + * 暂停同步运动模式。 + * + * @return + * + * @par Python函数原型 + * syncMoveSuspend(self: pyaubo_sdk.SyncMove) -> int + * + * @par Lua函数原型 + * syncMoveSuspend() -> nil + * \endchinese + * \english + * Suspend synchronized movement mode. + * + * @return + * + * @par Python prototype + * syncMoveSuspend(self: pyaubo_sdk.SyncMove) -> int + * + * @par Lua prototype + * syncMoveSuspend() -> nil + * \endenglish + */ + int syncMoveSuspend(); + + /** + * \chinese + * 恢复同步运动模式。 + * + * @return + * + * @par Python函数原型 + * syncMoveResume(self: pyaubo_sdk.SyncMove) -> int + * + * @par Lua函数原型 + * syncMoveResume() -> nil + * \endchinese + * \english + * Resume synchronized movement mode. + * + * @return + * + * @par Python prototype + * syncMoveResume(self: pyaubo_sdk.SyncMove) -> int + * + * @par Lua prototype + * syncMoveResume() -> nil + * \endenglish + */ + int syncMoveResume(); + + /** + * \chinese + * 添加一个名为 name 的坐标系,其初始位姿为 pose,位姿以 ref_frame 坐标系表达。 + * 此命令仅向世界模型添加一个坐标系,并不会将其附加到 ref_frame 坐标系。 + * 如需将新添加的坐标系附加到 ref_frame,请使用 frameAttach()。 + * + * @param name: 要添加的坐标系名称。名称不能与任何已存在的世界模型对象(坐标系、轴或轴组)重复,否则会抛出异常。 + * @param pose: 新对象的初始位姿。 + * @param ref_frame: 位姿所表达的参考坐标系对象名称。若未指定,默认使用机器人“base”坐标系。 + * + * @return + * \endchinese + * \english + * Add a frame with the name "name" initialized at the specified pose + * expressed in the ref_frame coordinate frame. This command only adds a + * frame to the world, it does not attach it to the ref_frame coordinate + * frame. Use frameAttach() to attach the newly added frame to ref_frame if + * desired. + * + * @param name: name of the frame to be added. The name must not be the same + * as any existing world model object (frame, axis, or axis group), + * otherwise an exception is thrown + * @param pose: initial pose of the new object + * @param ref_frame: name of the world model object whose coordinate frame + * the pose is expressed in. If nothing is provided here, the default is the + * robot “base” frame. + * + * @return + * \endenglish + */ + int frameAdd(const std::string &name, const std::vector &pose, + const std::string &ref_name); + + /** + * \chinese + * 将子坐标系附加到父世界模型对象。附加时会设置父子之间的相对变换,使得子坐标系在世界中不会移动。 + * + * 子坐标系不能为“world”、“flange”、“tcp”,也不能与父坐标系同名。 + * + * 如果子或父不是已存在的坐标系,或导致形成闭环,则操作会失败。 + * + * 如果用于 MotionPlus,parent 参数可以是外部轴或轴组的名称。 + * + * @param child: 要附加的子坐标系名称,不能为“world”、“flange”或“tcp”。 + * @param parent: 子坐标系将要附加到的父对象名称。 + * + * @return + * \endchinese + * \english + * Attaches the child frame to the parent world model object. The relative + * transform between the parent and child will be set such that the child + * does not move in the world when the attachment occurs. + * + * The child cannot be “world”, “flange”, “tcp”, or the same as parent. + * + * This will fail if child or parent is not an existing frame, or this makes + * the attachments form a closed chain. + * + * If being used with the MotionPlus, the parent argument can be the name of + * an external axis or axis group. + * + * @param child: name of the frame to be attached. The name must not be + * “world”, “flange”, or “tcp”. + * @param parent: name of the object that the child frame will be attached + * to. + * + * @return + * \endenglish + */ + int frameAttach(const std::string &child, const std::string &parent); + + /** + * \chinese + * 删除所有已添加到世界模型的坐标系。 + * + * “world”、“base”、“flange”和“tcp”坐标系不能被删除。 + * + * 任何附加到被删除坐标系的坐标系将会被附加到“world”坐标系,并设置新的偏移,使得被分离的坐标系在世界中不会移动。 + * + * @return + * \endchinese + * \english + * Delete all frames that have been added to the world model. + * + * The “world”, “base”, “flange”, and “tcp” frames cannot be deleted. + * + * Any frames that are attached to the deleted frames will be attached to + * the “world” frame with new frame offsets set such that the detached + * frames do not move in the world. + * + * @return + * \endenglish + */ + int frameDeleteAll(); + + /** + * \chinese + * 删除指定名称的坐标系。 + * + * “world”、“base”、“flange”和“tcp”坐标系不能被删除。 + * + * 任何附加到被删除坐标系的坐标系将会被附加到“world”坐标系,并设置新的偏移,使得被分离的坐标系在世界中不会移动。 + * + * 如果指定的坐标系不存在,则操作会失败。 + * + * @param name: 要删除的坐标系名称 + * + * @return + * \endchinese + * \english + * Delete the frame with name from the world model. + * + * The “world”, “base”, “flange”, and “tcp” frames cannot be deleted. + * + * Any frames that are attached to the deleted frame will be attached to the + * “world” frame with new frame offsets set such that the detached frame + * does not move in the world. + * + * This command will fail if the frame does not exist. + * + * @param name: name of the frame to be deleted + * + * @return + * \endenglish + */ + int frameDelete(const std::string &name); + + /** + * \chinese + * 更改名为 name 的坐标系的位置,将其移动到由 pose 指定的新位置,pose 以 ref_name 坐标系表达。 + * + * 如果 name 为 “world”、“flange”、“tcp”,或该坐标系不存在,则操作会失败。注意:如需移动 “tcp” 坐标系,请使用 set_tcp() 命令。 + * + * 如果用于 MotionPlus,ref_name 参数可以是外部轴或轴组的名称。 + * + * @param name: 要移动的坐标系名称 + * @param pose: 新的位置 + * @param ref_name: pose 所表达的参考坐标系,默认值为机器人的 “base” 坐标系。 + * + * @return + * \endchinese + * \english + * Changes the placement of the coordinate frame named name to the new + * placement given by pose that is defined in the ref_name coordinate frame. + * + * This will fail if name is “world”, “flange”, “tcp”, or if the frame does + * not exist. Note: to move the “tcp” frame, use the set_tcp() command + * instead. + * + * If being used with the MotionPlus, the ref_name argument can be the name + * of an external axis or axis group. + * + * @param name: the name of the frame to move + * @param pose: the new placement + * @param ref_name: the coordinate frame that pose is expressed in. The + * default value is the robot’s “base” frame. + * + * @return + * \endenglish + */ + int frameMove(const std::string &name, const std::vector &pose, + const std::string &ref_name); + + /** + * \chinese + * 获取名为 name 的坐标系相对于 rel_frame 坐标系的位姿,并以 ref_frame 坐标系表达。 + * 如果未提供 ref_frame,则返回 name 坐标系相对于 rel_frame 坐标系的位姿,并以 rel_frame 坐标系表达。 + * + * 如果任一参数不是已存在的坐标系,则操作会失败。 + * + * 如果用于 MotionPlus,所有三个参数也可以是外部轴或轴组的名称。 + * + * @param name: 要查询的坐标系名称。 + * @param rel_frame: “相对坐标系”,用于计算相对位姿的坐标系。 + * @param ref_frame: “参考坐标系”,用于表达结果相对位姿的坐标系。如果未提供,则默认为 rel_frame。 + * + * @return 以 ref_frame 坐标系表达的 name 坐标系的位姿。 + * \endchinese + * \english + * Get the pose of the name frame relative to the rel_frame frame but + * expressed in the coordinates of the ref_frame frame. If ref_frame is not + * provided, then this returns the pose of the name frame relative to and + * expressed in the same frame as rel_frame. + * + * This will fail if any arguments are not an existing frame. + * + * If being used with MotionPlus, all three arguments can also be the names + * of external axes or axis groups. + * + * @param name: name of the frame to query. + * @param rel_frame: short for “relative frame” is the frame where the pose + * is computed relative to + * @param ref_frame: short for “reference frame” is the frame to express the + * coordinates of resulting relative pose in. If this is not provided, then + * it will default to match the value of rel_frame. + * + * @return The pose of the frame expressed in the ref_frame coordinates. + * \endenglish + */ + std::vector frameGetPose(const std::string &name, + const std::string &rel_frame, + const std::string &ref_frame); + + /** + * \chinese + * 将位姿从 from_frame 坐标系转换到 to_frame 坐标系。 + * + * 如果任一坐标系参数不是已存在的坐标系,则操作会失败。 + * + * 如果用于 MotionPlus,所有三个参数也可以是外部轴或轴组的名称。 + * + * @param pose: 要转换的位姿 + * @param from_frame: 原始坐标系的参考坐标系名称 + * @param to_frame: 新坐标系的参考坐标系名称 + * + * @return 以 to_frame 坐标系表达的 pose 值。 + * \endchinese + * \english + * Convert pose from from_frame to to_frame. + * + * This will fail if either coordinate system argument is not an existing + * frame. + * + * If being used with MotionPlus, all three arguments can also be the names + * of external axes or axis groups. + * + * @param pose: pose to be converted + * @param from_frame: name of reference frame at origin of old coordinate + * system + * @param to_frame: name of reference frame at origin of new coordinate + * system + * + * @return Value of pose expressed in the coordinates of to_frame. + * \endenglish + */ + std::vector frameConvertPose(const std::vector &pose, + const std::string &from_frame, + const std::string &to_frame); + + /** + * \chinese + * 查询指定名称的坐标系是否存在。 + * + * @param name: 要查询的坐标系名称。 + * + * @return 如果存在该名称的坐标系则返回 true,否则返回 false。 + * \endchinese + * \english + * Queries for the existence of a frame by the given name. + * + * @param name: name of the frame to be queried. + * + * @return Returns true if there is a frame by the given name, false if not. + * \endenglish + */ + bool frameExist(const std::string &name); + + /** + * \chinese + * 获取名为 name 的坐标系在世界模型中的父坐标系名称。 + * + * 如果该坐标系没有附加到其他坐标系,则其父坐标系为 "world"。 + * + * @param name: 要查询的坐标系名称 + * + * @return 父坐标系的名称,字符串类型 + * \endchinese + * \english + * Get the parent of the frame named name in the world model. + * + * If the frame is not attached to another frame, then “world” is the + * parent. + * + * @param name: the frame being queried + * + * @return name of the parent as a string + * \endenglish + */ + std::string frameGetParent(const std::string &name); + + /** + * \chinese + * 返回指定父对象的直接子对象坐标系名称列表。父子关系由世界模型的附加关系定义。 + * 如果用于 MotionPlus,子对象也可以是轴组或轴。 + * + * @param name: 父对象的名称。 + * + * @return 直接子对象坐标系名称列表 + * \endchinese + * \english + * Returns a list of immediate child object frame names. Parent-child + * relationships are defined by world model attachments. If being used with + * MotionPlus, the child objects may also be an axis group or an axis. + * + * @param name: the name of the parent object. + * + * @return a list of immediate child object frame names + * \endenglish + */ + std::vector frameGetChildren(const std::string &name); + + /** + * \chinese + * 向世界模型添加一个新的轴组,名称为 name。轴组基座放置在 ref_frame 坐标系下的 pose 位置。 + * + * 轴组只能附加到世界坐标系。 + * + * 每个轴组的基座都附加有一个坐标系,可以通过轴组名称作为参数传递给其他世界模型函数。 + * + * 世界模型最多可添加 6 个轴组。 + * + * @param name: 要添加的轴组名称,不能为空字符串。世界模型对象(如坐标系、轴组、轴等)的名称必须唯一。 + * @param pose: 轴组基座在参考坐标系下的位姿。 + * @param ref_frame (可选): pose 所在的参考坐标系名称,可以是任何带有坐标系的世界模型实体(如坐标系、轴组、轴等)。默认值 "base" 表示机器人基座坐标系。 + * + * @return + * \endchinese + * \english + * Adds a new axis group with the given name to the world model. It is + * placed at the given pose in the reference coordinate frame defined by + * ref_frame. + * + * An axis group can only be attached to the world coordinate frame. + * + * Each axis group has a coordinate frame attached to its base, which can be + * used as an argument to other world model functions by referring the name + * of the group. + * + * At most 6 axis groups can be added to the world model. + * + * @param name: (string) Name of the axis group to add. The name cannot be + * an empty string. Names used by world model objects (e.g., frame, axis + * group, axis, etc.) must be unique. + * + * @param pose: (pose) Pose of the axis group’s base, in the reference + * coordinate frame. + * + * @param ref_frame (optional): (string) Name of the reference coordinate + * frame that pose is defined in. This can be any world model entity with a + * coordinate system (e.g., frame, axis group, axis, etc.). The default + * value "base" refers to the robot’s base frame. + * + * @return + * \endenglish + */ + int axisGroupAdd(const std::string &name, const std::vector &pose, + const std::string &ref_frame); + + /** + * \chinese + * 删除具有给定名称的轴组。 + * + * 所有附加的轴也会被禁用(如果处于活动状态)并删除。 + * + * 如果该轴组正被其他函数控制,则操作会失败。 + * + * @param name: 要删除的轴组名称。该名称的轴组必须存在。 + * + * @return + * \endchinese + * \english + * Deletes the axis group with the given name from the world model. + * + * All attached axes are also disabled (if live) and deleted. + * + * This function will fail, if this axis group is under control by another function. + * + * @param name: (string) Name of the axis group to delete. Axis group with + * such name must exist. + * + * @return + * \endenglish + */ + int axisGroupDelete(const std::string &name); + + /** + * \chinese + * 向名为 group_name 的轴组添加一个名为 name 的外部轴。该轴在 parent 坐标系下的 pose 位置附加,pose 表示轴位置为 0 时的位姿。 + * 轴的类型、最大速度、最大加速度、位置限制和索引分别由 type、v_limit、a_limit、q_limits 和 axis_index 定义。 + * pose 参数通常通过外部轴调试标定流程获得。 + * 如果该轴组正被其他函数控制,或附加关系形成闭环,则操作会失败。 + * + * @param group_name: 要添加轴的轴组名称,需已通过 axis_group_add() 创建且存在。 + * @param name: 新轴的名称,不能为空且需唯一。 + * @param parent: 父轴名称,若为空或与 group_name 相同,则附加到轴组基座。父轴需已存在于该轴组。 + * @param pose: 轴在父坐标系下的零位姿。type 为 0(旋转轴)时,z 轴为旋转轴;type 为 1(直线轴)时,z 轴为移动方向。 + * @param type: 轴类型,0 表示旋转轴,1 表示直线轴。 + * @param v_limit: 最大速度。 + * @param a_limit: 最大加速度。 + * @param q_limits: 位置限制。 + * @param axis_index: 轴索引。 + * \endchinese + * \english + * Adds an external axis with the given name to the axis group named group_name. + * The axis is attached at the given pose in the reference coordinate frame defined by parent when its axis position is 0. + * The type, max velocity, max acceleration, position limits, and index of this axis are defined by type, v_limit, a_limit, q_limits, and axis_index, respectively. + * The pose parameter is typically obtained from a calibration process when the external axis is commissioned. + * This function will fail if this axis group is under control of another function, or if the kinematic chain created by the attachment forms a closed chain. + * + * @param group_name: Name of the axis group this new axis is added to. The axis group would have been created using axis_group_add(). Axis group with such name must exist. + * @param name: Name of the new axis. The name cannot be an empty string. Names used by world model objects (e.g., frame, axis group, axis, etc.) must be unique. + * @param parent: Name of the parent axis. If it’s empty or the same as group_name, the new axis will be attached to the base of the axis group. Axis with such name must exist in the axis group. + * @param pose: The zero-position pose, in the parent coordinate frame, this axis will be placed and attached to. This is the pose the axis will be (relative to its parent) when its axis position is 0. If type is 0 (rotary), then the z axis of the frame corresponds to the axis of rotation. If type is 1 (linear), then the z axis is the axis of translation. + * @param type: Axis type, 0 for rotary, 1 for linear. + * @param v_limit: Maximum velocity. + * @param a_limit: Maximum acceleration. + * @param q_limits: Position limits. + * @param axis_index: Axis index. + * \endenglish + */ + int axisGroupAddAxis(const std::string &group_name, const std::string &name, + const std::string &parent, + const std::vector &pose); + + /** + * \chinese + * 更新指定名称的轴的相关属性。pose 参数通常通过外部轴调试标定流程获得。 + * 如果该轴所属的轴组正被其他命令控制,则操作会失败。 + * 如果该轴组中任何已附加的轴处于激活和使能状态,则操作会失败。 + * + * @param name: 要更新的轴的名称,需已存在。 + * @param pose (可选): 轴在父轴(或轴组)坐标系下的零位姿。即轴位置为 0 时的位姿。 + * \endchinese + * \english + * Updates the corresponding properties of axis with name. The pose + * parameter is typically obtained from a calibration process when the + * external axis is commissioned. See here for a guide on a basic routine + * for calibrating a single rotary axis. + * + * This function will fail, if the axis group the axis attached to is + * already being controlled by another command. + * This function will fail, if any attached axis of the axis group is live + * and enabled. + * + * @param name: (string) Name of the axis to update. Axis with such name + * must exist. + * + * @param pose (optional): (pose) New zero-position pose, in the coordinate + * frame of the parent axis (or axis group), of the axis. This is the pose + * of the axis when its axis position is 0. + * \endenglish + */ + int axisGroupUpdateAxis(const std::string &name, + const std::vector &pose); + + /** + * \chinese + * 返回指定轴名称在 RTDE 目标位置和实际位置数组中的索引。 + * + * @param axis_name: (string) 要查询的轴名称。该名称的轴必须存在。 + * + * @return integer: 该轴在 RTDE 目标位置和实际位置数组中的索引。 + * \endchinese + * \english + * Returns the index of the axis with given axis_name in the RTDE target + * positions and actual positions arrays. + * + * @param axis_name: (string) Name of the axis in query. + * Axis with such name must exist. + * + * @return integer: Index of the axis in the RTDE target positions and + * actual positions arrays. + * \endenglish + */ + int axisGroupGetAxisIndex(const std::string &name); + + /** + * \chinese + * 返回指定轴索引对应的轴名称。 + * + * @param axis_index: (整数) 要查询的轴索引。该索引的轴必须存在。 + * + * @return 字符串: 轴的名称。 + * \endchinese + * \english + * Returns the name of the axis with the given axis_index. + * + * @param axis_index: (integer) Index of the axis in query. + * Axis with such index must exist. + * + * @return string: Name of the axis. + * \endenglish + */ + std::string axisGroupGetAxisName(int index); + + /** + * \chinese + * 返回指定轴组的当前目标位置。 + * 如果未指定 group_name,则返回所有外部轴的目标位置。 + * + * 如果外部轴总线被禁用,则该函数会失败。 + * + * @param group_name (可选): (string) 要查询的轴组名称。该名称的轴组必须真实存在。 + * + * @return Double[]: 涉及轴的目标位置,顺序为其外部轴索引顺序。 + * \endchinese + * \english + * Returns the current target positions of the axis group with group_name. + * If group_name is not provided, the target positions of all external axes + * will be returned. + * + * This function will fail, if the external axis bus is disabled. + * + * @param group_name (optional): (string) Name of the axis group in query. + * Axis group with such name must REALLY exist. + * + * @return Double[]: Target positions of the involved axes, in the order of + * their external axis indices. + * \endenglish + */ + std::vector axisGroupGetTargetPositions( + const std::string &group_name); + + /** + * \chinese + * 返回指定轴组的当前实际位置。 + * 如果未指定 group_name,则返回所有外部轴的实际位置。 + * + * 如果外部轴总线被禁用,则该函数会失败。 + * + * @param group_name (可选): (string) 要查询的轴组名称。该名称的轴组必须真实存在。 + * + * @return Double[]: 涉及轴的实际位置,顺序为其外部轴索引顺序。 + * \endchinese + * \english + * Returns the current actual positions of the axis group with group_name. + * If group_name is not provided, the actual positions of all external axes + * will be returned. + * + * This function will fail, if the external axis bus is disabled. + * + * @param group_name (optional): (string) Name of the axis group in query. + * Axis group with such name must exist. + * + * @return Double[]: Actual positions of the involved axes, in the order of + * their external axis indices. + * \endenglish + */ + std::vector axisGroupGetActualPositions( + const std::string &group_name); + + /** + * \chinese + * 通过给定的 offset,将轴组 group_name 的目标位置和实际位置整体偏移。 + * + * 这是一个仅在控制器内部进行的软件偏移,不会影响外部轴驱动器。该偏移也会应用于通过 RTDE 发布的任何目标和实际位置流。 + * + * @param group_name: (string) 要应用偏移的轴组名称。该名称的轴组必须存在。 + * + * @param offset: (float[]) 目标和实际位置需要整体偏移的量。offset 的大小必须与该轴组所包含的轴数量一致。 + * + * @return + * \endchinese + * \english + * Shifts the target and actual positions of the axis group group_name by + * the given offset. + * + * This is a software shift that happens in the controller only, it does not + * affect external axis drives. The shift is also applied to any streamed + * target and actual positions published on RTDE. + * + * @param group_name: (string) Name of the axis group to apply the offset + * positions to. Axis group with such name must exist. + * + * @param offset: (float[]) Offsets that the target and actual positions + * should be shifted by. The size of offset must match the number of axes + * attached to the given group. + * + * @return + * \endenglish + */ + int axisGroupOffsetPositions(const std::string &group_name, + const std::vector &offset); + + /** + * \chinese + * 以梯形速度曲线将名为 group_name 的轴组移动到新的位置 q。 + * 参数 a 指定本次运动的最大加速度占各轴加速度极限的百分比。 + * 参数 v 指定本次运动的最大速度占各轴速度极限的百分比。 + * + * 实际的加速度和速度由最受限制的轴决定,以确保所有轴在加速、匀速和减速阶段同时完成。 + * + * @param group_name: (string) 要移动的轴组名称。该名称的轴组必须存在。 + * @param q: (float[]) 目标位置,旋转轴为弧度,直线轴为米。如果目标超出位置极限,则会被限制在最近的极限值。涉及的轴按其索引递增排序。q 的大小必须与该轴组包含的轴数量一致。 + * @param a: (float) 本次运动的最大加速度因子,取值范围 (0,1],表示占加速度极限的百分比。 + * @param v: (float) 本次运动的最大速度因子,取值范围 (0,1],表示占速度极限的百分比。 + * + * 返回值: 无 + * \endchinese + * \english + * Moves the axes of axis group named group_name to new positions q, using a + * trapezoidal velocity profile. Factor a specifying the percentage of the + * max profile accelerations out of the acceleration limits of each axes. + * Factor v specifying the percentage of the max profile velocities out of + * the velocity limits of each axes. + * + * The actual accelerations and velocities are determined by the most + * constraining axis, so that all the axes complete the acceleration, + * cruise, and deceleration phases at the same time. + * + * @param group_name: (string) Name of the axis group to move. + * Axis group with such name must exist. + * + * @param q: (float[]) Target positions in rad (rotary) or in m (linear). If + * the target exceeds the position limits, then it is set to the nearest + * limit. The involved axes are ordered increasingly by their axis indices. + * The size of q must match the number of axes attached to the given group. + * + * @param a: (float) Factor specifying the max accelerations of this move + * out of the acceleration limits. a must be in range of (0,1]. + * + * @param v: (float) Factor specifying the max velocities of this move out + * of the velocity limits. v must be in range of (0,1]. + * + * Return: n/a + * \endenglish + */ + int axisGroupMoveJoint(const std::string &group_name, + const std::vector &q, double a, double v); + + /** + * \chinese + * 以指定的加速度因子 a,将名为 group_name 的轴组加速到目标速度 qd。该函数会运行 t 秒。 + * @param group_name: (string) 要控制的外部轴组名称,必须已存在。 + * @param qd: (float[]) 轴组各轴的目标速度。如果目标速度超过速度极限,则会被限制在极限值。涉及的轴按其索引递增排序。qd 的大小必须与该轴组包含的轴数量一致。 + * @param a: (float) 本次运动的最大加速度因子,取值范围 (0,1],表示占加速度极限的百分比。 + * @param t (可选): (float) 函数运行的持续时间(秒)。若 t < 0,则函数将在目标速度达到时返回;若 t ≥ 0,则函数将在该持续时间后返回,无论实际速度是否达到目标值。 + * \endchinese + * \english + * Accelerates the axes of axis group named group_name up to the target + * velocities qd. Factor a specifying the percentage of the max + * accelerations out of the acceleration limits of each axes. The function + * will run for a period of t seconds. + * + * @param group_name: (string) Name of the external axis group to control. + * Axis group with such name must exist. + * + * @param qd: (float[]) Target velocities for the axes in the axis group. If + * the target exceeds the velocity limits, then it is set to the limit. The + * involved axes are ordered increasingly by their axis indices. The size of + * qd must match the number of axes attached to the given group. + * + * @param a: (float) Factor specifying the max accelerations of this move + * out of the acceleration limits. a must be in range of (0,1]. + * + * @param t (optional): (float) Duration in seconds before the function + * returns. If t < 0, then the function will return when the target + * velocities are reached. if t ≥ 0, then the function will return after + * this duration, regardless of what the achieved axes velocities are. + * \endenglish + */ + int axisGroupSpeedJoint(const std::string &group_name, + const std::vector &qd, double a, double t); + +protected: + void *d_; +}; + +using SyncMovePtr = std::shared_ptr; +} // namespace common_interface +} // namespace arcs +#endif // AUBO_SDK_SYNC_MOVE_INTERFACE_H diff --git a/third_party/AuboSdk/linux/include/aubo/system_info.h b/third_party/AuboSdk/linux/include/aubo/system_info.h new file mode 100644 index 00000000..b6d836f7 --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo/system_info.h @@ -0,0 +1,342 @@ +/** @file system_info.h + * @brief 获取系统信息接口,如接口板的版本号、示教器软件的版本号 + */ +#ifndef AUBO_SDK_SYSTEM_INFO_INTERFACE_H +#define AUBO_SDK_SYSTEM_INFO_INTERFACE_H + +#include +#include +#include + +#include + +namespace arcs { +namespace common_interface { + +class ARCS_ABI_EXPORT SystemInfo +{ +public: + SystemInfo(); + virtual ~SystemInfo(); + + /** + * \chinese + * 获取控制器软件版本号 + * + * @return 返回控制器软件版本号 + * + * @par Python函数原型 + * getControlSoftwareVersionCode(self: pyaubo_sdk.SystemInfo) -> int + * + * @par Lua函数原型 + * getControlSoftwareVersionCode() -> number + * + * @par C++示例 + * @code + * int control_version = + * rpc_cli->getSystemInfo()->getControlSoftwareVersionCode(); + * @endcode + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"SystemInfo.getControlSoftwareVersionCode","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":28003} + * + * \endchinese + * \english + * Get the controller software version code + * + * @return Returns the controller software version code + * + * @par Python prototype + * getControlSoftwareVersionCode(self: pyaubo_sdk.SystemInfo) -> int + * + * @par Lua prototype + * getControlSoftwareVersionCode() -> number + * + * @par C++ example + * @code + * int control_version = + * rpc_cli->getSystemInfo()->getControlSoftwareVersionCode(); + * @endcode + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"SystemInfo.getControlSoftwareVersionCode","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":28003} + * + * \endenglish + */ + int getControlSoftwareVersionCode(); + + /** + * \chinese + * 获取完整控制器软件版本号 + * + * @return 返回完整控制器软件版本号 + * + * @par Python函数原型 + * getControlSoftwareFullVersion(self: pyaubo_sdk.SystemInfo) -> str + * + * @par Lua函数原型 + * getControlSoftwareFullVersion() -> string + * + * @par C++示例 + * @code + * std::string control_version = + * rpc_cli->getSystemInfo()->getControlSoftwareFullVersion(); + * @endcode + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"SystemInfo.getControlSoftwareFullVersion","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"0.31.0-alpha.16+20alc76"} + * + * \endchinese + * \english + * Get the full controller software version + * + * @return Returns the full controller software version + * + * @par Python prototype + * getControlSoftwareFullVersion(self: pyaubo_sdk.SystemInfo) -> str + * + * @par Lua prototype + * getControlSoftwareFullVersion() -> string + * + * @par C++ example + * @code + * std::string control_version = + * rpc_cli->getSystemInfo()->getControlSoftwareFullVersion(); + * @endcode + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"SystemInfo.getControlSoftwareFullVersion","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"0.31.0-alpha.16+20alc76"} + * + * \endenglish + */ + std::string getControlSoftwareFullVersion(); + + /** + * \chinese + * 获取接口版本号 + * + * @return 返回接口版本号 + * + * @par Python函数原型 + * getInterfaceVersionCode(self: pyaubo_sdk.SystemInfo) -> int + * + * @par Lua函数原型 + * getInterfaceVersionCode() -> number + * + * @par C++示例 + * @code + * int interface_version = + * rpc_cli->getSystemInfo()->getInterfaceVersionCode(); + * @endcode + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"SystemInfo.getInterfaceVersionCode","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":22003} + * + * \endchinese + * \english + * Get the interface version code + * + * @return Returns the interface version code + * + * @par Python prototype + * getInterfaceVersionCode(self: pyaubo_sdk.SystemInfo) -> int + * + * @par Lua prototype + * getInterfaceVersionCode() -> number + * + * @par C++ example + * @code + * int interface_version = + * rpc_cli->getSystemInfo()->getInterfaceVersionCode(); + * @endcode + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"SystemInfo.getInterfaceVersionCode","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":22003} + * + * \endenglish + */ + int getInterfaceVersionCode(); + + /** + * \chinese + * 获取控制器软件构建时间 + * + * @return 返回控制器软件构建时间 + * + * @par Python函数原型 + * getControlSoftwareBuildDate(self: pyaubo_sdk.SystemInfo) -> str + * + * @par Lua函数原型 + * getControlSoftwareBuildDate() -> string + * + * @par C++示例 + * @code + * std::string build_date = + * rpc_cli->getSystemInfo()->getControlSoftwareBuildDate(); + * @endcode + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"SystemInfo.getControlSoftwareBuildDate","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"2024-3-5 07:03:20"} + * + * \endchinese + * \english + * Get the controller software build date + * + * @return Returns the controller software build date + * + * @par Python prototype + * getControlSoftwareBuildDate(self: pyaubo_sdk.SystemInfo) -> str + * + * @par Lua prototype + * getControlSoftwareBuildDate() -> string + * + * @par C++ example + * @code + * std::string build_date = + * rpc_cli->getSystemInfo()->getControlSoftwareBuildDate(); + * @endcode + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"SystemInfo.getControlSoftwareBuildDate","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"2024-3-5 07:03:20"} + * + * \endenglish + */ + std::string getControlSoftwareBuildDate(); + + /** + * \chinese + * 获取控制器软件git版本 + * + * @return 返回控制器软件git版本 + * + * @par Python函数原型 + * getControlSoftwareVersionHash(self: pyaubo_sdk.SystemInfo) -> str + * + * @par Lua函数原型 + * getControlSoftwareVersionHash() -> string + * + * @par C++示例 + * @code + * std::string git_version = + * rpc_cli->getSystemInfo()->getControlSoftwareVersionHash(); + * @endcode + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"SystemInfo.getControlSoftwareVersionHash","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"fa4f64a"} + * + * \endchinese + * \english + * Get the controller software git version + * + * @return Returns the controller software git version + * + * @par Python prototype + * getControlSoftwareVersionHash(self: pyaubo_sdk.SystemInfo) -> str + * + * @par Lua prototype + * getControlSoftwareVersionHash() -> string + * + * @par C++ example + * @code + * std::string git_version = + * rpc_cli->getSystemInfo()->getControlSoftwareVersionHash(); + * @endcode + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"SystemInfo.getControlSoftwareVersionHash","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"fa4f64a"} + * + * \endenglish + */ + std::string getControlSoftwareVersionHash(); + + /** + * \chinese + * 获取系统时间(软件启动时间 ns 纳秒) + * + * @return 返回系统时间(软件启动时间 ns 纳秒) + * + * @par Python函数原型 + * getControlSystemTime(self: pyaubo_sdk.SystemInfo) -> int + * + * @par Lua函数原型 + * getControlSystemTime() -> number + * + * @par C++示例 + * @code + * std::string system_time = + * rpc_cli->getSystemInfo()->getControlSystemTime(); + * @endcode + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"SystemInfo.getControlSystemTime","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":9287799079682} + * + * \endchinese + * \english + * Get the system time (software start time in nanoseconds) + * + * @return Returns the system time (software start time in nanoseconds) + * + * @par Python prototype + * getControlSystemTime(self: pyaubo_sdk.SystemInfo) -> int + * + * @par Lua prototype + * getControlSystemTime() -> number + * + * @par C++ example + * @code + * std::string system_time = + * rpc_cli->getSystemInfo()->getControlSystemTime(); + * @endcode + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"SystemInfo.getControlSystemTime","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":9287799079682} + * + * \endenglish + */ + uint64_t getControlSystemTime(); + +protected: + void *d_; +}; + +using SystemInfoPtr = std::shared_ptr; + +} // namespace common_interface +} // namespace arcs +#endif diff --git a/third_party/AuboSdk/linux/include/aubo/trace.h b/third_party/AuboSdk/linux/include/aubo/trace.h new file mode 100644 index 00000000..c1401f8d --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo/trace.h @@ -0,0 +1,231 @@ +/** @file trace.h + * \~chinese @brief 向控制器日志系统注入日志方面的接口 \~english @brief Interface for injecting logs into the controller's logging system + */ +#ifndef AUBO_SDK_TRACE_INTERFACE_H +#define AUBO_SDK_TRACE_INTERFACE_H + +#include +#include +#include +#include + +#include +#include + +namespace arcs { +namespace common_interface { + +/** + * \~chinese 提供给控制器扩展程序的日志记录系统 \~english provides a logging system for controller extension programs + */ +class ARCS_ABI_EXPORT Trace +{ +public: + Trace(); + virtual ~Trace(); + + /** + * \~chinese 向 aubo_control 日志注入告警信息 \~english Injects alarm information into the aubo_control log + * + * TraceLevel: \n + * 0 - FATAL \n + * 1 - ERROR \n + * 2 - WARNING \n + * 3 - INFO \n + * 4 - DEBUG \n + * + * \~chinese code定义参考 error_stack \~english Code definitions refer to error_stack + * + * @param level + * @param code + * @param args + * @return + * + * \~chinese @par Python函数原型 \~english @par Python function prototype + * alarm(self: pyaubo_sdk.Trace, arg0: arcs::common_interface::TraceLevel, + * arg1: int, arg2: List[str]) -> int + * + * \~chinese @par Lua函数原型 \~english @par Lua function prototype + * alarm(level: number, code: number, args: table) -> nil + * + * \~chinese @par JSON-RPC请求示例 \~english @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.Trace.alarm","params":["",1,["Error","Trajectory + * planning failed!","1"]],"id":1} + * + * \~chinese @par JSON-RPC响应示例 \~engish @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + */ + int alarm(TraceLevel level, int code, + const std::vector &args = {}); + + /** + * \chinese + * 打印文本信息到日志中 + * + * @param msg 文本信息 + * @return + * + * @par Python函数原型 + * textmsg(self: pyaubo_sdk.Trace, arg0: str) -> int + * + * @par Lua函数原型 + * textmsg(msg: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.Trace.textmsg","params":["test"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * print message into log + * + * @param msg message information + * @return + * + * @par Python function prototype + * textmsg(self: pyaubo_sdk.Trace, arg0: str) -> int + * + * @par Lua function prototype + * textmsg(msg: string) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.Trace.textmsg","params":["test"],"id":1} + * + * @par JSON-RPC responose example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int textmsg(const std::string &msg); + + /** + * \~chinese 通知上位机 \~english Notify the system + * + * @param msg + * @return + */ + int notify(const std::string &msg); + + /** + * \chinese + * 向连接的 RTDE 客户端发送弹窗请求 + * + * @param level + * @param title + * @param msg + * @param mode 模式 \n + * 0: 普通模式 \n + * 1: 阻塞模式 \n + * 2: 输入模式 bool \n + * 3: 输入模式 int \n + * 4: 输入模式 double \n + * 5: 输入模式 string \n + * @return + * + * @par Python函数原型 + * popup(self: pyaubo_sdk.Trace, arg0: arcs::common_interface::TraceLevel, + * arg1: str, arg2: str, arg3: int) -> int + * + * @par Lua函数原型 + * popup(level: number, title: string, msg: string, mode: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.Trace.popup","params":["","Error","Trajectory + * planning failed!",1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Send a popup request to the connected RTDE client + * + * @param level + * @param title + * @param msg + * @param mode mode \n + * 0: normal mode \n + * 1: blocking mode \n + * 2: input mode bool \n + * 3: input mode int \n + * 4: input mode double \n + * 5: input mode string \n + * @return + * + * @par Python function prototype + * popup(self: pyaubo_sdk.Trace, arg0: arcs::common_interface::TraceLevel, + * arg1: str, arg2: str, arg3: int) -> int + * + * @par Lua function prototype + * popup(level: number, title: string, msg: string, mode: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.Trace.popup","params":["","Error","Trajectory + * planning failed!",1],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int popup(TraceLevel level, const std::string &title, + const std::string &msg, int mode); + + /** + * \chinese + * peek最新的 AlarmInfo(上次一获取之后) + * + * last_time设置为0时,可以获取到所有的AlarmInfo + * + * @param num + * @param last_time + * @return + * + * @par Python函数原型 + * peek(self: pyaubo_sdk.Trace, arg0: int, arg1: int) -> + * List[arcs::common_interface::RobotMsg] + * + * @par Lua函数原型 + * peek(num: number, last_time: number) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.Trace.peek","params":[1,0],"id":1} + * + * @par JSON-RPC响应示例 + * {{"id":1,"jsonrpc":"2.0","result":[{"args":["RobotModeType.Running"], + * "code":30045,"level":"INFO","source":"rob1","timestamp":5102883064300}]} + * \endchinese + * \english + * peek the latest AlarmInfo (after the last retrieval) + * + * When last_time is set as 0, retrieve all AlarmInfo + * + * @param num + * @param last_time + * @return + * + * @par Python function prototype + * peek(self: pyaubo_sdk.Trace, arg0: int, arg1: int) -> + * List[arcs::common_interface::RobotMsg] + * + * @par Lua function prototype + * peek(num: number, last_time: number) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.Trace.peek","params":[1,0],"id":1} + * + * @par JSON-RPC response example + * {{"id":1,"jsonrpc":"2.0","result":[{"args":["RobotModeType.Running"], + * "code":30045,"level":"INFO","source":"rob1","timestamp":5102883064300}]} + * \endenglish + */ + RobotMsgVector peek(size_t num, uint64_t last_time = 0); + +protected: + void *d_; +}; + +using TracePtr = std::shared_ptr; + +} // namespace common_interface +} // namespace arcs +#endif diff --git a/third_party/AuboSdk/linux/include/aubo/type_def.h b/third_party/AuboSdk/linux/include/aubo/type_def.h new file mode 100644 index 00000000..7b538f2d --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo/type_def.h @@ -0,0 +1,941 @@ +/** @file type_def.h + * \~chinese @brief 数据类型的定义 \~english @brief enum type definitions + */ +#ifndef AUBO_SDK_TYPE_DEF_H +#define AUBO_SDK_TYPE_DEF_H + +#include +#include +#include +#include +#include +#include +#include + +#ifdef _MSC_VER +#pragma execution_character_set("utf-8") +#endif + +// clang-format off + +namespace arcs { +namespace common_interface { + +/// Cartesion degree of freedom, 6 for x,y,z,rx,ry,rz +#define CARTESIAN_DOF 6 +#define SAFETY_PARAM_SELECT_NUM 2 ///< \~chinese 正常 + 缩减 \~english normal + reduced +#define SAFETY_PLANES_NUM 8 ///< \~chinese 安全平面的数量 \~english Number of safety planes +#define SAFETY_CUBIC_NUM 10 ///< \~chinese 安全立方体的数量 \~english Number of safety cubes +#define TOOL_CONFIGURATION_NUM 3 ///< \~chinese 工具配置数量 \~english Number of tool configurations + +using Vector3d = std::array; +using Vector4d = std::array; +using Vector3f = std::array; +using Vector4f = std::array; +using Vector6f = std::array; + +struct RobotSafetyParameterRange +{ + RobotSafetyParameterRange() + { + for (int i = 0; i < SAFETY_PARAM_SELECT_NUM; i++) { + params[i].power = 0.; + params[i].momentum = 0.; + params[i].stop_time = 0.; + params[i].stop_distance = 0.; + params[i].reduced_entry_time = 0.; + params[i].reduced_entry_distance = 0.; + params[i].tcp_speed = 0.; + params[i].elbow_speed = 0.; + params[i].tcp_force = 0.; + params[i].elbow_force = 0.; + std::fill(params[i].qmin.begin(), params[i].qmin.end(), 0.); + std::fill(params[i].qmax.begin(), params[i].qmax.end(), 0.); + std::fill(params[i].qdmax.begin(), params[i].qdmax.end(), 0.); + std::fill(params[i].joint_torque.begin(), + params[i].joint_torque.end(), 0.); + params[i].tool_orientation.fill(0.); + params[i].tool_deviation = 0.; + for (int j = 0; j < SAFETY_PLANES_NUM; j++) { + params[i].planes[j].fill(0.); + params[i].restrict_elbow[j] = 0; + } + } + for (int i = 0; i < SAFETY_PLANES_NUM; i++) { + trigger_planes[i].plane.fill(0.); + trigger_planes[i].restrict_elbow = 0; + } + for (int i = 0; i < SAFETY_CUBIC_NUM; i++) { + cubic[i].orig.fill(0.); + cubic[i].size.fill(0.); + cubic[i].restrict_elbow = 0; + } + for (int i = 0; i < TOOL_CONFIGURATION_NUM; i++) { + tools[i].fill(0.); + } + + tool_inclination = 0.; + tool_azimuth = 0.; + std::fill(safety_home.begin(), safety_home.end(), 0.); + + safety_input_emergency_stop = 0; + safety_input_safeguard_stop = 0; + safety_input_safeguard_reset = 0; + safety_input_auto_safeguard_stop = 0; + safety_input_auto_safeguard_reset = 0; + safety_input_three_position_switch = 0; + safety_input_operational_mode = 0; + safety_input_reduced_mode = 0; + safety_input_handguide = 0; + + safety_output_emergency_stop = 0; + safety_output_not_emergency_stop = 0; + safety_output_robot_moving = 0; + safety_output_robot_steady = 0; + safety_output_reduced_mode = 0; + safety_output_not_reduced_mode = 0; + safety_output_safe_home = 0; + safety_output_robot_not_stopping = 0; + safety_output_safetyguard_stop = 0; + + tp_3pe_for_handguide = 1; + allow_manual_high_speed = 0; + } + + uint32_t crc32{ 0 }; + + /// \~chinese 最多可以保存2套参数, 默认使用第 0 套参数 \~english At most 2 + /// sets of parameters can be saved, default is the 0th set + struct + { + float power; ///< \~chinese 关节力矩与关节角速度的乘积之和 \~english sum of joint torques times joint angular speeds + float momentum; ///< \~chinese 机器人动量限制 \~english robot momentum limit + float stop_time; ///< \~chinese 停机时间 ms \~english stop time in milliseconds + float stop_distance; ///< \~chinese 停机距离 m \~english stop distance in meters + float reduced_entry_time; ///< \~chinese 进入缩减模式的最大时间 \~english maximum time to enter reduced mode + float reduced_entry_distance; ///< \~chinese 进入缩减模式的最大距离(可由安全平面触发) \~english maximum distance to enter reduced mode (can be triggered by safety planes) + float tcp_speed; + float elbow_speed; + float tcp_force; + float elbow_force; + std::vector qmin; + std::vector qmax; + std::vector qdmax; + std::vector joint_torque; + Vector3f tool_orientation; ///< + float tool_deviation; + Vector4f planes[SAFETY_PLANES_NUM]; /// x,y,z,displacement + int restrict_elbow[SAFETY_PLANES_NUM]; + } params[SAFETY_PARAM_SELECT_NUM]; + + /// \~chinese 8个触发平面 \~english 8 trigger planes + struct + { + Vector4f plane; /// x,y,z,displacement + int restrict_elbow; + } trigger_planes[SAFETY_PLANES_NUM]; + + struct + { + Vector6f orig; ///< \~chinese 立方块的原点 (x,y,z,rx,ry,rz) \~english origin of the cubic (x,y,z,rx,ry,rz) + Vector3f size; ///< \~chinese 立方块的尺寸 (x,y,z) \~english size of the cubic (x,y,z) + int restrict_elbow; + } cubic[SAFETY_CUBIC_NUM]; ///< \~chinese 10个安全空间 \~english 10 safety spaces + + /// \~chinese 3个工具 \~english 3 tools + Vector4f tools[TOOL_CONFIGURATION_NUM]; /// x,y,z,radius + + float tool_inclination{ + 0. + }; ///< \~chinese 倾角 \~english inclination angle + float tool_azimuth{ 0. }; ///< \~chinese 方位角 \~english azimuth angle + std::vector safety_home; + + /// \~chinese 可配置IO的输入输出安全功能配置 \~english Configurable IO input + /// and output safety functions + uint32_t safety_input_emergency_stop; + uint32_t safety_input_safeguard_stop; + uint32_t safety_input_safeguard_reset; + uint32_t safety_input_auto_safeguard_stop; + uint32_t safety_input_auto_safeguard_reset; + uint32_t safety_input_three_position_switch; + uint32_t safety_input_operational_mode; + uint32_t safety_input_reduced_mode; + uint32_t safety_input_handguide; + + uint32_t safety_output_emergency_stop; + uint32_t safety_output_not_emergency_stop; + uint32_t safety_output_robot_moving; + uint32_t safety_output_robot_steady; + uint32_t safety_output_reduced_mode; + uint32_t safety_output_not_reduced_mode; + uint32_t safety_output_safe_home; + uint32_t safety_output_robot_not_stopping; + uint32_t safety_output_safetyguard_stop; + + int tp_3pe_for_handguide; ///< \~chinese 是否将示教器三档位开关作为拖动功能开关 \~english Whether to use the three-position switch of the teach pendant as a hand guiding function switch + int allow_manual_high_speed; ///< \~chinese 手动模式下允许高速运行 /~english Allow high-speed operation in manual mode +}; + +inline std::ostream &operator<<(std::ostream &os, + const RobotSafetyParameterRange &vd) +{ + // os << (int)vd; + return os; +} + +struct WObjectData +{ + /// \~chinese 是否为外部工具 \~english Whether it is an external tool + bool remote_tool{ false }; + + /// \~chinese 工件坐标系耦合的 \~english Coupled with the workpiece + /// coordinate system + std::string attach_frame{ "" }; + + /// \~english User coordinate system. \~chinese 用户坐标系 + /// \~chinese 如果 robhold 为 false, 那 uframe 的数值是基于 world \~english + /// If robhold is false, the values of uframe are based on world. + /// \~chinese 否则,uframe 的数值是基于 flange \~english Otherwise, the + /// values of uframe are based on flange. + std::vector user_coord{ std::vector(6, 0) }; + + /// \~chinese 工件坐标系,基于 uframe \~english tool coordinate system, + /// based on uframe + std::vector obj_coord{ std::vector(6, 0) }; +}; + +inline std::ostream &operator<<(std::ostream &os, WObjectData p) +{ + return os; +} + +/// \~chinese 接口函数返回值定义 \~english Error codes definition +/// +/// \~chinese 整数为警告,负数为错误,0为没有错误也没有警告 \~english whole +/// number is warning, negative number is error, 0 is no error and no warning +#define ENUM_AuboErrorCodes_DECLARES \ + ENUM_ITEM(AUBO_OK, 0, "Success") \ + ENUM_ITEM(AUBO_BAD_STATE, 1, "State error") \ + ENUM_ITEM(AUBO_QUEUE_FULL, 2, "Planning queue full") \ + ENUM_ITEM(AUBO_BUSY, 3, "The previous command is executing") \ + ENUM_ITEM(AUBO_TIMEOUT, 4, "Timeout") \ + ENUM_ITEM(AUBO_INVL_ARGUMENT, 5, "Invalid parameters") \ + ENUM_ITEM(AUBO_NOT_IMPLETEMENT, 6, "Interface not implemented") \ + ENUM_ITEM(AUBO_NO_ACCESS, 7, "Cannot access") \ + ENUM_ITEM(AUBO_CONN_REFUSED, 8, "Connection refused") \ + ENUM_ITEM(AUBO_CONN_RESET, 9, "Connection is reset") \ + ENUM_ITEM(AUBO_INPROGRESS, 10, "Execution in progress") \ + ENUM_ITEM(AUBO_EIO, 11, "Input/Output error") \ + ENUM_ITEM(AUBO_NOBUFFS, 12, "") \ + ENUM_ITEM(AUBO_REQUEST_IGNORE, 13, "Request was ignored") \ + ENUM_ITEM(AUBO_ALGORITHM_PLAN_FAILED, 14, \ + "Motion planning algorithm error") \ + ENUM_ITEM(AUBO_VERSION_INCOMPAT, 15, "Interface version unmatch") \ + ENUM_ITEM(AUBO_DIMENSION_ERR, 16, \ + "Input parameter dimension is incorrect") \ + ENUM_ITEM(AUBO_SINGULAR_ERR, 17, "Input configuration may be singular") \ + ENUM_ITEM(AUBO_POS_BOUND_ERR, 18, \ + "Input position boundary exceeds the limit range") \ + ENUM_ITEM(AUBO_INIT_POS_ERR, 19, "Initial position input is unreasonable") \ + ENUM_ITEM(AUBO_ELP_SETTING_ERR, 20, "Envelope body setting error") \ + ENUM_ITEM(AUBO_TRAJ_GEN_FAIL, 21, "Trajectory generation failed") \ + ENUM_ITEM(AUBO_TRAJ_SELF_COLLISION, 22, "Trajectory self collision") \ + ENUM_ITEM( \ + AUBO_IK_NO_CONVERGE, 23, \ + "Inverse kinematics computation did not converge; computation failed") \ + ENUM_ITEM(AUBO_IK_OUT_OF_RANGE, 24, \ + "Inverse kinematics result out of robot range") \ + ENUM_ITEM(AUBO_IK_CONFIG_DISMATCH, 25, \ + "Inverse kinematics input configuration contains errors") \ + ENUM_ITEM(AUBO_IK_JACOBIAN_FAILED, 26, \ + "The calculation of the inverse Jacobian matrix failed") \ + ENUM_ITEM(AUBO_IK_NO_SOLU, 27, \ + "The target point has solutions, but it has exceeded the joint " \ + "limit conditions") \ + ENUM_ITEM(AUBO_IK_UNKOWN_ERROR, 28, "Inverse kinematics unkown error") \ + ENUM_ITEM(AUBO_MOVE_IGNORED_SERVOMODE, 29, \ + "Robot is in servo mode where movement is disabled") \ + ENUM_ITEM(AUBO_INST_QUEUED, 100, "Instruction pused into queue succeed") \ + ENUM_ITEM(AUBO_INTERNAL_ERR, 101, "Internal error caused by alg .etc.") \ + ENUM_ITEM(AUBO_BADSTATE_THREAD_DETACHED, 200, \ + "Bad state: Operation not allowed on detached thread") \ + ENUM_ITEM(AUBO_BADSTATE_THREAD_KILLED, 201, \ + "Bad state: Operation not allowed on killed thread") \ + ENUM_ITEM(AUBO_BADSTATE_TASK_NOT_FOUND, 202, \ + "Bad state: Specified task id does not exist in the task queue")\ + ENUM_ITEM(AUBO_BADSTATE_RTM_NOT_STARTED, 203, \ + "Bad state: RuntimeMachine has not been started yet") \ + ENUM_ITEM(AUBO_BADSTATE_RTM_NOT_STOPPED, 204, \ + "Bad state: RuntimeMachine must be in Stopped state for this operation") \ + ENUM_ITEM(AUBO_BADSTATE_RTM_NOT_PAUSED, 205, \ + "Bad state: RuntimeMachine must be in Paused state for this operation") \ + ENUM_ITEM(AUBO_BADSTATE_RTM_ABORTING, 206, "Bad state: RuntimeMachine is in aborting state") \ + ENUM_ITEM(AUBO_BADSTATE_PSTOP, 207, "Bad state: Operation blocked by protective stop") \ + ENUM_ITEM(AUBO_BADSTATE_ROBOT_ESTOP, 208, "Bad state: Robot emergency stop triggered") \ + ENUM_ITEM(AUBO_BADSTATE_SYSTEM_ESTOP, 209, "Bad state: System emergency stop triggered") \ + ENUM_ITEM(AUBO_BADSTATE_INVALID_ROBOT_MODE, 210, \ + "Bad state: Robot is not in required operation mode") \ + ENUM_ITEM(AUBO_BADSTATE_INVALID_SAFETY_MODE, 211, \ + "Bad state: Robot is not in required safety mode") \ + ENUM_ITEM(AUBO_BADSTATE_ROBOT_NOT_RUNNING, 212, \ + "Bad state: Robot must be in Running mode for this operation") \ + ENUM_ITEM(AUBO_BADSTATE_ROBOT_NOT_POWERED_OFF, 213, \ + "Bad state: Robot must be in PowerOff mode for this operation") \ + ENUM_ITEM(AUBO_BADSTATE_SERIAL_OPEN_FAILED, 214, "Bad state: Failed to open serial device") \ + ENUM_ITEM(AUBO_BADSTATE_SERIAL_NOT_A_TERMINAL, 215, \ + "Bad state: Specified device is not a terminal") \ + ENUM_ITEM(AUBO_BADSTATE_SERIAL_CONFIG_FAILED, 216, \ + "Bad state: Failed to configure serial port parameters") \ + ENUM_ITEM(AUBO_BADSTATE_KINEMATICS_COMPENSATE_FAILED, 217, \ + "Bad state: Failed to set kinematics compensation parameters") \ + ENUM_ITEM(AUBO_BADSTATE_ROBOT_NOT_STEADY, 218, "Bad state: Robot is not in steady state") \ + ENUM_ITEM(AUBO_BADSTATE_FREE_DRIVE_ACTIVE, 219, "Bad state: Free-drive mode is active") \ + ENUM_ITEM(AUBO_BADSTATE_FORCE_CTRL_ACTIVE, 220, "Bad state: Force control mode is active") \ + ENUM_ITEM(AUBO_BADSTATE_SIMULATION_MODE_ACTIVE, 221, \ + "Bad state: Operation not allowed in simulation mode") \ + ENUM_ITEM(AUBO_ERR_UNKOWN, 99999, "Unkown error occurred.") + +/** + * The RuntimeState enum + * + */ +#define ENUM_RuntimeState_DECLARES \ + ENUM_ITEM(Running, 0, "正在运行中") \ + ENUM_ITEM(Retracting, 1, "倒退") \ + ENUM_ITEM(Pausing, 2, "暂停中") \ + ENUM_ITEM(Paused, 3, "暂停状态") \ + ENUM_ITEM(Stepping, 4, "单步执行中") \ + ENUM_ITEM(Stopping, 5, "受控停止中(保持原有轨迹)") \ + ENUM_ITEM(Stopped, 6, "已停止") \ + ENUM_ITEM(Aborting, 7, "停止(最大速度关节运动停机)") + +/** + * \chinese + * @brief The RobotModeType enum + * + * 硬件强相关 + * \endchinese + * + * \english + * @brief The RobotModeType enum + * + * Hardware related + * \endenglish + */ +#define ENUM_RobotModeType_DECLARES \ + ENUM_ITEM(NoController, -1, "提供给示教器使用的, 如果aubo_control进程崩溃则会显示为NoController") \ + ENUM_ITEM(Disconnected, 0, "没有连接到机械臂本体(控制器与接口板断开连接或是 EtherCAT 等总线断开)") \ + ENUM_ITEM(ConfirmSafety, 1, "正在进行安全配置, 断电状态下进行") \ + ENUM_ITEM(Booting, 2, "机械臂本体正在上电初始化") \ + ENUM_ITEM(PowerOff, 3, "机械臂本体处于断电状态") \ + ENUM_ITEM(PowerOn, 4, "机械臂本体上电成功, 刹车暂未松开(抱死), 关节初始状态未获取") \ + ENUM_ITEM(Idle, 5, "机械臂上电成功, 刹车暂未松开(抱死), 电机不通电, 关节初始状态获取完成") \ + ENUM_ITEM(BrakeReleasing, 6, "机械臂上电成功, 刹车正在松开") \ + ENUM_ITEM(BackDrive, 7, "反向驱动:刹车松开, 电机不通电") \ + ENUM_ITEM(Running, 8, "机械臂刹车松开, 运行模式, 控制权由硬件移交给软件") \ + ENUM_ITEM(Maintaince, 9, "维护模式: 包括固件升级、参数写入等") \ + ENUM_ITEM(Error, 10, "") \ + ENUM_ITEM(PowerOffing, 11, "机械臂本体处于断电过程中") + +#define ENUM_SafetyModeType_DECLARES \ + ENUM_ITEM(Undefined, 0, "安全状态待定") \ + ENUM_ITEM(Normal, 1, "正常运行模式") \ + ENUM_ITEM(ReducedMode, 2, "缩减运行模式") \ + ENUM_ITEM(Recovery, 3, "启动时如果在安全限制之外, 机器人将进入recovery模式") \ + ENUM_ITEM(Violation, 4, "超出安全限制(根据安全配置, 例如速度超限等)") \ + ENUM_ITEM(ProtectiveStop, 5, "软件触发的停机(保持轨迹, 不抱闸, 不断电)") \ + ENUM_ITEM(SafeguardStop, 6, "IO触发的防护停机(不保持轨迹, 抱闸, 不断电)") \ + ENUM_ITEM(SystemEmergencyStop,7, "系统急停:急停信号由外部输入(可配置输入), 不对外输出急停信号") \ + ENUM_ITEM(RobotEmergencyStop, 8, "机器人急停:控制柜急停输入或者示教器急停按键触发, 对外输出急停信号") \ + ENUM_ITEM(Fault, 9, "机械臂硬件故障或者系统故障") + //ValidateJointId + +/** + * \chinese + * 根据ISO 10218-1:2011(E) 5.7节 + * Automatic: In automatic mode, the robot shall execute the task programme and + * the safeguarding measures shall be functioning. Automatic operation shall be + * prevented if any stop condition is detected. Switching from this mode shall + * result in a stop. + * \endchinese + * \english + * Based on ISO 10218-1:2011(E) Section 5.7 + * Automatic: In automatic mode, the robot shall execute the task programme and + * the safeguarding measures shall be functioning. Automatic operation shall be + * prevented if any stop condition is detected. Switching from this mode shall + * result in a stop. + * \endenglish + */ +#define ENUM_OperationalModeType_DECLARES \ + ENUM_ITEM(Disabled, 0, "禁用模式: 不使用 Operational Mode") \ + ENUM_ITEM(Automatic, 1, "自动模式: 机器人正常工作模式, 运行速度不会被限制 (auto mode: robot normal operation, speed will not be limited)") \ + ENUM_ITEM(Manual, 2, "手动模式: 机器人编程示教模式(T1), 机器人运行速度将会被限制或者机器人程序校验模式(T2) (manual mode: robot programming teaching mode (T1), robot running speed will be limited or robot program verification mode (T2)") \ + +/** + * \~chinese 机器人的控制模式, 最终的控制对象 \~english Robot control mode, the final control object + */ +#define ENUM_RobotControlModeType_DECLARES \ + ENUM_ITEM(Unknown, 0, "未知的控制模式 (unknown control mode)") \ + ENUM_ITEM(Position, 1, "位置控制 movej (position control)") \ + ENUM_ITEM(Speed, 2, "速度控制 speedj/speedl (speed control)") \ + ENUM_ITEM(Servo, 3, "位置控制 servoj (position control)") \ + ENUM_ITEM(Freedrive, 4, "拖动示教 freedrive_mode") \ + ENUM_ITEM(Force, 5, "末端力控 force_mode") \ + ENUM_ITEM(Torque, 6, "关节力矩控制 (joint torque control)") \ + ENUM_ITEM(Collision, 7, "碰撞模式 (collision mode)") \ + +#define ENUM_JointServoModeType_DECLARES \ + ENUM_ITEM(Unknown, -1, "未知") \ + ENUM_ITEM(Open, 0, "开环模式 (open loop mode)") \ + ENUM_ITEM(Current, 1, "电流伺服模式 (current servo mode)") \ + ENUM_ITEM(Velocity, 2, "速度伺服模式 (speed servo mode)") \ + ENUM_ITEM(Position, 3, "位置伺服模式 (position servo mode)") \ + ENUM_ITEM(Torque, 4, "力矩伺服模式 (torque servo mode)") \ + +#define ENUM_JointStateType_DECLARES \ + ENUM_ITEM(Poweroff, 0, "节点未连接到接口板或者已经断电 (node not conected to interface board or already powered off)") \ + ENUM_ITEM(Idle, 2, "节点空闲 (node idle)") \ + ENUM_ITEM(Fault, 3, "节点错误, 节点停止伺服运动, 刹车抱死 (node error, node stopped servo move, brake engaged)") \ + ENUM_ITEM(Running, 4, "节点伺服 (node servo)") \ + ENUM_ITEM(Bootload, 5, "节点bootloader状态, 暂停一切通讯 (node bootloader state, pause all communication)") \ + +#define ENUM_StandardInputAction_DECLARES \ + ENUM_ITEM(Default, 0, "无触发") \ + ENUM_ITEM(Handguide, 1, "拖动示教,高电平触发") \ + ENUM_ITEM(GoHome, 2, "运动到工程初始位姿,高电平触发") \ + ENUM_ITEM(StartProgram, 3, "开始工程,上升沿触发") \ + ENUM_ITEM(StopProgram, 4, "停止工程,上升沿触发") \ + ENUM_ITEM(PauseProgram, 5, "暂停工程,上升沿触发") \ + ENUM_ITEM(PopupDismiss, 6, "消除弹窗,上升沿触发") \ + ENUM_ITEM(PowerOn, 7, "机器人上电/松刹车,上升沿触发") \ + ENUM_ITEM(PowerOff, 8, "机器人抱死刹车/断电,上升沿触发") \ + ENUM_ITEM(ResumeProgram, 9, "恢复工程,上升沿触发") \ + ENUM_ITEM(SlowDown1, 10, "机器人减速触发1,高电平触发") \ + ENUM_ITEM(SlowDown2, 11, "机器人减速触发2,高电平触发") \ + ENUM_ITEM(SafeStop, 12, "安全停止,高电平触发") \ + ENUM_ITEM(RunningGuard, 13, "信号,高电平有效") \ + ENUM_ITEM(MoveToFirstPoint, 14, "运动到工程初始位姿,高电平触发") \ + ENUM_ITEM(xSlowDown1, 15, "机器人减速触发1,低电平触发") \ + ENUM_ITEM(xSlowDown2, 16, "机器人减速触发2,低电平触发") \ + ENUM_ITEM(ConveyorTrack, 17, "传送带检测到物品触发,高电平触发") \ + ENUM_ITEM(xConveyorTrack, 18, "传送带检测到物品触发,低电平触发") \ + ENUM_ITEM(UnlockProtectiveStop, 19, "解除保护性停止,上升沿触发") \ + ENUM_ITEM(ArbitraryResumeProgram , 20, "恢复工程,不检查当前位置和暂停点之间的距离,上升沿触发") + +#define ENUM_StandardOutputRunState_DECLARES \ + ENUM_ITEM(None, 0, "标准输出状态未定义") \ + ENUM_ITEM(StopLow, 1, "低电平指示工程停止") \ + ENUM_ITEM(StopHigh, 2, "高电平指示机器人停止") \ + ENUM_ITEM(RunningHigh, 3, "指示工程正在运行") \ + ENUM_ITEM(PausedHigh, 4, "指示工程已经暂停") \ + ENUM_ITEM(AtHome, 5, "高电平指示机器人正在拖动") \ + ENUM_ITEM(Handguiding, 6, "高电平指示机器人正在拖动") \ + ENUM_ITEM(PowerOn, 7, "高电平指示机器人已经上电") \ + ENUM_ITEM(RobotEmergencyStop, 8, "高电平指示机器人急停按下") \ + ENUM_ITEM(SystemEmergencyStop, 9, "高电平指示外部输入系统急停按下") \ + ENUM_ITEM(InternalEmergencyStop, 8, "高电平指示机器人急停按下") \ + ENUM_ITEM(ExternalEmergencyStop, 9, "高电平指示外部输入系统急停按下") \ + ENUM_ITEM(SystemError, 10, "系统错误,包括故障、超限、急停、安全停止、防护停止 ") \ + ENUM_ITEM(NotSystemError, 11, "无系统错误,包括普通模式、缩减模式和恢复模式 ") \ + ENUM_ITEM(RobotOperable, 12, "机器人可操作,机器人上电且松刹车了 ") \ + ENUM_ITEM(OperationalMode, 13, "高电平指示自动模式,低电平指示手动模式") \ + ENUM_ITEM(SafeguardStop, 14, "高电平指示处于安全停止状态") \ + ENUM_ITEM(ProtectiveStop, 15, "高电平指示处于防护停止状态") + +#define ENUM_SafetyInputAction_DECLARES \ + ENUM_ITEM(Unassigned, 0, "安全输入未分配动作") \ + ENUM_ITEM(EmergencyStop, 1, "安全输入触发急停") \ + ENUM_ITEM(SafeguardStop, 2, "安全输入触发防护停止, 边沿触发") \ + ENUM_ITEM(SafeguardReset, 3, "安全输入触发防护重置, 边沿触发") \ + ENUM_ITEM(ThreePositionSwitch, 4, "3档位使能开关") \ + ENUM_ITEM(OperationalMode, 5, "切换自动模式和手动模式") \ + ENUM_ITEM(HandGuide, 6, "拖动示教") \ + ENUM_ITEM(ReducedMode, 7, "安全参数切换1(缩减模式),序号越低优先级越高,三路输出都无效时,选用第0组安全参数") \ + ENUM_ITEM(AutomaticModeSafeguardStop, 8, "自动模式下防护停机输入(需要配置三档位使能设备)") \ + ENUM_ITEM(AutomaticModeSafeguardReset, 9, "自动模式下上升沿触发防护重置(需要配置三档位使能设备)") + +#define ENUM_SafetyOutputRunState_DECLARES \ + ENUM_ITEM(Unassigned, 0, "安全输出未定义") \ + ENUM_ITEM(SystemEmergencyStop, 1, "输出高当有机器人急停输入或者急停按键被按下") \ + ENUM_ITEM(NotSystemEmergencyStop, 2, "输出低当有机器人急停输入或者急停按键被按下") \ + ENUM_ITEM(RobotMoving, 3, "输出高当有关节运动速度超过 0.1rad/s") \ + ENUM_ITEM(RobotNotMoving, 4, "输出高当所有的关节运动速度不超过 0.1rad/s") \ + ENUM_ITEM(ReducedMode, 5, "输出高当机器人处于缩减模式") \ + ENUM_ITEM(NotReducedMode, 6, "输出高当机器人不处于缩减模式") \ + ENUM_ITEM(SafeHome, 7, "输出高当机器人已经处于安全Home位姿") \ + ENUM_ITEM(RobotNotStopping, 8, "输出低当机器人正在急停或者安全停止中") + +#define ENUM_PayloadIdentifyMoveAxis_DECLARES \ + ENUM_ITEM(Joint_2_6, 0,"第2和6关节运动") \ + ENUM_ITEM(Joint_3_6, 1,"第3和6关节运动") \ + ENUM_ITEM(Joint_4_6, 2,"第4和6关节运动") \ + ENUM_ITEM(Joint_4_5_6, 3,"第4、5、6关节运动") \ + +#define ENUM_EnvelopingShape_DECLARES \ + ENUM_ITEM(Cube, 1,"立方体") \ + ENUM_ITEM(Column, 2,"柱状体") \ + ENUM_ITEM(Stl, 3,"以STL文件的形式描述负载碰撞集合体") + +#define ENUM_TaskFrameType_DECLARES \ + ENUM_ITEM(NONE, 0,"") \ + ENUM_ITEM(POINT_FORCE, 1, "力控坐标系发生变换, 使得力控参考坐标系的y轴沿着机器人TCP指向力控所选特征的原点, x和z轴取决于所选特征的原始方向" \ + "力控坐标系发生变换, 使得力控参考坐标系的y轴沿着机器人TCP指向力控所选特征的原点, x和z轴取决于所选特征的原始方向" \ + "机器人TCP与所选特征的起点之间的距离至少为10mm" \ + "优先选择X轴, 为所选特征的X轴在力控坐标系Y轴垂直平面上的投影, 如果所选特征的X轴与力控坐标系的Y轴平行, " \ + "通过类似方法确定力控坐标系Z轴, Y-X或者Y-Z轴确定之后, 通过右手法则确定剩下的轴") \ + ENUM_ITEM(FRAME_FORCE, 2,"力控坐标系不发生变换 SIMPLE_FORC") \ + ENUM_ITEM(MOTION_FORCE, 3,"力控坐标系发生变换, 使得力控参考坐标系的x轴为机器人TCP速度在所选特征x-y平面上的投影y轴将垂直于机械臂运动, 并在所选特征的x-y平面内")\ + ENUM_ITEM(TOOL_FORCE, 4,"以工具末端坐标系作为力控参考坐标系") + +#ifdef ERROR +#undef ERROR +#endif + +#define ENUM_TraceLevel_DECLARES \ + ENUM_ITEM(FATAL, 0, "") \ + ENUM_ITEM(ERROR, 1, "") \ + ENUM_ITEM(WARNING, 2, "") \ + ENUM_ITEM(INFO, 3, "") \ + ENUM_ITEM(DEBUG, 4, "") + +#define ENUM_AxisModeType_DECLARES \ + ENUM_ITEM(NoController, -1, "提供给示教器使用的, 如果aubo_control进程崩溃则会显示为NoController") \ + ENUM_ITEM(Disconnected, 0, "未连接") \ + ENUM_ITEM(PowerOff, 1, "断电") \ + ENUM_ITEM(BrakeReleasing, 2, "刹车松开中") \ + ENUM_ITEM(Idle, 3, "空闲") \ + ENUM_ITEM(Running, 4, "运行中") \ + ENUM_ITEM(Fault, 5, "错误状态") + +#define ENUM_SafeguedStopType_DECLARES \ + ENUM_ITEM(None, 0, "无安全停止") \ + ENUM_ITEM(SafeguedStopIOInput, 1, "安全停止(IO输入)") \ + ENUM_ITEM(SafeguedStop3PE, 2, "安全停止(三态开关)") \ + ENUM_ITEM(SafeguedStopOperational, 3, "安全停止(操作模式)") + +#define ENUM_RobotEmergencyStopType_DECLARES \ + ENUM_ITEM(RobotEmergencyStopNone, 0, "无紧急停止") \ + ENUM_ITEM(RobotEmergencyStopControlBox, 1, "紧急停止(控制柜急停)") \ + ENUM_ITEM(RobotEmergencyStopTeachPendant, 2, "紧急停止(示教器急停)") \ + ENUM_ITEM(RobotEmergencyStopHandle, 3, "紧急停止(手柄急停)") \ + ENUM_ITEM(RobotEmergencyStopEI, 4, "紧急停止(固定IO急停)") + +#define ENUM_ITEM(c, n, ...) c = n, +enum AuboErrorCodes : int +{ + ENUM_AuboErrorCodes_DECLARES +}; + +enum class RuntimeState : int +{ + ENUM_RuntimeState_DECLARES +}; + +enum class RobotModeType : int +{ + ENUM_RobotModeType_DECLARES +}; + +enum class AxisModeType : int +{ + ENUM_AxisModeType_DECLARES +}; + +/** + * \~chinese 安全状态: \~english Safety Mode + * + */ +enum class SafetyModeType : int +{ + ENUM_SafetyModeType_DECLARES +}; + +/** + * \~chinese 操作模式 \~english Operational Mode + */ +enum class OperationalModeType : int +{ + ENUM_OperationalModeType_DECLARES +}; + +/** + * \~chinese 机器人控制模式 \~english Robot Control Mode + */ +enum class RobotControlModeType : int +{ + ENUM_RobotControlModeType_DECLARES +}; + +/** + * \~chinese 关节伺服模式 \~english Joint Servo Mode + */ +enum class JointServoModeType : int +{ + ENUM_JointServoModeType_DECLARES +}; + +/** + * \~chinese 关节状态 \~english Joint State + */ +enum class JointStateType : int +{ + ENUM_JointStateType_DECLARES +}; + +/** + * \~chinese 标准输出运行状态 \~english Standard Output Run State + */ +enum class StandardOutputRunState : int +{ + ENUM_StandardOutputRunState_DECLARES +}; + +/** + * @brief The StandardInputAction enum + */ +enum class StandardInputAction : int +{ + ENUM_StandardInputAction_DECLARES +}; + +enum class SafetyInputAction : int +{ + ENUM_SafetyInputAction_DECLARES +}; + +enum class SafetyOutputRunState : int +{ + ENUM_SafetyOutputRunState_DECLARES +}; + +enum TaskFrameType +{ + ENUM_TaskFrameType_DECLARES +}; + +enum EnvelopingShape : int +{ + ENUM_EnvelopingShape_DECLARES +}; + +enum PayloadIdentifyMoveAxis : int +{ + ENUM_PayloadIdentifyMoveAxis_DECLARES +}; + +enum TraceLevel +{ + ENUM_TraceLevel_DECLARES +}; + +enum SafeguedStopType : int +{ + ENUM_SafeguedStopType_DECLARES +}; + +enum RobotEmergencyStopType : int +{ + ENUM_RobotEmergencyStopType_DECLARES +}; +#undef ENUM_ITEM + +#define DECL_TO_STRING_FUNC(ENUM) \ + inline std::string toString(ENUM v) \ + { \ + using T = ENUM; \ + std::string name = #ENUM "."; \ + ENUM_##ENUM##_DECLARES \ + \ + return #ENUM ".Unkown"; \ + } \ + inline std::ostream &operator<<(std::ostream &os, ENUM v) \ + { \ + os << toString(v); \ + return os; \ + } + +#define ENUM_ITEM(c, n, ...) \ + if (v == T::c) { \ + return name + #c; \ + } + +DECL_TO_STRING_FUNC(RuntimeState) +DECL_TO_STRING_FUNC(RobotModeType) +DECL_TO_STRING_FUNC(AxisModeType) +DECL_TO_STRING_FUNC(SafetyModeType) +DECL_TO_STRING_FUNC(OperationalModeType) +DECL_TO_STRING_FUNC(RobotControlModeType) +DECL_TO_STRING_FUNC(JointServoModeType) +DECL_TO_STRING_FUNC(JointStateType) +DECL_TO_STRING_FUNC(StandardInputAction) +DECL_TO_STRING_FUNC(StandardOutputRunState) +DECL_TO_STRING_FUNC(SafetyInputAction) +DECL_TO_STRING_FUNC(SafetyOutputRunState) +DECL_TO_STRING_FUNC(TaskFrameType) +DECL_TO_STRING_FUNC(TraceLevel) + +#undef ENUM_ITEM + +enum class ForceControlState +{ + Stopped, + Starting, + Stropping, + Running +}; + +enum class RefFrameType +{ + None, /// + Tool, ///< \~chinese 工具坐标系 \~english Tool coordinate system + Path, ///< \~chinese 轨迹坐标系 \~english Trajectory coordinate system + Base ///< \~chinese 基坐标系 \~english Base coordinate system +}; + +/// \~chinese 圆周运动参数定义 \~english Circular motion parameters definition +struct CircleParameters +{ + std::vector pose_via; ///< \~chinese 圆周运动途中点的位姿 \~english Pose of the intermediate point in circular motion + std::vector pose_to; ///< \~chinese 圆周运动结束点的位姿 \~english Pose of the end point in circular motion + double a; ///< \~chinese 加速度, 单位: m/s^2 \~english Acceleration, unit: m/s^2 + double v; ///< \~chinese 速度,单位: m/s \~english Speed, unit: m/s + double blend_radius; ///< \~chinese 交融半径,单位: m \~english Blending radius, unit: m + double duration; ///< \~chinese 运行时间,单位: s \~english Running time, unit: s + double helix; + double spiral; + double direction; + int loop_times; ///< \~chinese 暂不支持 \~english Currently not supported +}; + +inline std::ostream &operator<<(std::ostream &os, CircleParameters p) +{ + return os; +} + +struct SpiralParameters +{ + std::vector frame; ///< \~chinese 参考点,螺旋线的中心点和参考坐标系 \~english Reference point, the center point of the spiral and the reference coordinate system + int plane; ///< \~chinese 参考平面选择 0-XY 1-YZ 2-ZX \~english Reference plane selection 0-XY 1-YZ 2-ZX + double angle; ///< \~chinese 转动的角度,如果为正数,机器人逆时针旋转 \~english The angle of rotation, if positive, the robot rotates counterclockwise + double spiral; ///< \~chinese 正数外扩 \~english Positive outward + double helix; ///< \~chinese 正数上升 \~english Positive upward +}; + +inline std::ostream &operator<<(std::ostream &os, SpiralParameters p) +{ + return os; +} + +struct Enveloping +{ + EnvelopingShape shape; // \~chinese 包络体形状 \~english Enveloping shape + std::vector ep_args; // \~chinese 包络体组合,shape为None或Stl时无需对ep_args赋值; \~english Enveloping combination, when shape is None or Stl, no need to assign value to ep_args. + // \~chinese shape为Cube时ep_args有9个元素,分别为xmin,xmax,ymin,ymax,zmin,zmax,rx,ry,rz; \~english When shape is Cube, ep_args has 9 elements, which are xmin, xmax, ymin, ymax, zmin, zmax, rx, ry, rz; + // \~chinese shape为Column时ep_args有5个元素,分别为radius,height,rx,ry,rz; \~english When shape is Column, ep_args has 5 elements, which are radius, height, rx, ry, rz; + std::string stl_path; // \~chinese stl的路径(绝对路径),stl文件需为二进制文件, \~english Path of the stl file (absolute path), the stl file must be a binary file, \~chinese shape设置为Stl时,此项生效 \~english When shape is set to Stl, this item takes effect +}; + +inline std::ostream &operator<<(std::ostream &os, Enveloping p) +{ + return os; +} + +/// \~chinese 用于负载辨识的轨迹配置 \~english Trajectory configuration for +/// payload identification +struct TrajConfig +{ + std::vector envelopings; // \~chinese 包络体组合 \~english Enveloping combination + PayloadIdentifyMoveAxis move_axis; // \~chinese 运动的轴(ID), 下标从0开始 \~english Axis of movement (ID), index starts from 0 + std::vector init_joint; // \~chinese 关节初始位置 \~english Initial joint positions + std::vector upper_joint_bound; // \~chinese 运动轴上限 \~english Upper joint limits + std::vector lower_joint_bound; // \~chinese 运动轴下限 \~english Lower joint limits + std::vector max_velocity; // \~chinese 关节运动的最大速度,默认值为 3.0 \~english Maximum joint velocities, default value is 3.0 + std::vector max_acceleration; // \~chinese 关节运动的最大加速度,默认值为 5.0 \~english Maximum joint accelerations, default value is 5.0 +}; + +inline std::ostream &operator<<(std::ostream &os, TrajConfig p) +{ + return os; +} + +// result with error code +using ResultWithErrno = std::tuple, int>; +using ResultWithErrno1 = std::tuple>, int>; + +// mass, cog, aom, inertia +using Payload = std::tuple, std::vector, + std::vector>; + +// force_offset, com, mass, angle +using ForceSensorCalibResult = + std::tuple, std::vector, double, + std::vector>; + +// force_offset, com, mass, angle error +using ForceSensorCalibResultWithError = + std::tuple, std::vector, double, + std::vector, double>; + +// \~chinese 动力学模型m,d,k \~english Dynamics model m, d, k +using DynamicsModel = + std::tuple, std::vector, std::vector>; + +// double xmin; +// double xmax; +// double ymin; +// double ymax; +// double zmin; +// double zmax; +using Box = std::vector; + +// double xcbottom; +// double ycbottom; +// double zcbottom; +// double height; +// double radius; +using Cylinder = std::vector; + +// double xc; +// double yc; +// double radius; +using Sphere = std::vector; + +struct RobotMsg +{ + uint64_t timestamp; ///< \~chinese 时间戳,即系统时间 \~english Timestamp, + ///< i.e., system time + TraceLevel level; ///< \~chinese 日志等级 \~english Log level + int code; ///< \~chinese 错误码 \~english Error code + std::string + source; ///< \~chinese 发送消息的机器人别名 alias \~english Alias of the + ///< robot sending the message + ///< \~chinese 可在 /root/arcs_ws/config/aubo_control.conf + ///< \~english Can be found in + ///< /root/arcs_ws/config/aubo_control.conf + ///< \~chinese 配置文件中查到机器人的alias \~english The robot's + ///< alias can be found in the configuration file + ///< /root/arcs_ws/config/aubo_control.conf + std::vector args; ///< \~chinese 机器人参数 \~english Robot parameters +}; +using RobotMsgVector = std::vector; + +/// \~chinese RTDE菜单 \~english RTDE menu +struct RtdeRecipe +{ + bool to_server; ///< \~chinese 输入/输出 \~english Input/Output + int chanel; ///< \~chinese 通道 \~english Channel + double frequency; ///< \~chinese 更新频率 \~english Update frequency + int trigger; ///< \~chinese 触发方式(该功能暂未实现): 0 - 周期; 1 - 变化 + ///< \~english Trigger method (this feature is not yet + ///< implemented): 0 - Periodic; 1 - Change + std::vector segments; ///< \~chinese 字段列表 \~english segment list +}; + +/// \~chinese 异常类型 \~english Error type +enum error_type +{ + parse_error = -32700, ///< \~chinese 解析错误 \~english Parse error + invalid_request = -32600, ///< \~chinese 无效请求 \~english Invalid request + method_not_found = -32601, ///< \~chinese 方法未找到 \~english Method not found + invalid_params = -32602, ///< \~chinese 无效参数 \~english Invalid parameters + internal_error = -32603, ///< \~chinese 内部错误 \~english Internal error + server_error, ///< \~chinese 服务器错误 \~english Server error + invalid ///< \~chinese 无效 \~english Invalid +}; + +/// \~chinese 异常码 \~english Exception code +enum ExceptionCode +{ + EC_DISCONNECTED = -1, ///< \~chinese 断开连接 \~english Disconnected + EC_NOT_LOGINED = -2, ///< \~chinese 未登录 \~english Not logged in + EC_INVAL_SOCKET = -3, ///< \~chinese 无效套接字 \~english Invalid socket + EC_REQUEST_BUSY = -4, ///< \~chinese 请求繁忙 \~english Request busy + EC_SEND_FAILED = -5, ///< \~chinese 发送失败 \~english Send failed + EC_RECV_TIMEOUT = -6, ///< \~chinese 接收超时 \~english Receive timeout + EC_RECV_ERROR = -7, ///< \~chinese 接收错误 \~english Receive error + EC_PARSE_ERROR = -8, ///< \~chinese 解析错误 \~english Parse error + EC_INVALID_REQUEST = -9, ///< \~chinese 无效请求 \~english Invalid request + EC_METHOD_NOT_FOUND = -10, ///< \~chinese 方法未找到 \~english Method not found + EC_INVALID_PARAMS = -11, ///< \~chinese 无效参数 \~english Invalid parameters + EC_INTERNAL_ERROR = -12, ///< \~chinese 内部错误 \~english Internal error + EC_SERVER_ERROR = -13, ///< \~chinese 服务器错误 \~english Server error + EC_INVALID = -14 ///< \~chinese 无效 \~english Invalid +}; + +/// \~chinese 自定义异常类 AuboException \~english Custom exception class +/// AuboException +class AuboException : public std::exception +{ +public: + AuboException(int code, const std::string &prefix, + const std::string &message) noexcept + : code_(code), message_(prefix + "-" + message) + { + } + + AuboException(int code, const std::string &message) noexcept + : code_(code), message_(message) + { + } + + error_type type() const + { + if (code_ >= -32603 && code_ <= -32600) { + return static_cast(code_); + } else if (code_ >= -32099 && code_ <= -32000) { + return server_error; + } else if (code_ == -32700) { + return parse_error; + } + return invalid; + } + + int code() const { return code_; } + const char *what() const noexcept override { return message_.c_str(); } + +private: + int code_; ///< \~chinese 异常码 \~english Exception code + std::string message_; ///< \~chinese 异常消息 \~chinese Exception message +}; + +inline const char *returnValue2Str(int retval) +{ + static const char *retval_str[] = { +#define ENUM_ITEM(n, v, s) s, + ENUM_AuboErrorCodes_DECLARES +#undef ENUM_ITEM + }; + + enum arcs_index + { +#define ENUM_ITEM(n, v, s) n##_INDEX, + ENUM_AuboErrorCodes_DECLARES +#undef ENUM_ITEM + }; + + int index = -1; + +#define ENUM_ITEM(n, v, s) \ + if (abs(retval) == v) \ + index = n##_INDEX; + ENUM_AuboErrorCodes_DECLARES +#undef ENUM_ITEM + + if (index == -1) + { + index = AUBO_ERR_UNKOWN_INDEX; + } + + return retval_str[(unsigned)index]; +} + +} // namespace common_interface +} // namespace arcs +#endif + +// clang-format on + +#if defined ENABLE_JSON_TYPES +#include "bindings/jsonrpc/json_types.h" +#endif diff --git a/third_party/AuboSdk/linux/include/aubo_sdk/math_c.h b/third_party/AuboSdk/linux/include/aubo_sdk/math_c.h new file mode 100644 index 00000000..8eca724a --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo_sdk/math_c.h @@ -0,0 +1,53 @@ +#ifndef AUBO_SDK_Math_C_H +#define AUBO_SDK_Math_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI int poseAdd(MATH_HANDLER h, const double *p1, const double *p2, + double *result); +ARCS_ABI int poseSub(MATH_HANDLER h, const double *p1, const double *p2, + double *result); +ARCS_ABI int interpolatePose(MATH_HANDLER h, const double *p1, const double *p2, + double alpha, double *result); +ARCS_ABI int poseTrans(MATH_HANDLER h, const double *pose_from, + const double *pose_from_to, double *result); +ARCS_ABI int poseTransInv(MATH_HANDLER h, const double *pose_from, + const double *pose_to_from, double *result); +ARCS_ABI int poseInverse(MATH_HANDLER h, const double *pose, double *result); +ARCS_ABI double poseDistance(MATH_HANDLER h, const double *p1, + const double *p2); +ARCS_ABI double poseAngleDistance(MATH_HANDLER h, const double *p1, + const double *p2); +ARCS_ABI BOOL poseEqual(MATH_HANDLER h, const double *p1, const double *p2, + double eps); +ARCS_ABI int transferRefFrame(MATH_HANDLER h, const double *F_b_a_old, + Vector3d_C V_in_a, int type, double *result); +ARCS_ABI int poseRotation(MATH_HANDLER h, const double *pose, + const double *rotv, double *result); +ARCS_ABI int rpyToQuaternion(MATH_HANDLER h, const double *rpy, double *result); +ARCS_ABI int quaternionToRpy(MATH_HANDLER h, const double *quant, + double *result); +ARCS_ABI int tcpOffsetIdentify(MATH_HANDLER h, const double *poses, int rows, + double *result); +ARCS_ABI int calibrateCoordinate(MATH_HANDLER h, const double *poses, int rows, + int type, double *result); +ARCS_ABI int calculateCircleFourthPoint(MATH_HANDLER h, const double *p1, + const double *p2, const double *p3, + int mode, double *result); +ARCS_ABI int forceTrans(MATH_HANDLER h, const double *pose_a_in_b, + const double *force_in_a, double *result); +ARCS_ABI int getDeltaPoseBySensorDistance(MATH_HANDLER h, + const double *distances, + double position, double radius, + double track_scale, double *result); +ARCS_ABI int deltaPoseTrans(MATH_HANDLER h, const double *pose_a_in_b, + const double *ft_in_a, double *result); +ARCS_ABI int deltaPoseAdd(MATH_HANDLER h, const double *pose_a_in_b, + const double *v_in_b, double *result); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/linux/include/aubo_sdk/register_control_c.h b/third_party/AuboSdk/linux/include/aubo_sdk/register_control_c.h new file mode 100644 index 00000000..c3e38858 --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo_sdk/register_control_c.h @@ -0,0 +1,120 @@ +#ifndef AUBO_SDK_RegisterControl_C_H +#define AUBO_SDK_RegisterControl_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI BOOL getBoolInput(REGISTER_CONTROL_HANDLER h, uint32_t address); +ARCS_ABI int setBoolInput(REGISTER_CONTROL_HANDLER h, uint32_t address, + BOOL value); +ARCS_ABI int getInt32Input(REGISTER_CONTROL_HANDLER h, uint32_t address); +ARCS_ABI int setInt32Input(REGISTER_CONTROL_HANDLER h, uint32_t address, + int value); +ARCS_ABI float getFloatInput(REGISTER_CONTROL_HANDLER h, uint32_t address); +ARCS_ABI int setFloatInput(REGISTER_CONTROL_HANDLER h, uint32_t address, + float value); +ARCS_ABI double getDoubleInput(REGISTER_CONTROL_HANDLER h, uint32_t address); +ARCS_ABI int setDoubleInput(REGISTER_CONTROL_HANDLER h, uint32_t address, + double value); +ARCS_ABI BOOL getBoolOutput(REGISTER_CONTROL_HANDLER h, uint32_t address); +ARCS_ABI int setBoolOutput(REGISTER_CONTROL_HANDLER h, uint32_t address, + BOOL value); +ARCS_ABI int getInt32Output(REGISTER_CONTROL_HANDLER h, uint32_t address); +ARCS_ABI int setInt32Output(REGISTER_CONTROL_HANDLER h, uint32_t address, + int value); +ARCS_ABI float getFloatOutput(REGISTER_CONTROL_HANDLER h, uint32_t address); +ARCS_ABI int setFloatOutput(REGISTER_CONTROL_HANDLER h, uint32_t address, + float value); +ARCS_ABI double getDoubleOutput(REGISTER_CONTROL_HANDLER h, uint32_t address); +ARCS_ABI int setDoubleOutput(REGISTER_CONTROL_HANDLER h, uint32_t address, + double value); +ARCS_ABI int16_t getInt16Register(REGISTER_CONTROL_HANDLER h, uint32_t address); +ARCS_ABI int setInt16Register(REGISTER_CONTROL_HANDLER h, uint32_t address, + int16_t value); +ARCS_ABI BOOL variableUpdated(REGISTER_CONTROL_HANDLER h, const char *key, + uint64_t since); +ARCS_ABI BOOL hasNamedVariable(REGISTER_CONTROL_HANDLER h, const char *key); +ARCS_ABI int getNamedVariableType(REGISTER_CONTROL_HANDLER h, const char *key, + char *result); +ARCS_ABI BOOL getBool(REGISTER_CONTROL_HANDLER h, const char *key, + BOOL default_value); +ARCS_ABI int setBool(REGISTER_CONTROL_HANDLER h, const char *key, BOOL value); +ARCS_ABI int getVecChar(REGISTER_CONTROL_HANDLER h, const char *key, + const char *default_value, char *result, int sz); +ARCS_ABI int setVecChar(REGISTER_CONTROL_HANDLER h, const char *key, + const char *value, int sz); +ARCS_ABI int getInt32(REGISTER_CONTROL_HANDLER h, const char *key, + int default_value); +ARCS_ABI int setInt32(REGISTER_CONTROL_HANDLER h, const char *key, int value); +ARCS_ABI int getVecInt32(REGISTER_CONTROL_HANDLER h, const char *key, + int32_t *default_value, int *result); +ARCS_ABI int setVecInt32(REGISTER_CONTROL_HANDLER h, const char *key, + int32_t *value); +ARCS_ABI float getFloat(REGISTER_CONTROL_HANDLER h, const char *key, + float default_value); +ARCS_ABI int setFloat(REGISTER_CONTROL_HANDLER h, const char *key, float value); +ARCS_ABI int getVecFloat(REGISTER_CONTROL_HANDLER h, const char *key, + const float *default_value, float *result); +ARCS_ABI int setVecFloat(REGISTER_CONTROL_HANDLER h, const char *key, + const float *value); +ARCS_ABI double getDouble(REGISTER_CONTROL_HANDLER h, const char *key, + double default_value); +ARCS_ABI int setDouble(REGISTER_CONTROL_HANDLER h, const char *key, + double value); +ARCS_ABI int getVecDouble(REGISTER_CONTROL_HANDLER h, const char *key, + const double *default_value, double *result); +ARCS_ABI int setVecDouble(REGISTER_CONTROL_HANDLER h, const char *key, + const double *value); +ARCS_ABI int getString(REGISTER_CONTROL_HANDLER h, const char *key, + const char *default_value, char *result); +ARCS_ABI int setString(REGISTER_CONTROL_HANDLER h, const char *key, + const char *value); +ARCS_ABI int clearNamedVariable(REGISTER_CONTROL_HANDLER h, const char *key); +ARCS_ABI int setWatchDog(REGISTER_CONTROL_HANDLER h, const char *key, + double timeout, int action); +ARCS_ABI int getWatchDogAction(REGISTER_CONTROL_HANDLER h, const char *key); +ARCS_ABI int getWatchDogTimeout(REGISTER_CONTROL_HANDLER h, const char *key); +ARCS_ABI int modbusAddSignal(REGISTER_CONTROL_HANDLER h, + const char *device_info, int slave_number, + int signal_address, int signal_type, + const char *signal_name, BOOL sequential_mode); +ARCS_ABI int modbusDeleteSignal(REGISTER_CONTROL_HANDLER h, + const char *signal_name); +ARCS_ABI int modbusDeleteAllSignals(REGISTER_CONTROL_HANDLER h); +ARCS_ABI int modbusGetSignalStatus(REGISTER_CONTROL_HANDLER h, + const char *signal_name); +ARCS_ABI int modbusGetSignalNames(REGISTER_CONTROL_HANDLER h, char **result); +ARCS_ABI int modbusGetSignalTypes(REGISTER_CONTROL_HANDLER h, int *result); +ARCS_ABI int modbusGetSignalValues(REGISTER_CONTROL_HANDLER h, int *result); +ARCS_ABI int modbusGetSignalErrors(REGISTER_CONTROL_HANDLER h, int *result); +ARCS_ABI int modbusSendCustomCommand(REGISTER_CONTROL_HANDLER h, const char *IP, + int slave_number, int function_code, + uint8_t *data, int sz); +ARCS_ABI int modbusSetDigitalInputAction(REGISTER_CONTROL_HANDLER h, + const char *robot_name, + const char *signal_name, + StandardInputAction_C action); +ARCS_ABI int modbusSetOutputRunstate(REGISTER_CONTROL_HANDLER h, + const char *robot_name, + const char *signal_name, + StandardOutputRunState_C runstate); +ARCS_ABI int modbusSetOutputSignal(REGISTER_CONTROL_HANDLER h, + const char *signal_name, uint16_t value); +ARCS_ABI int modbusSetOutputSignalPulse(REGISTER_CONTROL_HANDLER h, + const char *signal_name, uint16_t value, + double duration); +ARCS_ABI int modbusSetSignalUpdateFrequency(REGISTER_CONTROL_HANDLER h, + const char *signal_name, + int update_frequency); +ARCS_ABI int modbusGetSignalIndex(REGISTER_CONTROL_HANDLER h, + const char *signal_name); +ARCS_ABI int modbusGetSignalError(REGISTER_CONTROL_HANDLER h, + const char *signal_name); +ARCS_ABI int getModbusDeviceStatus(REGISTER_CONTROL_HANDLER h, + const char *device_name); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/linux/include/aubo_sdk/robot/force_control_c.h b/third_party/AuboSdk/linux/include/aubo_sdk/robot/force_control_c.h new file mode 100644 index 00000000..55ccc592 --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo_sdk/robot/force_control_c.h @@ -0,0 +1,78 @@ +#ifndef AUBO_SDK_ForceControl_C_H +#define AUBO_SDK_ForceControl_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI int fcEnable(FORCE_CONTROL_HANDLER h); +ARCS_ABI int fcDisable(FORCE_CONTROL_HANDLER h); +ARCS_ABI BOOL isFcEnabled(FORCE_CONTROL_HANDLER h); +ARCS_ABI int setTargetForce(FORCE_CONTROL_HANDLER h, const double *feature, + const uint8_t *compliance, const double *wrench, + const double *limits, TaskFrameType_C type); +ARCS_ABI int setDynamicModel(FORCE_CONTROL_HANDLER h, const double *m, + const double *d, const double *k); +ARCS_ABI DynamicsModel_C getDynamicModel(FORCE_CONTROL_HANDLER h); +ARCS_ABI int setDynamicModelContact(FORCE_CONTROL_HANDLER h, + const double *env_stiff, + const double *damp_scale, + const double *stiff_scale); +ARCS_ABI int setCondForce(FORCE_CONTROL_HANDLER h, const double *min, + const double *max, BOOL outside, double timeout); +ARCS_ABI int setCondOrient(FORCE_CONTROL_HANDLER h, const double *frame, + double max_angle, double max_rot, BOOL outside, + double timeout); +ARCS_ABI int setCondPlane(FORCE_CONTROL_HANDLER h, const double *plane, + double timeout); +ARCS_ABI int setCondCylinder(FORCE_CONTROL_HANDLER h, const double *axis, + double radius, BOOL outside, double timeout); +ARCS_ABI int setCondSphere(FORCE_CONTROL_HANDLER h, const double *center, + double radius, BOOL outside, double timeout); +ARCS_ABI int setCondTcpSpeed(FORCE_CONTROL_HANDLER h, const double *min, + const double *max, BOOL outside, double timeout); +ARCS_ABI int setCondActive(FORCE_CONTROL_HANDLER h); +ARCS_ABI int setCondDistance(FORCE_CONTROL_HANDLER h, double distance, + double timeout); +ARCS_ABI int setCondAdvanced(FORCE_CONTROL_HANDLER h, const char *type, + const double *args, double timeout); +ARCS_ABI BOOL isCondFullfiled(FORCE_CONTROL_HANDLER h); +ARCS_ABI int setSupvForce(FORCE_CONTROL_HANDLER h, const double *min, + const double *max); +ARCS_ABI int setSupvOrient(FORCE_CONTROL_HANDLER h, const double *frame, + double max_angle, double max_rot, BOOL outside); +ARCS_ABI int setSupvPosBox(FORCE_CONTROL_HANDLER h, const double *frame, + const double *box); +ARCS_ABI int setSupvPosCylinder(FORCE_CONTROL_HANDLER h, const double *frame, + const double *cylinder); +ARCS_ABI int setSupvPosSphere(FORCE_CONTROL_HANDLER h, const double *frame, + const double *sphere); +ARCS_ABI int setSupvReoriSpeed(FORCE_CONTROL_HANDLER h, + const double *speed_limit, BOOL outside, + double timeout); +ARCS_ABI int setSupvTcpSpeed(FORCE_CONTROL_HANDLER h, const double *speed_limit, + BOOL outside, double timeout); +ARCS_ABI int setLpFilter(FORCE_CONTROL_HANDLER h, const double *cutoff_freq); +ARCS_ABI int resetLpFilter(FORCE_CONTROL_HANDLER h); +ARCS_ABI int speedChangeTune(FORCE_CONTROL_HANDLER h, int speed_levels, + double speed_ratio_min); +ARCS_ABI int speedChangeEnable(FORCE_CONTROL_HANDLER h, double ref_force); +ARCS_ABI int speedChangeDisable(FORCE_CONTROL_HANDLER h); +ARCS_ABI int setDamping(FORCE_CONTROL_HANDLER h, const double *damping, + double ramp_time); +ARCS_ABI int resetDamping(FORCE_CONTROL_HANDLER h); +ARCS_ABI int softFloatEnable(FORCE_CONTROL_HANDLER h); +ARCS_ABI int softFloatDisable(FORCE_CONTROL_HANDLER h); +ARCS_ABI BOOL isSoftFloatEnabled(FORCE_CONTROL_HANDLER h); +ARCS_ABI int setSoftFloatParams(FORCE_CONTROL_HANDLER h, BOOL joint_space, + const uint8_t *select, + const double *stiff_percent, + const double *stiff_damp_ratio, + const double *force_threshold, + const double *force_limit); +ARCS_ABI int toolContact(FORCE_CONTROL_HANDLER h, const uint8_t *direction); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/linux/include/aubo_sdk/robot/io_control_c.h b/third_party/AuboSdk/linux/include/aubo_sdk/robot/io_control_c.h new file mode 100644 index 00000000..45565338 --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo_sdk/robot/io_control_c.h @@ -0,0 +1,113 @@ +#ifndef AUBO_SDK_IoControl_C_H +#define AUBO_SDK_IoControl_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI int getStandardDigitalInputNum(IO_CONTROL_HANDLER h); +ARCS_ABI int getToolDigitalInputNum(IO_CONTROL_HANDLER h); +ARCS_ABI int getConfigurableDigitalInputNum(IO_CONTROL_HANDLER h); +ARCS_ABI int getStandardDigitalOutputNum(IO_CONTROL_HANDLER h); +ARCS_ABI int getToolDigitalOutputNum(IO_CONTROL_HANDLER h); +ARCS_ABI int setToolIoInput(IO_CONTROL_HANDLER h, int index, BOOL input); +ARCS_ABI BOOL isToolIoInput(IO_CONTROL_HANDLER h, int index); +ARCS_ABI int getConfigurableDigitalOutputNum(IO_CONTROL_HANDLER h); +ARCS_ABI int getStandardAnalogInputNum(IO_CONTROL_HANDLER h); +ARCS_ABI int getToolAnalogInputNum(IO_CONTROL_HANDLER h); +ARCS_ABI int getStandardAnalogOutputNum(IO_CONTROL_HANDLER h); +ARCS_ABI int getToolAnalogOutputNum(IO_CONTROL_HANDLER h); +ARCS_ABI int setDigitalInputActionDefault(IO_CONTROL_HANDLER h); +ARCS_ABI int setStandardDigitalInputAction(IO_CONTROL_HANDLER h, int index, + StandardInputAction_C action); +ARCS_ABI int setToolDigitalInputAction(IO_CONTROL_HANDLER h, int index, + StandardInputAction_C action); +ARCS_ABI int setConfigurableDigitalInputAction(IO_CONTROL_HANDLER h, int index, + StandardInputAction_C action); +ARCS_ABI StandardInputAction_C +getStandardDigitalInputAction(IO_CONTROL_HANDLER h, int index); +ARCS_ABI StandardInputAction_C getToolDigitalInputAction(IO_CONTROL_HANDLER h, + int index); +ARCS_ABI StandardInputAction_C +getConfigurableDigitalInputAction(IO_CONTROL_HANDLER h, int index); +ARCS_ABI int setDigitalOutputRunstateDefault(IO_CONTROL_HANDLER h); +ARCS_ABI int setStandardDigitalOutputRunstate( + IO_CONTROL_HANDLER h, int index, StandardOutputRunState_C runstate); +ARCS_ABI int setToolDigitalOutputRunstate(IO_CONTROL_HANDLER h, int index, + StandardOutputRunState_C runstate); +ARCS_ABI int setConfigurableDigitalOutputRunstate( + IO_CONTROL_HANDLER h, int index, StandardOutputRunState_C runstate); +ARCS_ABI StandardOutputRunState_C +getStandardDigitalOutputRunstate(IO_CONTROL_HANDLER h, int index); +ARCS_ABI StandardOutputRunState_C +getToolDigitalOutputRunstate(IO_CONTROL_HANDLER h, int index); +ARCS_ABI StandardOutputRunState_C +getConfigurableDigitalOutputRunstate(IO_CONTROL_HANDLER h, int index); +ARCS_ABI int setStandardAnalogOutputRunstate(IO_CONTROL_HANDLER h, int index, + StandardOutputRunState_C runstate); +ARCS_ABI int setToolAnalogOutputRunstate(IO_CONTROL_HANDLER h, int index, + StandardOutputRunState_C runstate); +ARCS_ABI StandardOutputRunState_C +getStandardAnalogOutputRunstate(IO_CONTROL_HANDLER h, int index); +ARCS_ABI StandardOutputRunState_C +getToolAnalogOutputRunstate(IO_CONTROL_HANDLER h, int index); +ARCS_ABI int setStandardAnalogInputDomain(IO_CONTROL_HANDLER h, int index, + int domain); +ARCS_ABI int setToolAnalogInputDomain(IO_CONTROL_HANDLER h, int index, + int domain); +ARCS_ABI int getStandardAnalogInputDomain(IO_CONTROL_HANDLER h, int index); +ARCS_ABI int getToolAnalogInputDomain(IO_CONTROL_HANDLER h, int index); +ARCS_ABI int setStandardAnalogOutputDomain(IO_CONTROL_HANDLER h, int index, + int domain); +ARCS_ABI int setToolAnalogOutputDomain(IO_CONTROL_HANDLER h, int index, + int domain); +ARCS_ABI int setToolVoltageOutputDomain(IO_CONTROL_HANDLER h, int domain); +ARCS_ABI int getToolVoltageOutputDomain(IO_CONTROL_HANDLER h); +ARCS_ABI int getStandardAnalogOutputDomain(IO_CONTROL_HANDLER h, int index); +ARCS_ABI int getToolAnalogOutputDomain(IO_CONTROL_HANDLER h, int index); +ARCS_ABI int setStandardDigitalOutput(IO_CONTROL_HANDLER h, int index, + BOOL value); +ARCS_ABI int setStandardDigitalOutputPulse(IO_CONTROL_HANDLER h, int index, + BOOL value, double duration); +ARCS_ABI int setToolDigitalOutput(IO_CONTROL_HANDLER h, int index, BOOL value); +ARCS_ABI int setToolDigitalOutputPulse(IO_CONTROL_HANDLER h, int index, + BOOL value, double duration); +ARCS_ABI int setConfigurableDigitalOutput(IO_CONTROL_HANDLER h, int index, + BOOL value); +ARCS_ABI int setConfigurableDigitalOutputPulse(IO_CONTROL_HANDLER h, int index, + BOOL value, double duration); +ARCS_ABI int setStandardAnalogOutput(IO_CONTROL_HANDLER h, int index, + double value); +ARCS_ABI int setToolAnalogOutput(IO_CONTROL_HANDLER h, int index, double value); +ARCS_ABI BOOL getStandardDigitalInput(IO_CONTROL_HANDLER h, int index); +ARCS_ABI uint32_t getStandardDigitalInputs(IO_CONTROL_HANDLER h); +ARCS_ABI BOOL getToolDigitalInput(IO_CONTROL_HANDLER h, int index); +ARCS_ABI uint32_t getToolDigitalInputs(IO_CONTROL_HANDLER h); +ARCS_ABI BOOL getConfigurableDigitalInput(IO_CONTROL_HANDLER h, int index); +ARCS_ABI uint32_t getConfigurableDigitalInputs(IO_CONTROL_HANDLER h); +ARCS_ABI double getStandardAnalogInput(IO_CONTROL_HANDLER h, int index); +ARCS_ABI double getToolAnalogInput(IO_CONTROL_HANDLER h, int index); +ARCS_ABI BOOL getStandardDigitalOutput(IO_CONTROL_HANDLER h, int index); +ARCS_ABI uint32_t getStandardDigitalOutputs(IO_CONTROL_HANDLER h); +ARCS_ABI BOOL getToolDigitalOutput(IO_CONTROL_HANDLER h, int index); +ARCS_ABI uint32_t getToolDigitalOutputs(IO_CONTROL_HANDLER h); +ARCS_ABI BOOL getConfigurableDigitalOutput(IO_CONTROL_HANDLER h, int index); +ARCS_ABI uint32_t getConfigurableDigitalOutputs(IO_CONTROL_HANDLER h); +ARCS_ABI double getStandardAnalogOutput(IO_CONTROL_HANDLER h, int index); +ARCS_ABI double getToolAnalogOutput(IO_CONTROL_HANDLER h, int index); +ARCS_ABI int getStaticLinkInputNum(IO_CONTROL_HANDLER h); +ARCS_ABI int getStaticLinkOutputNum(IO_CONTROL_HANDLER h); +ARCS_ABI uint32_t getStaticLinkInputs(IO_CONTROL_HANDLER h); +ARCS_ABI uint32_t getStaticLinkOutputs(IO_CONTROL_HANDLER h); +ARCS_ABI BOOL hasEncoderSensor(IO_CONTROL_HANDLER h); +ARCS_ABI int setEncDecoderType(IO_CONTROL_HANDLER h, int type, int range_id); +ARCS_ABI int setEncTickCount(IO_CONTROL_HANDLER h, int tick); +ARCS_ABI int getEncDecoderType(IO_CONTROL_HANDLER h); +ARCS_ABI int getEncTickCount(IO_CONTROL_HANDLER h); +ARCS_ABI int unwindEncDeltaTickCount(IO_CONTROL_HANDLER h, int delta_count); +ARCS_ABI BOOL getToolButtonStatus(IO_CONTROL_HANDLER h); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/linux/include/aubo_sdk/robot/motion_control_c.h b/third_party/AuboSdk/linux/include/aubo_sdk/robot/motion_control_c.h new file mode 100644 index 00000000..dd2b4f7f --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo_sdk/robot/motion_control_c.h @@ -0,0 +1,154 @@ +#ifndef AUBO_SDK_MotionControl_C_H +#define AUBO_SDK_MotionControl_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI double getEqradius(MOTION_CONTROL_HANDLER h); +ARCS_ABI int setEqradius(MOTION_CONTROL_HANDLER h, double eqradius); +ARCS_ABI double getSpeedFraction(MOTION_CONTROL_HANDLER h); +ARCS_ABI int setSpeedFraction(MOTION_CONTROL_HANDLER h, double fraction); +ARCS_ABI int speedFractionCritical(MOTION_CONTROL_HANDLER h, BOOL enable); +ARCS_ABI BOOL isSpeedFractionCritical(MOTION_CONTROL_HANDLER h); +ARCS_ABI BOOL isBlending(MOTION_CONTROL_HANDLER h); +ARCS_ABI int pathOffsetEnable(MOTION_CONTROL_HANDLER h); +ARCS_ABI int pathOffsetSet(MOTION_CONTROL_HANDLER h, const double *offset, + int type); +ARCS_ABI int pathOffsetDisable(MOTION_CONTROL_HANDLER h); +ARCS_ABI int jointOffsetEnable(MOTION_CONTROL_HANDLER h); +ARCS_ABI int jointOffsetSet(MOTION_CONTROL_HANDLER h, const double *offset, + int type); +ARCS_ABI int jointOffsetDisable(MOTION_CONTROL_HANDLER h); +ARCS_ABI int getTrajectoryQueueSize(MOTION_CONTROL_HANDLER h); +ARCS_ABI int getQueueSize(MOTION_CONTROL_HANDLER h); +ARCS_ABI int getExecId(MOTION_CONTROL_HANDLER h); +ARCS_ABI double getDuration(MOTION_CONTROL_HANDLER h, int id); +ARCS_ABI double getMotionLeftTime(MOTION_CONTROL_HANDLER h, int id); +ARCS_ABI double getProgress(MOTION_CONTROL_HANDLER h); +ARCS_ABI int setWorkObjectHold(MOTION_CONTROL_HANDLER h, + const char *module_name, + const double *mounting_pose); +ARCS_ABI char *getWorkObjectHold(MOTION_CONTROL_HANDLER h); +ARCS_ABI int getPauseJointPositions(MOTION_CONTROL_HANDLER h, double *result); +ARCS_ABI int setServoMode(MOTION_CONTROL_HANDLER h, BOOL enable); +ARCS_ABI BOOL isServoModeEnabled(MOTION_CONTROL_HANDLER h); +ARCS_ABI int setServoModeSelect(MOTION_CONTROL_HANDLER h, int mode); +ARCS_ABI int getServoModeSelect(MOTION_CONTROL_HANDLER h); +ARCS_ABI int servoJoint(MOTION_CONTROL_HANDLER h, const double *q, double a, + double v, double t, double lookahead_time, double gain); +ARCS_ABI int servoCartesian(MOTION_CONTROL_HANDLER h, const double *pose, + double a, double v, double t, double lookahead_time, + double gain); +ARCS_ABI int servoJointWithAxes(MOTION_CONTROL_HANDLER h, const double *q, + const double *extq, double a, double v, + double t, double lookahead_time, double gain); +ARCS_ABI int servoCartesianWithAxes(MOTION_CONTROL_HANDLER h, + const double *pose, const double *extq, + double a, double v, double t, + double lookahead_time, double gain); +ARCS_ABI int trackJoint(MOTION_CONTROL_HANDLER h, const double *q, double t, + double smooth_scale, double delay_sacle); +ARCS_ABI int trackCartesian(MOTION_CONTROL_HANDLER h, const double *pose, + double t, double smooth_scale, double delay_sacle); +ARCS_ABI int followJoint(MOTION_CONTROL_HANDLER h, const double *q); +ARCS_ABI int followLine(MOTION_CONTROL_HANDLER h, const double *pose); +ARCS_ABI int speedJoint(MOTION_CONTROL_HANDLER h, const double *qd, double a, + double t); +ARCS_ABI int resumeSpeedJoint(MOTION_CONTROL_HANDLER h, const double *qd, + double a, double t); +ARCS_ABI int speedLine(MOTION_CONTROL_HANDLER h, const double *xd, double a, + double t); +ARCS_ABI int resumeSpeedLine(MOTION_CONTROL_HANDLER h, const double *xd, + double a, double t); +ARCS_ABI int moveSpline(MOTION_CONTROL_HANDLER h, const double *q, double a, + double v, double duration); +ARCS_ABI int moveJoint(MOTION_CONTROL_HANDLER h, const double *q, double a, + double v, double blend_radius, double duration); +ARCS_ABI int resumeMoveJoint(MOTION_CONTROL_HANDLER h, const double *q, + double a, double v, double duration); +ARCS_ABI int moveLine(MOTION_CONTROL_HANDLER h, const double *pose, double a, + double v, double blend_radius, double duration); +ARCS_ABI int moveProcess(MOTION_CONTROL_HANDLER h, const double *pose, double a, + double v, double blend_radius); +ARCS_ABI int resumeMoveLine(MOTION_CONTROL_HANDLER h, const double *pose, + double a, double v, double duration); +ARCS_ABI int moveCircle(MOTION_CONTROL_HANDLER h, const double *via_pose, + const double *end_pose, double a, double v, + double blend_radius, double duration); +ARCS_ABI int setCirclePathMode(MOTION_CONTROL_HANDLER h, int mode); +ARCS_ABI int moveCircle2(MOTION_CONTROL_HANDLER h, + const CircleParameters_C *param); +ARCS_ABI int pathBufferAlloc(MOTION_CONTROL_HANDLER h, const char *name, + int type, int size); +ARCS_ABI int pathBufferAppend(MOTION_CONTROL_HANDLER h, const char *name, + const double *waypoints, int rows); +ARCS_ABI int pathBufferEval(MOTION_CONTROL_HANDLER h, const char *name, + const double *a, const double *v, double t); +ARCS_ABI BOOL pathBufferValid(MOTION_CONTROL_HANDLER h, const char *name); +ARCS_ABI int pathBufferFree(MOTION_CONTROL_HANDLER h, const char *name); +ARCS_ABI int pathBufferList(MOTION_CONTROL_HANDLER h, char **result); +ARCS_ABI int movePathBuffer(MOTION_CONTROL_HANDLER h, const char *name); +ARCS_ABI int moveIntersection(MOTION_CONTROL_HANDLER h, const double *poses, + int rows, double a, double v, + double main_pipe_radius, double sub_pipe_radius, + double normal_distance, double normal_alpha); +ARCS_ABI int stopJoint(MOTION_CONTROL_HANDLER h, double acc); +ARCS_ABI int resumeStopJoint(MOTION_CONTROL_HANDLER h, double acc); +ARCS_ABI int stopLine(MOTION_CONTROL_HANDLER h, double acc, double acc_rot); +ARCS_ABI int resumeStopLine(MOTION_CONTROL_HANDLER h, double acc, + double acc_rot); +ARCS_ABI int weaveStart(MOTION_CONTROL_HANDLER h, const char *params); +ARCS_ABI int weaveEnd(MOTION_CONTROL_HANDLER h); +ARCS_ABI int storePath(MOTION_CONTROL_HANDLER h, BOOL keep_sync); +ARCS_ABI int stopMove(MOTION_CONTROL_HANDLER h, BOOL quick, BOOL all_tasks); +ARCS_ABI int startMove(MOTION_CONTROL_HANDLER h); +ARCS_ABI int clearPath(MOTION_CONTROL_HANDLER h); +ARCS_ABI int restoPath(MOTION_CONTROL_HANDLER h); +ARCS_ABI int setFuturePointSamplePeriod(MOTION_CONTROL_HANDLER h, + double sample_time); +ARCS_ABI int getFuturePathPointsJoint(MOTION_CONTROL_HANDLER h, + double **result); +ARCS_ABI int conveyorTrackCircle(MOTION_CONTROL_HANDLER h, int encoder_id, + const double *center, BOOL rotate_tool); +ARCS_ABI int conveyorTrackLine(MOTION_CONTROL_HANDLER h, int encoder_id, + const double *direction); +ARCS_ABI int conveyorTrackStop(MOTION_CONTROL_HANDLER h, int encoder_id, + double a); +ARCS_ABI int setConveyorTrackEncoder(MOTION_CONTROL_HANDLER h, int encoder_id, + int tick_per_meter); +ARCS_ABI int setConveyorTrackLimit(MOTION_CONTROL_HANDLER h, int encoder_id, + double limit); +ARCS_ABI int setConveyorTrackStartWindow(MOTION_CONTROL_HANDLER h, + int encoder_id, double window_min, + double window_max); +ARCS_ABI int setConveyorTrackSensorOffset(MOTION_CONTROL_HANDLER h, + int encoder_id, double offset); +ARCS_ABI int setConveyorTrackSyncSeparation(MOTION_CONTROL_HANDLER h, + int encoder_id, double distance, + double time); +ARCS_ABI int setConveyorTrackCompensate(MOTION_CONTROL_HANDLER h, + int encoder_id, double comp); +ARCS_ABI BOOL isConveyorTrackSync(MOTION_CONTROL_HANDLER h, int encoder_id); +ARCS_ABI BOOL isConveyorTrackExceed(MOTION_CONTROL_HANDLER h, int encoder_id); +ARCS_ABI int getConveyorTrackQueue(MOTION_CONTROL_HANDLER h, int encoder_id, + double *result); +ARCS_ABI int getConveyorTrackNextItem(MOTION_CONTROL_HANDLER h, int encoder_id); +ARCS_ABI int conveyorTrackCreatItem(MOTION_CONTROL_HANDLER h, int encoder_id, + int item_id, const double *offset); +ARCS_ABI BOOL hasItemOnConveyorToTrack(MOTION_CONTROL_HANDLER h, + int encoder_id); +ARCS_ABI BOOL conveyorTrackSwitch(MOTION_CONTROL_HANDLER h, int encoder_id); +ARCS_ABI int conveyorTrackClearItems(MOTION_CONTROL_HANDLER h, int encoder_id); +ARCS_ABI int moveSpiral(MOTION_CONTROL_HANDLER h, + const SpiralParameters_C *param, double blend_radius, + double v, double a, double t); +ARCS_ABI int pathOffsetLimits(MOTION_CONTROL_HANDLER h, double v, double a); +ARCS_ABI int pathOffsetCoordinate(MOTION_CONTROL_HANDLER h, int ref_coord); +ARCS_ABI int getLookAheadSize(MOTION_CONTROL_HANDLER h); +ARCS_ABI int setLookAheadSize(MOTION_CONTROL_HANDLER h, int size); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/linux/include/aubo_sdk/robot/robot_algorithm_c.h b/third_party/AuboSdk/linux/include/aubo_sdk/robot/robot_algorithm_c.h new file mode 100644 index 00000000..9a34d80c --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo_sdk/robot/robot_algorithm_c.h @@ -0,0 +1,69 @@ +#ifndef AUBO_SDK_RobotAlgorithm_C_H +#define AUBO_SDK_RobotAlgorithm_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI ForceSensorCalibResult_C +calibrateTcpForceSensor(ROBOT_ALGORITHM_HANDLER h, const double *forces, + int forces_rows, const double *poses, int poses_rows); +ARCS_ABI ForceSensorCalibResult_C +calibrateTcpForceSensor2(ROBOT_ALGORITHM_HANDLER h, const double *forces, + int forces_rows, const double *poses, int poses_rows); +ARCS_ABI int payloadIdentify(ROBOT_ALGORITHM_HANDLER h, + const char *data_no_payload, + const char *data_with_payload); +ARCS_ABI int payloadIdentify1(ROBOT_ALGORITHM_HANDLER h, const char *file_name); +ARCS_ABI int payloadCalculateFinished(ROBOT_ALGORITHM_HANDLER h); +ARCS_ABI Payload_C getPayloadIdentifyResult(ROBOT_ALGORITHM_HANDLER h); +ARCS_ABI int generatePayloadIdentifyTraj(ROBOT_ALGORITHM_HANDLER h, + const char *name, + const TrajConfig_C *traj_config); +ARCS_ABI int payloadIdentifyTrajGenFinished(ROBOT_ALGORITHM_HANDLER h); +ARCS_ABI BOOL frictionModelIdentify(ROBOT_ALGORITHM_HANDLER h, const double *q, + int q_rows, const double *qd, int qd_rows, + const double *qdd, int qdd_rows, + const double *temp, int temp_rows); +ARCS_ABI int calibWorkpieceCoordinatePara(ROBOT_ALGORITHM_HANDLER h, + const double *q, int q_rows, int type, + double *result); +ARCS_ABI int forwardDynamics(ROBOT_ALGORITHM_HANDLER h, const double *q, + const double *torqs, double *result); +ARCS_ABI int forwardKinematics(ROBOT_ALGORITHM_HANDLER h, const double *q, + double *result); +ARCS_ABI int forwardToolKinematics(ROBOT_ALGORITHM_HANDLER h, const double *q, + double *result); +ARCS_ABI int forwardDynamics1(ROBOT_ALGORITHM_HANDLER h, const double *q, + const double *torqs, const double *tcp_offset, + double *result); +ARCS_ABI int forwardKinematics1(ROBOT_ALGORITHM_HANDLER h, const double *q, + const double *tcp_offset, double *result); +ARCS_ABI int inverseKinematics(ROBOT_ALGORITHM_HANDLER h, const double *qnear, + const double *pose, double *result); +ARCS_ABI int inverseKinematicsAll(ROBOT_ALGORITHM_HANDLER h, const double *pose, + double **result); +ARCS_ABI int inverseKinematics1(ROBOT_ALGORITHM_HANDLER h, const double *qnear, + const double *pose, const double *tcp_offset, + double *result); +ARCS_ABI int inverseKinematicsAll1(ROBOT_ALGORITHM_HANDLER h, + const double *pose, const double *tcp_offset, + double **result); +ARCS_ABI int inverseToolKinematics(ROBOT_ALGORITHM_HANDLER h, + const double *qnear, const double *pose, + double *result); +ARCS_ABI int inverseToolKinematicsAll(ROBOT_ALGORITHM_HANDLER h, + const double *pose, double **result); +ARCS_ABI int pathMovej(ROBOT_ALGORITHM_HANDLER h, const double *q1, double r1, + const double *q2, double r2, double d, double **result); +ARCS_ABI int pathBlend3Points(ROBOT_ALGORITHM_HANDLER h, int type, + const double *q_start, const double *q_via, + const double *q_to, double r, double d, + double **result); +ARCS_ABI int calcJacobian(ROBOT_ALGORITHM_HANDLER h, const double *q, + BOOL base_or_end, double *result); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/linux/include/aubo_sdk/robot/robot_config_c.h b/third_party/AuboSdk/linux/include/aubo_sdk/robot/robot_config_c.h new file mode 100644 index 00000000..7dc9fd99 --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo_sdk/robot/robot_config_c.h @@ -0,0 +1,92 @@ +#ifndef AUBO_SDK_RobotConfig_C_H +#define AUBO_SDK_RobotConfig_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI int getDof(ROBOT_CONFIG_HANDLER h); +ARCS_ABI int getName(ROBOT_CONFIG_HANDLER h, char *result); +ARCS_ABI double getCycletime(ROBOT_CONFIG_HANDLER h); +ARCS_ABI int setSlowDownFraction(ROBOT_CONFIG_HANDLER h, int level, + double fraction); +ARCS_ABI double getSlowDownFraction(ROBOT_CONFIG_HANDLER h, int level); +ARCS_ABI int getRobotType(ROBOT_CONFIG_HANDLER h, char *result); +ARCS_ABI int getRobotSubType(ROBOT_CONFIG_HANDLER h, char *result); +ARCS_ABI int getControlBoxType(ROBOT_CONFIG_HANDLER h, char *result); +ARCS_ABI double getDefaultToolAcc(ROBOT_CONFIG_HANDLER h); +ARCS_ABI double getDefaultToolSpeed(ROBOT_CONFIG_HANDLER h); +ARCS_ABI double getDefaultJointAcc(ROBOT_CONFIG_HANDLER h); +ARCS_ABI double getDefaultJointSpeed(ROBOT_CONFIG_HANDLER h); +ARCS_ABI int setMountingPose(ROBOT_CONFIG_HANDLER h, const double *pose); +ARCS_ABI int getMountingPose(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int setCollisionLevel(ROBOT_CONFIG_HANDLER h, int level); +ARCS_ABI int getCollisionLevel(ROBOT_CONFIG_HANDLER h); +ARCS_ABI int setCollisionStopType(ROBOT_CONFIG_HANDLER h, int type); +ARCS_ABI int getCollisionStopType(ROBOT_CONFIG_HANDLER h); +ARCS_ABI int setHomePosition(ROBOT_CONFIG_HANDLER h, const double *positions); +ARCS_ABI int getHomePosition(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int setFreedriveDamp(ROBOT_CONFIG_HANDLER h, const double *damp); +ARCS_ABI int getFreedriveDamp(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int getTcpForceSensorNames(ROBOT_CONFIG_HANDLER h, char **result); +ARCS_ABI int selectTcpForceSensor(ROBOT_CONFIG_HANDLER h, const char *name); +ARCS_ABI BOOL hasTcpForceSensor(ROBOT_CONFIG_HANDLER h); +ARCS_ABI int setTcpForceOffset(ROBOT_CONFIG_HANDLER h, + const double *force_offset); +ARCS_ABI int getTcpForceOffset(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int getBaseForceSensorNames(ROBOT_CONFIG_HANDLER h, char **result); +ARCS_ABI int selectBaseForceSensor(ROBOT_CONFIG_HANDLER h, const char *name); +ARCS_ABI BOOL hasBaseForceSensor(ROBOT_CONFIG_HANDLER h); +ARCS_ABI int setBaseForceOffset(ROBOT_CONFIG_HANDLER h, + const double *force_offset); +ARCS_ABI int getBaseForceOffset(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int setPersistentParameters(ROBOT_CONFIG_HANDLER h, const char *param); +ARCS_ABI int setKinematicsCompensate(ROBOT_CONFIG_HANDLER h, + const DHParam_C *param); +ARCS_ABI int setHardwareCustomParameters(ROBOT_CONFIG_HANDLER h, + const char *param); +ARCS_ABI int getHardwareCustomParameters(ROBOT_CONFIG_HANDLER h, + const char *param, char *result); +ARCS_ABI int setRobotZero(ROBOT_CONFIG_HANDLER h); +ARCS_ABI DHParam_C *getKinematicsParam(ROBOT_CONFIG_HANDLER h, BOOL real); +ARCS_ABI DHComp_C *getKinematicsCompensate(ROBOT_CONFIG_HANDLER h, + double ref_temperature); +ARCS_ABI uint32_t getSafetyParametersCheckSum(ROBOT_CONFIG_HANDLER h); +ARCS_ABI int confirmSafetyParameters( + ROBOT_CONFIG_HANDLER h, const RobotSafetyParameterRange_C *parameters); +ARCS_ABI uint32_t calcSafetyParametersCheckSum( + ROBOT_CONFIG_HANDLER h, const RobotSafetyParameterRange_C *parameters); +ARCS_ABI int getJointMaxPositions(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int getJointMinPositions(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int getJointMaxSpeeds(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int getJointMaxAccelerations(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int getTcpMaxSpeeds(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int getTcpMaxAccelerations(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI BOOL toolSpaceInRange(ROBOT_CONFIG_HANDLER h, const double *pose); +ARCS_ABI int setPayload(ROBOT_CONFIG_HANDLER h, double m, const double *cog, + const double *aom, const double *inertia); +ARCS_ABI Payload_C getPayload(ROBOT_CONFIG_HANDLER h); +ARCS_ABI int getTcpOffset(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int getGravity(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int setGravity(ROBOT_CONFIG_HANDLER h, const double *gravity); +ARCS_ABI int setTcpOffset(ROBOT_CONFIG_HANDLER h, const double *offset); +ARCS_ABI int setToolInertial(ROBOT_CONFIG_HANDLER h, double m, + const double *com, const double *inertial); +ARCS_ABI int firmwareUpdate(ROBOT_CONFIG_HANDLER h, const char *fw); +ARCS_ABI double getFirmwareUpdateProcess(ROBOT_CONFIG_HANDLER h); +ARCS_ABI int setTcpForceSensorPose(ROBOT_CONFIG_HANDLER h, + const double *sensor_pose); +ARCS_ABI int getTcpForceSensorPose(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int getLimitJointMaxPositions(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int getLimitJointMinPositions(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int getLimitJointMaxSpeeds(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int getLimitJointMaxAccelerations(ROBOT_CONFIG_HANDLER h, + double *result); +ARCS_ABI double getLimitTcpMaxSpeed(ROBOT_CONFIG_HANDLER h); +ARCS_ABI SafeguedStopType_C getSafeguardStopType(ROBOT_CONFIG_HANDLER h); +ARCS_ABI int getSafeguardStopSource(ROBOT_CONFIG_HANDLER h); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/linux/include/aubo_sdk/robot/robot_interface_c.h b/third_party/AuboSdk/linux/include/aubo_sdk/robot/robot_interface_c.h new file mode 100644 index 00000000..ca8521a0 --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo_sdk/robot/robot_interface_c.h @@ -0,0 +1,22 @@ +#ifndef AUBO_SDK_RobotInterface_C_H +#define AUBO_SDK_RobotInterface_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI ROBOT_CONFIG_HANDLER robot_getRobotConfig(ROBOT_HANDLER robot); +ARCS_ABI MOTION_CONTROL_HANDLER robot_getMotionControl(ROBOT_HANDLER robot); +ARCS_ABI FORCE_CONTROL_HANDLER robot_getForceControl(ROBOT_HANDLER robot); +ARCS_ABI IO_CONTROL_HANDLER robot_getIoControl(ROBOT_HANDLER robot); +ARCS_ABI SYNC_MOVE_HANDLER robot_getSyncMove(ROBOT_HANDLER robot); +ARCS_ABI ROBOT_ALGORITHM_HANDLER robot_getRobotAlgorithm(ROBOT_HANDLER robot); +ARCS_ABI ROBOT_MANAGE_HANDLER robot_getRobotManage(ROBOT_HANDLER robot); +ARCS_ABI ROBOT_STATE_HANDLER robot_getRobotState(ROBOT_HANDLER robot); +ARCS_ABI TRACE_HANDLER robot_getTrace(ROBOT_HANDLER robot); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/linux/include/aubo_sdk/robot/robot_manage_c.h b/third_party/AuboSdk/linux/include/aubo_sdk/robot/robot_manage_c.h new file mode 100644 index 00000000..7b94f3cb --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo_sdk/robot/robot_manage_c.h @@ -0,0 +1,38 @@ +#ifndef AUBO_SDK_RobotManage_C_H +#define AUBO_SDK_RobotManage_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI int poweron(ROBOT_MANAGE_HANDLER h); +ARCS_ABI int startup(ROBOT_MANAGE_HANDLER h); +ARCS_ABI int poweroff(ROBOT_MANAGE_HANDLER h); +ARCS_ABI int backdrive(ROBOT_MANAGE_HANDLER h, BOOL enable); +ARCS_ABI int freedrive(ROBOT_MANAGE_HANDLER h, BOOL enable); +ARCS_ABI int handguideMode(ROBOT_MANAGE_HANDLER h, int32_t *freeAxes, + const double *feature); +ARCS_ABI int exitHandguideMode(ROBOT_MANAGE_HANDLER h); +ARCS_ABI int getHandguideStatus(ROBOT_MANAGE_HANDLER h); +ARCS_ABI int getHandguideTrigger(ROBOT_MANAGE_HANDLER h); +ARCS_ABI BOOL isHandguideEnabled(ROBOT_MANAGE_HANDLER h); +ARCS_ABI int setSim(ROBOT_MANAGE_HANDLER h, BOOL enable); +ARCS_ABI int setOperationalMode(ROBOT_MANAGE_HANDLER h, + OperationalModeType_C mode); +ARCS_ABI OperationalModeType_C getOperationalMode(ROBOT_MANAGE_HANDLER h); +ARCS_ABI RobotControlModeType_C getRobotControlMode(ROBOT_MANAGE_HANDLER h); +ARCS_ABI BOOL isSimulationEnabled(ROBOT_MANAGE_HANDLER h); +ARCS_ABI BOOL isFreedriveEnabled(ROBOT_MANAGE_HANDLER h); +ARCS_ABI BOOL isBackdriveEnabled(ROBOT_MANAGE_HANDLER h); +ARCS_ABI int setUnlockProtectiveStop(ROBOT_MANAGE_HANDLER h); +ARCS_ABI int startRecord(ROBOT_MANAGE_HANDLER h, const char *file_name); +ARCS_ABI int stopRecord(ROBOT_MANAGE_HANDLER h); +ARCS_ABI int pauseRecord(ROBOT_MANAGE_HANDLER h, BOOL pause); +ARCS_ABI int restartInterfaceBoard(ROBOT_MANAGE_HANDLER h); +ARCS_ABI int setLinkModeEnable(ROBOT_MANAGE_HANDLER h, BOOL enable); +ARCS_ABI BOOL isLinkModeEnabled(ROBOT_MANAGE_HANDLER h); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/linux/include/aubo_sdk/robot/robot_state_c.h b/third_party/AuboSdk/linux/include/aubo_sdk/robot/robot_state_c.h new file mode 100644 index 00000000..7e214bb1 --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo_sdk/robot/robot_state_c.h @@ -0,0 +1,73 @@ +#ifndef AUBO_SDK_RobotState_C_H +#define AUBO_SDK_RobotState_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI RobotModeType_C getRobotModeType(ROBOT_STATE_HANDLER h); +ARCS_ABI SafetyModeType_C getSafetyModeType(ROBOT_STATE_HANDLER h); +ARCS_ABI BOOL isPowerOn(ROBOT_STATE_HANDLER h); +ARCS_ABI BOOL isSteady(ROBOT_STATE_HANDLER h); +ARCS_ABI BOOL isCollisionOccurred(ROBOT_STATE_HANDLER h); +ARCS_ABI BOOL isWithinSafetyLimits(ROBOT_STATE_HANDLER h); +ARCS_ABI int getTcpPose(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getActualTcpOffset(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getTargetTcpPose(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getToolPose(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getTcpSpeed(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getTcpForce(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getElbowPosistion(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getElbowVelocity(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getBaseForce(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getTcpTargetPose(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getTcpTargetSpeed(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getTcpTargetForce(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getJointState(ROBOT_STATE_HANDLER h, JointStateType_C *result); +ARCS_ABI int getJointServoMode(ROBOT_STATE_HANDLER h, + JointServoModeType_C *result); +ARCS_ABI int getJointPositions(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getJointPositionsHistory(ROBOT_STATE_HANDLER h, int steps, + double *result); +ARCS_ABI int getJointSpeeds(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getJointAccelerations(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getJointTorqueSensors(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getJointContactTorques(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getBaseForceSensor(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getTcpForceSensors(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getJointCurrents(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getJointVoltages(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getJointTemperatures(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getJointUniqueIds(ROBOT_STATE_HANDLER h, char **result); +ARCS_ABI int getJointFirmwareVersions(ROBOT_STATE_HANDLER h, int *result); +ARCS_ABI int getJointHardwareVersions(ROBOT_STATE_HANDLER h, int *result); +ARCS_ABI int getMasterBoardUniqueId(ROBOT_STATE_HANDLER h, char *result); +ARCS_ABI int getMasterBoardFirmwareVersion(ROBOT_STATE_HANDLER h); +ARCS_ABI int getMasterBoardHardwareVersion(ROBOT_STATE_HANDLER h); +ARCS_ABI int getSlaveBoardUniqueId(ROBOT_STATE_HANDLER h, char *result); +ARCS_ABI int getSlaveBoardFirmwareVersion(ROBOT_STATE_HANDLER h); +ARCS_ABI int getSlaveBoardHardwareVersion(ROBOT_STATE_HANDLER h); +ARCS_ABI int getToolUniqueId(ROBOT_STATE_HANDLER h, char *result); +ARCS_ABI int getToolFirmwareVersion(ROBOT_STATE_HANDLER h); +ARCS_ABI int getToolHardwareVersion(ROBOT_STATE_HANDLER h); +ARCS_ABI int getToolCommMode(ROBOT_STATE_HANDLER h); +ARCS_ABI int getPedestalUniqueId(ROBOT_STATE_HANDLER h, char *result); +ARCS_ABI int getPedestalFirmwareVersion(ROBOT_STATE_HANDLER h); +ARCS_ABI int getPedestalHardwareVersion(ROBOT_STATE_HANDLER h); +ARCS_ABI int getJointTargetPositions(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getJointTargetSpeeds(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getJointTargetAccelerations(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getJointTargetTorques(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getJointTargetCurrents(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI double getControlBoxTemperature(ROBOT_STATE_HANDLER h); +ARCS_ABI double getControlBoxHumidity(ROBOT_STATE_HANDLER h); +ARCS_ABI double getMainVoltage(ROBOT_STATE_HANDLER h); +ARCS_ABI double getMainCurrent(ROBOT_STATE_HANDLER h); +ARCS_ABI double getRobotVoltage(ROBOT_STATE_HANDLER h); +ARCS_ABI double getRobotCurrent(ROBOT_STATE_HANDLER h); +ARCS_ABI int getSlowDownLevel(ROBOT_STATE_HANDLER h); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/linux/include/aubo_sdk/rpc.h b/third_party/AuboSdk/linux/include/aubo_sdk/rpc.h new file mode 100644 index 00000000..ab5bd031 --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo_sdk/rpc.h @@ -0,0 +1,171 @@ +/** @file rpc.h + * @brief 用于RPC模块的交互,如登录、连接等功能 + */ + +#ifndef AUBO_SDK_RPC_H +#define AUBO_SDK_RPC_H + +#include + +#include +#include + +namespace arcs { +namespace aubo_sdk { +using namespace arcs::common_interface; + +/// RPC客户端 +class ARCS_ABI RpcClient : public AuboApi +{ +public: + enum Event + { + Connected = 0, + Disconnected = 1, + }; + + /** + * @brief RpcClient + * @param mode 0-TCP 1-UDS + */ + RpcClient(int mode = 0); + ~RpcClient(); + + /** + * 设置日志处理器 + * + * 此函数可设置自定义的日志处理函数来处理日志消息。 \n + * Aubo SDK 有一套默认的日志系统,按照默认的格式输出到默认的文件。 + * 如果用户不希望采用默认的格式或者不希望输出到默认的文件,那就可以通过这个接口重新自定义格式,或者输出路径。 + * 这个函数可以将用户自定义的日志系统与 Aubo SDK 默认的日志系统合并。 + * + * @note setLogHandler函数要放在即将触发的日志之前, + * 否则会按照默认的形式输出日志。 + * + * @param handler 日志处理函数 \n + * 此日志处理函数的下定义如下: \n + * void handler(int level, const char* filename, int line, const + * std::string& message) \n + * level 表示日志等级 \n + *   0: LOGLEVEL_FATAL 严重的错误 \n + *   1: LOGLEVEL_ERROR 错误 \n + *   2: LOGLEVEL_WARNING 警告 \n + *   3: LOGLEVEL_INFO 通知 \n + *   4: LOGLEVEL_DEBUG 调试 \n + *   5: LOGLEVEL_BACKTRACE 跟踪 \n + * filename 表示文件名 \n + * line 表示代码行号 \n + * message 表示日志信息 \n + * @return 无 + */ + void setLogHandler( + std::function + handler); + + /** + * 连接到RPC服务 + * + * @param ip IP地址 + * @param port 端口号,RPC的端口号是30004 + * @param ip和port为空时,采用unix domain sockets通讯方式 + * @retval 0 RPC连接成功 + * @retval -8 RPC连接失败,RPC连接被拒绝 + * @retval -15 RPC连接失败,SDK版本与Server版本不兼容 + */ + int connect(const std::string &ip = "", int port = 0); + + /** + * 断开RPC连接 + * + * @retval 0 成功 + * @retval -1 失败 + */ + int disconnect(); + + /** + * 判断是否连接RPC + * + * @retval true 已连接RPC + * @retval false 未连接RPC + */ + bool hasConnected() const; + + /** + * 登录 + * + * @param usrname 用户名 + * @param passwd 密码 + * @return 0 + */ + int login(const std::string &usrname, const std::string &passwd); + + /** + * 登出 + * + * @return 0 + */ + int logout(); + + /** + * 判断是否登录 + * + * @retval true 已登录 + * @retval false 未登录 + */ + bool hasLogined(); + + /** + * 设置RPC请求超时时间 + * + * @param timeout 请求超时时间,单位 ms + * @return 0 + */ + int setRequestTimeout(int timeout = 100); + + /** + * 设置事件处理 + * + * @param cb + * @return + */ + int setEventHandler(std::function cb); + + /** + * 是否关闭异常抛出 + * + * @param enable + * @return + */ + int setExceptionFree(bool enable); + + /** + * 返回错误代码 + * + * @return + */ + int errorCode() const; + + /** + * 设备关机 + * + * @return + */ + int shutdown(); +}; +using RpcClientPtr = std::shared_ptr; + +} // namespace aubo_sdk +} // namespace arcs + +#ifdef __cplusplus +extern "C" { +#endif + +ARCS_ABI arcs::aubo_sdk::RpcClient *createRpcClient(int mode = 0); +ARCS_ABI void destroyRpcClient(arcs::aubo_sdk::RpcClient *cli); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/third_party/AuboSdk/linux/include/aubo_sdk/rpc_c.h b/third_party/AuboSdk/linux/include/aubo_sdk/rpc_c.h new file mode 100644 index 00000000..00ade7be --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo_sdk/rpc_c.h @@ -0,0 +1,321 @@ +/** @file rpc_c.h + * @brief 用于RPC模块的交互,如登录、连接等功能 + */ + +#ifndef AUBO_SDK_RPC_C_H +#define AUBO_SDK_RPC_C_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +enum Event +{ + Event_Connected = 0, + Event_Disconnected = 1, +}; + +ARCS_ABI RPC_HANDLER rpc_create_client(int mode = 0); +ARCS_ABI void rpc_destroy_client(RPC_HANDLER cli); + +/** + * 设置日志处理器 + * + * 此函数可设置自定义的日志处理函数来处理日志消息。 \n + * Aubo SDK 有一套默认的日志系统,按照默认的格式输出到默认的文件。 + * 如果用户不希望采用默认的格式或者不希望输出到默认的文件,那就可以通过这个接口重新自定义格式,或者输出路径。 + * 这个函数可以将用户自定义的日志系统与 Aubo SDK 默认的日志系统合并。 + * + * @note setLogHandler函数要放在即将触发的日志之前, + * 否则会按照默认的形式输出日志。 + * + * @param handler 日志处理函数 \n + * 此日志处理函数的下定义如下: \n + * void handler(int level, const char* filename, int line, const + * std::string& message) \n + * level 表示日志等级 \n + *   0: LOGLEVEL_FATAL 严重的错误 \n + *   1: LOGLEVEL_ERROR 错误 \n + *   2: LOGLEVEL_WARNING 警告 \n + *   3: LOGLEVEL_INFO 通知 \n + *   4: LOGLEVEL_DEBUG 调试 \n + *   5: LOGLEVEL_BACKTRACE 跟踪 \n + * filename 表示文件名 \n + * line 表示代码行号 \n + * message 表示日志信息 \n + * @return 无 + */ +ARCS_ABI void rpc_setLogHandler(RPC_HANDLER cli, LOG_HANDLER handler); + +/** + * 连接到RPC服务 + * + * @param ip IP地址 + * @param port 端口号,RPC的端口号是30004 + * @param ip和port为空时,采用unix domain sockets通讯方式 + * @retval 0 RPC连接成功 + * @retval -8 RPC连接失败,RPC连接被拒绝 + * @retval -15 RPC连接失败,SDK版本与Server版本不兼容 + */ +ARCS_ABI int rpc_connect(RPC_HANDLER cli, const char *ip = "", int port = 0); + +/** + * 断开RPC连接 + * + * @retval 0 成功 + * @retval -1 失败 + */ +ARCS_ABI int rpc_disconnect(RPC_HANDLER cli); + +/** + * 判断是否连接RPC + * + * @retval true 已连接RPC + * @retval false 未连接RPC + */ +ARCS_ABI bool rpc_hasConnected(RPC_HANDLER cli); + +/** + * 登录 + * + * @param usrname 用户名 + * @param passwd 密码 + * @return 0 + */ +ARCS_ABI int rpc_login(RPC_HANDLER cli, const char *usrname, + const char *passwd); + +/** + * 登出 + * + * @return 0 + */ +ARCS_ABI int rpc_logout(RPC_HANDLER cli); + +/** + * 判断是否登录 + * + * @retval true 已登录 + * @retval false 未登录 + */ +ARCS_ABI bool rpc_hasLogined(RPC_HANDLER cli); + +/** + * 设置RPC请求超时时间 + * + * @param timeout 请求超时时间,单位 ms + * @return 0 + */ +ARCS_ABI int rpc_setRequestTimeout(RPC_HANDLER cli, int timeout = 10); + +/** + * 设置事件处理 + * + * @param cb + * @return + */ +ARCS_ABI int rpc_setEventHandler(RPC_HANDLER cli, EVENT_CALLBACK cb); + +/** + * 是否关闭异常抛出 + * + * @param enable + * @return + */ +ARCS_ABI int rpc_set_exception_free(RPC_HANDLER cli, bool enable); + +/** + * 返回错误代码 + * + * @return + */ +ARCS_ABI int rpc_errorCode(RPC_HANDLER cli); + +/** + * 设备关机 + * + * @return + */ +ARCS_ABI int rpc_shutdown(RPC_HANDLER cli); + +/** + * 获取纯数学相关接口 + * + * @return MathPtr对象的指针 + * + * @par Python函数原型 + * getMath(self: pyaubo_sdk.AuboApi) -> pyaubo_sdk.Math + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * MathPtr ptr = rpc_cli->getMath(); + * @endcode + * + */ +ARCS_ABI MATH_HANDLER rpc_getMath(RPC_HANDLER cli); + +/** + * 获取系统信息 + * + * @return SystemInfoPtr对象的指针 + * + * @par Python函数原型 + * getSystemInfo(self: pyaubo_sdk.AuboApi) -> pyaubo_sdk.SystemInfo + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * SystemInfoPtr ptr = rpc_cli->getSystemInfo(); + * @endcode + * + */ +ARCS_ABI SYSTEM_INFO_HANDLER rpc_getSystemInfo(RPC_HANDLER cli); + +/** + * 获取运行时接口 + * + * @return RuntimeMachinePtr对象的指针 + * + * @par Python函数原型 + * getRuntimeMachine(self: pyaubo_sdk.AuboApi) -> pyaubo_sdk.RuntimeMachine + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * RuntimeMachinePtr ptr = rpc_cli->getRuntimeMachine(); + * @endcode + * + */ +ARCS_ABI RUNTIME_MACHINE_HANDLER rpc_getRuntimeMachine(RPC_HANDLER cli); + +/** + * 对外寄存器接口 + * + * @return RegisterControlPtr对象的指针 + * + * @par Python函数原型 + * getRegisterControl(self: pyaubo_sdk.AuboApi) -> + * pyaubo_sdk.RegisterControl + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * RegisterControlPtr ptr = rpc_cli->getRegisterControl(); + * @endcode + * + */ +ARCS_ABI REGISTER_CONTROL_HANDLER rpc_getRegisterControl(RPC_HANDLER cli); + +/** + * 获取机器人列表 + * + * @return 机器人列表 + * + * @par Python函数原型 + * getRobotNames(self: pyaubo_sdk.AuboApi) -> List[str] + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * @endcode + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"getRobotNames","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":["rob1"]} + * + */ +ARCS_ABI int rpc_getRobotNames(RPC_HANDLER cli, char **names); + +/** + * 根据名字获取 RobotInterfacePtr 接口 + * + * @param name 机器人名字 + * @return RobotInterfacePtr对象的指针 + * + * @par Python函数原型 + * getRobotInterface(self: pyaubo_sdk.AuboApi, arg0: str) -> + * pyaubo_sdk.RobotInterface + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * RobotInterfacePtr ptr = rpc_cli->getRobotInterface(robot_name); + * @endcode + * + */ +ARCS_ABI ROBOT_HANDLER rpc_getRobotInterface(RPC_HANDLER cli, const char *name); + +/** + * 获取外部轴列表 + * + * @return + */ +ARCS_ABI int rpc_getAxisNames(RPC_HANDLER cli, char **names); + +/** + * 获取外部轴接口 + * + * @param name + * @return + */ +ARCS_ABI AXIS_HANDLER rpc_getAxisInterface(RPC_HANDLER cli, const char *name); + +/// 获取独立 IO 模块接口 + +/** + * 获取 socket + * @return SocketPtr对象的指针 + * + * @par Python函数原型 + * getSocket(self: pyaubo_sdk.AuboApi) -> arcs::common_interface::Socket + * @endcode + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * SocketPtr ptr = rpc_cli->getSocket(); + * @endcode + * + */ +ARCS_ABI SOCKET_HANDLER rpc_getSocket(RPC_HANDLER cli); + +/** + * + * @return SerialPtr对象的指针 + * + * @par Python函数原型 + * getSerial(self: pyaubo_sdk.AuboApi) -> arcs::common_interface::Serial + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * SerialPtr ptr = rpc_cli->getSerial(); + * @endcode + */ +ARCS_ABI SERIAL_HANDLER rpc_getSerial(RPC_HANDLER cli); + +/** + * 获取同步运动接口 + * + * @return SyncMovePtr对象的指针 + */ +ARCS_ABI SYNC_MOVE_HANDLER rpc_getSyncMove(RPC_HANDLER cli, const char *name); + +/** + * 获取告警信息接口 + * + * @return TracePtr对象的指针 + */ +ARCS_ABI TRACE_HANDLER rpc_getTrace(RPC_HANDLER cli, const char *name); + +#ifdef __cplusplus +} +#endif +#endif // #define AUBO_SDK_RPC_C_H diff --git a/third_party/AuboSdk/linux/include/aubo_sdk/rtde.h b/third_party/AuboSdk/linux/include/aubo_sdk/rtde.h new file mode 100644 index 00000000..6c8b7ff7 --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo_sdk/rtde.h @@ -0,0 +1,302 @@ +/** @file rtde.h + * @brief 用于RPC模块的交互,如订阅、发布等功能 + */ +#ifndef AUBO_SDK_RTDE_H +#define AUBO_SDK_RTDE_H + +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace arcs { +namespace aubo_sdk { + +class RtdeClient; + +/// 向输出数据中增加 +class ARCS_ABI OutputBuilder +{ +public: + OutputBuilder(); + ~OutputBuilder(); + + OutputBuilder &push(int val); + OutputBuilder &push(double val); + OutputBuilder &push(const std::vector &val); + OutputBuilder &push(const std::tuple &val); + OutputBuilder &push(int16_t &val); + OutputBuilder &push(const std::vector &val); + OutputBuilder &push(const std::vector &val); + OutputBuilder &push(const std::string &val); + OutputBuilder &push(char val); + OutputBuilder &push(const common_interface::RtdeRecipe &val); + +private: + friend RtdeClient; + class Impl; + Impl *impl; +}; + +/// 解析输入 +class ARCS_ABI InputParser +{ +public: + InputParser(); + ~InputParser(); + + bool popBool(); + int popInt32(); + int64_t popInt64(); + int16_t popInt16(); + double popDouble(); + char popChar(); + std::vector popVectorInt(); + std::vector popVectorInt16(); + std::vector popVectorDouble(); + std::vector> popVectorVectorDouble(); + std::vector popVectorJointStateType(); + common_interface::RobotModeType popRobotModeType(); + common_interface::OperationalModeType popOperationalModeType(); + common_interface::SafetyModeType popSafetyModeType(); + common_interface::RuntimeState popRuntimeState(); + common_interface::RobotMsgVector popRobotMsgVector(); + common_interface::Payload popPayload(); + +private: + friend RtdeClient; + class Impl; + Impl *impl; +}; + +/// RTDE客户端 +class ARCS_ABI RtdeClient +{ +public: + enum Event + { + Connected, + Disconnected, + }; + + /** + * RTDE客户端初始化 + * + * @param mode 设置通讯方式, 0 tcp通讯 1 uds通讯 + */ + RtdeClient(int mode = 0); + ~RtdeClient(); + + /** + * 设置日志处理器 + * + * 此函数可设置自定义的日志处理函数来处理日志消息。 \n + * Aubo SDK 有一套默认的日志系统,按照默认的格式输出到默认的文件。 + * 如果用户不希望采用默认的格式或者不希望输出到默认的文件,那就可以通过这个接口重新自定义格式,或者输出路径。 + * 这个函数可以将用户自定义的日志系统与 Aubo SDK 默认的日志系统合并。 + * + * @note setLogHandler函数要放在即将触发的日志之前, + * 否则会按照默认的形式输出日志。 + * + * @param handler 日志处理函数 \n + * 此日志处理函数的下定义如下: \n + * void handler(int level, const char* filename, int line, const + * std::string& message) \n + * level 表示日志等级 \n + *   0: LOGLEVEL_FATAL 严重的错误 \n + *   1: LOGLEVEL_ERROR 错误 \n + *   2: LOGLEVEL_WARNING 警告 \n + *   3: LOGLEVEL_INFO 通知 \n + *   4: LOGLEVEL_DEBUG 调试 \n + *   5: LOGLEVEL_BACKTRACE 跟踪 \n + * filename 表示文件名 \n + * line 表示代码行号 \n + * message 表示日志信息 \n + * @return 无 + */ + void setLogHandler( + std::function + handler); + + /** + * 连接到服务器 + * + * @param ip IP地址 + * @param port 端口号,RTDE 端口号为30010 + * @retval 0 连接成功 + * @retval 1 在执行函数前,已连接 + * @retval -1 连接失败 + */ + int connect(const std::string &ip = "", int port = 0); + + /** + * socket 是否已连接 + * + * @retval true 已连接socket + * @retval false 未连接socket + */ + bool hasConnected() const; + + /** + * socket 是否已连接 + * + * @param callback + * @retval true 已连接socket + * @retval false 未连接socket + */ + bool hasConnected1(std::function callback); + + /** + * 登录 + * + * @param usrname 用户名 + * @param passwd 密码 + * @retval 0 成功 + * @retval -1 失败 + */ + int login(const std::string &usrname, const std::string &passwd); + + /** + * 是否已经登录 + * + * @retval true 已登录 + * @retval false 未登录 + */ + bool hasLogined(); + + /** + * 登出 + * + * @return 0 + */ + int logout(); + + /** + * 断开连接 + * + * @retval 0 成功 + * @retval -1 失败 + */ + int disconnect(); + + /** + * 获取协议版本号 + * + * @return 协议版本号 + */ + int getProtocolVersion(); + + /** + * 获取输入列表 + * + * @return 输入列表 + */ + std::map getInputMaps(); + + /** + * 获取输出列表 + * + * @return 输出列表 + */ + std::map getOutputMaps(); + + /** + * 设置话题 + * + * @param to_server 数据流向。 + * true 表示客户端给服务器发送消息,false 表示服务器给客户端发送消息 + * @param names 服务器推送的信息列表 + * @param freq 服务器推送信息的频率 + * @param expected_chanel 通道。 + * 取值范围:0~99, + * 发布不同的话题走不同的通道 + * @retval expected_chanel参数的值 成功 + * @retval -1 失败 + */ + int setTopic(bool to_server, const std::vector &names, + double freq, int expected_chanel); + + /** + * 取消订阅 + * + * @param to_server 数据流向 + * true 表示客户端给服务器发送消息,false 表示服务器给客户端发送消息 + * @param chanel 通道 + * @retval 0 成功 + * @retval 1 失败 + */ + int removeTopic(bool to_server, int chanel); + + /** + * 获取已注册的输入菜单 + * + * @return 已注册的输入菜单 + */ + std::unordered_map + getRegisteredInputRecipe(); + + /** + * 获取已注册的输出菜单 + * + * @return 已注册的输出菜单 + */ + std::unordered_map + getRegisteredOutputRecipe(); + + /** + * 订阅 subscribe from output + * + * @param chanel 通道 + * @param callback 回调函数,用于处理订阅的输入信息。\n + * 回调函数的定义如下: + * void callback(InputParser &parser) + * @return 0 + */ + int subscribe(int chanel, std::function callback); + + /** + * 发布 publish to input + * + * @param chanel 通道 + * @param callback 回调函数,用于构建发布的输出信息。\n + * 回调函数的定义如下: + * void callback(OutputBuilder &builder) + * @retval 0 成功 + * @retval -1 失败 + */ + int publish(int chanel, std::function callback); + + /** + * 设置事件处理 + * + * @param cb + * @return + */ + int setEventHandler(std::function cb); + +private: + class Impl; + Impl *impl; +}; +using RtdeClientPtr = std::shared_ptr; + +} // namespace aubo_sdk +} // namespace arcs + +#ifdef __cplusplus +extern "C" { +#endif + +ARCS_ABI arcs::aubo_sdk::RtdeClient *createRtdeClient(int mode = 0); +ARCS_ABI void destroyRtdeClient(arcs::aubo_sdk::RtdeClient *cli); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/third_party/AuboSdk/linux/include/aubo_sdk/rtde_c.h b/third_party/AuboSdk/linux/include/aubo_sdk/rtde_c.h new file mode 100644 index 00000000..527bf2d9 --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo_sdk/rtde_c.h @@ -0,0 +1,180 @@ +#ifndef AUBO_SDK_RTDE_C_H +#define AUBO_SDK_RTDE_C_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief 创建 RTDE 客户端实例。 + * + * @param mode 设置通讯方式,0 表示 TCP 通讯,1 表示 UDS 通讯。 + * @return 成功返回 RTDE 客户端句柄,失败返回 NULL。 + */ +ARCS_ABI RTDE_HANDLE rtde_create_client(int mode); + +/** + * @brief 销毁 RTDE 客户端实例。 + * + * @param cli RTDE 客户端句柄。 + */ +ARCS_ABI void rtde_destroy_client(RTDE_HANDLE cli); + +/** + * @brief 设置日志处理器。 + * + * @param cli RTDE 客户端句柄。 + * @param handler 日志处理函数。 + */ +ARCS_ABI void rtde_setLogHandler(RTDE_HANDLE cli, + void (*handler)(int level, + const char *filename, int line, + const char *message)); + +/** + * @brief 连接到服务器。 + * + * @param cli RTDE 客户端句柄。 + * @param ip IP 地址,NULL 表示使用默认地址。 + * @param port 端口号,0 表示使用默认端口。 + * @return 0 表示成功,-1 表示失败。 + */ +ARCS_ABI int rtde_connect(RTDE_HANDLE cli, const char *ip, int port); + +/** + * @brief 检查是否已连接。 + * + * @param cli RTDE 客户端句柄。 + * @return true 表示已连接,false 表示未连接。 + */ +ARCS_ABI bool rtde_hasConnected(RTDE_HANDLE cli); + +/** + * @brief 登录到服务器。 + * + * @param cli RTDE 客户端句柄。 + * @param username 用户名。 + * @param password 密码。 + * @return 0 表示成功,-1 表示失败。 + */ +ARCS_ABI int rtde_login(RTDE_HANDLE cli, const char *username, + const char *password); + +/** + * @brief 检查是否已登录。 + * + * @param cli RTDE 客户端句柄。 + * @return true 表示已登录,false 表示未登录。 + */ +ARCS_ABI bool rtde_hasLogined(RTDE_HANDLE cli); + +/** + * @brief 登出。 + * + * @param cli RTDE 客户端句柄。 + * @return 0 表示成功。 + */ +ARCS_ABI int rtde_logout(RTDE_HANDLE cli); + +/** + * @brief 断开连接。 + * + * @param cli RTDE 客户端句柄。 + * @return 0 表示成功,-1 表示失败。 + */ +ARCS_ABI int rtde_disconnect(RTDE_HANDLE cli); + +/** + * @brief 获取协议版本号。 + * + * @param cli RTDE 客户端句柄。 + * @return 协议版本号。 + */ +ARCS_ABI int rtde_getProtocolVersion(RTDE_HANDLE cli); + +/** + * @brief 设置话题。 + * + * @param cli RTDE 客户端句柄。 + * @param to_server 数据流向,true 表示客户端发送消息,false + * 表示服务器发送消息。 + * @param names 信息列表(逗号分隔的字符串)。 + * @param freq 推送频率。 + * @param expected_chanel 通道号。 + * @return 成功返回通道号,失败返回 -1。 + */ +ARCS_ABI int rtde_setTopic(RTDE_HANDLE cli, bool to_server, const char *names, + double freq, int expected_chanel); + +/** + * @brief 取消订阅。 + * + * @param cli RTDE 客户端句柄。 + * @param to_server 数据流向。 + * @param chanel 通道号。 + * @return 0 表示成功,-1 表示失败。 + */ +ARCS_ABI int rtde_removeTopic(RTDE_HANDLE cli, bool to_server, int chanel); + +/** + * @brief 订阅主题。 + * + * @param cli RTDE 客户端句柄。 + * @param chanel 通道号。 + * @param callback 回调函数,用于处理订阅的数据。 + * @return 0 表示成功,-1 表示失败。 + */ +ARCS_ABI int rtde_subscribe(RTDE_HANDLE cli, int chanel, + void (*callback)(void *parser)); + +/** + * @brief 发布数据。 + * + * @param cli RTDE 客户端句柄。 + * @param chanel 通道号。 + * @param callback 回调函数,用于生成发布数据。 + * @return 0 表示成功,-1 表示失败。 + */ +ARCS_ABI int rtde_publish(RTDE_HANDLE cli, int chanel, + void (*callback)(void *builder)); + +// OutputBuilder +ARCS_ABI int rtde_pushInt(OUTPUT_BUILDER_HANDLE builder, int val); +ARCS_ABI int rtde_pushDouble(OUTPUT_BUILDER_HANDLE builder, double val); +ARCS_ABI int rtde_pushVectorDouble(OUTPUT_BUILDER_HANDLE builder, const double* val, int size); +ARCS_ABI int rtde_pushTupleIntBool(OUTPUT_BUILDER_HANDLE builder, int first, bool second); +ARCS_ABI int rtde_pushInt16(OUTPUT_BUILDER_HANDLE builder, int16_t val); +ARCS_ABI int rtde_pushVectorInt16(OUTPUT_BUILDER_HANDLE builder, const int16_t* val, int size); +ARCS_ABI int rtde_pushVectorInt(OUTPUT_BUILDER_HANDLE builder, const int* val, int size); +ARCS_ABI int rtde_pushString(OUTPUT_BUILDER_HANDLE builder, const char* val); +ARCS_ABI int rtde_pushChar(OUTPUT_BUILDER_HANDLE builder, char val); +ARCS_ABI int rtde_pushRtdeRecipe(OUTPUT_BUILDER_HANDLE builder, const struct RtdeRecipe_C* val); + +// InputParser +ARCS_ABI bool rtde_popBool(INPUT_PARSER_HANDLE parser); +ARCS_ABI int32_t rtde_popInt32(INPUT_PARSER_HANDLE parser); +ARCS_ABI int64_t rtde_popInt64(INPUT_PARSER_HANDLE parser); +ARCS_ABI int16_t rtde_popInt16(INPUT_PARSER_HANDLE parser); +ARCS_ABI double rtde_popDouble(INPUT_PARSER_HANDLE parser); +ARCS_ABI char rtde_popChar(INPUT_PARSER_HANDLE parser); + +ARCS_ABI int rtde_popVectorInt(INPUT_PARSER_HANDLE* parser, int* data, int size); +ARCS_ABI int rtde_popVectorInt16(INPUT_PARSER_HANDLE parser, int16_t* data, int size); +ARCS_ABI int rtde_popVectorDouble(INPUT_PARSER_HANDLE parser, double* data, int size); +ARCS_ABI int rtde_popVectorVectorDouble(INPUT_PARSER_HANDLE parser, double*** data, int rows, int cols); + +ARCS_ABI JointStateType_C rtde_popVectorJointStateType(INPUT_PARSER_HANDLE parser); +ARCS_ABI RobotModeType_C rtde_popRobotModeType(INPUT_PARSER_HANDLE parser); +ARCS_ABI OperationalModeType_C rtde_popOperationalModeType(INPUT_PARSER_HANDLE parser); +ARCS_ABI SafetyModeType_C rtde_popSafetyModeType(INPUT_PARSER_HANDLE parser); +ARCS_ABI RuntimeState_C rtde_popRuntimeState(INPUT_PARSER_HANDLE parser); +ARCS_ABI int rtde_popRobotMsgVector(INPUT_PARSER_HANDLE parser, struct RobotMsgVector_C* robot_msg_vec); +ARCS_ABI int rtde_popPayload(INPUT_PARSER_HANDLE parser, struct Payload_C* payload); + +#ifdef __cplusplus +} +#endif + +#endif // AUBO_SDK_RTDE_C_H diff --git a/third_party/AuboSdk/linux/include/aubo_sdk/runtime_machine_c.h b/third_party/AuboSdk/linux/include/aubo_sdk/runtime_machine_c.h new file mode 100644 index 00000000..0afd4c75 --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo_sdk/runtime_machine_c.h @@ -0,0 +1,60 @@ +#ifndef AUBO_SDK_RuntimeMachine_C_H +#define AUBO_SDK_RuntimeMachine_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif + +ARCS_ABI int newTask(RUNTIME_MACHINE_HADNLER h, BOOL daemon); +ARCS_ABI int deleteTask(RUNTIME_MACHINE_HADNLER h, int tid); +ARCS_ABI int detachTask(RUNTIME_MACHINE_HADNLER h, int tid); +ARCS_ABI BOOL isTaskAlive(RUNTIME_MACHINE_HADNLER h, int tid); +ARCS_ABI int nop(RUNTIME_MACHINE_HADNLER h); +ARCS_ABI int switchTask(RUNTIME_MACHINE_HADNLER h, int tid); +ARCS_ABI int setLabel(RUNTIME_MACHINE_HADNLER h, int tid, const char *lineno); +ARCS_ABI int setPlanContext(RUNTIME_MACHINE_HADNLER h, int tid, int lineno, + const char *comment); +ARCS_ABI int gotoLine(RUNTIME_MACHINE_HADNLER h, int lineno); +ARCS_ABI int getAdvancePlanContext(RUNTIME_MACHINE_HADNLER h, int tid, + struct PlanContext_C *result); +ARCS_ABI int getAdvancePtr(RUNTIME_MACHINE_HADNLER h, int tid); +ARCS_ABI int getMainPtr(RUNTIME_MACHINE_HADNLER h, int tid); +ARCS_ABI int getInterpPtr(RUNTIME_MACHINE_HADNLER h, int tid); +ARCS_ABI int getPlanContext(RUNTIME_MACHINE_HADNLER h, int tid, + struct PlanContext_C *result); +ARCS_ABI int getExecutionStatus(RUNTIME_MACHINE_HADNLER h, + struct ExecutionStatus_C *result); +ARCS_ABI int getExecutionStatus1(RUNTIME_MACHINE_HADNLER h, + struct ExecutionStatus1_C *result); +ARCS_ABI int loadProgram(RUNTIME_MACHINE_HADNLER h, const char *program); +ARCS_ABI int runProgram(RUNTIME_MACHINE_HADNLER h); +ARCS_ABI int start(RUNTIME_MACHINE_HADNLER h); +ARCS_ABI int stop(RUNTIME_MACHINE_HADNLER h); +ARCS_ABI int abort1(RUNTIME_MACHINE_HADNLER h); +ARCS_ABI int pause(RUNTIME_MACHINE_HADNLER h); +ARCS_ABI int step(RUNTIME_MACHINE_HADNLER h); +ARCS_ABI int setResumeWait(RUNTIME_MACHINE_HADNLER h, BOOL wait); +ARCS_ABI int resume(RUNTIME_MACHINE_HADNLER h); +ARCS_ABI RuntimeState_C getStatus(RUNTIME_MACHINE_HADNLER h); +ARCS_ABI RuntimeState_C getRuntimeState(RUNTIME_MACHINE_HADNLER h); +ARCS_ABI int setBreakPoint(RUNTIME_MACHINE_HADNLER h, int lineno); +ARCS_ABI int removeBreakPoint(RUNTIME_MACHINE_HADNLER h, int lineno); +ARCS_ABI int clearBreakPoints(RUNTIME_MACHINE_HADNLER h); +ARCS_ABI int timerStart(RUNTIME_MACHINE_HADNLER h, const char *name); +ARCS_ABI int timerStop(RUNTIME_MACHINE_HADNLER h, const char *name); +ARCS_ABI int timerReset(RUNTIME_MACHINE_HADNLER h, const char *name); +ARCS_ABI int timerDelete(RUNTIME_MACHINE_HADNLER h, const char *name); +ARCS_ABI double getTimer(RUNTIME_MACHINE_HADNLER h, const char *name); +ARCS_ABI int triggBegin(RUNTIME_MACHINE_HADNLER h, double distance, + double delay); +ARCS_ABI int triggEnd(RUNTIME_MACHINE_HADNLER h); +ARCS_ABI int triggInterrupt(RUNTIME_MACHINE_HADNLER h, double distance, + double delay); +ARCS_ABI int getTriggInterrupts(RUNTIME_MACHINE_HADNLER h, int *result); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/linux/include/aubo_sdk/script.h b/third_party/AuboSdk/linux/include/aubo_sdk/script.h new file mode 100644 index 00000000..8cb97fe7 --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo_sdk/script.h @@ -0,0 +1,209 @@ +/** @file script.h + * @brief 用于SCRIPT模块的交互,如向服务器发送脚本 + */ +#ifndef AUBO_SDK_SCRIPT_H +#define AUBO_SDK_SCRIPT_H + +#include +#include +#include +#include + +namespace arcs { +namespace aubo_sdk { + +class ScriptWriter +{ +public: + virtual ~ScriptWriter() = default; + + virtual ScriptWriter &append(const std::string &line) = 0; + virtual ScriptWriter &append(const char *buf, size_t len) = 0; + virtual ScriptWriter &moveJoint() = 0; + virtual ScriptWriter &moveLine() = 0; + virtual ScriptWriter &ifCondition() = 0; + virtual ScriptWriter &elseCondition() = 0; + virtual ScriptWriter &elseIfCondition() = 0; + virtual ScriptWriter &whileCondition() = 0; + virtual ScriptWriter &end() = 0; +}; + +/// SCRIPT客户端 +class ARCS_ABI ScriptClient +{ +public: + enum Event + { + Connected, + Disconnected, + }; + + ScriptClient(int mode = 0); + ~ScriptClient(); + + /** + * 设置日志处理器 + * + * 此函数可设置自定义的日志处理函数来处理日志消息。 \n + * Aubo SDK 有一套默认的日志系统,按照默认的格式输出到默认的文件。 + * 如果用户不希望采用默认的格式或者不希望输出到默认的文件,那就可以通过这个接口重新自定义格式,或者输出路径。 + * 这个函数可以将用户自定义的日志系统与 Aubo SDK 默认的日志系统合并。 + * + * @note setLogHandler函数要放在即将触发的日志之前, + * 否则会按照默认的形式输出日志。 + * + * @param handler 日志处理函数 \n + * 此日志处理函数的下定义如下: \n + * void handler(int level, const char* filename, int line, const + * std::string& message) \n + * level 表示日志等级 \n + *   0: LOGLEVEL_FATAL 严重的错误 \n + *   1: LOGLEVEL_ERROR 错误 \n + *   2: LOGLEVEL_WARNING 警告 \n + *   3: LOGLEVEL_INFO 通知 \n + *   4: LOGLEVEL_DEBUG 调试 \n + *   5: LOGLEVEL_BACKTRACE 跟踪 \n + * filename 表示文件名 \n + * line 表示代码行号 \n + * message 表示日志信息 \n + * @return 无 + */ + void setLogHandler( + std::function + handler); + + /** + * 连接到服务器 + * + * @param ip IP地址 + * @param port 端口号。SCRIPT端口号为30004 + * @retval 0 连接成功 + * @retval 1 在执行函数前,已连接 + * @retval -1 连接失败 + */ + int connect(const std::string &ip = "", int port = 0); + + /** + * 是否处于连接状态 + * + * @retval true 已连接 + * @retval false 未连接 + */ + bool hasConnected() const; + + /** + * 登录 + * + * @param usrname 用户名 + * @param passwd 密码 + * @retval 0 成功 + * @retval -1 失败 + */ + int login(const std::string &usrname, const std::string &passwd); + + /** + * 返回客户端是否登录 + * + * @retval true 已登录 + * @retval false 未登录 + */ + bool hasLogined(); + + /** + * 登出 + * + * @return 0 + */ + int logout(); + + /** + * 断开连接 + * + * @retval 0 成功 + * @retval -1 失败 + */ + int disconnect(); + + /** + * 发送脚本文件 + * + * 远程调用机器人的脚本 + * + * @param path 文件在机器人端的路径 + * @retval 0 成功 + * @retval -1 失败 + */ + int sendFile(const std::string &path); + + /** + * 发送脚本内容 + * + * 调用本地的脚本 + * + * @param script 脚本内容 + * @retval 0 成功 + * @retval -1 失败 + */ + int sendString(const std::string &script); + + /** + * 使用ScriptWriter构建服务器脚本 + * + * @param chunck_name + * @param cb + * @retval 0 成功 + * @retval -1 失败 + */ + int send(const std::string &chunck_name, + std::function cb); + + /** + * 设置服务器脚本的全局变量 + * + * @param cb 脚本的全局变量 + * @return 0 + */ + int subscribeVariableUpdate( + std::function cb); + + /** + * 设置服务器脚本的错误码 + * + * @param cb 脚本的错误码 + * @return 0 + */ + ARCS_DEPRECATED int subscribeScriptError( + std::function cb); + + int subscribeScriptError2( + std::function cb); + + /** + * 设置事件处理 + * + * @param cb + * @return + */ + int setEventHandler(std::function cb); + +private: + class Impl; + Impl *impl; +}; +using ScriptClientPtr = std::shared_ptr; + +} // namespace aubo_sdk +} // namespace arcs + +#ifdef __cplusplus +extern "C" { +#endif + +ARCS_ABI arcs::aubo_sdk::ScriptClient *createScriptClient(int mode = 0); +ARCS_ABI void destroyScriptClient(arcs::aubo_sdk::ScriptClient *cli); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/third_party/AuboSdk/linux/include/aubo_sdk/serial_c.h b/third_party/AuboSdk/linux/include/aubo_sdk/serial_c.h new file mode 100644 index 00000000..bac17286 --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo_sdk/serial_c.h @@ -0,0 +1,32 @@ +#ifndef AUBO_SDK_Serial_C_H +#define AUBO_SDK_Serial_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI int serialOpen(SERIAL_HANDLER h, const char *device, int baud, + float stop_bits, int even, const char *serial_name); +ARCS_ABI int serialClose(SERIAL_HANDLER h, const char *serial_name); +ARCS_ABI int serialReadByte(SERIAL_HANDLER h, const char *variable, + const char *serial_name); +ARCS_ABI int serialReadByteList(SERIAL_HANDLER h, int number, + const char *variable, const char *serial_name); +ARCS_ABI int serialReadString(SERIAL_HANDLER h, const char *variable, + const char *serial_name, const char *prefix, + const char *suffix, BOOL interpret_escape); +ARCS_ABI int serialSendByte(SERIAL_HANDLER h, char value, + const char *serial_name); +ARCS_ABI int serialSendInt(SERIAL_HANDLER h, int value, + const char *serial_name); +ARCS_ABI int serialSendLine(SERIAL_HANDLER h, const char *str, + const char *serial_name); +ARCS_ABI int serialSendString(SERIAL_HANDLER h, const char *str, + const char *serial_name); +ARCS_ABI int serialSendAllString(SERIAL_HANDLER h, BOOL is_check, + const char *str, const char *serial_name); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/linux/include/aubo_sdk/socket_c.h b/third_party/AuboSdk/linux/include/aubo_sdk/socket_c.h new file mode 100644 index 00000000..ba95fa56 --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo_sdk/socket_c.h @@ -0,0 +1,38 @@ +#ifndef AUBO_SDK_Socket_C_H +#define AUBO_SDK_Socket_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI int socketOpen(SOCKET_HANDLER h, const char *address, int port, + const char *socket_name); +ARCS_ABI int socketClose(SOCKET_HANDLER h, const char *socket_name); +ARCS_ABI int socketReadAsciiFloat(SOCKET_HANDLER h, int number, + const char *variable, + const char *socket_name); +ARCS_ABI int socketReadBinaryInteger(SOCKET_HANDLER h, int number, + const char *variable, + const char *socket_name); +ARCS_ABI int socketReadByteList(SOCKET_HANDLER h, int number, + const char *variable, const char *socket_name); +ARCS_ABI int socketReadString(SOCKET_HANDLER h, const char *variable, + const char *socket_name, const char *prefix, + const char *suffix, BOOL interpret_escape); +ARCS_ABI int socketReadAllString(SOCKET_HANDLER h, const char *variable, + const char *socket_name); +ARCS_ABI int socketSendByte(SOCKET_HANDLER h, char value, + const char *socket_name); +ARCS_ABI int socketSendInt(SOCKET_HANDLER h, int value, + const char *socket_name); +ARCS_ABI int socketSendLine(SOCKET_HANDLER h, const char *str, + const char *socket_name); +ARCS_ABI int socketSendString(SOCKET_HANDLER h, const char *str, + const char *socket_name); +ARCS_ABI int socketSendAllString(SOCKET_HANDLER h, BOOL is_check, + const char *str, const char *socket_name); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/linux/include/aubo_sdk/sync_move_c.h b/third_party/AuboSdk/linux/include/aubo_sdk/sync_move_c.h new file mode 100644 index 00000000..2b8048f8 --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo_sdk/sync_move_c.h @@ -0,0 +1,22 @@ +#ifndef AUBO_SDK_SyncMove_C_H +#define AUBO_SDK_SyncMove_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI int syncMoveOn(SYNC_MOVE_HANDLER h, const char *syncident, + const char **taskset); +ARCS_ABI BOOL syncMoveSegment(SYNC_MOVE_HANDLER h, int id); +ARCS_ABI int syncMoveOff(SYNC_MOVE_HANDLER h, const char *syncident); +ARCS_ABI int syncMoveUndo(SYNC_MOVE_HANDLER h); +ARCS_ABI int waitSyncTasks(SYNC_MOVE_HANDLER h, const char *syncident, + const char **taskset); +ARCS_ABI BOOL isSyncMoveOn(SYNC_MOVE_HANDLER h); +ARCS_ABI int syncMoveSuspend(SYNC_MOVE_HANDLER h); +ARCS_ABI int syncMoveResume(SYNC_MOVE_HANDLER h); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/linux/include/aubo_sdk/system_info_c.h b/third_party/AuboSdk/linux/include/aubo_sdk/system_info_c.h new file mode 100644 index 00000000..7f37e318 --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo_sdk/system_info_c.h @@ -0,0 +1,18 @@ +#ifndef AUBO_SDK_SystemInfo_C_H +#define AUBO_SDK_SystemInfo_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI int getControlSoftwareVersionCode(SYSTEM_INFO_HANDLER h); +ARCS_ABI int getControlSoftwareFullVersion(SYSTEM_INFO_HANDLER h, char *result); +ARCS_ABI int getInterfaceVersionCode(SYSTEM_INFO_HANDLER h); +ARCS_ABI int getControlSoftwareBuildDate(SYSTEM_INFO_HANDLER h, char *result); +ARCS_ABI int getControlSoftwareVersionHash(SYSTEM_INFO_HANDLER h, char *result); +ARCS_ABI uint64_t getControlSystemTime(SYSTEM_INFO_HANDLER h); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/linux/include/aubo_sdk/trace_c.h b/third_party/AuboSdk/linux/include/aubo_sdk/trace_c.h new file mode 100644 index 00000000..fd46477a --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo_sdk/trace_c.h @@ -0,0 +1,20 @@ +#ifndef AUBO_SDK_Trace_C_H +#define AUBO_SDK_Trace_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI int alarm(TRACE_HANDLER h, TraceLevel_C level, int code, + const char **args); +ARCS_ABI int popup(TRACE_HANDLER h, TraceLevel_C level, const char *title, + const char *msg, int mode); +ARCS_ABI int textmsg(TRACE_HANDLER h, const char *msg); +ARCS_ABI int notify(TRACE_HANDLER h, const char *msg); +ARCS_ABI int peek(TRACE_HANDLER h, uint64_t num, uint64_t last_time, + struct RobotMsg_C *result); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/linux/include/aubo_sdk/type_def_c.h b/third_party/AuboSdk/linux/include/aubo_sdk/type_def_c.h new file mode 100644 index 00000000..a60718c6 --- /dev/null +++ b/third_party/AuboSdk/linux/include/aubo_sdk/type_def_c.h @@ -0,0 +1,750 @@ +#ifndef AUBO_SDK_TYPE_DEF_C_H +#define AUBO_SDK_TYPE_DEF_C_H +#include +#include +#include + +#ifdef _MSC_VER +#pragma execution_character_set("utf-8") +#endif + +/// Cartesion degree of freedom, 6 for x,y,z,rx,ry,rz +#define CARTESIAN_DOF 6 +#define SAFETY_PARAM_SELECT_NUM 2 /// normal + reduced +#define SAFETY_PLANES_NUM 8 /// 安全平面的数量 +#define SAFETY_CUBIC_NUM 10 /// 安全立方体的数量 +#define TOOL_CONFIGURATION_NUM 3 /// 工具配置数量 +#define MAX_DOF 7 /// 工具配置数量 +#define TRUE 1 +#define FALSE 0 + +typedef uint8_t BOOL; +typedef double Vector3d_C[3]; +typedef double Vector4d_C[4]; +typedef float Vector3f_C[3]; +typedef float Vector4f_C[4]; +typedef float Vector6f_C[6]; + +typedef void *RPC_HANDLER; +typedef void *RTDE_HANDLE; +typedef void *INPUT_PARSER_HANDLE; +typedef void *OUTPUT_BUILDER_HANDLE; +typedef void *MATH_HANDLER; +typedef void *SYSTEM_INFO_HANDLER; +typedef void *RUNTIME_MACHINE_HANDLER; +typedef void *REGISTER_CONTROL_HANDLER; +typedef void *RUNTIME_MACHINE_HADNLER; +typedef void *ROBOT_HANDLER; +typedef void *AXIS_HANDLER; +typedef void *SOCKET_HANDLER; +typedef void *SERIAL_HANDLER; +typedef void *SYNC_MOVE_HANDLER; +typedef void *TRACE_HANDLER; +typedef void *FORCE_CONTROL_HANDLER; +typedef void *IO_CONTROL_HANDLER; +typedef void *MOTION_CONTROL_HANDLER; +typedef void *ROBOT_ALGORITHM_HANDLER; +typedef void *ROBOT_MANAGE_HANDLER; +typedef void *ROBOT_CONFIG_HANDLER; +typedef void *ROBOT_STATE_HANDLER; + +typedef void (*LOG_HANDLER)(int /*level*/, const char * /*filename*/, + int /*line*/, const char * /*message*/); +typedef void (*EVENT_CALLBACK)(int /*event*/); + +struct RobotSafetyParameterRange_C +{ + uint32_t crc32{ 0 }; + + /// 最多可以保存2套参数, 默认使用第 0 套参数 + struct + { + float power; ///< sum of joint torques times joint angular speeds + float momentum; ///< 机器人动量限制 + float stop_time; ///< 停机时间 ms + float stop_distance; ///< 停机距离 m + float reduced_entry_time; ///< 进入缩减模式的最大时间 + float + reduced_entry_distance; ///< 进入缩减模式的最大距离(可由安全平面触发) + float tcp_speed; + float elbow_speed; + float tcp_force; + float elbow_force; + float qmin[MAX_DOF]; + float qmax[MAX_DOF]; + float qdmax[MAX_DOF]; + float joint_torque[MAX_DOF]; + Vector3f_C tool_orientation; ///< + float tool_deviation; + Vector4f_C planes[SAFETY_PLANES_NUM]; /// x,y,z,displacement + int restrict_elbow[SAFETY_PLANES_NUM]; + } params[SAFETY_PARAM_SELECT_NUM]; + + /// 8个触发平面 + struct + { + Vector4f_C plane; /// x,y,z,displacement + int restrict_elbow; + } trigger_planes[SAFETY_PLANES_NUM]; + + struct + { + Vector6f_C orig; ///< 立方块的原点 (x,y,z,rx,ry,rz) + Vector3f_C size; ///< 立方块的尺寸 (x,y,z) + int restrict_elbow; + } cubic[SAFETY_CUBIC_NUM]; ///< 10个安全空间 + + /// 3个工具 + Vector4f_C tools[TOOL_CONFIGURATION_NUM]; /// x,y,z,radius + + float tool_inclination{ 0. }; ///< 倾角 + float tool_azimuth{ 0. }; ///< 方位角 + float safety_home[MAX_DOF]; + + /// 可配置IO的输入输出安全功能配置 + uint32_t safety_input_emergency_stop; + uint32_t safety_input_safeguard_stop; + uint32_t safety_input_safeguard_reset; + uint32_t safety_input_auto_safeguard_stop; + uint32_t safety_input_auto_safeguard_reset; + uint32_t safety_input_three_position_switch; + uint32_t safety_input_operational_mode; + uint32_t safety_input_reduced_mode; + uint32_t safety_input_handguide; + + uint32_t safety_output_emergency_stop; + uint32_t safety_output_not_emergency_stop; + uint32_t safety_output_robot_moving; + uint32_t safety_output_robot_steady; + uint32_t safety_output_reduced_mode; + uint32_t safety_output_not_reduced_mode; + uint32_t safety_output_safe_home; + uint32_t safety_output_robot_not_stopping; + uint32_t safety_output_safetyguard_stop; + + int tp_3pe_for_handguide; ///< 是否将示教器三档位开关作为拖动功能开关 + int allow_manual_high_speed; ///< 手动模式下允许高速运行 +}; + +inline void RobotSafetyParameterRange_init( + struct RobotSafetyParameterRange_C *range) +{ + memset(range, 0, sizeof(struct RobotSafetyParameterRange_C)); + range->tp_3pe_for_handguide = 1; +} + +struct WObjectData_C +{ + /// 是否为外部工具 + bool remote_tool; + + /// 工件坐标系耦合的 + char attach_frame[100]; + + /// 用户坐标系 + /// 如果 robhold 为 false, 那 uframe 的数值是基于 world + /// 否则,uframe 的数值是基于 flange + double user_coord[6]; + + /// 工件坐标系,基于 uframe + double obj_coord[6]; +}; + +/// 接口函数返回值定义 +/// +/// 整数为警告,负数为错误,0为没有错误也没有警告 +#define ENUM_AuboErrorCodes_DECLARES \ + ENUM_ITEM(AUBO_OK, 0, "Success") \ + ENUM_ITEM(AUBO_BAD_STATE, 1, "State error") \ + ENUM_ITEM(AUBO_QUEUE_FULL, 2, "Planning queue full") \ + ENUM_ITEM(AUBO_BUSY, 3, "The previous command is executing") \ + ENUM_ITEM(AUBO_TIMEOUT, 4, "Timeout") \ + ENUM_ITEM(AUBO_INVL_ARGUMENT, 5, "Invalid parameters") \ + ENUM_ITEM(AUBO_NOT_IMPLETEMENT, 6, "Interface not implemented") \ + ENUM_ITEM(AUBO_NO_ACCESS, 7, "Cannot access") \ + ENUM_ITEM(AUBO_CONN_REFUSED, 8, "Connection refused") \ + ENUM_ITEM(AUBO_CONN_RESET, 9, "Connection is reset") \ + ENUM_ITEM(AUBO_INPROGRESS, 10, "Execution in progress") \ + ENUM_ITEM(AUBO_EIO, 11, "Input/Output error") \ + ENUM_ITEM(AUBO_NOBUFFS, 12, "") \ + ENUM_ITEM(AUBO_REQUEST_IGNORE, 13, "Request was ignored") \ + ENUM_ITEM(AUBO_ALGORITHM_PLAN_FAILED, 14, \ + "Motion planning algorithm error") \ + ENUM_ITEM(AUBO_VERSION_INCOMPAT, 15, "Interface version unmatch") \ + ENUM_ITEM(AUBO_DIMENSION_ERR, 16, \ + "Input parameter dimension is incorrect") \ + ENUM_ITEM(AUBO_SINGULAR_ERR, 17, "Input configuration may be singular") \ + ENUM_ITEM(AUBO_POS_BOUND_ERR, 18, \ + "Input position boundary exceeds the limit range") \ + ENUM_ITEM(AUBO_INIT_POS_ERR, 19, "Initial position input is unreasonable") \ + ENUM_ITEM(AUBO_ELP_SETTING_ERR, 20, "Envelope body setting error") \ + ENUM_ITEM(AUBO_TRAJ_GEN_FAIL, 21, "Trajectory generation failed") \ + ENUM_ITEM(AUBO_TRAJ_SELF_COLLISION, 22, "Trajectory self collision") \ + ENUM_ITEM( \ + AUBO_IK_NO_CONVERGE, 23, \ + "Inverse kinematics computation did not converge; computation failed") \ + ENUM_ITEM(AUBO_IK_OUT_OF_RANGE, 24, \ + "Inverse kinematics result out of robot range") \ + ENUM_ITEM(AUBO_IK_CONFIG_DISMATCH, 25, \ + "Inverse kinematics input configuration contains errors") \ + ENUM_ITEM(AUBO_IK_JACOBIAN_FAILED, 26, \ + "The calculation of the inverse Jacobian matrix failed") \ + ENUM_ITEM(AUBO_IK_NO_SOLU, 27, \ + "The target point has solutions, but it has exceeded the joint " \ + "limit conditions") \ + ENUM_ITEM(AUBO_IK_UNKOWN_ERROR, 28, "Inverse kinematics unkown error") \ + ENUM_ITEM(AUBO_ERR_UNKOWN, 99999, "Unkown error occurred.") + +// clang-format off +/** + * The RuntimeState enum + * + */ +#define ENUM_RuntimeState_DECLARES \ + ENUM_ITEM(Running, 0, "正在运行中") \ + ENUM_ITEM(Retracting, 1, "倒退") \ + ENUM_ITEM(Pausing, 2, "暂停中") \ + ENUM_ITEM(Paused, 3, "暂停状态") \ + ENUM_ITEM(Stepping, 4, "单步执行中") \ + ENUM_ITEM(Stopping, 5, "受控停止中(保持原有轨迹)") \ + ENUM_ITEM(Stopped, 6, "已停止") \ + ENUM_ITEM(Aborting, 7, "停止(最大速度关节运动停机)") + +/** + * @brief The RobotModeType enum + * + * 硬件强相关 + */ +#define ENUM_RobotModeType_DECLARES \ + ENUM_ITEM(NoController, -1, "提供给示教器使用的, 如果aubo_control进程崩溃则会显示为NoController") \ + ENUM_ITEM(Disconnected, 0, "没有连接到机械臂本体(控制器与接口板断开连接或是 EtherCAT 等总线断开)") \ + ENUM_ITEM(ConfirmSafety, 1, "正在进行安全配置, 断电状态下进行") \ + ENUM_ITEM(Booting, 2, "机械臂本体正在上电初始化") \ + ENUM_ITEM(PowerOff, 3, "机械臂本体处于断电状态") \ + ENUM_ITEM(PowerOn, 4, "机械臂本体上电成功, 刹车暂未松开(抱死), 关节初始状态未获取") \ + ENUM_ITEM(Idle, 5, "机械臂上电成功, 刹车暂未松开(抱死), 电机不通电, 关节初始状态获取完成") \ + ENUM_ITEM(BrakeReleasing, 6, "机械臂上电成功, 刹车正在松开") \ + ENUM_ITEM(BackDrive, 7, "反向驱动:刹车松开, 电机不通电") \ + ENUM_ITEM(Running, 8, "机械臂刹车松开, 运行模式, 控制权由硬件移交给软件") \ + ENUM_ITEM(Maintaince, 9, "维护模式: 包括固件升级、参数写入等") \ + ENUM_ITEM(Error, 10, "") \ + ENUM_ITEM(PowerOffing, 11, "机械臂本体处于断电过程中") + +#define ENUM_SafetyModeType_DECLARES \ + ENUM_ITEM(Undefined, 0, "安全状态待定") \ + ENUM_ITEM(Normal, 1, "正常运行模式") \ + ENUM_ITEM(ReducedMode, 2, "缩减运行模式") \ + ENUM_ITEM(Recovery, 3, "启动时如果在安全限制之外, 机器人将进入recovery模式") \ + ENUM_ITEM(Violation, 4, "超出安全限制(根据安全配置, 例如速度超限等)") \ + ENUM_ITEM(ProtectiveStop, 5, "软件触发的停机(保持轨迹, 不抱闸, 不断电)") \ + ENUM_ITEM(SafeguardStop, 6, "IO触发的防护停机(不保持轨迹, 抱闸, 不断电)") \ + ENUM_ITEM(SystemEmergencyStop,7, "系统急停:急停信号由外部输入(可配置输入), 不对外输出急停信号") \ + ENUM_ITEM(RobotEmergencyStop, 8, "机器人急停:控制柜急停输入或者示教器急停按键触发, 对外输出急停信号") \ + ENUM_ITEM(Fault, 9, "机械臂硬件故障或者系统故障") + //ValidateJointId + +/** + * 根据ISO 10218-1:2011(E) 5.7节 + * Automatic: In automatic mode, the robot shall execute the task programme and + * the safeguarding measures shall be functioning. Automatic operation shall be + * prevented if any stop condition is detected. Switching from this mode shall + * result in a stop. + */ +#define ENUM_OperationalModeType_DECLARES \ + ENUM_ITEM(Disabled, 0, "禁用模式: 不使用Operational Mode") \ + ENUM_ITEM(Automatic, 1, "自动模式: 机器人正常工作模式, 运行速度不会被限制") \ + ENUM_ITEM(Manual, 2, "手动模式: 机器人编程示教模式(T1), 机器人运行速度将会被限制或者机器人程序校验模式(T2)") + +/** + * 机器人的控制模式, 最终的控制对象 + */ +#define ENUM_RobotControlModeType_DECLARES \ + ENUM_ITEM(Unknown, 0, "未知的控制模式") \ + ENUM_ITEM(Position, 1, "位置控制 movej") \ + ENUM_ITEM(Speed, 2, "速度控制 speedj/speedl") \ + ENUM_ITEM(Servo, 3, "位置控制 servoj") \ + ENUM_ITEM(Freedrive, 4, "拖动示教 freedrive_mode") \ + ENUM_ITEM(Force, 5, "末端力控 force_mode") \ + ENUM_ITEM(Torque, 6, "关节力矩控制") \ + ENUM_ITEM(Collision, 7, "碰撞模式") + +#define ENUM_JointServoModeType_DECLARES \ + ENUM_ITEM(Unknown, -1, "未知") \ + ENUM_ITEM(Open, 0, "开环模式") \ + ENUM_ITEM(Current, 1, "电流伺服模式") \ + ENUM_ITEM(Velocity, 2, "速度伺服模式") \ + ENUM_ITEM(Position, 3, "位置伺服模式") \ + ENUM_ITEM(Torque, 4, "力矩伺服模式") + +#define ENUM_JointStateType_DECLARES \ + ENUM_ITEM(Poweroff, 0, "节点未连接到接口板或者已经断电") \ + ENUM_ITEM(Idle, 2, "节点空闲") \ + ENUM_ITEM(Fault, 3, "节点错误, 节点停止伺服运动, 刹车抱死") \ + ENUM_ITEM(Running, 4, "节点伺服") \ + ENUM_ITEM(Bootload, 5, "节点bootloader状态, 暂停一切通讯") + +#define ENUM_StandardInputAction_DECLARES \ + ENUM_ITEM(Default, 0, "无触发") \ + ENUM_ITEM(Handguide, 1, "拖动示教,高电平触发") \ + ENUM_ITEM(GoHome, 2, "运动到工程初始位姿,高电平触发") \ + ENUM_ITEM(StartProgram, 3, "开始工程,上升沿触发") \ + ENUM_ITEM(StopProgram, 4, "停止工程,上升沿触发") \ + ENUM_ITEM(PauseProgram, 5, "暂停工程,上升沿触发") \ + ENUM_ITEM(PopupDismiss, 6, "消除弹窗,上升沿触发") \ + ENUM_ITEM(PowerOn, 7, "机器人上电/松刹车,上升沿触发") \ + ENUM_ITEM(PowerOff, 8, "机器人抱死刹车/断电,上升沿触发") \ + ENUM_ITEM(ResumeProgram, 9, "恢复工程,上升沿触发") \ + ENUM_ITEM(SlowDown1, 10, "机器人减速触发1,高电平触发") \ + ENUM_ITEM(SlowDown2, 11, "机器人减速触发2,高电平触发") \ + ENUM_ITEM(SafeStop, 12, "安全停止,高电平触发") \ + ENUM_ITEM(RunningGuard, 13, "信号,高电平有效") \ + ENUM_ITEM(MoveToFirstPoint, 14, "运动到工程初始位姿,高电平触发") \ + ENUM_ITEM(xSlowDown1, 15, "机器人减速触发1,低电平触发") \ + ENUM_ITEM(xSlowDown2, 16, "机器人减速触发2,低电平触发") \ + ENUM_ITEM(ConveyorTrack, 17, "传送带检测到物品触发,高电平触发") \ + ENUM_ITEM(xConveyorTrack, 18, "传送带检测到物品触发,低电平触发") + +#define ENUM_StandardOutputRunState_DECLARES \ + ENUM_ITEM(None, 0, "标准输出状态未定义") \ + ENUM_ITEM(StopLow, 1, "低电平指示工程停止") \ + ENUM_ITEM(StopHigh, 2, "高电平指示机器人停止") \ + ENUM_ITEM(RunningHigh, 3, "指示工程正在运行") \ + ENUM_ITEM(PausedHigh, 4, "指示工程已经暂停") \ + ENUM_ITEM(AtHome, 5, "高电平指示机器人正在拖动") \ + ENUM_ITEM(Handguiding, 6, "高电平指示机器人正在拖动") \ + ENUM_ITEM(PowerOn, 7, "高电平指示机器人已经上电") \ + ENUM_ITEM(RobotEmergencyStop, 8, "高电平指示机器人急停按下") \ + ENUM_ITEM(SystemEmergencyStop, 9, "高电平指示外部输入系统急停按下") \ + ENUM_ITEM(InternalEmergencyStop, 8, "高电平指示机器人急停按下") \ + ENUM_ITEM(ExternalEmergencyStop, 9, "高电平指示外部输入系统急停按下") \ + ENUM_ITEM(SystemError, 10, "系统错误,包括故障、超限、急停、安全停止、防护停止 ") \ + ENUM_ITEM(NotSystemError, 11, "无系统错误,包括普通模式、缩减模式和恢复模式 ") \ + ENUM_ITEM(RobotOperable, 12, "机器人可操作,机器人上电且松刹车了 ") + +#define ENUM_SafetyInputAction_DECLARES \ + ENUM_ITEM(Unassigned, 0, "安全输入未分配动作") \ + ENUM_ITEM(EmergencyStop, 1, "安全输入触发急停") \ + ENUM_ITEM(SafeguardStop, 2, "安全输入触发防护停止, 边沿触发") \ + ENUM_ITEM(SafeguardReset, 3, "安全输入触发防护重置, 边沿触发") \ + ENUM_ITEM(ThreePositionSwitch, 4, "3档位使能开关") \ + ENUM_ITEM(OperationalMode, 5, "切换自动模式和手动模式") \ + ENUM_ITEM(HandGuide, 6, "拖动示教") \ + ENUM_ITEM(ReducedMode, 7, "安全参数切换1(缩减模式),序号越低优先级越高,三路输出都无效时,选用第0组安全参数") \ + ENUM_ITEM(AutomaticModeSafeguardStop, 8, "自动模式下防护停机输入(需要配置三档位使能设备)") \ + ENUM_ITEM(AutomaticModeSafeguardReset, 9, "自动模式下上升沿触发防护重置(需要配置三档位使能设备)") + +#define ENUM_SafetyOutputRunState_DECLARES \ + ENUM_ITEM(Unassigned, 0, "安全输出未定义") \ + ENUM_ITEM(SystemEmergencyStop, 1, "输出高当有机器人急停输入或者急停按键被按下") \ + ENUM_ITEM(NotSystemEmergencyStop, 2, "输出低当有机器人急停输入或者急停按键被按下") \ + ENUM_ITEM(RobotMoving, 3, "输出高当有关节运动速度超过 0.1rad/s") \ + ENUM_ITEM(RobotNotMoving, 4, "输出高当所有的关节运动速度不超过 0.1rad/s") \ + ENUM_ITEM(ReducedMode, 5, "输出高当机器人处于缩减模式") \ + ENUM_ITEM(NotReducedMode, 6, "输出高当机器人不处于缩减模式") \ + ENUM_ITEM(SafeHome, 7, "输出高当机器人已经处于安全Home位姿") \ + ENUM_ITEM(RobotNotStopping, 8, "输出低当机器人正在急停或者安全停止中") + +#define ENUM_PayloadIdentifyMoveAxis_DECLARES \ + ENUM_ITEM(Joint_2_6, 0,"第2和6关节运动") \ + ENUM_ITEM(Joint_3_6, 1,"第3和6关节运动") \ + ENUM_ITEM(Joint_4_6, 2,"第4和6关节运动") \ + ENUM_ITEM(Joint_4_5_6, 3,"第4、5、6关节运动") \ + +#define ENUM_EnvelopingShape_DECLARES \ + ENUM_ITEM(Cube, 1,"立方体") \ + ENUM_ITEM(Column, 2,"柱状体") \ + ENUM_ITEM(Stl, 3,"以STL文件的形式描述负载碰撞集合体") + +#define ENUM_TaskFrameType_DECLARES \ + ENUM_ITEM(NONE, 0,"") \ + ENUM_ITEM(POINT_FORCE, 1, "力控坐标系发生变换, 使得力控参考坐标系的y轴沿着机器人TCP指向力控所选特征的原点, x和z轴取决于所选特征的原始方向" \ + "力控坐标系发生变换, 使得力控参考坐标系的y轴沿着机器人TCP指向力控所选特征的原点, x和z轴取决于所选特征的原始方向" \ + "机器人TCP与所选特征的起点之间的距离至少为10mm" \ + "优先选择X轴, 为所选特征的X轴在力控坐标系Y轴垂直平面上的投影, 如果所选特征的X轴与力控坐标系的Y轴平行, " \ + "通过类似方法确定力控坐标系Z轴, Y-X或者Y-Z轴确定之后, 通过右手法则确定剩下的轴") \ + ENUM_ITEM(FRAME_FORCE, 2,"力控坐标系不发生变换 SIMPLE_FORC") \ + ENUM_ITEM(MOTION_FORCE, 3,"力控坐标系发生变换, 使得力控参考坐标系的x轴为机器人TCP速度在所选特征x-y平面上的投影y轴将垂直于机械臂运动, 并在所选特征的x-y平面内")\ + ENUM_ITEM(TOOL_FORCE, 4,"以工具末端坐标系作为力控参考坐标系") + +#ifdef ERROR +#undef ERROR +#endif + +#define ENUM_TraceLevel_DECLARES \ + ENUM_ITEM(FATAL, 0, "") \ + ENUM_ITEM(ERROR, 1, "") \ + ENUM_ITEM(WARNING, 2, "") \ + ENUM_ITEM(INFO, 3, "") \ + ENUM_ITEM(DEBUG, 4, "") + +#define ENUM_AxisModeType_DECLARES \ + ENUM_ITEM(NoController, -1, "提供给示教器使用的, 如果aubo_control进程崩溃则会显示为NoController") \ + ENUM_ITEM(Disconnected, 0, "未连接") \ + ENUM_ITEM(PowerOff, 1, "断电") \ + ENUM_ITEM(BrakeReleasing, 2, "刹车松开中") \ + ENUM_ITEM(Idle, 3, "空闲") \ + ENUM_ITEM(Running, 4, "运行中") \ + ENUM_ITEM(Fault, 5, "错误状态") + +#define ENUM_SafeguedStopType_DECLARES \ + ENUM_ITEM(None, 0, "无安全停止") \ + ENUM_ITEM(SafeguedStopIOInput, 1, "安全停止(IO输入)") \ + ENUM_ITEM(SafeguedStop3PE, 2, "安全停止(三态开关)") \ + ENUM_ITEM(SafeguedStopOperational, 3, "安全停止(操作模式)") +// clang-format on + +#define ENUM_ITEM(c, n, ...) c = n, +enum AuboErrorCodes_C : int +{ + ENUM_AuboErrorCodes_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) RuntimeState_##c = n, +enum RuntimeState_C : int +{ + ENUM_RuntimeState_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) RobotModeType_##c = n, +enum RobotModeType_C : int +{ + ENUM_RobotModeType_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) AxisModeType_##c = n, +enum AxisModeType_C : int +{ + ENUM_AxisModeType_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) SafetyModeType_##c = n, +enum SafetyModeType_C : int +{ + ENUM_SafetyModeType_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) OperationalModeType_##c = n, +enum OperationalModeType_C : int +{ + ENUM_OperationalModeType_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) RobotControlModeType_##c = n, +enum RobotControlModeType_C : int +{ + ENUM_RobotControlModeType_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) JointServoModeType_##c = n, +enum JointServoModeType_C : int +{ + ENUM_JointServoModeType_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) JointStateType_##c = n, +enum JointStateType_C : int +{ + ENUM_JointStateType_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) StandardOutputRunState_##c = n, +enum StandardOutputRunState_C : int +{ + ENUM_StandardOutputRunState_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) StandardInputAction_##c = n, +enum StandardInputAction_C : int +{ + ENUM_StandardInputAction_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) SafetyInputAction_##c = n, +enum SafetyInputAction_C : int +{ + ENUM_SafetyInputAction_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) SafetyOutputRunState_##c = n, +enum SafetyOutputRunState_C : int +{ + ENUM_SafetyOutputRunState_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) TaskFrameType_##c = n, +enum TaskFrameType_C +{ + ENUM_TaskFrameType_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) EnvelopingShape_##c = n, +enum EnvelopingShape_C : int +{ + ENUM_EnvelopingShape_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) PayloadIdentifyMoveAxis_##c = n, +enum PayloadIdentifyMoveAxis_C : int +{ + ENUM_PayloadIdentifyMoveAxis_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) TraceLevel_##c = n, +enum TraceLevel_C +{ + ENUM_TraceLevel_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) SafeguedStopType_##c = n, +enum SafeguedStopType_C : int +{ + ENUM_SafeguedStopType_DECLARES +}; +#undef ENUM_ITEM + +enum ForceControlState_C +{ + ForceControlState_Stopped, + ForceControlState_Starting, + ForceControlState_Stropping, + ForceControlState_Running +}; + +enum RefFrameType_C +{ + RefFrameType_None, /// + RefFrameType_Tool, ///< 工具坐标系 + RefFrameType_Path, ///< 轨迹坐标系 + RefFrameType_Base ///< 基坐标系 +}; + +/// 圆周运动参数定义 +struct CircleParameters_C +{ + double pose_via[6]; ///< 圆周运动途中点的位姿 + double pose_to[6]; ///< 圆周运动结束点的位姿 + double a; ///< 加速度, 单位: m/s^2 + double v; ///< 速度,单位: m/s + double blend_radius; ///< 交融半径,单位: m + double duration; ///< 运行时间,单位: s + double helix; + double spiral; + double direction; + int loop_times; ///< 暂不支持 +}; + +struct SpiralParameters_C +{ + double frame[6]; ///< 参考点,螺旋线的中心点和参考坐标系 + int plane; ///< 参考平面选择 0-XY 1-YZ 2-ZX + double angle; ///< 转动的角度,如果为正数,机器人逆时针旋转 + double spiral; ///< 正数外扩 + double helix; ///< 正数上升 +}; + +struct Enveloping_C +{ + EnvelopingShape_C shape; // 包络体形状 + double ep_args + [6]; // 包络体组合,shape为None或Stl时无需对ep_args赋值; + // shape为Cube时ep_args有9个元素,分别为xmin,xmax,ymin,ymax,zmin,zmax,rx,ry,rz; + // shape为Column时ep_args有5个元素,分别为radius,height,rx,ry,rz; + char stl_path[100]; // stl的路径(绝对路径),stl文件需为二进制文件, + // shape设置为Stl时,此项生效 +}; + +/// 用于负载辨识的轨迹配置 +struct TrajConfig_C +{ + Enveloping_C *envelopings; // 包络体组合 + PayloadIdentifyMoveAxis_C move_axis; // 运动的轴(ID), 下标从0开始 + double init_joint[MAX_DOF]; // 关节初始位置 + double upper_joint_bound[MAX_DOF]; // 运动轴上限 + double lower_joint_bound[MAX_DOF]; // 运动轴下限 + double max_velocity; // 关节运动的最大速度,默认值为 3.0 + double max_acceleration; // 关节运动的最大加速度,默认值为 5.0 +}; + +struct DHParam_C +{ + double theta[6]; + double beta[6]; + double d[6]; + double a[6]; + double alpha[6]; +}; + +struct DHComp_C +{ + double theta_comp[6]; + double beta_comp[6]; + double d_comp[6]; + double a_comp[6]; + double alpha_comp[6]; +}; + +struct Payload_C +{ + double mass; + double cog[3]; + double aom[3]; + double inertia[6]; +}; + +struct PlanContext_C +{ + int tid; + int lineno; + char comment[100]; +}; + +struct ExecutionStatus_C +{ + char name[100]; + char status[100]; +}; + +struct ExecutionStatus1_C +{ + char name[100]; + char status[100]; + int retval; +}; + +struct UpdateProcess_C +{ + char name[100]; + int process; +}; + +struct WorkObjectHold_C +{ + char module_name[100]; + double mounting_pose[][6]; +}; + +struct ForceSensorCalibResult_C +{ + double force_offset[6]; + double com[3]; + double mass; + double angle[6]; +}; + +// 动力学模型m,d,k +struct DynamicsModel_C +{ + double m[6]; + double d[6]; + double k[6]; +}; + +struct RobotMsg_C +{ + uint64_t timestamp; ///< 时间戳,即系统时间 + TraceLevel_C level; ///< 日志等级 + int code; ///< 错误码 + char source[100]; ///< 发送消息的机器人别名 alias + ///< 可在 /root/arcs_ws/config/aubo_control.conf + ///< 配置文件中查到机器人的alias + char** args; ///< 机器人参数(指针数组) + int args_count; ///< 参数数量 +}; + +struct RobotMsgVector_C +{ + struct RobotMsg_C *data; // 数组指针 + int size; // 数组元素个数 +} ; + +/// RTDE菜单 +struct RtdeRecipe_C +{ + bool to_server; ///< 输入/输出 + int chanel; ///< 通道 + double frequency; ///< 更新频率 + int trigger; ///< 触发方式(该功能暂未实现): 0 - 周期; 1 - 变化 + char **segments; ///< 字段列表 + int segments_count; ///< 字段数量 +}; + +/// 异常类型 +enum error_type_C +{ + parse_error = -32700, ///< 解析错误 + invalid_request = -32600, ///< 无效请求 + method_not_found = -32601, ///< 方法未找到 + invalid_params = -32602, ///< 无效参数 + internal_error = -32603, ///< 内部错误 + server_error, ///< 服务器错误 + invalid ///< 无效 +}; + +/// 异常码 +enum ExceptionCode_C +{ + EC_DISCONNECTED = -1, ///< 断开连接 + EC_NOT_LOGINED = -2, ///< 未登录 + EC_INVAL_SOCKET = -3, ///< 无效套接字 + EC_REQUEST_BUSY = -4, ///< 请求繁忙 + EC_SEND_FAILED = -5, ///< 发送失败 + EC_RECV_TIMEOUT = -6, ///< 接收超时 + EC_RECV_ERROR = -7, ///< 接收错误 + EC_PARSE_ERROR = -8, ///< 解析错误 + EC_INVALID_REQUEST = -9, ///< 无效请求 + EC_METHOD_NOT_FOUND = -10, ///< 方法未找到 + EC_INVALID_PARAMS = -11, ///< 无效参数 + EC_INTERNAL_ERROR = -12, ///< 内部错误 + EC_SERVER_ERROR = -13, ///< 服务器错误 + EC_INVALID = -14 ///< 无效 +}; + +inline const char *returnValue2Str(int retval) +{ + static const char *retval_str[] = { +#define ENUM_ITEM(n, v, s) s, + ENUM_AuboErrorCodes_DECLARES +#undef ENUM_ITEM + }; + + enum arcs_index_C + { +#define ENUM_ITEM(n, v, s) n##_INDEX, + ENUM_AuboErrorCodes_DECLARES +#undef ENUM_ITEM + }; + + int index = -1; + +#define ENUM_ITEM(n, v, s) \ + if (retval == v) \ + index = n##_INDEX; + ENUM_AuboErrorCodes_DECLARES +#undef ENUM_ITEM + + if (index == -1) + { + index = AUBO_ERR_UNKOWN; + } + + return retval_str[(unsigned)index]; +} + +#endif // AUBO_SDK_TYPE_DEF_C_H diff --git a/third_party/AuboSdk/linux/include/research_interface/robot.h b/third_party/AuboSdk/linux/include/research_interface/robot.h new file mode 100644 index 00000000..0160720f --- /dev/null +++ b/third_party/AuboSdk/linux/include/research_interface/robot.h @@ -0,0 +1,65 @@ +#ifndef ARCS_RESEARCH_INTERFACE_ROBOT_H +#define ARCS_RESEARCH_INTERFACE_ROBOT_H + +#include +#include +#include +#include +#include +#include "aubo_sdk/rpc.h" + +namespace arcs { +namespace research_interface { + +struct JointPositions +{ + JointPositions() {} + JointPositions(const std::array &joint_positions) + : q(joint_positions) + { + } + JointPositions(std::initializer_list joint_positions) + { + if (joint_positions.size() != q.size()) { + throw std::invalid_argument( + "Invalid number of elements in joint_positions."); + } + std::copy(joint_positions.begin(), joint_positions.end(), q.begin()); + } + + std::array q{}; + bool finished{ false }; +}; + +class ARCS_ABI Robot +{ +public: + Robot(const std::string &ip, int port = 30030); + ~Robot(); + + // 启动机器人 + int startup(); + + int setControlPeriod(int period = 5000); + + int movej(const JointPositions &jnt_pos); + + // 位置控制 + void control( + std::function + control_callback, + bool limit_rate = false, double cutoff_frequency = 100, + bool loop = false); + + // 实时读取机器人的状态 + void read(std::function read_callback); + +protected: + void *d_{ nullptr }; + bool init_{ false }; +}; + +} // namespace research_interface +} // namespace arcs + +#endif diff --git a/third_party/AuboSdk/linux/include/robot_proxy/realtime_robot_state.h b/third_party/AuboSdk/linux/include/robot_proxy/realtime_robot_state.h new file mode 100644 index 00000000..356dc3cc --- /dev/null +++ b/third_party/AuboSdk/linux/include/robot_proxy/realtime_robot_state.h @@ -0,0 +1,477 @@ +#ifndef AUBO_SCOPE_REALTIME_ROBOT_STATE_H +#define AUBO_SCOPE_REALTIME_ROBOT_STATE_H + +#include +#include + +#include +#include + +namespace arcs { +namespace aubo_sdk { +using namespace common_interface; + +struct RobotInfo +{ + std::string robot_type_; + std::string robot_subtype_; + std::string cb_type_; + int dof_{ 6 }; + + Payload actual_payload_{ 0., std::vector(3, 0.), + std::vector(3, 0.), + std::vector(9, 0.) }; + + std::vector actual_q_{ std::vector(6, 0.) }; + std::vector actual_current_{ std::vector(6, 0.) }; + std::vector actual_TCP_pose_{ std::vector(6, 0.) }; + std::vector actual_TCP_speed_{ std::vector(6, 0.) }; + std::vector actual_tool_pose_{ std::vector(6, 0.) }; + std::vector actual_tcp_force_{ std::vector(6, 0.) }; + std::vector actual_tcp_force_sensor_{ std::vector(6, 0.) }; + + std::vector joint_voltages_{ std::vector(6, 0.) }; + std::vector joint_temperatures_{ std::vector(6, 0.) }; + std::vector joint_mode_{ std::vector( + 6, JointStateType::Idle) }; + RobotModeType robot_mode_{ RobotModeType::NoController }; + SafetyModeType safety_mode_{ SafetyModeType::Normal }; + OperationalModeType operational_mode_{ OperationalModeType::Disabled }; + bool link_mode_{ false }; + bool freedrive_enabled_{ false }; + + double actual_main_voltage_{ 0 }; + double actual_robot_voltage_{ 0 }; + double actual_robot_current_{ 0 }; + double cb_temperature_{ 0 }; + double cb_humidity_{ 0 }; + int collision_level_{ 0 }; + int slow_down_level_{ 0 }; + + std::string tool_uuid_; + std::string mb_uuid_; + std::string sb_uuid_; + std::string pedestal_uuid_; + std::vector joint_uuids_; + + std::string hardware_interface_verion_{ "" }; + + std::vector joint_fw_; + std::vector joint_hw_; + int tool_fw_; + int tool_hw_; + int m_ifb_fw_; + int m_ifb_hw_; + int s_ifb_fw_; + int s_ifb_hw_; + int pedestal_fw_; + int pedestal_hw_; + + int standardDigitalInputNum_{ 0 }; + int toolDigitalInputNum_{ 0 }; + int configurableDigitalInputNum_{ 0 }; + + int standardDigitalOutputNum_{ 0 }; + int toolDigitalOutputNum_{ 0 }; + int configurableDigitalOutputNum_{ 0 }; + + int standardAnalogInputNum_{ 0 }; + int toolAnalogInputNum_{ 0 }; + + int standardAnalogOutputNum_{ 0 }; + int toolAnalogOutputNum_{ 0 }; + int staticLinkInputNum_{ 0 }; + int staticLinkOutputNum_{ 0 }; + + std::unordered_map> dh_; + std::unordered_map> threory_dh_; + + std::vector standard_digital_input_data_{ std::vector(64, + false) }; + std::vector tool_digital_input_data_{ std::vector(64, false) }; + std::vector configurable_digital_input_data_{ std::vector( + 64, false) }; + std::vector link_digital_input_data_{ std::vector(64, false) }; + std::vector standard_digital_output_data_{ std::vector(64, + false) }; + std::vector tool_digital_output_data_{ std::vector(64, false) }; + std::vector configurable_digital_output_data_{ std::vector( + 64, false) }; + std::vector link_digital_output_data_{ std::vector(64, false) }; + + std::vector standard_analog_input_data_; + std::vector tool_analog_input_data_; + std::vector standard_analog_output_data_; + std::vector tool_analog_output_data_; + + std::vector joints_model_type_; + std::vector joint_max_positions_{ std::vector(6, 0.) }; + std::vector joint_min_positions_{ std::vector(6, 0.) }; + std::vector joint_max_speeds_{ std::vector(6, 0.) }; + std::vector joint_max_accelerations_{ std::vector(6, 0.) }; + std::vector tcp_max_speeds_{ std::vector(6, 0.) }; + std::vector tcp_max_accelerations_{ std::vector(6, 0.) }; + std::vector gravity_{ std::vector{ 0, 0, -9.81 } }; + + bool simulation_enabled_{ false }; + double speed_fraction_{ 0 }; + quint32 handle_io_status_{ 0 }; +}; + +class ARCS_ABI RealtimeRobotState : public QObject +{ + Q_OBJECT + friend class RobotProxy; + +public: + RealtimeRobotState(RpcClientPtr client, RtdeClientPtr rtde); + + ~RealtimeRobotState(); + + int updateRobotInformationOnLogin(); + int updateRobotInformationOnPoweron(int robot_index = -1); + int updateHDParamOnRobotTypeChanged(int robot_index = -1); + + std::vector getRobotNames() const; + + int getLineNumber(); + /// 弃用,只能返回主线程号 + ARCS_DEPRECATED int getThreadID(); + + RuntimeState getRuntimeState(); + + int getDof(); + + bool isSimulationEnabled(); + double getSpeedFraction(); + + std::string getRobotType() const; + std::string getRobotSubType() const; + std::string getControlBoxType() const; + + OperationalModeType getOperationalMode() const; + bool isLinkModeEnabled() const; + bool isFreedriveEnabled() const; + int getSlowDownLevel() const; + + int updateOperationMode(int robot_index); + int updateIsLinkModeEnabled(int robot_index); + + // 获取机器人的模式状态 + RobotModeType getRobotModeType(); + + // 获取安全模式 + SafetyModeType getSafetyModeType(); + + // 获取TCP的位姿 + std::vector getTcpPose(); + + // 获取工具端的位姿(不带TCP偏移) + std::vector getToolPose(); + + // 获取TCP速度 + std::vector getTcpSpeed(); + + // 获取TCP的力/力矩 + std::vector getTcpForce(); + std::vector getTcpForce(const std::vector &pose); + + std::vector getTcpForceSensor(); + + // 获取肘部的位置 + std::vector getElbowPosistion(); + + // 获取肘部速度 + std::vector getElbowVelocity(); + + // 获取基座力/力矩 + std::vector getBaseForce(); + + // 获取TCP目标位姿 + std::vector getTcpTargetPose(); + + // 获取TCP目标速度 + std::vector getTcpTargetSpeed(); + + // 获取TCP目标力/力矩 + std::vector getTcpTargetForce(); + + // 获取机械臂关节标志接口 + std::vector getJointState(); + + // 获取关节的伺服状态 + std::vector getJointServoMode(); + + // 获取实际负载 + Payload getPayload(); + + // 获取机械臂关节角度接口 + std::vector getJointPositions(); + + // 获取机械臂关节速度接口 + std::vector getJointSpeeds(); + + // 获取机械臂关节加速度接口 + std::vector getJointAccelerations(); + + // 获取机械臂关节力矩接口 + std::vector getJointTorqueSensors(); + + // 获取底座力传感器读数 + std::vector getBaseForceSensor(); + + // 获取TCP力传感器读数 + std::vector getTcpForceSensors(); + + // 获取机械臂关节电流接口 + std::vector getJointCurrents(); + + // 获取机械臂关节电压接口 + std::vector getJointVoltages(); + + // 获取机械臂关节温度接口 + std::vector getJointTemperatures(); + + // 获取关节固件版本 + std::vector getJointFirmwareVersions(); + + // 获取关节硬件版本 + std::vector getJointHardwareVersions(); + + std::string getToolUniqueId(); + std::string getMasterBoardUniqueId(); + std::string getSlaveBoardUniqueId(); + std::string getPedestalUniqueId(); + std::vector getJointUniqueIds(); + + // 获取新老协议区分 + std::string getHardwareInterfaceVersion(); + + // 获取 MasterBoard 固件版本 + int getMasterBoardFirmwareVersion(); + + // 获取 MasterBoard 硬件版本 + int getMasterBoardHardwareVersion(); + + // 获取 SlaveBoard 固件版本 + int getSlaveBoardFirmwareVersion(); + + // 获取 SlaveBoard 硬件版本 + int getSlaveBoardHardwareVersion(); + + // 获取工具端固件版本 + int getToolFirmwareVersion(); + + // 获取工具端硬件版本 + int getToolHardwareVersion(); + + // 获取 Pedestal 固件版本 + int getPedestalFirmwareVersion(); + + // 获取 Pedestal 硬件版本 + int getPedestalHardwareVersion(); + + // 获取机械臂关节目标位置角度接口 + std::vector getJointTargetPositions(); + + // 获取机械臂关节目标速度 + std::vector getJointTargetSpeeds(); + + // 获取机械臂关节目标加速度 + std::vector getJointTargetAccelerations(); + + // 获取机械臂关节目标力矩 + std::vector getJointTargetTorques(); + + // 获取机械臂关节目标电流 + std::vector getJointTargetCurrents(); + + // 获取关节最大位置(物理极限) + std::vector getJointMaxPositions(); + + // 获取关节最小位置(物理极限) + std::vector getJointMinPositions(); + + // 获取关节最大速度(物理极限) + std::vector getJointMaxSpeeds(); + + // 获取关节最大加速度(物理极限) + std::vector getJointMaxAccelerations(); + + // 获取TCP最大速度(物理极限) + std::vector getTcpMaxSpeeds(); + + // 获取TCP最大加速度(物理极限) + std::vector getTcpMaxAccelerations(); + + // 获取控制柜温度 + double getControlBoxTemperature(); + + // 获取控制柜湿度 + double getControlBoxHumidity(); + + // 获取母线电压 + double getMainVoltage(); + + // 获取母线电流 + double getMainCurrent(); + + int getCollisionLevel(); + + // 获取机器人电压 + double getRobotVoltage(); + + // 获取机器人电流 + double getRobotCurrent(); + + // 获取手柄 IO 状态 + uint32_t getHandleIoStatus(); + + int getStandardDigitalInputNum(); + int getToolDigitalInputNum(); + int getConfigurableDigitalInputNum(); + + int getStandardDigitalOutputNum(); + int getToolDigitalOutputNum(); + int getConfigurableDigitalOutputNum(); + + int getStandardAnalogInputNum(); + int getToolAnalogInputNum(); + + int getStandardAnalogOutputNum(); + int getToolAnalogOutputNum(); + + SafetyInputAction getConfigurableInputAction(int index); + SafetyOutputRunState getConfigurableOutputRunstate(int index); + + int setStandardDigitalInputAction(int index, StandardInputAction action); + int setToolDigitalInputAction(int index, StandardInputAction action); + int setConfigurableDigitalInputAction(int index, + StandardInputAction action); + + StandardInputAction getStandardDigitalInputAction(int index); + StandardInputAction getToolDigitalInputAction(int index); + StandardInputAction getConfigurableDigitalInputAction(int index); + + int setStandardDigitalOutputRunstate(int index, + StandardOutputRunState runstate); + int setToolDigitalOutputRunstate(int index, + StandardOutputRunState runstate); + int setConfigurableDigitalOutputRunstate(int index, + StandardOutputRunState runstate); + StandardOutputRunState getStandardDigitalOutputRunstate(int index); + StandardOutputRunState getToolDigitalOutputRunstate(int index); + StandardOutputRunState getConfigurableDigitalOutputRunstate(int index); + + int setStandardAnalogOutputRunstate(int index, + StandardOutputRunState runstate); + int setToolAnalogOutputRunstate(int index, StandardOutputRunState runstate); + + StandardOutputRunState getStandardAnalogOutputRunstate(int index); + StandardOutputRunState getToolAnalogOutputRunstate(int index); + + int setStandardAnalogInputDomain(int index, int domain); + int setToolAnalogInputDomain(int index, int domain); + + int getStandardAnalogInputDomain(int index); + int getToolAnalogInputDomain(int index); + + int setStandardAnalogOutputDomain(int index, int domain); + int setToolAnalogOutputDomain(int index, int domain); + + int getStandardAnalogOutputDomain(int index); + int getToolAnalogOutputDomain(int index); + + int setStandardDigitalOutput(int index, bool value); + int setToolDigitalOutput(int index, bool value); + int setConfigurableDigitalOutput(int index, bool value); + + int setStandardAnalogOutput(int index, double value); + int setToolAnalogOutput(int index, double value); + + bool getStandardDigitalInput(int index); + bool getToolDigitalInput(int index); + bool getConfigurableDigitalInput(int index); + + bool getStandardDigitalOutput(int index); + bool getToolDigitalOutput(int index); + bool getConfigurableDigitalOutput(int index); + + double getStandardAnalogInput(int index); + double getToolAnalogInput(int index); + + double getStandardAnalogOutput(int index); + double getToolAnalogOutput(int index); + + int getStaticLinkInputNum(); + int getStaticLinkOutputNum(); + bool getStaticLinkInput(int index); + bool getStaticLinkOutput(int index); + + int configSubscribe(); + int selectRobot(int index); + + void reset(); + + void updateModbusSignalNames(); + void addModbusSignalName(const std::string &name); + void removeModbusSignalName(const std::string &name); + std::vector getModbusSignalNames() const; + std::vector getModbusSignalValues() const; + std::vector getModbusSignalErrors() const; + std::vector getGravity(); + std::unordered_map> getRealDHParam(); + std::unordered_map> getTheoryDHParam(); + + int updateGravity(int robot_index); + + int startTrackRecord( + const std::function & /*q*/, + const std::vector & /*pose*/)> &cb, + double interval = 0.1); + + int stopTrackRecord(); + + // 获取关节类型 + std::vector getJointsModelType(); + +signals: + void interfaceBoardVersionInfoUpdated(int robot_index); + void jointVersionInfoUpdated(int robot_index); + void runtimeStateChanged(arcs::common_interface::RuntimeState state); + void safetyModeChanged(int robot_index, + arcs::common_interface::SafetyModeType mode); + void robotModeChanged(int robot_index, + arcs::common_interface::RobotModeType mode); + +private: + RpcClientPtr rpc_client_{ nullptr }; + RtdeClientPtr rtde_client_{ nullptr }; + mutable std::mutex rtde_mtx_; + + std::vector names_; + std::string name_; + int robot_index_{ -1 }; + + int tid_{ -1 }; + int line_{ -1 }; + RuntimeState runtime_state_{ RuntimeState::Stopped }; + + std::vector modbus_signals_; + std::vector modbus_signals_errors_; + std::vector modbus_names_; + + RobotInfo info_[4]; + + std::function &, + const std::vector &)> + track_record_callback_; + int track_record_sample_cnt_{ 0 }; + int track_record_sample_index_{ 0 }; +}; + +using RealtimeRobotStatePtr = std::shared_ptr; + +} // namespace aubo_sdk +} // namespace arcs +#endif diff --git a/third_party/AuboSdk/linux/include/robot_proxy/robot_proxy.h b/third_party/AuboSdk/linux/include/robot_proxy/robot_proxy.h new file mode 100644 index 00000000..ce81a2d0 --- /dev/null +++ b/third_party/AuboSdk/linux/include/robot_proxy/robot_proxy.h @@ -0,0 +1,276 @@ +#ifndef AUBO_SCOPE_ROBOT_PROXY_H +#define AUBO_SCOPE_ROBOT_PROXY_H + +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include + +namespace arcs { +namespace aubo_sdk { +class RtdeClient; +class ScriptClient; +class RpcClient; +using RtdeClientPtr = std::shared_ptr; +using ScriptClientPtr = std::shared_ptr; +using RpcClientPtr = std::shared_ptr; + +using arcs::common_interface::ForceControlPtr; +using arcs::common_interface::IoControlPtr; +using arcs::common_interface::MotionControlPtr; +using arcs::common_interface::RegisterControlPtr; +using arcs::common_interface::RobotAlgorithmPtr; +using arcs::common_interface::RobotConfigPtr; +using arcs::common_interface::RobotInterfacePtr; +using arcs::common_interface::RobotManagePtr; +using arcs::common_interface::RobotStatePtr; +using arcs::common_interface::RuntimeMachinePtr; +using arcs::common_interface::SyncMovePtr; +using arcs::common_interface::SystemInfoPtr; +using arcs::common_interface::TracePtr; + +using RobotInterface = common_interface::RobotInterface; + +/** + * 单个机器人代理接口类 + */ +class ARCS_ABI RobotProxy : public QObject +{ + Q_OBJECT + +public: + RobotProxy(QObject *parent = NULL); + ~RobotProxy(); + + /// 获取当前机器人的名称 + QString getRobotName() const; + + /// 获取当前机器人在所有机器人中的索引 + int getRobotIndex() const; + + /// 获取所有机器人的名字 + std::vector getRobotNames(); + + /// 连接到当前机器人 + int connect(const QString &ip, int port); + + /// 连接到当前机器人 + int nonblock_connect(const QString &ip, int port, + std::function cb); + int nonblock_connect2(const QString &ip, int port, + std::function cb); + + /// 登录到当前机器人 + int login(const QString &usrname, const QString &passwd); + + /// 断开与机器人的连接,如果不指定名称,则断开当前选中的机器人 + int disconnectFromServer(); + + /// 机器人是否已经连接,如果不指定名称,则断开当前选中的机器人 + bool hasConnected(); + + /// 机器人是否已经登录,如果不指定名称,则断开当前选中的机器人 + bool hasLogined(); + + /// 发送脚本程序到当前机器人 + int sendScript(const std::string &script); + + /// 获取当前机器人的脚本程序 + std::string getScript() const; + + /// 使用 RealtimeRobotState 中的 getRealDHParam getTheoryDHParam 替代 + ARCS_DEPRECATED std::unordered_map> getDH( + bool real = true); + + SystemInfoPtr getSystemInfo(); + RuntimeMachinePtr getRuntimeMachine(); + RegisterControlPtr getRegisterControl(); + + /// 获取RobotConfig接口 + RobotConfigPtr getRobotConfig(); + + /// 获取运动规划接口 + MotionControlPtr getMotionControl(); + + /// 获取力控接口 + ForceControlPtr getForceControl(); + + /// 获取IO控制的接口 + IoControlPtr getIoControl(); + + /// 获取同步运动接口 + SyncMovePtr getSyncMove(); + + /// 获取机器人实用算法接口 + RobotAlgorithmPtr getRobotAlgorithm(); + + /// 获取机器人管理接口(上电、启动、停止等) + RobotManagePtr getRobotManage(); + + /// 获取机器人状态接口 + RobotStatePtr getRobotState(); + + RealtimeRobotStatePtr getRealTimeState(); + + /// 获取告警信息接口 + TracePtr getTrace(); + + /// 根据机器人名字获取机器人接口 + RobotInterfacePtr getRobotInterface(const std::string &name); + + /// 切换机器人 + int selectRobot(int index); + + aubo_sdk::RpcClientPtr getRpcClient(); + aubo_sdk::RtdeClientPtr getRtdeClient(); + aubo_sdk::ScriptClientPtr getScriptClient(); + + /// 通过错误码获取消息文本 + QString getErrorCodeMsg(int code); + + /// 获取 ICM 连接状态 + bool icmIsConnected(); + + /// 获取 Profinet 地址表数据 + std::vector> getPnAddressData(); + +signals: + // FIXME: 断开连接和登出的信号需要从 RobotProxy 类主动发出 + + /// 建立连接的信号 + void connected(const QString &ip, int port); + + /// 断开连接的信号 + void disconnected(); + + /// 登录或者登出 + void logined(bool has_login); + + /// 弹窗信号 + void popup(int robot_index, int level, const QString &title, + const QString &msg, int mode); + + /// 解除弹窗信号 + void popupDismiss(const QString &src); + + /// 从控制器层上传的系统关机信号 + void systemHalt(const QString &src); + + /// 已弃用,推荐使用下面的重载函数 + ARCS_DEPRECATED void scriptError(const QString &); + /// aubo_control 报错 + void scriptError(int lineno, const QString &error); + /// 脚本运行报错 + void scriptError2(const QString &, const QString &); + + /// 脚本运行时里面的变量发生变化 + void variableUpdate(const QString &, const QString &); + + /// 运行时状态发生变化 + void runtimeStateChanged(arcs::common_interface::RuntimeState state); + + /// 拖动示教器使能状态切换 + void freedriveEnabled(int robot_index, bool enabled); + + /// 接收到机器人控制端消息 + void robotMessageRecieved(int robot_index, QString src, int level, int code, + const QString &msg); + void robotMessageRecieved(int robot_index, const QString &src, int level, + const RobotMsg &msg); + + /// 操作模式切换 + void operationalModeChanged( + int robot_index, arcs::common_interface::OperationalModeType mode); + + /// 联动模式切换 + void linkModeChanged(int robot_index, bool enable); + + /// 安全模式切换 + void safetyModeChanged(int robot_index, + arcs::common_interface::SafetyModeType mode); + + /// 机器人状态切换 + void robotModeChanged(int robot_index, + arcs::common_interface::RobotModeType mode); + + /// 机器人型号切换 + void robotTypeChanged(const QString &type, const QString &subtype); + + /// 缓速切换 + void slowDownChanged(int robot_index, int level); + + /// 运行时上下文更新 + void runtimeContextUpdated(int tid, int lineno, int index, + const QString &comment); + void interpContextUpdated(int tid, int lineno, int index, + const QString &comment); + void taskDeleted(int tid); + + /// ICM 插件状态变化 + void icmStatusChanged(bool status); + + /// PNIO 从站数据变化 + void pnioDeviceChanged(const QString &name); + void pnioNetworkChanged(const QString &ip, const QString &subnet_mask, + const QString &gateway); + /// 示教器启用状态变化 + void teachPendantEnabledChanged(bool status); + + /// Modbus master + void modbusSignalCreated(const QString &name); + void modbusSignalRemoved(const QString &name); + + void jointMovedDuringPoweroff(int robot_index); + void robotCollisionOccurred(int robot_index, const QString &msg); + + void robotToolSensorChanged(int robot_index, const QString &sensor_id); + void robotToolSensorRemoved(int robot_index); + void robotToolSensorStatusChanged(int robot_index, bool status); + void programLoaded(int robot_index, const QString &program); + +private: + RobotInterfacePtr currentRobotRpcInterface(); + void robotMessageCallback(InputParser &parser); + void sendDisconnectedSignal(); + void initPNCacheData(); + void pnValueChanged(const std::vector &data); + +private: + QString name_; + int robot_index_{ -1 }; + std::vector robot_names_; + + std::string ip_; + int port_; + + aubo_sdk::RpcClientPtr rpc_client_{ nullptr }; + aubo_sdk::RtdeClientPtr rtde_client_{ nullptr }; + aubo_sdk::ScriptClientPtr script_client_{ nullptr }; + + RealtimeRobotStatePtr rt_state_{ nullptr }; + + bool initiallized_{ false }; + + QMap script_; + + bool icm_connected_{ false }; + bool pn_connected_{ false }; + + // Profinet 地址表数据 + std::shared_mutex mtx_pn_address_; + std::vector> cache_pn_address_; +}; +using RobotProxyPtr = std::shared_ptr; + +} // namespace aubo_sdk +} // namespace arcs +Q_DECLARE_METATYPE(arcs::aubo_sdk::RobotProxyPtr) +#endif diff --git a/third_party/AuboSdk/linux/include/robotiomatetype.h b/third_party/AuboSdk/linux/include/robotiomatetype.h new file mode 100644 index 00000000..6b867005 --- /dev/null +++ b/third_party/AuboSdk/linux/include/robotiomatetype.h @@ -0,0 +1,103 @@ +#ifndef ROBOTIOMATETYPE_H +#define ROBOTIOMATETYPE_H + +//接口板用户DI 名称定义 +#define UESR_IO_DI_00_NAME "U_DI_00" +#define UESR_IO_DI_01_NAME "U_DI_01" +#define UESR_IO_DI_02_NAME "U_DI_02" +#define UESR_IO_DI_03_NAME "U_DI_03" +#define UESR_IO_DI_04_NAME "U_DI_04" +#define UESR_IO_DI_05_NAME "U_DI_05" +#define UESR_IO_DI_06_NAME "U_DI_06" +#define UESR_IO_DI_07_NAME "U_DI_07" +#define UESR_IO_DI_10_NAME "U_DI_10" +#define UESR_IO_DI_11_NAME "U_DI_11" +#define UESR_IO_DI_12_NAME "U_DI_12" +#define UESR_IO_DI_13_NAME "U_DI_13" +#define UESR_IO_DI_14_NAME "U_DI_14" +#define UESR_IO_DI_15_NAME "U_DI_15" +#define UESR_IO_DI_16_NAME "U_DI_16" +#define UESR_IO_DI_17_NAME "U_DI_17" + +//接口板用户DI 地址定义 +#define UESR_IO_DI_00_ADDR 0X24 +#define UESR_IO_DI_01_ADDR 0X25 +#define UESR_IO_DI_02_ADDR 0X26 +#define UESR_IO_DI_03_ADDR 0X27 +#define UESR_IO_DI_04_ADDR 0X28 +#define UESR_IO_DI_05_ADDR 0X29 +#define UESR_IO_DI_06_ADDR 0X2A +#define UESR_IO_DI_07_ADDR 0X2B +#define UESR_IO_DI_10_ADDR 0X2C +#define UESR_IO_DI_11_ADDR 0X2D +#define UESR_IO_DI_12_ADDR 0X2E +#define UESR_IO_DI_13_ADDR 0X2F +#define UESR_IO_DI_14_ADDR 0X30 +#define UESR_IO_DI_15_ADDR 0X31 +#define UESR_IO_DI_16_ADDR 0X32 +#define UESR_IO_DI_17_ADDR 0X33 + + +//接口板用户DO 名称定义 +#define UESR_IO_DO_00_NAME "U_DO_00" +#define UESR_IO_DO_01_NAME "U_DO_01" +#define UESR_IO_DO_02_NAME "U_DO_02" +#define UESR_IO_DO_03_NAME "U_DO_03" +#define UESR_IO_DO_04_NAME "U_DO_04" +#define UESR_IO_DO_05_NAME "U_DO_05" +#define UESR_IO_DO_06_NAME "U_DO_06" +#define UESR_IO_DO_07_NAME "U_DO_07" +#define UESR_IO_DO_10_NAME "U_DO_10" +#define UESR_IO_DO_11_NAME "U_DO_11" +#define UESR_IO_DO_12_NAME "U_DO_12" +#define UESR_IO_DO_13_NAME "U_DO_13" +#define UESR_IO_DO_14_NAME "U_DO_14" +#define UESR_IO_DO_15_NAME "U_DO_15" +#define UESR_IO_DO_16_NAME "U_DO_16" +#define UESR_IO_DO_17_NAME "U_DO_17" + +//接口板用户DO 地址定义 +#define UESR_IO_DO_00_ADDR 0X20 +#define UESR_IO_DO_01_ADDR 0X21 +#define UESR_IO_DO_02_ADDR 0X22 +#define UESR_IO_DO_03_ADDR 0X23 +#define UESR_IO_DO_04_ADDR 0X24 +#define UESR_IO_DO_05_ADDR 0X25 +#define UESR_IO_DO_06_ADDR 0X26 +#define UESR_IO_DO_07_ADDR 0X27 +#define UESR_IO_DO_10_ADDR 0X28 +#define UESR_IO_DO_11_ADDR 0X29 +#define UESR_IO_DO_12_ADDR 0X2A +#define UESR_IO_DO_13_ADDR 0X2B +#define UESR_IO_DO_14_ADDR 0X2C +#define UESR_IO_DO_15_ADDR 0X2D +#define UESR_IO_DO_16_ADDR 0X2E +#define UESR_IO_DO_17_ADDR 0X2F + + +//接口板用户AI 名称定义 +#define UESR_IO_AI_00_NAME "VI0" +#define UESR_IO_AI_01_NAME "VI1" +#define UESR_IO_AI_02_NAME "VI2" +#define UESR_IO_AI_03_NAME "VI3" + +//接口板用户AI 地址定义 +#define UESR_IO_AI_00_ADDR 0X00 +#define UESR_IO_AI_01_ADDR 0X01 +#define UESR_IO_AI_02_ADDR 0X02 +#define UESR_IO_AI_03_ADDR 0X03 + +//接口板用户AI 名称定义 +#define UESR_IO_AO_00_NAME "VO0" +#define UESR_IO_AO_01_NAME "VO1" +#define UESR_IO_AO_02_NAME "VO2" +#define UESR_IO_AO_03_NAME "VO3" + +//接口板用户AI 地址定义 +#define UESR_IO_AO_00_ADDR 0X00 +#define UESR_IO_AO_01_ADDR 0X01 +#define UESR_IO_AO_02_ADDR 0X02 +#define UESR_IO_AO_03_ADDR 0X03 + + +#endif // ROBOTIOMATETYPE_H diff --git a/third_party/AuboSdk/linux/include/rsdef.h b/third_party/AuboSdk/linux/include/rsdef.h new file mode 100644 index 00000000..bf34a7bf --- /dev/null +++ b/third_party/AuboSdk/linux/include/rsdef.h @@ -0,0 +1,1583 @@ +#ifndef RSDEF_H +#define RSDEF_H +#include +#include "rstype.h" +#include "AuboRobotMetaType.h" + +#define TRUE 1 +#define FALSE 0 +#define RS_SUCC 0 +#define RS_FAILED -1 +#define MAX_RS_INSTANCE 32 +#define POS_SIZE 3 +#define ORI_SIZE 4 +#define INERTIA_SIZE 6 +#define JOINT_RADIAN_SIZE 6 + +#define RS_UNUSED(x) (void)x; +//#define _DEBUG + +using namespace aubo_robot_namespace; + +typedef CoordCalibrateByJointAngleAndTool CoordCalibrate; + +typedef struct +{ + CoordCalibrate user_coord; + char used; +} CustomUserCoord; + +typedef struct +{ + double rotateAxis[3]; +} Move_Rotate_Axis; + +typedef struct +{ + wayPoint_S waypoint[8]; + int solution_count; +} ik_solutions; + +#ifdef __cplusplus +extern "C" { +#endif + +// library initialize and uninitialize +/** + * @brief 初始化机械臂控制库 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_initialize(void); + +/** + * @brief 反初始化机械臂控制库 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_uninitialize(void); + +// robot service context +/** + * @brief 创建机械臂控制上下文句柄 + * @param rshd + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_create_context( + RSHD *rshd /*returned context handle*/); + +/** + * @brief 注销机械臂控制上下文句柄 + * @param rshd + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_destory_context(RSHD rshd); + +// login logout +/** + * @brief 链接机械臂服务器 + * @param rshd 械臂控制上下文句柄 + * @param addr 机械臂服务器的IP地址 + * @param port 机械臂服务器的端口号 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_login(RSHD rshd, const char *addr, + int port); + +/** + * @brief 断开机械臂服务器链接 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_logout(RSHD rshd); + +/** + * @brief 获取当前的连接状态 + * @param rshd 械臂控制上下文句柄 + * @param status true 在线 false 离线 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_login_status(RSHD rshd, bool *status); +// set move profile +/** + * @brief 初始化全局的运动属性 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_init_global_move_profile(RSHD rshd); + +// joint max acc,velc +/** + * @brief 设置六个关节的最大加速度 + * @param rshd 械臂控制上下文句柄 + * @param max_acc 六个关节的最大加速度,单位(rad/ss) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_global_joint_maxacc( + RSHD rshd, const JointVelcAccParam *max_acc); + +/** + * @brief 设置六个关节的最大速度 + * @param rshd 械臂控制上下文句柄 + * @param max_velc 六个关节的最大速度,单位(rad/s) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_global_joint_maxvelc( + RSHD rshd, const JointVelcAccParam *max_velc); + +/** + * @brief 获取六个关节的最大加速度 + * @param rshd 械臂控制上下文句柄 + * @param max_acc 返回六个关节的最大加速度单位(rad/s^2) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_global_joint_maxacc( + RSHD rshd, JointVelcAccParam *max_acc); + +/** + * @brief 获取六个关节的最大速度 + * @param rshd 械臂控制上下文句柄 + * @param max_velc 返回六个关节的最大加度单位(rad/s) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_global_joint_maxvelc( + RSHD rshd, JointVelcAccParam *max_velc); + +// end line max acc,velc +/** + * @brief 设置机械臂末端最大线加速度 + * @param rshd 械臂控制上下文句柄 + * @param max_acc 末端最大加线速度,单位(m/s^2) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_global_end_max_line_acc(RSHD rshd, + double max_acc); + +/** + * @brief 设置机械臂末端最大线速度 + * @param rshd 械臂控制上下文句柄 + * @param max_velc 末端最大线速度,单位(m/s) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_global_end_max_line_velc( + RSHD rshd, double max_velc); + +/** + * @brief 获取机械臂末端最大线加速度 + * @param rshd 械臂控制上下文句柄 + * @param max_acc 机械臂末端最大线加速度,单位(m/s^2) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_global_end_max_line_acc( + RSHD rshd, double *max_acc); + +/** + * @brief 获取机械臂末端最大线速度 + * @param rshd 械臂控制上下文句柄 + * @param max_velc 机械臂末端最大线速度,单位(m/s) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_global_end_max_line_velc( + RSHD rshd, double *max_velc); + +// end line max acc,velc +/** + * @brief 设置机械臂末端最大角加速度 + * @param rshd 械臂控制上下文句柄 + * @param max_acc 末端最大角加速度,单位(rad/s^2) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_global_end_max_angle_acc( + RSHD rshd, double max_acc); + +/** + * @brief 设置机械臂末端最大角速度 + * @param rshd 械臂控制上下文句柄 + * @param max_velc 末端最大速度,单位(rad/s) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_global_end_max_angle_velc( + RSHD rshd, double max_velc); + +/** + * @brief 获取机械臂末端最大角加速度 + * @param rshd 械臂控制上下文句柄 + * @param max_acc 机械臂末端最大角加速度,单位(m/s^2) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_global_end_max_angle_acc( + RSHD rshd, double *max_acc); + +/** + * @brief 获取机械臂末端最大角加速度 + * @param rshd 械臂控制上下文句柄 + * @param max_velc 机械臂末端最大角速度,单位(m/s) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_global_end_max_angle_velc( + RSHD rshd, double *max_velc); + +/** + * @brief 设置机械臂关节运动范围 + * @param rshd 械臂控制上下文句柄 + * @param joint_range + * 机械臂每个关节的运动范围(±175°)注意!!!单位使用弧度(rad) + * @param enable 使能关节运动范围控制 true:启用 false:禁用 + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_robot_joint_motion_range( + RSHD rshd, RangeOfMotion joint_range[ARM_DOF], bool enable = true); + +// robot move +/** + * @brief 机械臂轴动 + * @param rshd 械臂控制上下文句柄 + * @param joint_radian 六个关节的关节角,单位(rad) + * @param isblock isblock==true + * 代表阻塞,机械臂运动直到到达目标位置或者出现故障后返回。 isblock==false + * 代表非阻塞,立即返回,运动指令发送成功就返回,函数返回后机械臂开始运动。 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_move_joint(RSHD rshd, + double joint_radian[ARM_DOF], + bool isblock = true); + +/** + * @brief 机械臂轴动 + * @param rshd 械臂控制上下文句柄 + * @param move_profile 运动属性 + * @param joint_radian 六个关节的关节角,单位(rad) + * @param isblock isblock==true + * 代表阻塞,机械臂运动直到到达目标位置或者出现故障后返回。 isblock==false + * 代表非阻塞,立即返回,运动指令发送成功就返回,函数返回后机械臂开始运动。 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_move_joint_ex(RSHD rshd, + MoveProfile_t *move_profile, + double joint_radian[ARM_DOF], + bool isblock = true); + +/** + * @brief 跟随模式机械臂轴动 + * @param rshd 械臂控制上下文句柄 + * @param joint_radian 六个关节的关节角,单位(rad) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_follow_mode_move_joint( + RSHD rshd, double joint_radian[ARM_DOF]); + +/** + * @brief 机械臂保持当前姿态直线运动 + * @param rshd 械臂控制上下文句柄 + * @param joint_radian 六个关节的关节角,单位(rad) + * @param isblock isblock==true + * 代表阻塞,机械臂运动直到到达目标位置或者出现故障后返回。 isblock==false + * 代表非阻塞,立即返回,运动指令发送成功就返回,函数返回后机械臂开始运动。 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_move_line(RSHD rshd, + double joint_radian[ARM_DOF], + bool isblock = true); + +/** + * @brief 机械臂保持当前姿态直线运动 + * @param rshd 械臂控制上下文句柄 + * @param move_profile 运动属性 + * @param joint_radian 六个关节的关节角,单位(rad) + * @param isblock isblock==true + * 代表阻塞,机械臂运动直到到达目标位置或者出现故障后返回。 isblock==false + * 代表非阻塞,立即返回,运动指令发送成功就返回,函数返回后机械臂开始运动。 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_move_line_ex(RSHD rshd, + MoveProfile_t *move_profile, + double joint_radian[ARM_DOF], + bool isblock = true); + +/** + * @brief rs_move_rotate_to_waypoint保持当前位置变换姿态旋转运动至目标路点 + * @param rshd 械臂控制上下文句柄 + * @param target_waypiont 目标路点 + * @param isblock isblock==true + * 代表阻塞,机械臂运动直到到达目标位置或者出现故障后返回。 isblock==false + * 代表非阻塞,立即返回,运动指令发送成功就返回,函数返回后机械臂开始运动。 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_move_rotate_to_waypoint( + RSHD rshd, aubo_robot_namespace::wayPoint_S *target_waypiont, + bool isblock = true); + +/** + * @brief 保持当前位置变换姿态做旋转运动 + * @param rshd 械臂控制上下文句柄 + * @param user_coord 用户坐标系 + * @param rotate_axis :转轴(x,y,z) 例如:(1,0,0)表示沿Y轴转动 + * @param rotate_angle 旋转角度 单位(rad) + * @param isblock isblock==true + * 代表阻塞,机械臂运动直到到达目标位置或者出现故障后返回。 isblock==false + * 代表非阻塞,立即返回,运动指令发送成功就返回,函数返回后机械臂开始运动。 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_move_rotate( + RSHD rshd, const CoordCalibrate *user_coord, + const Move_Rotate_Axis *rotate_axis, double rotate_angle, + bool isblock = true); + +/** + * rs_get_rotate_target_waypiont + * 根据根据起始点姿态及基坐标系下描述的旋转轴、旋转角,获取目标位姿 + * @param rshd 械臂控制上下文句柄 + * @param originateWayPointOnBaseCoord 起始路点信息 + * @param rotateAxisOnBaseCoord 基坐标系下表示的旋转轴 + * @param rotateAngle 旋转角 + * @param targetWayPointOnBaseCoord 目标路点信息 (传出参数) + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_rotate_target_waypiont( + RSHD rshd, + const aubo_robot_namespace::wayPoint_S *originateWayPointOnBaseCoord, + const double rotateAxisOnBaseCoord[], double rotateAngle, + aubo_robot_namespace::wayPoint_S *targetWayPointOnBaseCoord); + +/** + * @brief rs_get_rotateaxis_user_to_Base + * 将用户坐标系下描述的旋转轴转换到基坐标系下描述 + * @param rshd 械臂控制上下文句柄 + * @param oriOnUserCoord 用户做标系旋转姿态 + * @param rotateAxisOnUserCoord 用户坐标系下描述的旋转轴 + * @param rotateAxisOnBaseCoord 基坐标系下描述的旋转轴 + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_rotateaxis_user_to_Base( + RSHD rshd, const aubo_robot_namespace::Ori *oriOnUserCoord, + const double rotateAxisOnUserCoord[], double rotateAxisOnBaseCoord[]); + +/** + * @brief 清除所有已经设置的全局路点 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_remove_all_waypoint(RSHD rshd); + +/** + * @brief 添加全局路点用于轨迹运动 + * @param rshd 械臂控制上下文句柄 + * @param joint_radian 六个关节的关节角,单位(rad) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_add_waypoint(RSHD rshd, + double joint_radian[ARM_DOF]); + +/** + * @brief 设置交融半径 + * @param rshd 械臂控制上下文句柄 + * @param radius 交融半径,单位(m) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_blend_radius(RSHD rshd, double radius); + +/** + * @brief 设置圆运动圈数 + * @param rshd 械臂控制上下文句柄 + * @param times 当times大于0时,机械臂进行圆运动times次 + * 当times等于0时,机械臂进行圆弧轨迹运动 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_circular_loop_times(RSHD rshd, + int times); + +/** + * @brief 设置用户坐标系 + * @param rshd 械臂控制上下文句柄 + * @param user_coord 用户坐标系 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_user_coord( + RSHD rshd, const CoordCalibrate *user_coord); + +/** + * @brief 设置基座坐标系 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_base_coord(RSHD rshd); + +/** + * @brief 检查用户坐标系参数设置是否合理 + * @param rshd 械臂控制上下文句柄 + * @param user_coord 用户坐标系 + * @return RS_SUCC 成功 其他失败 合理返回: 0 不合理返回: 其他 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_check_user_coord( + RSHD rshd, const CoordCalibrate *user_coord); + +/** + * @brief 检查用户坐标系标定 + * @param rshd + * @param user_coord + * @param bInWPos 在世界坐标系中的位置 + * @param bInWOri 在世界坐标系中的姿态 + * @param wInBPos 在基座坐标系中的位置 + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_user_coord_calibrate( + RSHD rshd, const CoordCalibrate *user_coord, double bInWPos[3], + double bInWOri[9], double wInBPos[3]); + +/** + * @brief rs_tool_calibration 工具标定  该函数能标定出工具的位置信息和姿态信息 + * @param toolCalibrate 工具标定结构体 用于储存标定点,标定方法等 + * @param toolInEndDesc       标定的结果 + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_tool_calibration( + RSHD rshd, const ToolCalibrate &toolCalibrate, + ToolInEndDesc &toolInEndDesc); +/** + * @brief 设置基于基座标系运动偏移量 + * @param rshd 械臂控制上下文句柄 + * @param relative 相对位移(x, y, z) 单位(m) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_relative_offset_on_base( + RSHD rshd, const MoveRelative *relative); + +/** + * @brief 设置基于用户标系运动偏移量 + * @param rshd 械臂控制上下文句柄 + * @param relative 相对位移(x, y, z) 单位(m) + * @param user_coord 用户坐标系 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_relative_offset_on_user( + RSHD rshd, const MoveRelative *relative, const CoordCalibrate *user_coord); + +/** + * @brief 取消提前到位设置 + * @param rshd + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_no_arrival_ahead(RSHD rshd); + +/** + * @brief 设置距离模式下的提前到位距离 + * @param rshd + * @param distance 提前到位距离 单位(米) + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_arrival_ahead_distance(RSHD rshd, + double distance); + +/** + * @brief 设置时间模式下的提前到位时间 + * @param rshd + * @param sec 提前到位时间 单位(秒) + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_arrival_ahead_time(RSHD rshd, + double sec); + +/** + * @brief 设置距离模式下交融半径距离 + * @param rshd + * @param distance 提前到位距离 单位(米) + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_arrival_ahead_blend(RSHD rshd, + double radius); + +/** + * @brief 轨迹运动 + * @param rshd 械臂控制上下文句柄 + * @param sub_move_mode 轨迹类型: + * 2:圆弧 + * 3:轨迹 + * @param isblock isblock==true + * 代表阻塞,机械臂运动直到到达目标位置或者出现故障后返回。 isblock==false + * 代表非阻塞,立即返回,运动指令发送成功就返回,函数返回后机械臂开始运动。 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_move_track(RSHD rshd, + move_track sub_move_mode, + bool isblock = true); + +/** + * @brief + * 保持当前位姿通过直线运动的方式运动到目标位置,其中目标位置是通过相对当前位置的偏移给出 + * @param rshd 械臂控制上下文句柄 + * @param target 基于用户平面表示的目标位置 + * @param tool 工具参数 + * @param isblock isblock==true + * 代表阻塞,机械臂运动直到到达目标位置或者出现故障后返回。 isblock==false + * 代表非阻塞,立即返回,运动指令发送成功就返回,函数返回后机械臂开始运动。 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_move_line_to(RSHD rshd, const Pos *target, + const ToolInEndDesc *tool, + bool isblock = true); + +/** + * @brief 保持当前位姿通过关节运动的方式运动到目标位置 + * @param rshd 械臂控制上下文句柄 + * @param target 基于用户平面表示的目标位置 + * @param tool 工具参数 + * @param isblock isblock==true + * 代表阻塞,机械臂运动直到到达目标位置或者出现故障后返回。 isblock==false + * 代表非阻塞,立即返回,运动指令发送成功就返回,函数返回后机械臂开始运动。 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_move_joint_to(RSHD rshd, const Pos *target, + const ToolInEndDesc *tool, + bool isblock = true); + +/** + * @brief 设置示教坐标系 + * @param rshd 械臂控制上下文句柄 + * @param user_coord 示教坐标系 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_teach_coord( + RSHD rshd, const CoordCalibrate *teach_coord); + +/** + * @brief 开始轴动示教 + * @param rshd 械臂控制上下文句柄 + * @param mode 示教关节:JOINT1,JOINT2,JOINT3, JOINT4,JOINT5,JOINT6, + * 位置示教:MOV_X,MOV_Y,MOV_Z 姿态示教:ROT_X,ROT_Y,ROT_Z + * @param dir 运动方向 正方向true 反方向false + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_teach_move_start(RSHD rshd, teach_mode mode, + bool dir); + +/** + * @brief 结束示教 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_teach_move_stop(RSHD rshd); + +/** + * @brief 清理服务器上的非在线轨迹运动数据 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_clear_offline_track(RSHD rshd); + +/** + * @brief 向服务器添加非在线轨迹运动路点 + * @param rshd 械臂控制上下文句柄 + * @param waypoints 路点数组 (路点个数小于等于3000) + * @param waypoint_count 路点数组大小 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_append_offline_track_waypoint( + RSHD rshd, const JointParam waypoints[], int waypoint_count); + +/** + * @brief 向服务器添加非在线轨迹运动路点文件 + * @param rshd 械臂控制上下文句柄 + * @param filename + * 路点文件全路径,路点文件的每一行包含六个关节的关节角(弧度),用逗号隔开 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_append_offline_track_file( + RSHD rshd, const char *filename); + +/** + * @brief 通知服务器启动非在线轨迹运动 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_startup_offline_track(RSHD rshd); + +/** + * @brief 通知服务器停止非在线轨迹运动 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_stop_offline_track(RSHD rshd); + +/** + * @brief 通知服务器启动非在线轨迹运动 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_startup_excit_traj_track( + RSHD rshd, const char *trackfile, char type, char subtype); + +/** + * @brief 设置轨迹回放采样周期 + * @param rshd 械臂控制上下文句柄 + * @param second 采样周期(秒) + * @param RS_SUCC 成功 其他失败 + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_track_playback_cycle(RSHD rshd, + double second); + +/** + * @brief rs_get_dynidentify_results + * @param param + * @param len + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT bool rs_get_dynidentify_results( + RSHD rshd, std::vector ¶mVector); + +/** + * @brief 通知服务器进入TCP2CANBUS透传模式 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_enter_tcp2canbus_mode(RSHD rshd); + +/** + * @brief 通知服务器退出TCP2CANBUS透传模式 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_leave_tcp2canbus_mode(RSHD rshd); + +/** + * @brief 透传运动路点到CANBUS + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_waypoint_to_canbus( + RSHD rshd, double joint_radian[ARM_DOF]); + +/** + * @brief 透传运动路点到CANBUS + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_waypoints_to_canbus( + RSHD rshd, double joint_radian[][ARM_DOF], int waypint_count); + +/** + * @brief 正解     此函数为正解函数,已知关节角求对应位置的位置和姿态。 + * @param rshd 械臂控制上下文句柄 + * @param joint_radian 六个关节的关节角,单位(rad) + * @param waypoint 六个关节角,位置,姿态 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_forward_kin( + RSHD rshd, const double joint_radian[ARM_DOF], wayPoint_S *waypoint); + +/** + * @brief 逆解 + * 此函数为机械臂逆解函数,根据位置信息(x,y,z)和对应位置的参考姿态(w,x,y,z)得到对应位置的关节角信息。 + * @param rshd 械臂控制上下文句柄 + * @param joint_radian 参考关节角(通常为当前机械臂位置)单位(rad) + * @param pos 目标路点的位置 单位:米 + * @param ori 目标路点的参考姿态 + * @param waypoint 目标路点信息 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_inverse_kin(RSHD rshd, + double joint_radian[ARM_DOF], + const Pos *pos, const Ori *ori, + wayPoint_S *waypoint); + +/** + * @brief 逆解 + * 此函数为机械臂逆解函数,根据位置信息(x,y,z)和对应位置的参考姿态(w,x,y,z)得到对应位置的关节角信息。 + * @param rshd 械臂控制上下文句柄 + * @param pos 目标路点的位置 单位:米 + * @param ori 目标路点的参考姿态 + * @param ik_solutions + * 目标路点信息(最多返回八组解,逆解结果超过8个则仅返回前8个) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_inverse_kin_closed_form( + RSHD rshd, const Pos *pos, const Ori *ori, ik_solutions *solutions); + +/** + * @brief 用户坐标系转基座坐标系 + * 概述: + * 将法兰盘中心基于基座标系下的位置和姿态 转成 工具末端基于用户座标系下的位置和姿态。 + * + *  扩展1: 法兰盘中心可以看成是一个特殊的工具,即工具的位置为(0,0,0) + * + * 因此当工具为(0,0,0)时,相当于将法兰盘中心基于基座标系下的位置和姿态 转成 法兰盘中心基于用户座标系下的位置和姿态。 + * + *     扩展2: 用户坐标系也可以选择成基座标系,  即:userCoord.coordType = + * BaseCoordinate + * 因此当用户平面为基座标系时,相当于将法兰盘中心基于基座标系下的位置和姿态 转成 工具末端基于基座标系下的位置和姿态, + * 即在基座标系加工具。 + * @param rshd 械臂控制上下文句柄 + * @param pos_onbase 基于基座标系的法兰盘中心位置信息(x,y,z) 单位(m) + * @param ori_onbase 基于基座标系的姿态信息(w, x, y, z) + * @param user_coord 用户坐标系 + * @param tool_pos 工具信息 + * @param pos_onuser 基于用户座标系的工具末端位置信息,输出参数 + * @param ori_onuser 基于用户座标系的工具末端姿态信息,输出参数 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_base_to_user( + RSHD rshd, const Pos *pos_onbase, const Ori *ori_onbase, + const CoordCalibrate *user_coord, const ToolInEndDesc *tool_pos, + Pos *pos_onuser, Ori *ori_onuser); + +/** + * @brief 用户坐标系转基座标系 + * @param rshd 械臂控制上下文句柄 + * @param pos_onuser 基于用户座标系的工具末端位置信息 + * @param ori_onuser 基于用户座标系的工具末端姿态信息 + * @param user_coord 用户坐标系 + * @param tool_pos 工具信息 + * @param pos_onbase 基于基座标系的法兰盘中心位置信息 + * @param ori_onbase 基于基座标系的姿态信息 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_user_to_base( + RSHD rshd, const Pos *pos_onuser, const Ori *ori_onuser, + const CoordCalibrate *user_coord, const ToolInEndDesc *tool_pos, + Pos *pos_onbase, Ori *ori_onbase); + +/** + * @brief  基坐标系转基座标得到工具末端点的位置和姿态 + * @param rshd 械臂控制上下文句柄 + * @param flange_center_pos_onbase 基于基座标系的法兰盘中心位置信息 + * @param flange_center_ori_onbase 基于基座标系的姿态信息 + * @param tool 工具信息 + * @param tool_end_pos_onbase 基于基座标系的工具末端位置信息 + * @param tool_end_ori_onbase 基于基座标系的工具末端姿态信息 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_base_to_base_additional_tool( + RSHD rshd, const Pos *flange_center_pos_onbase, + const Ori *flange_center_ori_onbase, const ToolInEndDesc *tool, + Pos *tool_end_pos_onbase, Ori *tool_end_ori_onbase); + +/** + * @brief rs_get_target_waypoint_by_position   根据位置获取目标路点信息 + * @param sourceWayPointOnBaseCoord     起始路点(基于基坐标系) + * @param userCoordSystem           用户坐标系 + * @param toolEndPosition           工具末端位置 + * @param toolInEndDesc            工具末端偏移 + * @param targetWayPointOnBaseCoord     目标路点(基于基坐标系) + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_target_waypoint_by_position( + RSHD rshd, + const aubo_robot_namespace::wayPoint_S &sourceWayPointOnBaseCoord, + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &userCoordSystem, + const aubo_robot_namespace::Pos &toolEndPosition, + const aubo_robot_namespace::ToolInEndDesc &toolInEndDesc, + aubo_robot_namespace::wayPoint_S &targetWayPointOnBaseCoord); + +/** + * @brief 欧拉角转四元素 + * @param rshd 械臂控制上下文句柄 + * @param rpy 姿态的欧拉角表示方法 + * @param ori 姿态的四元素表示方法 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_rpy_to_quaternion(RSHD rshd, const Rpy *rpy, + Ori *ori); + +/** + * @brief 四元素转欧拉角 + * @param rshd 械臂控制上下文句柄 + * @param ori 姿态的四元素表示方法 + * @param rpy 姿态的欧拉角表示方法 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_quaternion_to_rpy(RSHD rshd, const Ori *ori, + Rpy *rpy); + +/** + * @brief 设置工具的运动学参数 + * @param rshd 械臂控制上下文句柄 + * @param tool 工具的运动学参数 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_tool_end_param( + RSHD rshd, const ToolInEndDesc *tool); + +// end tool parameters +/** + * @brief 设置无工具的动力学参数 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_none_tool_dynamics_param(RSHD rshd); + +/** + * @brief 设置工具的动力学参数 + * @param rshd 械臂控制上下文句柄 + * @param tool 工具的动力学参数 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_tool_dynamics_param( + RSHD rshd, const ToolDynamicsParam *tool); + +/** + * @brief 获取工具的动力学参数 + * @param rshd 械臂控制上下文句柄 + * @param tool 工具的动力学参数 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_tool_dynamics_param( + RSHD rshd, ToolDynamicsParam *tool); + +/** + * @brief 获取工具的动力学参数 + * @param rshd 械臂控制上下文句柄 + * @param tool 工具的动力学参数 + * @return RS_SUCC 成功 其他失败 + * @note 由于rs_get_tool_dynamics_param获取的位置值单位是mm,增加此 + * 函数将单位与rs_set_tool_dynamics_param统一 + */ +inline int rs_get_tool_dynamics_param2(RSHD rshd, ToolDynamicsParam *tool) +{ + int retval = rs_get_tool_dynamics_param(rshd, tool); + tool->positionX /= 1000.; + tool->positionY /= 1000.; + tool->positionZ /= 1000.; + + return retval; +} + +/** + * @brief 设置无工具运动学参数 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_none_tool_kinematics_param(RSHD rshd); + +/** + * @brief 设置工具的运动学参数 + * @param rshd 械臂控制上下文句柄 + * @param tool 工具的运动学参数 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_tool_kinematics_param( + RSHD rshd, const ToolKinematicsParam *tool); + +/** + * @brief 获取工具的运动学参数 + * @param rshd 械臂控制上下文句柄 + * @param tool 工具的运动学参数 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_tool_kinematics_param( + RSHD rshd, ToolKinematicsParam *tool); + +// robot control +/** + * @brief 启动机械臂 + * @param rshd 械臂控制上下文句柄 + * @param tool_dynamics 动力学参数 + * @param colli_class 碰撞等级 + * @param read_pos 是否允许读取位置 + * @param static_colli_detect 是否允许侦测静态碰撞 + * @param board_maxacc 接口板允许的最大加速度 + * @param state 机械臂启动状态 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_robot_startup( + RSHD rshd, const ToolDynamicsParam *tool_dynamics, uint8 colli_class, + bool read_pos, bool static_colli_detect, int board_maxacc, + ROBOT_SERVICE_STATE *state); + +/** + * @brief 关闭机械臂 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_robot_shutdown(RSHD rshd); + +/** + * @brief 停止机械臂运动加速度设置 + * @param rshd 械臂控制上下文句柄 + * @param jerkRatio [0.1,20] + * @param double acc 6维数组, + * 1,末端型运动,只使用acc[0] 最大加速度 + * 2,轴动,使用acc[0,5] 关节最大加速度 + * @param size 6 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_reduce_para(RSHD rshd, + const double jerkRatio, + const double acc[], + int size); + +/** + * @brief 停止机械臂运动 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_move_stop(RSHD rshd); + +/** + * @brief 停止机械臂运动 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_move_fast_stop(RSHD rshd); + +/** + * @brief 暂停机械臂运动 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_move_pause(RSHD rshd); + +/** + * @brief 暂停后回复机械臂运动 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_move_continue(RSHD rshd); + +/** + * @brief 机械臂碰撞后恢复 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_collision_recover(RSHD rshd); + +/** + * @brief 获取机械臂当前状态 + * @param rshd 械臂控制上下文句柄 + * @param state 机械臂当前状态 + * 机械臂当前停止:RobotStatus.Stopped + * 机械臂当前运行:RobotStatus.Running + * 机械臂当前暂停:RobotStatus.Paused + * 机械臂当前恢复:RobotStatus.Resumed + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_robot_state(RSHD rshd, + RobotState *state); + +/** + * @brief 设置机械臂运动进入缩减模式 + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT bool rs_enter_reduce_mode(RSHD rshd); + +/** + * @brief 设置机械臂运动退出缩减模式 + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT bool rs_exit_reduce_mode(RSHD rshd); + +/** + * @brief 通知机械臂工程启动,服务器同时开始检测安全IO + * @param rshd + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT bool rs_project_startup(RSHD rshd); + +/** + * @brief 通知机械臂工程停止,服务器停止检测安全IO + * @param rshd + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT bool rs_project_stop(RSHD rshd); + +// tool interface + +// robot parameters +/** + * @brief 设置机械臂服务器工作模式 + * @param rshd 械臂控制上下文句柄 + * @param mode 机械臂服务器工作模式 + * 机械臂仿真模式:RobotRunningMode.RobotModeSimulator + * 机械臂真实模式:RobotRunningMode.RobotModeReal + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_work_mode(RSHD rshd, + RobotWorkMode mode); + +/** + * @brief 获取机械臂服务器当前工作模式 + * @param rshd 械臂控制上下文句柄 + * @param mode 机械臂服务器工作模式 + * 机械臂仿真模式:RobotRunningMode.RobotModeSimulator + * 机械臂真实模式:RobotRunningMode.RobotModeReal + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_work_mode(RSHD rshd, + RobotWorkMode *mode); + +/** + * @brief 获取重力分量 + * @param rshd 械臂控制上下文句柄 + * @param gravity 重力分量 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_gravity_component( + RSHD rshd, RobotGravityComponent *gravity); + +/** + * @brief 设置机械臂碰撞等级 + * @param rshd 械臂控制上下文句柄 + * @param grade 碰撞等级 范围(0~10) + * @param mode 碰撞模式 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_collision_class(RSHD rshd, int grade); +SERVICE_INTERFACE_ABI_EXPORT int rs_set_collision_class2(RSHD rshd, int grade, + CollisionMode mode); + +/** + * @brief 获取当前碰撞等级 + * @param rshd 机械臂控制上下文句柄 + * @param grade 碰撞等级 范围(0~10) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_collision_class(RSHD rshd, int *grade); + +/** + * @brief 获取设备信息 + * @param rshd 械臂控制上下文句柄 + * @param dev 设备信息 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_device_info(RSHD rshd, + RobotDevInfo *dev); + +/** + * @brief 获取当前是否已经链接真实机械臂 + * @param rshd 械臂控制上下文句柄 + * @param exist true:存在 false:不存在 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_is_have_real_robot(RSHD rshd, bool *exist); + +/** + * @brief 当前机械臂是否运行在联机模式 + * @param rshd 械臂控制上下文句柄 + * @param isonline true:在 false:不在 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_is_online_mode(RSHD rshd, bool *isonline); + +/** + * @brief 当前机械臂是否运行在联机主模式 + * @param rshd 械臂控制上下文句柄 + * @param ismaster true:主模式 false:从模式 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_is_online_master_mode(RSHD rshd, + bool *ismaster); + +/** + * @brief 获取机械臂当前状态信息 + * @param rshd 械臂控制上下文句柄 + * @param jointStatus 返回六个关节状态,包括:电流,电压,温度 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_joint_status( + RSHD rshd, JointStatus jointStatus[ARM_DOF]); + +/** + * @brief 获取机械臂当前位置信息 + * @param rshd 械臂控制上下文句柄 + * @param waypoint 关节位置信息 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_current_waypoint(RSHD rshd, + wayPoint_S *waypoint); + +/** + * @brief 获取机械臂诊断信息 + * @param rshd 械臂控制上下文句柄 + * @param info 机械臂诊断信息 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_diagnosis_info( + RSHD rshd, RobotDiagnosis *robotDiagnosisInfo); + +/** + * @brief 根据错误号获取错误信息 + * @param rshd 机械臂控制上下文句柄 + * @param err_code 错误号 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ +SERVICE_INTERFACE_ABI_EXPORT const char *rs_get_error_information_by_errcode( + RSHD rshd, RobotErrorCode err_code); + +/** + * @brief 获取socket链接状态 + * @param rshd 械臂控制上下文句柄 + * @param connected true:已连接 false:未连接 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_socket_status(RSHD rshd, + bool *connected); + +/** + * @brief 获取机械表末端速度 + * @param rshd 械臂控制上下文句柄 + * @param endspeed 末端速度 单位(m/s) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_robot_end_speed(RSHD rshd, + float *endspeed); + +// IO interaface +/** + * @brief 获取接口板指定IO集合的配置信息 + * @param rshd 械臂控制上下文句柄 + * @param type IO类型 + * @param config IO配置信息集合 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_board_io_config( + RSHD rshd, RobotIoType type, std::vector *config); + +/** + * @brief 根据接口板IO类型和地址设置IO状态 + * @param rshd 械臂控制上下文句柄 + * @param type IO类型 + * @param name IO名称 + * @param val IO状态 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_board_io_status_by_name( + RSHD rshd, RobotIoType type, const char *name, double val); + +/** + * @brief 根据接口板IO类型和地址设置IO状态 + * @param rshd 械臂控制上下文句柄 + * @param type IO类型 + * @param addr IO状态 + * @param val IO状态 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_board_io_status_by_addr( + RSHD rshd, RobotIoType type, int addr, double val); + +/** + * @brief 根据接口板IO类型和地址获取IO状态 + * @param rshd 械臂控制上下文句柄 + * @param type IO类型 + * @param name IO名称 + * @param val IO状态 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_board_io_status_by_name( + RSHD rshd, RobotIoType type, const char *name, double *val); + +/** + * @brief 根据接口板IO类型和地址获取IO状态 + * @param rshd 械臂控制上下文句柄 + * @param type IO类型 + * @param addr IO地址 + * @param val + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_board_io_status_by_addr( + RSHD rshd, RobotIoType type, int addr, double *val); + +// tool device interface +/** + * @brief 设置工具端电源电压类型 + * @param rshd 械臂控制上下文句柄 + * @param type ower_type:电源类型 + * 0:.OUT_0V + * 1:.OUT_12V + * 2:.OUT_24V + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_tool_power_type(RSHD rshd, + ToolPowerType type); + +/** + * @brief 获取工具端电源电压类型 + * @param rshd 械臂控制上下文句柄 + * @param type ower_type:电源类型 + * 0:.OUT_0V + * 1:.OUT_12V + * 2:.OUT_24V + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_tool_power_type(RSHD rshd, + ToolPowerType *type); + +/** + * @brief 设置工具端数字量IO的类型 + * @param rshd 械臂控制上下文句柄 + * @param addr 地址 + * @param type 类型 0:输入 1:输出 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_tool_io_type(RSHD rshd, + ToolDigitalIOAddr addr, + ToolIOType type); + +/** + * @brief 获取工具端电压数值 + * @param rshd 械臂控制上下文句柄 + * @param voltage 电压数值,单位(伏特) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_tool_power_voltage(RSHD rshd, + double *voltage); + +/** + * @brief 获取工具端IO状态 + * @param rshd 械臂控制上下文句柄 + * @param name IO名称 + * @param val 工具端IO状态 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_tool_io_status(RSHD rshd, + const char *name, + double *val); + +/** + * @brief 设置工具端IO状态 + * @param rshd 械臂控制上下文句柄 + * @param name IO名称 + * @param status 工具端IO状态 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_tool_do_status(RSHD rshd, + const char *name, + IO_STATUS status); + +/** + * @brief 暂停工程 + * @param rshd + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_client_status_pause(RSHD rshd); + +/** + * @brief 继续工程 + * @param rshd + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_client_status_continue(RSHD rshd); + +/** + * @brief 工程停止 + * @param rshd + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_client_status_stop(RSHD rshd); + +/** + * @brief 工程启动 + * @param rshd + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_client_status_run(RSHD rshd); + +/** + * @brief 通知接口板上位机停止状态 + * @param data + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_robot_orpe_stop(RSHD rshd, uint8 data); + +/** + * @brief rs_robot_control + * @param rshd + * @param cmd + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_robot_control(RSHD rshd, + RobotControlCommand cmd); + +/** + * @brief 设置机械臂辨识参数 + * @param param + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_robot_recognition_param( + RSHD rshd, const RobotRecongnitionParam *param); + +/** + * @brief 获取机械臂辨识参数 + * @param type + * @param param + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_robot_recognition_param( + RSHD rshd, int type, RobotRecongnitionParam *param); + +/** + * @brief 获取机械臂安全配置 + * @param rshd + * @param safetyConfig + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_robot_safety_config( + RSHD rshd, RobotSafetyConfig *param); + +/** + * @brief 获取机械臂安全配置 + * @param rshd + * @param safetyConfig + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_robot_safety_config( + RSHD rshd, RobotSafetyConfig *param); + +/** + * @brief 获取机械臂安全状态 + * @param rshd + * @param safetyStatus + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_robot_safety_status( + RSHD rshd, OrpeSafetyStatus *param); + +//#ifndef FOR_FORCE_LIBRARY +/** + * @brief 设置底座参数信息 + * @param rshd + * @param param + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_robot_base_parameters( + RSHD rshd, const RobotBaseParameters *param); + +/** + * @brief 获取底座参数信息 + * @param rshd + * @param param + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_robot_base_parameters( + RSHD rshd, RobotBaseParameters *param); + +/** + * @brief 设置关节参数信息 + * @param rshd + * @param param + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_robot_joints_parameter( + RSHD rshd, const RobotJointsParameter *param); + +/** + * @brief 获取关节参数信息 + * @param rshd + * @param param + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_robot_joints_parameter( + RSHD rshd, RobotJointsParameter *param); + +/** + * @brief 刷新关节参数信息 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_robot_refresh_robot_arm_paramter( + RSHD rshd); + +//#else + +/** + * @brief 设置调速模式配置 + * @param rshd + * @param config + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_regulate_speed_param( + RSHD rshd, const RegulateSpeedModeParamConfig_t *config); + +/** + * @brief 获取调速模式配置 + * @param rshd + * @param config + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_regulate_speed_param( + RSHD rshd, RegulateSpeedModeParamConfig_t *config); + +/** + * @brief 使能/失能调速模式 + * @param rshd + * @param enbaleFlag + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_enable_regulate_speed_mode(RSHD rshd, + bool enbaleFlag); + +/** + * @brief 获取"主动探寻力"参数 + * @param rshd + * @param forceLimit + * @param distLimit + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_force_control_mode_explore_force_param( + RSHD rshd, double *forceLimit, double *distLimit); + +/** + * @brief 设置"主动探寻力"参数 + * @param rshd + * @param forceLimit + * @param distLimit + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_force_control_mode_explore_force_param( + RSHD rshd, double forceLimit, double distLimit); + +/** + * @brief 使能/失能力控模式 + * @param rshd + * @param enbaleFlag + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_enable_force_control_mode(RSHD rshd, + bool enbaleFlag); + +/** + * @brief 获取实时力数据 + * @param rshd + * @param 传出参数 + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_realtime_force_data( + RSHD rshd, double forceData[6]); + +/** + * @brief 将一个轨迹文件(位置+姿态)转换为路点容器,进行平滑处理和限制条件检查 + * @param rshd 械臂控制上下文句柄 + * @param filePath 轨迹文件路径 输入参数 + * @param poseType 位姿类型 + * @param referPointJointAngle 逆解参考点的关节角 输入参数 + * @param toolInEndDesc 末端工具的信息 输入参数 + * @param wayPointVector 路点集合 输出参数 + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_parse_file_as_roadpoint_collection( + RSHD rshd, const char *filePath, + aubo_robot_namespace::POSITION_ORIENTATION_TYPE poseType, + const double *referPointJointAngle, + const aubo_robot_namespace::ToolInEndDesc *toolInEndDesc, + aubo_robot_namespace::wayPoint_S wayPoint[], int waypointSize, + int *sizeReturn); + +/** + * @brief 解析路点文件并缓存结果 + * @param rshd 械臂控制上下文句柄 + * @param filePath 轨迹文件路径 输入参数 + * @param referPointJointAngle 逆解参考点的关节角 输入参数 + * @param toolInEndDesc 末端工具的信息 输入参数 + * @param firstWayPoint 轨迹的第一个点 输出参数 + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_parse_roadpoint_file_and_cache_result( + RSHD rshd, const char *filePath, const double *referPointJointAngle, + aubo_robot_namespace::ToolInEndDesc *toolInEndDesc, + aubo_robot_namespace::wayPoint_S *firstWayPoint); +/** + * @brief 运行缓存好的轨迹 + * 即:运行rs_parse_roadpoint_file_and_cache_result的结果 + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_move_cached_track(RSHD rshd); + +//#endif + +// callback +/** + * @brief 注册用于获取实时路点的回调函数 + * @param rshd 械臂控制上下文句柄 + * @param ptr 获取实时路点信息的函数指针 + * @param arg + * 这个参数系统不做任何处理,只是进行了缓存,当回调函数触发时该参数会通过回调函数的参数传回 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_setcallback_realtime_roadpoint( + RSHD rshd, const RealTimeRoadPointCallback ptr, void *arg); + +/** + * @brief 注册用于获取关节状态的回调函数 + * @param rshd 械臂控制上下文句柄 + * @param ptr 获取实时关节状态信息的函数指针 + * @param arg + * 这个参数系统不做任何处理,只是进行了缓存,当回调函数触发时该参数会通过回调函数的参数传回 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_setcallback_realtime_joint_status( + RSHD rshd, const RealTimeJointStatusCallback ptr, void *arg); + +/** + * @brief 注册用于获取实时末端速度的回调函数 + * @param rshd 械臂控制上下文句柄 + * @param ptr 获取实时末端速度的函数指针 + * @param arg + * 个参数系统不做任何处理,只是进行了缓存,当回调函数触发时该参数会通过回调函数的参数传回 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_setcallback_realtime_end_speed( + RSHD rshd, const RealTimeEndSpeedCallback ptr, void *arg); + +/** + * @brief 注册用于获取机械臂事件信息的回调函数 + * @param rshd 械臂控制上下文句柄 + * @param ptr 获取机械臂事件信息的函数指针 + * @param arg + * 个参数系统不做任何处理,只是进行了缓存,当回调函数触发时该参数会通过回调函数的参数传回 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_setcallback_robot_event( + RSHD rshd, const RobotEventCallback ptr, void *arg); + +/** + * @brief 注册用于获取函数的日志信息的回调函数 + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_setcallback_robot_loginfo( + RSHD rshd, const RobotLogPrintCallback ptr, void *arg); + +/** + * @brief 注册用于获取MOVEP运动进度信息的回调函数 + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_setcallback_movep_step_num( + RSHD rshd, const RealTimeMovepStepNumNotifyCallback ptr, void *arg); + +// enable push information +/** + * @brief 设置是否允许实时路点信息推送 + * @param rshd 械臂控制上下文句柄 + * @param enable true表示允许 false表示不允许 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_enable_push_realtime_roadpoint(RSHD rshd, + bool enable); + +/** + * @brief 设置是否允许实时关节状态推送 + * @param rshd 械臂控制上下文句柄 + * @param enable true表示允许 false表示不允许 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_enable_push_realtime_joint_status( + RSHD rshd, bool enable); + +/** + * @brief 设置是否允许实时末端速度推送 + * @param rshd 械臂控制上下文句柄 + * @param enable true表示允许 false表示不允许 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_enable_push_realtime_end_speed(RSHD rshd, + bool enable); + +// other +SERVICE_INTERFACE_ABI_EXPORT const char *rs_str_error(RSHD rshd, int err); +SERVICE_INTERFACE_ABI_EXPORT void print_plan(const CoordCalibrate *user_coord); +SERVICE_INTERFACE_ABI_EXPORT void print_move_relative_offset( + const MoveRelative *relative); +SERVICE_INTERFACE_ABI_EXPORT void print_waypoint(wayPoint_S *waypoint); +SERVICE_INTERFACE_ABI_EXPORT void print_tool_dynamics( + ToolDynamicsParam *tool_dynamics); + +#ifdef __cplusplus +} +#endif + +#endif // RSDEF_H diff --git a/third_party/AuboSdk/linux/include/rserrors.h b/third_party/AuboSdk/linux/include/rserrors.h new file mode 100644 index 00000000..d7b1c7ab --- /dev/null +++ b/third_party/AuboSdk/linux/include/rserrors.h @@ -0,0 +1,12 @@ +#ifndef RSERRORS_H +#define RSERRORS_H + +/*robot service errors*/ +#define RSERR_BASE 1000 +#define RSERR_SUCC 0 +#define RSERR_NOT_ENOUGH_RSHD_BUFFER RSERR_BASE + 1 +#define RSERR_RSHD_NO_FOUND RSERR_BASE + 2 +#define RSERR_PARAMETER_ERROR RSERR_BASE + 3 +#define RSERR_CREATE_THREAD_ERROR RSERR_BASE + 4 + +#endif // RSERRORS_H diff --git a/third_party/AuboSdk/linux/include/rspidcfg.h b/third_party/AuboSdk/linux/include/rspidcfg.h new file mode 100644 index 00000000..a7a98469 --- /dev/null +++ b/third_party/AuboSdk/linux/include/rspidcfg.h @@ -0,0 +1,125 @@ +#ifndef RSPIDCFG_H +#define RSPIDCFG_H +#include "rstype.h" +#include "AuboRobotMetaType.h" + +using namespace aubo_robot_namespace; + +typedef struct +{ + JointCommonData data[ARM_DOF]; +} RobotJointCommonData; + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief 获取机械臂配置表 + * @param rshd + * @param data 六个关节配置数据 + * @return + */ +int rs_get_joint_common_data(RSHD rshd, RobotJointCommonData &data); + +/** + * @brief 设置机械臂电流环参数P + * @param joint_id 机械臂ID(1~6) + * @param P 电流环参数P + * @return + */ +int rs_set_current_ip(RSHD rshd, int joint_id, uint16 P); + +/** + * @brief 设置机械臂电流环参数I + * @param joint_id 机械臂ID(1~6) + * @param I 电流环参数I + * @return + */ +int rs_set_current_ii(RSHD rshd, int joint_id, uint16 I); + +/** + * @brief 设置机械臂电流环参数D + * @param joint_id 机械臂ID(1~6) + * @param D 电流环参数D + * @return + */ +int rs_set_current_id(RSHD rshd, int joint_id, uint16 D); + +/** + * @brief 设置机械臂速度环参数P + * @param joint_id 机械臂ID(1~6) + * @param P 速度环参数P + * @return + */ +int rs_set_speed_p(RSHD rshd, int joint_id, uint16 P); + +/** + * @brief 设置机械臂速度环参数I + * @param joint_id 机械臂ID(1~6) + * @param I 速度环参数I + * @return + */ +int rs_set_speed_i(RSHD rshd, int joint_id, uint16 I); + +/** + * @brief 设置机械臂速度环参数D + * @param joint_id 机械臂ID(1~6) + * @param D 速度环参数D + * @return + */ +int rs_set_speed_d(RSHD rshd, int joint_id, uint16 D); + +/** + * @brief 设置机械臂速度环参数DS + * @param joint_id 机械臂ID(1~6) + * @param DS 速度环参数DS + * @return + */ +int rs_set_speed_ds(RSHD rshd, int joint_id, uint16 DS); + +/** + * @brief 设置机械臂位置环参数P + * @param joint_id 机械臂ID(1~6) + * @param P 位置环参数P + * @return + */ +int rs_set_pos_p(RSHD rshd, int joint_id, uint16 P); + +/** + * @brief 设置机械臂位置环参数I + * @param joint_id 机械臂ID(1~6) + * @param I 位置环参数I + * @return + */ +int rs_set_pos_i(RSHD rshd, int joint_id, uint16 I); + +/** + * @brief 设置机械臂位置环参数D + * @param joint_id 机械臂ID(1~6) + * @param D 位置环参数D + * @return + */ +int rs_set_pos_d(RSHD rshd, int joint_id, uint16 D); + +/** + * @brief 设置机械臂位置环参数DS + * @param joint_id 机械臂ID(1~6) + * @param DS 位置环参数DS + * @return + */ +int rs_set_pos_ds(RSHD rshd, int joint_id, uint16 DS); + +/** + * @brief 保存机械臂PID参数到关节flash + * @param rshd + * @param joint_id + * @return + */ +int rs_joint_save_data_flash(RSHD rshd, int joint_id); + +#ifdef __cplusplus +} +#endif + +#endif // RSPIDCFG_H diff --git a/third_party/AuboSdk/linux/include/rstype.h b/third_party/AuboSdk/linux/include/rstype.h new file mode 100644 index 00000000..fa1a2488 --- /dev/null +++ b/third_party/AuboSdk/linux/include/rstype.h @@ -0,0 +1,29 @@ +#ifndef RSTYPE_H +#define RSTYPE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/* General types */ +typedef uint8_t boolean; +typedef int8_t int8; +typedef int16_t int16; +typedef int32_t int32; +typedef uint8_t uint8; +typedef uint16_t uint16; +typedef uint32_t uint32; +typedef int64_t int64; +typedef uint64_t uint64; +typedef float float32; +typedef double float64; + +typedef uint16_t RSHD; // robot servcie handle + +#ifdef __cplusplus +} +#endif + +#endif // RSTYPE_H diff --git a/third_party/AuboSdk/linux/include/serviceinterface.h b/third_party/AuboSdk/linux/include/serviceinterface.h new file mode 100644 index 00000000..7a08f6e6 --- /dev/null +++ b/third_party/AuboSdk/linux/include/serviceinterface.h @@ -0,0 +1,1938 @@ +/** +CopyRight © AUBO Robotics Technology Co.Ltd. All Rights Reserved + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of mosquitto nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef SERVICEINTERFACE_H +#define SERVICEINTERFACE_H + +#include +#include + +#include "AuboRobotMetaType.h" //接口需要用到的数据类型 +#include + +namespace arcs { +namespace aubo_sdk { +class RpcClient; +typedef std::shared_ptr RpcClientPtr; + +class RtdeClient; +typedef std::shared_ptr RtdeClientPtr; +} // namespace aubo_sdk +} // namespace arcs + +// 对外接口类 : 为用户提供开发接口 +class SERVICE_INTERFACE_ABI_EXPORT ServiceInterface +{ +public: + ServiceInterface(); + ~ServiceInterface(); + + /** 数据类型初始化*/ + static void initPosDataType(aubo_robot_namespace::Pos &postion); + static void initOriDataType(aubo_robot_namespace::Ori &ori); + static void initMoveRelativeDataType( + aubo_robot_namespace::MoveRelative &moveRelative); + static void initWayPointDataType( + aubo_robot_namespace::wayPoint_S &wayPoint); + static void initToolInEndDescDataType( + aubo_robot_namespace::ToolInEndDesc &toolInEndDesc); + static void initCoordCalibrateByJointAngleAndToolDataType( + aubo_robot_namespace::CoordCalibrateByJointAngleAndTool &coord); + static void initToolInertiaDataType( + aubo_robot_namespace::ToolInertia &toolInertia); + static void initToolDynamicsParamDataType( + aubo_robot_namespace::ToolDynamicsParam &toolDynamicsParam); + + /********************************************************************************************************************************************** + ***********                                 机械臂系统接口                                 ********** + **********************************************************************************************************************************************/ + /** + * @brief 登录  与机械臂服务器建立网络连接; + * 该接口的成功是调用其他接口的前提。 + * + * @param host 机械臂服务器的IP地址 + * @param port 机械臂服务器的端口号 + * @param userName 用户名 默认为Aubo + * @param possword 密码   默认为123456 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceLogin(const char *host, int port, const char *userName, + const char *password); + + int robotServiceLogin(const char *host, int port, const char *userName, + const char *password, + aubo_robot_namespace::RobotType &robotType, + aubo_robot_namespace::RobotDhPara &robotDhPara); + + /** + * @brief robotServiceGetConnectStatus 获取当前的连接状态 + * @param connectStatus           输出参数 + */ + void robotServiceGetConnectStatus(bool &connectStatus); + + /** + * @brief 退出登录 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceLogout(); + + // + int robotServiceRobotHandShake(bool isBlock); + + aubo_robot_namespace::RobotType getRobotType(); + + /********************************************************************************************************************************************** + *****                                 状态推送                                         ******* + **********************************************************************************************************************************************/ + + /** + * @brief robotServiceSetRealTimeJointStatusPush + * 设置是否允许实时关节状态推送 + * @param enable true表示允许   false表示不允许 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetRealTimeJointStatusPush(bool enable); + + /** + * @brief robotServiceRegisterRealTimeJointStatusCallback + * 注册用于获取关节状态的回调函数 + * 注册回调函数后,服务器实时推送当前的关节状态信息. + * @param ptr + * 获取实时关节状态信息的函数指针,当ptr==NULL时,相当于取消回调函数的注册,取消该推送信息也可以通过该接口robotServiceSetRealTimeJointStatusPush进行。 + * @param arg + * 这个参数系统不做任何处理,只是进行了缓存,当回调函数触发时该参数会通过回调函数的参数传回。 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceRegisterRealTimeJointStatusCallback( + RealTimeJointStatusCallback ptr, void *arg); + + /** + * @brief robotServiceSetRealTimeRoadPointPush 设置是否允许实时路点信息推送 + * @param enable  true表示允许   false表示不允许 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetRealTimeRoadPointPush(bool enable); + + /** + * @brief robotServiceRegisterRealTimeRoadPointCallback + * 注册用于获取实时路点的回调函数 + * 注册回调函数后,服务器会推送当前的路点信息 当ptr==NULL时,相等于取消回调函数的注册。 + * @param ptr + * 获取实时路点信息的函数指针,当ptr==NULL时,相当于取消回调函数的注册,取消该推送信息也可以通过该接口robotServiceSetRealTimeRoadPointPush进行。 + * @param + * arg 这个参数系统不做任何处理,只是进行了缓存,当回调函数触发时该参数会通过回调函数的参数传回。 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceRegisterRealTimeRoadPointCallback( + const RealTimeRoadPointCallback ptr, void *arg); + + /** + * @brief robotServiceSetRealTimeEndSpeedPush 设置是否允许实时末端速度推送 + * @param enable true表示允许   false表示不允许 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetRealTimeEndSpeedPush(bool enable); + + /** + * @brief robotServiceRegisterRealTimeEndSpeedCallback + * 注册用于获取实时末端速度的回调函数 + * @param ptr + * 获取实时末端速度的函数指针 当ptr==NULL时,相等于取消回调函数的注册,取消该推送信息也可以通过该接口robotServiceSetRealTimeEndSpeedPush进行。 + * @param + * arg 这个参数系统不做任何处理,只是进行了缓存,当回调函数触发时该参数会通过回调函数的参数传回。 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceRegisterRealTimeEndSpeedCallback( + const RealTimeEndSpeedCallback ptr, void *arg); + + /** + * @brief robotServiceRegisterRobotEventInfoCallback + * 注册用于获取机械臂事件信息的回调函数 + * 注:关于事件信息信息的推送没有提供是否允许推送的接口,因为机械臂的很多重要通知都是通过事件推送实现的,所以事件信息是系统默认推送的,不允许取消的。 + * @param ptr + * 获取机械臂事件信息的函数指针 当ptr==NULL时,相等于取消回调函数的注册。 + * @param + * arg  这个参数系统不做任何处理,只是进行了缓存,当回调函数触发时该参数会通过回调函数的参数传回。 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceRegisterRobotEventInfoCallback(RobotEventCallback ptr, + void *arg); + + //注册movep进度通知的回调函数 + int robotServiceRegisterMovepStepNumNotifyCallback( + RealTimeMovepStepNumNotifyCallback ptr, void *arg); + + //注册日志输出回调函数 + int robotServiceRegisterLogPrintCallback(RobotLogPrintCallback ptr, + void *arg); + + /** + * @brief robotServiceInitGlobalMoveProfile 初始化全局的运动属性 + * 调用此函数时机械臂不运动,该函数初始化各个运动属性为默认值。 + *     初始化后各属性的默认值为: + * 0:关节型运动的最大速度和加速度属性: 关节最大速度默认为25度米每秒;关节最大加速度默认为25度米每秒方 + * 1:末端型运动的最大速度和加速度属性: + * 末端最大速度默认为3米每秒;末端最大加速度3米每秒方 + * 2:路点信息缓存属性:  默认路点缓存为空 + * 3:交融半径属性: 默认为0.02米 + * 4:圆的圈数属性: 默认为0 + * 5:偏移量属性属性: 默认没有偏移 + * 6:工具参数属性属性: 无工具即工具的位置为000; + * 7:示教坐标系属性:  示教坐标系为基座标系 + * + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceInitGlobalMoveProfile(); + + /** + * 设置和获取 关节型 运动的最大速度和加速度 + * 关节型运动包含: + *     关节运动; + *     示教运动中的关节示教(JOINT1,JOINT2,JOINT3,JOINT4,JOINT5,JOINT6) + *     轨迹运动下的(JIONT_CUBICSPLINE,JOINT_UBSPLINEINTP) + * + * 注意:用户在设置速度和加速度时,需要根据运动的类型设置, + *    关节型运动设置关节型运动的最大速度和加速度,关节型运动的最大速度是180度每秒,最大加速度为180度每秒方; + *    末端型运动会设置末端型运动的最大速度和加速度,末端型运动的最大速度为2米每秒,最大加速度为2米每秒方; + * + **/ + int robotServiceSetGlobalMoveJointMaxAcc( + const aubo_robot_namespace::JointVelcAccParam &moveMaxAcc); + + int robotServiceSetGlobalMoveJointMaxVelc( + const aubo_robot_namespace::JointVelcAccParam &moveMaxVelc); + + void robotServiceGetGlobalMoveJointMaxAcc( + aubo_robot_namespace::JointVelcAccParam &moveMaxAcc); + + void robotServiceGetGlobalMoveJointMaxVelc( + aubo_robot_namespace::JointVelcAccParam &moveMaxVelc); + + /** + * 设置和获取 末端型 运动的最大速度和加速度 + * 末端型包含: 直线运动(MODEL); + *     示教运动中的位置示教和姿态示教(MOV_X,MOV_Y,MOV_Z,ROT_X,ROT_Y,ROT_Z); + *     轨迹运动下的(ARC_CIR, CARTESIAN_MOVEP, CARTESIAN_CUBICSPLINE, CARTESIAN_UBSPLINEINTP) + * + * 注意:用户在设置速度和加速度时,需要根据运动的类型设置, + * 关节型运动设置关节型运动的最大速度和加速度,关节型运动的最大速度是180度每秒,最大加速度为180度每秒方; + *    末端型运动会设置末端型运动的最大速度和加速度,末端型运动的最大速度为2米每秒,最大加速度为2米每秒方; + * + **/ + int robotServiceSetGlobalMoveEndMaxLineAcc(double moveMaxAcc); + + int robotServiceSetGlobalMoveEndMaxLineVelc(double moveMaxVelc); + + void robotServiceGetGlobalMoveEndMaxLineAcc(double &moveMaxAcc); + + void robotServiceGetGlobalMoveEndMaxLineVelc(double &moveMaxVelc); + + int robotServiceSetGlobalMoveEndMaxAngleAcc(double moveMaxAcc); + + int robotServiceSetGlobalMoveEndMaxAngleVelc(double moveMaxVelc); + + void robotServiceGetGlobalMoveEndMaxAngleAcc(double &moveMaxAcc); + + void robotServiceGetGlobalMoveEndMaxAngleVelc(double &moveMaxVelc); + + /** + * 设置加加速度 + */ + int robotServiceSetJerkAccRatio(double acc); + + void robotServiceGetJerkAccRatio(double &acc); + + int robotServiceSetAngleJerkAccRatio(double acc); + + void robotServiceGetAngleJerkAccRatio(double &acc); + + /** 运动属性中的路点设置与获取 多用于轨迹运动**/ + void robotServiceClearGlobalWayPointVector(); + + /** + * @brief robotServiceAddGlobalWayPoint + * 添加路点,一般用于robotServiceTrackMove中 + * @param wayPoint  法兰盘中心基于基座标系的路点信息 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceAddGlobalWayPoint( + const aubo_robot_namespace::wayPoint_S &wayPoint); + + /** + * @brief robotServiceAddGlobalWayPoint + *添加路点,一般用于robotServiceTrackMove中 + * @param jointAngle    关节信息 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + **/ + + int robotServiceAddGlobalWayPoint( + const double jointAngle[aubo_robot_namespace::ARM_DOF]); + + void robotServiceGetGlobalWayPointVector( + std::vector &wayPointVector); + + /** 运动属性之交融半径的设置与获取 交融半径的范围:0.001m~1m + * 注意:交融半径必须大于或等于 0.001 + **/ + float robotServiceGetGlobalBlendRadius(); + + int robotServiceSetGlobalBlendRadius(float value); + + double robotServiceGetTrackPlaybackCycle(); + + int robotServiceSetTrackPlaybackCycle(double second); + + /** 运动属性之圆轨迹时圆的圈数 + * 当轨迹类型为ARC_CIR时有效,当圆的圈数属性(CircularLoopTimes)为0时,表示圆弧轨迹; + * 当圆的圈数属性(CircularLoopTimes)大于0时,表示圆轨迹。 + **/ + int robotServiceGetGlobalCircularLoopTimes(); + + void robotServiceSetGlobalCircularLoopTimes(int times); + + /** + * @brief robotServiceSetMoveRelativeParam 设置运动属性中的偏移属性 + * @param relativeMove 基于基座标系的偏移 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetMoveRelativeParam( + const aubo_robot_namespace::MoveRelative + &relativeMoveOnBase); //基于基座标系 + + /** + * @brief robotServiceSetMoveRelativeParam 设置运动属性中的偏移属性 + * @param relativeMoveOnUserCoord 基于用户坐标系(下面参数userCoord)下的偏移 + * @param userCoord 用户坐标系 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetMoveRelativeParam( + const aubo_robot_namespace::MoveRelative &relativeMoveOnUserCoord, + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &userCoord); //基于自定义坐标系 + + /** 跟随模式之提前到位 当前仅适用于关节运动**/ + int robotServiceSetNoArrivalAhead(); + + int robotServiceSetArrivalAheadDistanceMode(double distance /*米*/); + + int robotServiceSetArrivalAheadTimeMode(double second /*秒*/); + + int robotServiceSetArrivalAheadBlendDistanceMode(double distance /*米*/); + + /** + * @brief robotServiceSetTeachCoordinateSystem 设置示教运动的坐标系 + * @param coordSystem   用户坐标系 + * 通过该参数确定一个坐标系,具体使用参考类型定义处的使用说明 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetTeachCoordinateSystem( + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &coordSystem); + int waitarrive(); + /** + * @brief robotServiceJointMove 运动接口之关节运动 + * 属于关节型运动,调用该函数机械臂开始运动 + * @param wayPoint  目标路点信息 + * @param IsBolck IsBolck==true + * 代表阻塞,机械臂运动直到到达目标位置或者出现故障后返回。 IsBolck==false + * 代表非阻塞,立即返回,运动指令发送成功就返回,函数返回后机械臂开始运动。 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceJointMove(aubo_robot_namespace::wayPoint_S &wayPoint, + bool IsBolck); + + int robotServiceJointMove(double jointAngle[aubo_robot_namespace::ARM_DOF], + bool IsBolck); + + int robotServiceJointMove(aubo_robot_namespace::MoveProfile_t &moveProfile, + double jointAngle[aubo_robot_namespace::ARM_DOF], + bool IsBolck); + + //基于跟随模式的轴动接口 + int robotServiceFollowModeJointMove( + double jointAngle[aubo_robot_namespace::ARM_DOF]); + + /** + * @brief robotServiceLineMove 运动接口之直线运动 + * 属于末端型运动,调用该函数机械臂开始运动 + * @param wayPoint   目标路点信息 + * @param IsBolck 参考robotServiceJointMove函数的解释 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceLineMove(aubo_robot_namespace::wayPoint_S &wayPoint, + bool IsBolck); + + int robotServiceLineMove(double jointAngle[aubo_robot_namespace::ARM_DOF], + bool IsBolck); + + int robotServiceLineMove(aubo_robot_namespace::MoveProfile_t &moveProfile, + double jointAngle[aubo_robot_namespace::ARM_DOF], + bool IsBolck); + + /** + * @brief robotServiceRotateMove 运动接口之保持当前位置变换姿态做旋转运动 + * @param rotateAxis 转轴[x,y,z] 当绕X转,[1,0,0] + * @param rotateAngle  转角 + * @param IsBolck 是否阻塞 + * @return + */ + int robotServiceRotateMove( + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &userCoord, + const double rotateAxisOnUserCoord[3], double rotateAngle, + bool IsBolck); + /** 旋转运动到目标路点 **/ + int robotServiceRotateMoveToWaypoint( + const aubo_robot_namespace::wayPoint_S &targetWayPointOnBaseCoord, + bool IsBolck); + + /** + * @brief robotServiceGetRotateTargetWaypiont + * 根据当前位姿及基坐标系下表示的旋转轴、旋转角,获取目标位姿 + * @param originateWayPointOnBaseCoord 起始路点信息 + * @param rotateAxisOnBaseCoord 基坐标系下表示的旋转轴 + * @param rotateAngle 旋转角 + * @param targetWayPointOnBaseCoord 目标路点信息 (传出参数) + * @return + */ + int robotServiceGetRotateTargetWaypiont( + const aubo_robot_namespace::wayPoint_S &originateWayPointOnBaseCoord, + const double rotateAxisOnBaseCoord[], double rotateAngle, + aubo_robot_namespace::wayPoint_S &targetWayPointOnBaseCoord); + + /** + * @brief robotServiceGetRotateAxisUserToBase + * 将用户坐标系描述的旋转轴变换到基坐标系下描述 + * @param oriOnUserCoord 用户坐标系姿态 + * @param rotateAxisOnUserCoord 用户坐标系下描述的旋转轴 + * @param rotateAxisOnBaseCoord 基坐标系下描述的旋转轴(传出参数) + * @return + */ + int robotServiceGetRotateAxisUserToBase( + const aubo_robot_namespace::Ori &oriOnUserCoord, + const double rotateAxisOnUserCoord[], double rotateAxisOnBaseCoord[]); + + /** + * @brief robotServiceTrackMove 运动接口之轨迹运动 + * + * @param subMoveMode + * 当subMoveMode==ARC_CIR, CARTESIAN_MOVEP, CARTESIAN_CUBICSPLINE, CARTESIAN_UBSPLINEINTP时,该运动属于末端型运动; + * 当subMoveMode==JIONT_CUBICSPLINE,JOINT_UBSPLINEINTP时,该运动属于关节型运动; + * + * 当subMoveMode==ARC_CIR 表示圆或者圆弧    当圆的圈数属性(CircularLoopTimes)为0时,表示圆弧轨迹, + * + * 当圆的圈数属性(CircularLoopTimes)大于0时,表示圆轨迹。 + * + * 当subMoveMode==CARTESIAN_MOVEP + *      表示MOVEP轨迹,需要用户这只交融半径的属性。 + * + * 当subMoveMode==JOINT_UBSPLINEINTP    轨迹复现接口 + * + * @param IsBolck    参考robotServiceJointMove函数的解释 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceTrackMove(aubo_robot_namespace::move_track subMoveMode, + bool IsBolck); + + /** + * @brief robotMoveLineToTargetPosition + * 保持当前位姿通过直线运动的方式运动到目标位置,其中目标位置是通过相对当前位置的偏移给出 + * @param userCoord + * 用户坐标系 该坐标系参数(userCoord),表示下面的偏移量参数(relativeMoveOnUserCoord)是基于该平面的。 + * @param toolInEndDesc 工具参数   当没有使用工具时,将此参数设置为0; + * @param relativeMoveOnUserCoord 基于用户坐标系下的偏移 + * @param + * IsBolck                是否阻塞   参考robotServiceJointMove函数的解释 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotMoveLineToTargetPositionByRelative( + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &userCoord, + const aubo_robot_namespace::MoveRelative + &relativeMoveOnUserCoord, //目标位置相对当前位置的偏移 + bool IsBolck); //是否阻塞 + + /** 保持当前位姿通过关节运动的方式运动到目标位置 + * 参数描述参考robotMoveJointToTargetPosition **/ + int robotMoveJointToTargetPositionByRelative( + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &userCoord, + const aubo_robot_namespace::MoveRelative + &relativeMoveOnUserCoord, //目标位置相对当前位置的偏移 + bool IsBolck = false); //是否阻塞 + + //不进行运动 + int getJointAngleByTargetPositionKeepCurrentOri( + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &coordSystem, + const aubo_robot_namespace::Pos &toolEndPositionOnUserCoord, + const aubo_robot_namespace::ToolInEndDesc + &toolInEndDesc, //相对于用户坐标系的目标位置 + double jointAngle[aubo_robot_namespace::ARM_DOF]); + + int getJointAngleByTargetPositionKeepCurrentOri( + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &userCoordSystem, + const aubo_robot_namespace::Pos &position, + const aubo_robot_namespace::ToolInEndDesc &toolInEndDesc, + aubo_robot_namespace::wayPoint_S &targetWayPointOnBaseCoord); + + /** + * @brief robotMoveLineToTargetPosition + * 保持当前位姿通过直线运动的方式运动到目标位置。 + * @param userCoord + * 用户坐标系 该坐标系参数(userCoord),表示下面的目标位置(positionOnUserCoord)是基于该平面的。 + * @param positionOnUserCoord 基于用户平面表示的目标位置 + * @param toolInEndDesc + 工具参数   当没有使用工具时,将此参数设置为0; + * @param + * IsBolck               是否阻塞   参考robotServiceJointMove函数的解释 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotMoveLineToTargetPosition( + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &userCoord, + const aubo_robot_namespace::Pos &toolEndPositionOnUserCoord, + const aubo_robot_namespace::ToolInEndDesc + &toolInEndDesc, //相对于用户坐标系的目标位置 + bool IsBolck = false); //是否阻塞 + + /** 保持当前位姿通过关节运动的方式运动到目标位置 + * 参数描述参考robotMoveJointToTargetPosition **/ + int robotMoveJointToTargetPosition( + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &userCoord, + const aubo_robot_namespace::Pos &toolEndPositionOnUserCoord, + const aubo_robot_namespace::ToolInEndDesc + &toolInEndDesc, //相对于用户坐标系的目标位置 + bool IsBolck = false); //是否阻塞 + + /** + * @brief 获取机械臂运动轨迹(目前支持轴动及笛卡尔直线运动) + * @param mode 运动类型: 0为轴动,1为笛卡尔直线运动 + * @param resolution 轨迹点的更新步长,单位:m + * @param joint_start 起始点六个关节弧度值 + * @param joint_end 终点六个关节弧度值 + * @param wayPoint_Vector 两点之间轨迹路点的六个关节角度值 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetTrackAtResolutionLength( + int mode, double resolution, const double joint_start[], + const double joint_end[], + std::vector &way_point); + + /** + * @brief 开始示教 + * @param mode 示教关节:JOINT1,JOINT2,JOINT3, JOINT4,JOINT5,JOINT6, + * 位置示教:MOV_X,MOV_Y,MOV_Z 姿态示教:ROT_X,ROT_Y,ROT_Z + * @param direction 运动方向 正方向true 反方向false + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceTeachStart(aubo_robot_namespace::teach_mode mode, + bool direction); + + /** @brief 结束示教 **/ + int robotServiceTeachStop(); + + /** + * @brief 机械臂运动控制 停止,暂停,继续 + * 注意: 调用前,需要确保已通过robotServiceSetRobotOrpeStop启动规划器 + * @param cmd 控制命令 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int rootServiceRobotMoveControl( + aubo_robot_namespace::RobotMoveControlCommand cmd); + + /** @brief 机械臂运动快速停止 **/ + int robotMoveFastStop(); + + /** @brief 终止机械臂运动**/ + int robotMoveStop(); + + /** + * @brief 等待非阻塞运动到位或结束 + * @param timeout_ms 等待超时时间(ms) 默认 0-不限时 + */ + int robotWaitMotionFinish(int timeout_ms = 0); + + /** + * @brief robotSetReducePara + * @param jerkRatio [0.1,20] + * @param acc 6维数组, + * 1,末端型运动,只使用acc[0] 最大加速度 + * 2,轴动,使用acc[0,5] 关节最大加速度 + * @param size + * @return 0 成功,其他失败 + */ + int robotSetReducePara(const double jerkRatio, const double acc[], + int size); + + /** 离线轨迹 **/ + /** @brief 将离线路点缓存进类成员变量中 + * @param wayPointVector 离线路点 + * @return 调用成功返回ErrnoSucc + */ + int robotServiceOfflineTrackWaypointAppend( + const std::vector &wayPointVector); + + /** + * @brief robotServiceOfflineTrackWaypointAppend + * 从文件中读取路点并缓存进类成员变量 + * @param fileName + * 路点存储文件名 + * @return 调用成功返回ErrnoSucc + */ + int robotServiceOfflineTrackWaypointAppend(const char *fileName); + + /** + * @brief robotServiceOfflineTrackWaypointClear + * 清空离线路点缓存 + * @return 调用成功返回ErrnoSucc + */ + int robotServiceOfflineTrackWaypointClear(); + + /** + * @brief robotServiceOfflineTrackMoveStartup + * 离线轨迹开始运动 + * @param IsBolck + * 是否阻塞 + * @return 调用成功返回ErrnoSucc + */ + int robotServiceOfflineTrackMoveStartup(bool IsBolck); + + /** + * @brief robotServiceOfflineTrackMoveStop + * 终止离线轨迹运动 + * @return 调用成功返回ErrnoSucc + */ + int robotServiceOfflineTrackMoveStop(); + + /** tcp转can透传 **/ + /** + * @brief robotServiceEnterTcp2CanbusMode + * 进入tcp转can透传模式 + * @return 调用成功返回ErrnoSucc + */ + int robotServiceEnterTcp2CanbusMode(); + + /** + * @brief robotServiceLeaveTcp2CanbusMode + * 退出tcp转can透传模式 + * @return 调用成功返回ErrnoSucc + */ + int robotServiceLeaveTcp2CanbusMode(); + + /** + * @brief robotServiceSetRobotPosData2Canbus + * 机械臂位姿tcp转can透传 + * @param jointAngle + * 机械臂关节角度 + * @return 调用成功返回ErrnoSucc + */ + int robotServiceSetRobotPosData2Canbus( + double jointAngle[aubo_robot_namespace::ARM_DOF]); + + /** + * @brief robotServiceSetRobotPosData2Canbus + * 机械臂位姿tcp转can透传 + * @param wayPointVector + * 路点 + * @return 调用成功返回ErrnoSucc + */ + int robotServiceSetRobotPosData2Canbus( + const std::vector &wayPointVector); + + int startupOfflineExcitTrajService( + const char *trackFile, + aubo_robot_namespace::Robot_Dyn_identify_traj type, int subtype, + bool isBolck); + + int getDynIdentifyResultsService(std::vector ¶mVector); + + int startMoveGroup(aubo_robot_namespace::MoveModeType type = + aubo_robot_namespace::MoveModeType::MOVE_GROUP, + bool conveyer = false, int conveyer_index = 0); + + int setEndOfMoveGroup(); + + int waitMoveGroupFinished(); + + /*******************************************************************工具接口************************************************************* + * 工具接口:正解接口, + * 逆解接口, + * 工具标定接口 + * 坐标系标定接口 + *      基座标系转用户坐标系接口 + *      用户坐标系转基坐标系接口 + * + **************************************************************************************************************************************************/ + /** + * @brief 正解     此函数为正解函数,已知关节角求对应位置的位置和姿态。 + * @param jointAngle 六个关节的关节角    输入参数 单位:弧度(rad) + * @param size 关节角数组长度 规定为6个 + * @param wayPoint 正解结果    输出参数 + *    结果示例: 六个关节角 {'joint': [1.0, 1.0, 1.0, 1.0, 1.0, 1.0], + * 位置 'pos': [-0.06403157614989634, -0.4185973810159096, + * 0.816883228463401], 姿态 'ori': [-0.11863209307193756, + * 0.3820514380931854, 0.0, 0.9164950251579285]} + * + * @return 调用成功返回ErrnoSucc;错误返回错误号 + * 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceRobotFk(const double *jointAngle, int size, + aubo_robot_namespace::wayPoint_S &wayPoint); + + /** + * @brief用于计算第五、六关节后盖位置。 + * @param jointAngle 六个关节的关节角    输入参数 单位:弧度(rad) + * @param size 需要计算的关节 规定为 4(五关节)或5(六关节) + * @param wayPoint 结果    输出参数 + *调用示例,计算第六关节后盖位置,size为5,补偿值为-0.0598 + * ret = robotService.robotServiceRobotFk(wp_start, + *5,true,-0.0598,wayPoint); + * @return 调用成功返回ErrnoSucc;错误返回错误号 + *调用成功返回ErrnoSucc;错误返回错误号 + **/ + int robotServiceRobotFk(const double *jointAngle, int size, bool enable, + double compensate, + aubo_robot_namespace::wayPoint_S &wayPoint); + + /** + * @brief + * 逆解     此函数为机械臂逆解函数,根据位置信息(x,y,z)和对应位置的参考姿态(w,x,y,z)得到对应位置的关节角信息。 + * 机器人运动学方程的逆解,也称机器人的逆运动学问题。 + * 逆运动学问题:对某个机器人,当给出机器人手部(法兰盘中心)在基座标系中所处的位置和姿态时,求出其对应的关节角信息。 + * @param position 目标路点的位置    单位:米 输入参数 + * @param ori 目标路点的参考姿态 + *  输入参数    例如:可以获取当前位置位姿作为此参数,这样相当于保持当前姿态 + * @param wayPoint 计算结果----目标路点信息 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceRobotIk(const double *startPointJointAngle, + const aubo_robot_namespace::Pos &position, + const aubo_robot_namespace::Ori &ori, + aubo_robot_namespace::wayPoint_S &wayPoint); + + int robotServiceRobotIk( + const aubo_robot_namespace::Pos &position, + const aubo_robot_namespace::Ori &ori, + std::vector &wayPointVector); + + //工具标定 + int robotServiceToolCalibration( + const std::vector &wayPointPosVector, + char poseCalibMethod, + aubo_robot_namespace::ToolInEndDesc &toolInEndDesc); + + /** + * @brief toolCalibration + *  工具标定  该函数能标定出工具的位置信息和姿态信息 + * @param wayPointPosCalibVector  提供4个或4个以上的点用于位置标定 + * @param wayPointOriCalibVector  提供两个点用于姿态标定 + * @param poseCalibMethod      标定方法 + * @param toolInEndDesc       标定的结果 + * @return + */ + int robotServiceToolCalibration( + const std::vector + &wayPointPosCalibVector, + const std::vector + &wayPointOriCalibVector, + aubo_robot_namespace::ToolKinematicsOriCalibrateMathod poseCalibMethod, + aubo_robot_namespace::ToolInEndDesc &toolInEndDesc); + + /** + * @brief robotServiceCheckUserCoordinate 检查提供的参数是否标定出一个坐标系 + * @param coordSystem    坐标系提供的参数 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceCheckUserCoordinate( + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &coordSystem); + int calculate_Feature_Poses( + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &userCoord, + std::vector &coord_arcs); + /** + * @brief robotServiceUserCoordinateCalibration 用户坐标系校准 + * @param coordSystem 坐标系提供的参数 + * @param bInWPos + * @param bInWOri + * @param wInBPos + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceUserCoordinateCalibration( + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &coordSystem, + double bInWPos[3], double bInWOri[9], double wInBPos[3]); + bool circleFourthPoint(const std::vector &p1, + const std::vector &p2, + const std::vector &p3, + std::vector &p4); + int robotServiceOriMatrixToQuaternion(double eerot[], + aubo_robot_namespace::Ori &result); + + /** + * @brief baseToUserCoordinate 基座标系转用户坐标系 + * + * 概述: + * 将法兰盘中心基于基座标系下的位置和姿态 转成 工具末端基于用户座标系下的位置和姿态。 + * + *  扩展1: + * 法兰盘中心可以看成是一个特殊的工具,即工具的位置为(0,0,0)姿态为(1,0,0,0) + * + * 因此当工具为(0,0,0)时,相当于将法兰盘中心基于基座标系下的位置和姿态 转成 法兰盘中心基于用户座标系下的位置和姿态。 + * + *     扩展2: + * 用户坐标系也可以选择成基座标系,  即:userCoord.coordType = + * BaseCoordinate + * 因此当用户平面为基座标系时,相当于将法兰盘中心基于基座标系下的位置和姿态 转成 工具末端基于基座标系下的位置和姿态, + * 即在基座标系加工具。 + * + * @param flangeCenterPositionOnBase + * 基于基座标系的法兰盘中心位置信息(x,y,z) 单位(m) + * @param flangeCenterOrientationOnBase 基于基座标系的姿态信息(w, x, + * y, z) + * @param userCoord 用户坐标系 + * 通过该参数确定一个坐标系 + * @param toolInEndDesc 工具信息 + * @param toolEndPositionOnUserCoord 基于用户座标系的工具末端位置信息 + * 输出参数 + * @param toolEndOrientationOnUserCoord 基于用户座标系的工具末端姿态信息 + * 输出参数 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int baseToUserCoordinate( + const aubo_robot_namespace::Pos + &flangeCenterPositionOnBase, //基于基座标系的法兰盘中心位置信息 + const aubo_robot_namespace::Ori + &flangeCenterOrientationOnBase, //基于基座标系的姿态信息 + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &userCoord, //用户坐标系 + const aubo_robot_namespace::ToolInEndDesc &toolInEndDesc, //工具参数 + aubo_robot_namespace::Pos + &toolEndPositionOnUserCoord, //基于用户座标系的工具末端位置信息 + aubo_robot_namespace::Ori + &toolEndOrientationOnUserCoord //基于用户座标系的工具末端姿态信息 + ); + + /** + * @brief baseToBaseAdditionalTool + *  基坐标系转基座标得到工具末端点的位置和姿态 + * + * @param flangeCenterPositionOnBase 基于基座标系的法兰盘中心位置信息 + * @param flangeCenterOrientationOnBase 基于基座标系的姿态信息 + * @param toolInEndDesc 工具信息 + * @param toolEndPositionOnUserCoord 基于基座标系的工具末端位置信息 + * 输出参数 + * @param toolEndOrientationOnUserCoord 基于基座标系的工具末端姿态信息 + * 输出参数 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int baseToBaseAdditionalTool( + const aubo_robot_namespace::Pos + &flangeCenterPositionOnBase, //基于基座标系的法兰盘中心位置信息 + const aubo_robot_namespace::Ori + &flangeCenterOrientationOnBase, //基于基座标系的法兰盘姿态信息 + const aubo_robot_namespace::ToolInEndDesc &toolInEndDesc, //工具信息 + aubo_robot_namespace::Pos + &toolEndPositionOnBase, //基于基座标系的工具末端位置信息 + aubo_robot_namespace::Ori + &toolEndOrientationOnBase //基于基座标系的工具末端姿态信息); + ); + + /** + * @brief userToBaseCoordinate + * 用户坐标系位置和姿态信息转基座标系下位置和姿态信息 + * + * 概述: + * 将工具末端基于用户座标系下的位置和姿态 转成 法兰盘中心基于基座标系下的位置和姿态。 + * + *  扩展1: + * 法兰盘中心可以看成是一个特殊的工具,即工具的位置为(0,0,0)姿态为(1,0,0,0) + * + * 因此当工具工具的位置为(0,0,0)姿态为(1,0,0,0)时,表示toolEndPositionOnUserCoord和toolEndOrientationOnUserCoord是无工具的。 + * + *     扩展2: + * 用户坐标系也可以选择成基座标系,  即:userCoord.coordType = + * BaseCoordinate 因此当用户平面为基座标系时,相当于 + * 将工具末端基于基座标系下的位置和姿态 转成 法兰盘中心基于基座标系下的位置和姿态, + * 即在基座标系去工具. + * + * 扩展3: + * 利用该函数和逆解组合实现     当用户提供自定义坐标系(特殊为基座标系)下工具末端的位置和姿态 得到 基座标系下法兰盘中心的位置和姿态 + *         然后在逆解,得到目标路点。 + * + * @param toolEndPositionOnUserCoord 基于用户座标系的工具末端位置信息 + * @param toolEndOrientationOnUserCoord 基于用户座标系的工具末端姿态信息 + * @param userCoord 用户坐标系 + * 通过该参数确定一个坐标系 + * @param toolInEndDesc 工具信息 + * @param flangeCenterPositionOnBase 基于基座标系的法兰盘中心位置信息 + * @param flangeCenterOrientationOnBase 基于基座标系的姿态信息 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + * + * 注:这个的坐标系转换不支持末端系  即不支持userCoord==EndCoordinate,如果userCoord==EndCoordinate会报参数错误(ErrCode_ParamError) + */ + int userToBaseCoordinate( + const aubo_robot_namespace::Pos + &toolEndPositionOnUserCoord, //基于用户座标系的工具末端位置信息 + const aubo_robot_namespace::Ori + &toolEndOrientationOnUserCoord, //基于用户座标系的工具末端姿态信息 + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &userCoord, //用户坐标系 + const aubo_robot_namespace::ToolInEndDesc &toolInEndDesc, //工具信息 + aubo_robot_namespace::Pos + &flangeCenterPositionOnBase, //基于基座标系的法兰盘中心位置信息 + aubo_robot_namespace::Ori + &flangeCenterOrientationOnBase //基于基座标系的法兰盘中心姿态信息 + ); + + /** + * @brief userCoordPointToBasePoint + * 将空间内一个基于用户坐标系的位置信息(x,y,z) 转换成基于 基座标下的位置信息(x,y,z) + * + * @param userCoordPoint 用户坐标系下的位置信息 + * x,y,z(必须的基于下面参数提供的坐标系下的) + * @param userCoordSystem    用户坐标系描述 + * 通过该参数确定一个坐标系 不能为末端坐标系 如果userCoord==EndCoordinate会报参数错误(ErrCode_ParamError) + * @param basePoint        基于基坐标系下的位置信息x,y,z + * @return 调用成功返回ErrnoSucc;错误返回错误号 + * + * 注:这个的坐标系转换不支持末端系  即不支持userCoord==EndCoordinate,如果userCoord==EndCoordinate会报参数错误(ErrCode_ParamError) + */ + int userCoordPointToBasePoint( + const aubo_robot_namespace::Pos &userCoordPoint, + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &userCoordSystem, + aubo_robot_namespace::Pos &basePoint); + + //法兰盘姿态转成工具姿态 + static int endOrientation2ToolOrientation( + aubo_robot_namespace::Ori &tcpOriInEnd, + const aubo_robot_namespace::Ori &endOri, + aubo_robot_namespace::Ori &toolOri); + + //工具姿态转成法兰盘姿态 + static int toolOrientation2EndOrientation( + aubo_robot_namespace::Ori &tcpOriInEnd, + const aubo_robot_namespace::Ori &toolOri, + aubo_robot_namespace::Ori &endOri); + + //根据位置获取目标路点信息 + int getTargetWaypointByPosition( + const aubo_robot_namespace::wayPoint_S &sourceWayPointOnBaseCoord, + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &userCoordSystem, + const aubo_robot_namespace::Pos &toolEndPosition, + const aubo_robot_namespace::ToolInEndDesc &toolInEndDesc, + aubo_robot_namespace::wayPoint_S &targetWayPointOnBaseCoord); + + /** + * @brief quaternionToRPY 四元素转欧拉角 + * @param ori     姿态的四元素表示方法 + * @param rpy     姿态的欧拉角表示方法 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + static int quaternionToRPY(const aubo_robot_namespace::Ori &ori, + aubo_robot_namespace::Rpy &rpy); + + /** + * @brief RPYToQuaternion 欧拉角转四元素 + * @param rpy 姿态的欧拉角表示方法 + * @param ori 姿态的四元素表示方法 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + static int RPYToQuaternion(const aubo_robot_namespace::Rpy &rpy, + aubo_robot_namespace::Ori &ori); + + /** + * @brief 坐标变换(F_c_a = F_c_b * F_b_a) + * @param F_b_a: a 相对于 b 的位姿 + * @param F_c_b: b 相对于 c 的位姿 + * @return a 相对于 c 的位姿 + */ + int poseTrans(const aubo_robot_namespace::PositionAndQuaternion &F_b_a, + const aubo_robot_namespace::PositionAndQuaternion &F_c_b, + aubo_robot_namespace::PositionAndQuaternion &F_c_a); + + /** + * @brief 齐次变换矩阵的逆 + * @param F_b_a: a 相对于 b 的位姿 + * @return b 相对于 a 的位姿 + */ + int poseInv(const aubo_robot_namespace::PositionAndQuaternion &F_b_a, + aubo_robot_namespace::PositionAndQuaternion &F_a_b); + + /** + * @brief getErrDescByCode 根据错误号获取错误信息 + * @param code  错误号 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + std::string getErrDescByCode(aubo_robot_namespace::RobotErrorCode code); + + /********************************************************************************************************************************************** + ************************************************************机械臂控制接口********************************************************************** + **********************************************************************************************************************************************/ + /** + * @brief 机械臂控制 + * @param cmd 控制命令 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int rootServiceRobotControl( + const aubo_robot_namespace::RobotControlCommand cmd); + + /** + * @brief 设置机械臂的电源状态 + * @param value + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServicePowerControl(bool value); + + int robotServiceReleaseBrake(); + + /** + * @brief rootServiceRobotStartup + * 启动机械臂-----该操作会完成机械臂的上电,松刹车,设置碰撞等级,设置动力学参数等功能。 + * @param toolDynamicsParam      动力学参数 + * @param collisionClass        碰撞等级 + * @param readPose 是否允许读取位置   默认是true + * @param staticCollisionDetect + * @param boardBaxAcc + * @param result + * @param IsBolck + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int rootServiceRobotStartup( + const aubo_robot_namespace::ToolDynamicsParam &toolDynamicsParam, + uint8 collisionClass, bool readPose, bool staticCollisionDetect, + int boardBaxAcc, aubo_robot_namespace::ROBOT_SERVICE_STATE &result, + bool IsBolck = true); + + /** + * @brief 关机 + * @param IsBolck 是否阻塞 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceRobotShutdown(bool IsBolck = true); + + /********************************************************************************************************************************************** + ********************************************************************************************************************************************** + ************************************************************关于末端工具的接口******************************************************************* + ********************************************************************************************************************************************** + **********************************************************************************************************************************************/ + /** 设置无工具的动力学参数 **/ + int robotServiceSetNoneToolDynamicsParam(); + + /** 设置工具的动力学参数  **/ + int robotServiceSetToolDynamicsParam( + const aubo_robot_namespace::ToolDynamicsParam &toolDynamicsParam); + + /** 获取工具的动力学参数  **/ + int robotServiceGetToolDynamicsParam( + aubo_robot_namespace::ToolDynamicsParam &toolDynamicsParam); + + /** 设置无工具运动学参数  **/ + int robotServiceSetNoneToolKinematicsParam(); + + /** 设置工具的运动学参数  **/ + int robotServiceSetToolKinematicsParam( + const aubo_robot_namespace::ToolKinematicsParam &toolKinematicsParam); + + /** 获取工具的运动学参数  **/ + int robotServiceGetToolKinematicsParam( + aubo_robot_namespace::ToolKinematicsParam &toolKinematicsParam); + + /********************************************************************************************************************************************** + ************************************************************机械臂相关参数设置与获取的接口********************************************************* + **********************************************************************************************************************************************/ + /** + * @brief robotServiceGetRobotWorkMode   获取当前机械臂模式 + * @param mode 输出参数  仿真或真实的枚举类型 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetRobotWorkMode(aubo_robot_namespace::RobotWorkMode &mode); + + /** + * @brief robotServiceSetRobotWorkMode 设置当前机械臂模式 仿真或真实 + * @param mode   仿真或真实的枚举类型 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetRobotWorkMode(aubo_robot_namespace::RobotWorkMode mode); + + /** + * @brief robotServiceSetEnableForceTeachWhenProjectIsRunning + * 在工程运行的时候使能/失能力控模式 + * @param enable true:使能 false:失能 + * @return + */ + int robotServiceSetEnableForceTeachWhenProjectIsRunning(bool enable); + + /** + * @brief robotServiceSetRobotWorkMode 获取重力分量 + * @param mode   输出参数  仿真或真实的枚举类型 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetRobotGravityComponent( + aubo_robot_namespace::RobotGravityComponent &gravityComponent); + + //业务接口: 获取当前碰撞等级 + int robotServiceGetRobotCollisionCurrentService(int &collisionGrade); + + //业务接口: 设置碰撞等级 + int robotServiceSetRobotCollisionClass(int grade); + int robotServiceSetRobotCollisionClass( + int grade, aubo_robot_namespace::CollisionMode collision_mode); + + //业务接口:获取设备信息 + int robotServiceGetRobotDevInfoService( + aubo_robot_namespace::RobotDevInfo &devInfo); + int robotServiceGetRobotIoConfigService( + aubo_robot_namespace::IoConfig &ioconfig); + + //设置最大加速度 + int robotServiceSetRobotMaxACC(int maxAcc); + + //碰撞恢复 + int robotServiceCollisionRecover(); + + // 关节回复到安全限制以内 + int robotServiceJointPosRecover(bool confirm); + + //获取机械臂当前状态 + int robotServiceGetRobotCurrentState( + aubo_robot_namespace::RobotState &state); + + //获取通讯状态 + int robotServiceGetMacCommunicationStatus(bool &value); + + /** + * @brief robotServiceGetIsRealRobotExist 获取是否存在真实机械臂 + * @param value 输出参数  存在为true,不存在为false + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetIsRealRobotExist(bool &value); + + /** + * @brief robotServiceGetJoint6Rotate360EnableFlag 获取6关节旋转360使能标志 + * @param value + * @return + */ + int robotServiceGetJoint6Rotate360EnableFlag(bool &value); + + /** + * @brief robotServiceGetRobotJointStatus 获取机械臂关节状态 + * @param jointStatus 关节角缓冲区  输出参数 + * @param size 关节角缓冲区长度 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetRobotJointStatus( + aubo_robot_namespace::JointStatus *jointStatus, int size); + + /** + * @brief robotServiceGetRobotDiagnosisInfo 获取机械臂诊断信息 + * @param robotDiagnosisInfo 输出参数 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetRobotDiagnosisInfo( + aubo_robot_namespace::RobotDiagnosis &robotDiagnosisInfo); + + /** + * @brief robotServiceGetJointAngleInfo 获取机械臂当前关节角信息 + * @param jointParam 输出参数 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetJointAngleInfo( + aubo_robot_namespace::JointParam &jointParam); + + int robotServiceGetCorrectedWaypoint( + const aubo_robot_namespace::wayPoint_S source, + aubo_robot_namespace::wayPoint_S &waypint); + + /** + * @brief robotServiceGetCurrentWaypointInfo 获取机械臂当前路点信息 + * @param wayPoint 输出参数 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetCurrentWaypointInfo( + aubo_robot_namespace::wayPoint_S &wayPoint); + + /** + * @brief robotServerGetToolForceSensorData 获取力传感器数据 + * @param data 输出力传感器数据 + * @return 调用成功返回ErrnoSucc + */ + int robotServerGetToolForceSensorData( + aubo_robot_namespace::ForceSensorData &data); + + /** + * @brief robotServiceSetJointRangeOfMotion 设置关节运动范围 + * @param rangeOfMotion + * @return + */ + int robotServiceSetJointRangeOfMotion( + const aubo_robot_namespace::JointRangeOfMotion &rangeOfMotion); + + /** + * @brief robotServiceGetJointRangeOfMotion 获取关节运动范围 + * @param rangeOfMotion + * @return + */ + int robotServiceGetJointRangeOfMotion( + aubo_robot_namespace::JointRangeOfMotion &rangeOfMotion); + int robotServiceGetJointPositionLimit( + aubo_robot_namespace::JointRangeOfMotion &rangeOfMotion); + + /*****************************************************************************************************************************************************/ + /* 安全IO相关 */ + /* */ + /****************************************************************************************************************************************************/ + int robotServiceSetRobotAtOriginPose(); + + /** + * @brief 通知接口板上位机暂停状态 + * @param data 0x01-暂停 0x02-恢复 + * @return + */ + int robotServiceSetRobotOrpePause(uint8 data); + + /** + * @brief 通知接口板上位机停止状态 + * @param data 0x02-启动 0x01-停止 + * @return + */ + int robotServiceSetRobotOrpeStop(uint8 data); + + /** + * @brief 通知机械臂工程启动,服务器同时开始检测安全IO + * @return + */ + int robotServiceSetRobotProjectStartup(); + + /** + * @brief 通知机械臂工程停止,服务器停止检测安全IO + * @return + */ + int robotServiceSetRobotProjectStop(); + + /** + * @brief 通知接口板上位机错误 + * @param 16个字节的错误数据,每个错误占一个bit + * @return + */ + int robotServiceSetRobotOrpeError(uint8 data[], int len); + + /** + * @brief 解除系统紧急停止输出信号 0-无动作 1-解除 + * @param data + * @return + */ + int robotServiceClearSystemEmergencyStop(uint8 data); + + /** + * @brief 解除缩减模式错误 0-无效 1-解除 + * @param data + * @return + */ + int robotServiceClearReducedModeError(uint8 data); + + /** + * @brief 防护重置成功 0-无动作 1-解除 + * @param data + * @return + */ + int robotServiceRobotSafetyguardResetSucc(uint8 data); + + /** + * @brief 设置机械臂运动进入缩减模式 + * @return + */ + bool robotServiceEnterRobotReduceMode(); + + /** + * @brief 设置机械臂运动退出缩减模式 + * @return + */ + bool robotServiceExitRobotReduceMode(); + + /********************************************************************************************************************************************** + ************************************************************关于接口板IO的接口********************************************************************** + **********************************************************************************************************************************************/ + /** + * @brief 获取接口板指定IO集合的配置信息 + * @param ioType IO类型的集合 输入参数 + * @param configVector IO配置信息的集合 输出参数 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetBoardIOConfig( + const std::vector &ioType, + std::vector &configVector); + + /** + * @brief 获取接口板指定IO集合的状态信息 + * @param ioType + * @param statusVector + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetBoardIOStatus( + const std::vector ioType, + std::vector &statusVector); + + /** + * @brief 根据接口板IO类型和名称设置IO状态 + * @param type IO类型 + * @param name IO名称 + * @param value IO状态 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetBoardIOStatus(aubo_robot_namespace::RobotIoType type, + std::string name, double value); + + /** + * @brief 根据接口板IO类型和地址设置IO状态 + * @param type IO类型 + * @param addr IO地址 + * @param value IO状态 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetBoardIOStatus(aubo_robot_namespace::RobotIoType type, + int addr, double value); + + /** + * @brief 根据接口板IO类型和名称设置脉冲 + * @param type IO类型 + * @param addr IO地址 + * @param value IO状态 + * @param duration 脉冲时长(ms) + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetBoardIOPulse(aubo_robot_namespace::RobotIoType type, + std::string name, double value, + int millisecond); + + /** + * @brief 根据接口板IO类型和地址设置脉冲 + * @param type IO类型 + * @param addr IO地址 + * @param value IO状态 + * @param duration 脉冲时长(ms) + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetBoardIOPulse(aubo_robot_namespace::RobotIoType type, + int addr, double value, int millisecond); + + /** + * @brief 根据接口板IO类型和名称获取IO状态 + * @param type IO类型 + * @param name IO名称 + * @param value IO状态 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetBoardIOStatus(aubo_robot_namespace::RobotIoType type, + std::string name, double &value); + + /** + * @brief 根据接口板IO类型和地址获取IO状态 + * @param type IO类型 + * @param addr IO地址 + * @param value IO状态 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetBoardIOStatus(aubo_robot_namespace::RobotIoType type, + int addr, double &value); + + /** + * @brief 返回当前机械臂是否运行在联机模式 + * @param isOnlineMode true:联机 false:非联机 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceIsOnlineMode(bool &isOnlineMode); + + /** + * @brief 返回当前机械臂是否运行在联机主模式 + * @param isOnlineMode true:联机主模式 false:联机从模式 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceIsOnlineMasterMode(bool &isOnlineMasterMode); + + //业务接口: 获取机械臂安全配置 + int robotServiceGetRobotSafetyConfig( + aubo_robot_namespace::RobotSafetyConfig &safetyConfig); + + //业务接口: 设置机械臂安全配置 + int robotServiceSetRobotSafetyConfig( + const aubo_robot_namespace::RobotSafetyConfig &safetyConfig); + + //业务接口: 获取机械臂安全状态 + int robotServiceGetOrpeSafetyStatus( + aubo_robot_namespace::OrpeSafetyStatus &safetyStatus); + + /********************************************************************************************************************************************** + ************************************************************关于tool + *IO的接口********************************************************************** + **********************************************************************************************************************************************/ + /** + * @brief 设置工具端电源电压类型 + * @param type 电源电压类型 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetToolPowerVoltageType( + aubo_robot_namespace::ToolPowerType type); + + /** + * @brief 获取工具端电源电压类型 + * @param 输出参数 接口调用成功后返回的电源电压类型 + * @return + */ + int robotServiceGetToolPowerVoltageType( + aubo_robot_namespace::ToolPowerType &type); + + /** + * @brief 获取工具端的电源电压 + * @param value 输出参数 + * @return + */ + int robotServiceGetToolPowerVoltageStatus(double &value); + + /** + * @brief robotServiceSetToolPowerTypeAndDigitalIOType + * 设置工具端电源电压类型and所有数字量IO的类型 + * @param type + * @param io0 + * @param io1 + * @param io2 + * @param io3 + * @return + */ + int robotServiceSetToolPowerTypeAndDigitalIOType( + aubo_robot_namespace::ToolPowerType type, + aubo_robot_namespace::ToolIOType io0, + aubo_robot_namespace::ToolIOType io1, + aubo_robot_namespace::ToolIOType io2, + aubo_robot_namespace::ToolIOType io3); + + /** + * @brief 设置工具端数字量IO的类型 输入或者输出 + * @param 地址 + * @param 类型 输入或者输出 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetToolDigitalIOType( + aubo_robot_namespace::ToolDigitalIOAddr addr, + aubo_robot_namespace::ToolIOType type); + + /** + * @brief 获取工具端所有数字量IO的状态 + * @param statusVector 输出参数 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetAllToolDigitalIOStatus( + std::vector &statusVector); + + /** + * @brief 根据地址设置工具端数字量IO的状态 + * @param addr IO地址 + * @param value IO状态 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetToolDOStatus( + aubo_robot_namespace::ToolDigitalIOAddr addr, + aubo_robot_namespace::IO_STATUS value); + + /** + * @brief 根据名称设置工具端数字量IO的状态 + * @param addr IO地址 + * @param value IO状态 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetToolDOStatus(std::string name, + aubo_robot_namespace::IO_STATUS value); + + /** + * @brief 根据地址设置工具端数字量IO的脉冲 + * @param addr IO地址 + * @param value IO状态 + * @param duration 脉冲时长(ms) + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetToolDOPulse(int addr, double value, int millisecond); + + /** + * @brief 根据名称设置工具端数字量IO的脉冲 + * @param addr IO地址 + * @param value IO状态 + * @param duration 脉冲时长(ms) + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetToolDOPulse(std::string name, double value, + int millisecond); + + /** + * @brief 根据名称获取工具端IO的状态 + * @param name IO名称 + * @param value IO状态 输出参数 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetToolIoStatus(std::string name, double &value); + + /** + * @brief 获取工具端所有AI的状态 + * @param 输出参数 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetAllToolAIStatus( + std::vector &statusVector); + + /** + * @brief robotServiceUpdateRobotBoardFirmware 接口板固件升级 + * @param cmd 接口板固件升级类型 + * @param data + * @param length z + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceUpdateRobotBoardFirmware( + aubo_robot_namespace::update_board_firmware_cmd cmd, const void *data, + uint16 length); + + /** + * @brief robotServiceGetBoardFirmwareUpdateResultService + * 获取接口板固件升级结果 + * @param value 返回是否成功 + * @return + */ + int robotServiceGetBoardFirmwareUpdateResultService(bool &value); + + /** + * @brief robotServiceGetRobotEthernetDeviceName 获取网卡设备名称 + * @param ethernetDeviceName 返回网卡设备名称 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetRobotEthernetDeviceName(std::string ðernetDeviceName); + + //获取服务器版本信息 + int robotServiceGetServerVersionInfo(std::string &versionInfo); + + /** + * @brief 设置关节碰撞补偿(范围0.00~0.51度) + * @param jointOffset + * @return + */ + int robotServiceSetRobotJointOffset( + aubo_robot_namespace::RobotJointOffset &jointOffset); + + int robotServiceSetConveyorEncoderReset(void); + + /** + * @brief 启动传送带 + * @return + */ + int robotServiceSetConveyorStartup(void); + + /** + * @brief 停止传送带 + * @return + */ + int robotServiceSetConveyorStop(void); + + /** + * @brief 设置传送带方向 + * @param dir + * @return + */ + int robotServiceSetConveyorDir(int dir); + + /** + * @brief 设置手眼标定结果关系 + * @param robotCameraCalib + */ + int robotServiceSetRobotCameraCalib( + const aubo_robot_namespace::RobotCameraCalib &robotCameraCalib); + + /** + * @brief 设置传送带线速度 + * @param conveyorVelc (米/秒) + */ + int robotServiceSetConveyorVelc(const double conveyorVelc); + + /** + * @brief 设置编码器距离关系 + * @param encoderValPerMeter 编码器距离关系(编码器脉冲个数/米) + */ + int robotServiceSetEncoderValPerMeter(const uint32_t &encoderValPerMeter); + + /** + * @brief 设置传送带起始窗口上限 + * @param startWindowUpstream 单位:米 + */ + int robotServiceSetStartWindowUpstream(double startWindowUpstream); + + /** + * @brief 设置传送带起始窗口下限 + * @param startWindowDownstream 单位:米 + */ + int robotServiceSetStartWindowDownstream(double startWindowDownstream); + + /** + * @brief 设置传送带跟踪轨迹下限 单位:米 + * @param trackDownstream + */ + int robotServiceSetConveyorTrackDownstream(double trackDownstream); + + /** + * @brief robotServiceAppendObject2ConveyorTrackQueue + * 在传送带队列中添加object + * @param objectPos object位置 + * @param objectOri object姿态 + * @param timestamp + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceAppendObject2ConveyorTrackQueue( + const aubo_robot_namespace::Pos &objectPos, + const aubo_robot_namespace::Ori &objectOri, uint32_t timestamp); + + /** + * @brief robotServiceEnableConveyorTrack 使能传送带跟踪 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceEnableConveyorTrack(); + + /** + * @brief robotServiceGetConveyorEncoderVal 获取传送带编码器速度 + * @param value 返回的速度值 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetConveyorEncoderVal(int &value); + + //设置传送带跟踪的最大速度 + int robotServiceSetRobotConveyorTrackMaxVelc( + double robotConveyorTrackMaxVelc); + + //设置传送带跟踪的最大加速度 + int robotServiceSetRobotConveyorTrackMaxAcc( + double robotConveyorTrackMaxAcc); + + //设置传送带跟踪的系统延时时间 + int robotServiceSetRobotConveyorSystemDelay( + double robotConveyorSystemDelay); + + //设置机械臂工具 + int robotServiceSetRobotTool( + const aubo_robot_namespace::ToolInEndDesc &robotTool); + /** + * @brief robotServiceSetWeaveMoveParameters 设置焊接摇摆 + * @param weaveMove 焊接摇摆结构体 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetWeaveMoveParameters( + const aubo_robot_namespace::WeaveMove &weaveMove); + + /** + * @brief robotServiceSetRobotRecognitionParam 设置机械臂辨识参数 + * @param param 机械臂辨识参数 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetRobotRecognitionParam( + const aubo_robot_namespace::RobotRecongnitionParam ¶m); + + /** + * @brief robotServiceGetRobotRecognitionParam 获取机械臂辨识参数 + * @param type + * @param param 机械臂辨识参数 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetRobotRecognitionParam( + int type, aubo_robot_namespace::RobotRecongnitionParam ¶m); + + /** + * @brief robotServiceSetSeamTrackingParameters 设置焊缝跟踪参数 + * @param seamTrack 焊缝跟踪参数 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetSeamTrackingParameters( + const aubo_robot_namespace::SeamTracking &seamTrack); + + /** + * @brief robotServiceGetSeamTrackingParameters 获取焊缝跟踪参数 + * @param seamTrack 焊缝跟踪参数 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetSeamTrackingParameters( + aubo_robot_namespace::SeamTracking &seamTrack); + + /** + * @brief robotServiceGetJointCommonData 获取机械臂关节数据 + * @param jointCommonDataArray 机械臂关节数据 + * @param size + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetJointCommonData( + aubo_robot_namespace::JointCommonData jointCommonDataArray[], int size); + + /** + * @brief robotServiceSetJointParam_CurrentIP 设置关节电流P值 + * @param jointID 关节角ID + * @param P P值 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetJointParam_CurrentIP(int jointID, uint16 P); + + /** + * @brief robotServiceSetJointParam_CurrentII 设置关节电流I值 + * @param jointID 关节角ID + * @param I I值 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetJointParam_CurrentII(int jointID, uint16 I); + + /** + * @brief robotServiceSetJointParam_CurrentID 设置关节电流D值 + * @param jointID 关节角ID + * @param D D值 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetJointParam_CurrentID(int jointID, uint16 D); + + /** + * @brief robotServiceSetJointParam_SpeedP 设置关节速度P值 + * @param jointID 关节角ID + * @param P P值 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetJointParam_SpeedP(int jointID, uint16 P); + + /** + * @brief robotServiceSetJointParam_SpeedI 设置关节速度I值 + * @param jointID 关节角ID + * @param I I值 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetJointParam_SpeedI(int jointID, uint16 I); + + /** + * @brief robotServiceSetJointParam_SpeedD 设置关节速度D值 + * @param jointID 关节角ID + * @param D D值 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetJointParam_SpeedD(int jointID, uint16 D); + + /** + * @brief robotServiceSetJointParam_SpeedDS 设置关节速度死区 + * @param jointID 关节角ID + * @param DS 死区 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetJointParam_SpeedDS(int jointID, uint16 DS); + + /** + * @brief robotServiceSetJointParam_PosP 设置关节位置P值 + * @param jointID 关节角ID + * @param P P值 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetJointParam_PosP(int jointID, uint16 P); + + /** + * @brief robotServiceSetJointParam_PosI 设置关节位置I值 + * @param jointID 关节角ID + * @param I I值 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetJointParam_PosI(int jointID, uint16 I); + + /** + * @brief robotServiceSetJointParam_PosD 设置关节位置D值 + * @param jointID 关节角ID + * @param D D值 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetJointParam_PosD(int jointID, uint16 D); + + /** + * @brief robotServiceSetJointParam_PosDS 设置关节位置DS值 + * @param jointID 关节角ID + * @param DS DS值 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetJointParam_PosDS(int jointID, uint16 DS); + + int robotServiceJointSaveDataFlash(int jointID); + + /** + * @brief robotServiceSetRobotBaseParameters 设置机械臂基础数据 + * @param baseParameters 机械臂基础数据 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetRobotBaseParameters( + const aubo_robot_namespace::RobotBaseParameters &baseParameters); + + //设置调速模式配置 + int robotServiceSetRegulateSpeedModeParam( + const aubo_robot_namespace::RegulateSpeedModeParamConfig_t + ®ulateSpeedModeConfig); + + /** + * @brief robotServiceGetRobotBaseParameters 获取机械臂基础数据 + * @param baseParameters 机械臂基础数据 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetRobotBaseParameters( + aubo_robot_namespace::RobotBaseParameters &baseParameters); + + //获取调速模式配置 + int robotServiceGetRegulateSpeedModeParam( + aubo_robot_namespace::RegulateSpeedModeParamConfig_t + ®ulateSpeedModeConfig); + + /** + * @brief robotServiceSetRobotJointsParameter 设置机械臂关节数据 + * @param jointsParameter 机械臂关节数据 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetRobotJointsParameter( + const aubo_robot_namespace::RobotJointsParameter &jointsParameter); + + //使能/失能调速模式 + int robotServiceEnableRegulateSpeedMode(bool enbaleFlag); + + /** + * @brief robotServiceGetRobotJointsParameter 获取机械臂关节数据 + * @param jointsParameter 机械臂关节数据 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetRobotJointsParameter( + aubo_robot_namespace::RobotJointsParameter &jointsParameter); + + //获取力控参数 + int robotServiceGetForceControlModeAdmittancePatam( + aubo_robot_namespace::AdmittancePatam_t &admittancePatam); + + int robotServiceRefreshRobotArmParamter(); + //设置力控参数 + int robotServiceSetForceControlModeAdmittancePatam( + const aubo_robot_namespace::AdmittancePatam_t &admittancePatam); + + //获取"主动探寻力"参数 + int robotServiceGetForceControlModeExploreForceParam(double &forceLimit, + double &distLimit); + + // int robotServiceGetForceSensorData(WrenchParam &data); + //设置"主动探寻力"参数 + int robotServiceSetForceControlModeExploreForceParam(double forceLimit, + double distLimit); + + // int robotServiceCalibToolAndSensor(aubo_robot_namespace::JointParam + // JointParamGroup[3], WrenchParam wrenchParamGroup[3], FtSensorCalResult + // &result); 使能/失能力控模式 + int robotServicEnableForceControlModeService(bool enbaleFlag); + + int robotServiceEnableForceControlPlan(bool enableFlag); + //获取实时力数据 + int robotServiceGetRealtimeForceData(double forceData[6]); + + int robotServiceSetForceDeviation(double data[6]); + + /** + * @brief parseFileAsRoadpointCollection + * 将一个轨迹文件(位置+姿态)转换为路点容器,进行平滑处理和限制条件检查 + * @param filePath 轨迹文件路径 输入参数 + * @param referPointJointAngle 逆解参考点的关节角 输入参数 + * @param toolInEndDesc 末端工具的信息 输入参数 + * @param wayPointVector 路点集合 输出参数 + * @return + */ + int parseFileAsRoadpointCollection( + const char *filePath, + aubo_robot_namespace::POSITION_ORIENTATION_TYPE poseType, + const double *referPointJointAngle, + const aubo_robot_namespace::ToolInEndDesc &toolInEndDesc, + std::vector &wayPointVector); + + int robotServiceSetForceMaxValue(double data[6]); + /** + * @brief parsePoseListeAsRoadpointCollection + * 将位姿集合(位置+四元数)转换为路点容器, 进行平滑处理和限制条件检查 + * @param referPointJointAngle 逆解参考点的关节角 输入参数 + * @param toolInEndDesc 末端工具的信息 输入参数 + * @param toolEndPoseVector 位姿集合 输入参数 + * @param wayPointVector 路点集合 输出参数 + * @return + */ + int parsePoseListeAsRoadpointCollection( + const double *referPointJointAngle, + const aubo_robot_namespace::ToolInEndDesc &toolInEndDesc, + const std::vector + &toolEndPoseVector, + std::vector &wayPointVector); + + int robotServiceSetForceControlStiffness(double data[6]); + + int robotServiceSetForceControlDamp(double data[6]); + //解析路点文件并缓存结果 + int parseRoadPointFileAndCacheResult( + const char *filePath, const double *referPointJointAngle, + aubo_robot_namespace::ToolInEndDesc &toolInEndDesc, + aubo_robot_namespace::wayPoint_S &firstWayPoint); + + int robotServiceSetForceControlMass(double data[6]); + //运行缓存轨迹(parseRoadPointFileAndCacheResult 结果) + int moveCacheTrack(); + + int robotServiceForceControlCalibrationZero(); + + int HandlePosesFromFile( + const char *filePath, const double *referPointJointAngle, + aubo_robot_namespace::ToolInEndDesc &toolInEndDesc, + std::vector &wayPointVector); + + // 脚本管理 + int robotServiceScriptRunSetSpeedLimitPercent(const double speedLimit); + + //针对瀚维的轨迹处理 + int hanweiRoadPointHandle( + const char *filePath, const double *referPointJointAngle, + aubo_robot_namespace::ToolInEndDesc &toolInEndDesc, + aubo_robot_namespace::wayPoint_S &firstWayPoint); + + //针对瀚维使用 + int moveHanweiTrack(); + + //获取SDK版本 + std::string getVersion(); + + arcs::aubo_sdk::RpcClientPtr getRpcClient(); + arcs::aubo_sdk::RtdeClientPtr getRtdeClient(); + + // private: + class PrivateData; + PrivateData *pd_ = nullptr; + + bool fast_stop_{ false }; +}; +#endif // SERVICEINTERFACE_H diff --git a/third_party/AuboSdk/linux/include/skill_interface/force_control.h b/third_party/AuboSdk/linux/include/skill_interface/force_control.h new file mode 100644 index 00000000..c8f143f9 --- /dev/null +++ b/third_party/AuboSdk/linux/include/skill_interface/force_control.h @@ -0,0 +1,329 @@ +// 力控相关的工艺封装接口 +#ifndef AUBO_SDK_SKILL_INTERFACE_H +#define AUBO_SDK_SKILL_INTERFACE_H + +#include +#include +#include +#include + +using namespace arcs::common_interface; + +namespace arcs { +namespace aubo_sdk { + +class RtdeClient; +class RpcClient; +using RtdeClientPtr = std::shared_ptr; +using RpcClientPtr = std::shared_ptr; + +class GuideTrajMove; +using GuideTrajMovePtr = std::shared_ptr; + +class ARCS_ABI ForceControl +{ +public: + enum ForceStage + { + TOUCH = 1, // 接近 + SEARCH = 2, // 搜孔 + INSERT = 3, // 插孔 + CONSTANT = 4, // 恒力 + + }; // enum ForceStage + + enum StateCode + { + // 失败状态码 + TimeOut = -100, // 超时 + Search_MaxForce = -4, // 搜孔达到最大力 + Insert_MaxForce = -3, // 插入达到最大力 + Constant_NotTouch = -2, // 恒力过程中未接触 + Touch_Distance = -1, // 超出探寻距离 + + Running = 0, // 力控执行中 + + // 成功状态码 + Touch_Succeed = 1, // 接触成功 + Insert_Succeed = 2, // 插孔成功 + Search_Succeed = 3, // 搜孔成功 + Constant_Succeed = 4, // 接触成功 + + }; // StateCode + + // 轨迹类型 + enum GuideTrajType + { + NONE = 0, // 无参考轨迹 + LINE1 = 1, // 直线 speedLine + LINE2 = 2, // 直线 moveLine + SPIRAL = 3, // 螺旋线 + WEAVE = 4, // 摆线 + }; + + // 螺旋线平面 + enum class SpiralPlane + { + xy = 0, + yz = 1, + zx = 2 + }; + + // 螺旋线轨迹参数 + struct SpiralTrajParams + { + double step = 0.0; // 圈数 + double direction = -1; // 旋转方向 -1顺时针旋转,1逆时针旋转 + SpiralPlane plane = SpiralPlane::xy; // 参考平面选择 + double spiral = 0.0; // 螺旋线外扩 + double helix = 0.0; // 螺旋上升 m + double radius = 0.0; // 第一圈半径 m + }; + + // 摆线方向 + enum class WeaveSelect + { + x = 1, + y = 2, + z = 3, + rx = 4, + ry = 5, + rz = 6 + }; + + // 摆线轨迹参数 + struct WeaveTrajParams + { + double step = 0.0; // 周期 + double amplitude = 0.0; // 幅度 + WeaveSelect direction = WeaveSelect::x; // 方向 + double hold_distance = 0.0; // 保持距离 m + double angle = 0.0; // 角度 + double type; // 类型 + }; + + // 插孔方向 + enum class InsertSelect + { + x = 1, + y = 2, + z = 3, + }; + + // 插孔参数 + struct InsertParams + { + InsertSelect insert_select = InsertSelect::z; // 插入方向,可选x\y\z + double hole_diameter = 0.0; // 轴孔直径 m + double insert_max_speed = 0.01; // 插入速度限制 m/s + double insert_time = 1000; // 插入时间限制 ms + GuideTrajType guide_traj_type = NONE; // 主动轨迹类型 + std::vector insert_max_force = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 + }; // 最大力限制 + double insert_max_depth = 0.01; // 插入距离限制 m + double insert_guide_force = 10; // 插入引导力 + // 力控调节参数 + std::vector insert_damp_scale = { + 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 + }; + std::vector insert_stiff_scale = { + 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 + }; + + SpiralTrajParams spiral_param; // 螺旋轨迹参数 + WeaveTrajParams weave_param; // 摆动轨迹参数 + }; + + // 搜孔平面 + enum class SearchPlane + { + yz = 1, + xz = 2, + xy = 3 + }; + + // 搜孔参数 + struct SearchParams + { + SearchPlane search_plane = SearchPlane::xy; // 搜孔平面 + double hole_diameter = 0.0; // 轴孔直径 m + double search_range = 0.1; // 搜孔范围 + double search_time = 1000; // 搜孔时间限制 ms + GuideTrajType guide_traj_type = NONE; // 搜孔过程主动轨迹类型 + double search_max_force = 10; // 最大力限制 + double search_guide_force = 1; // 搜孔引导力 + // 力控调节参数 + std::vector search_damp_scale = { + 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 + }; + std::vector search_stiff_scale = { + 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 + }; + + SpiralTrajParams spiral_param; + WeaveTrajParams weave_param; + }; + + struct ConstantParams + { + TaskFrameType frame_type = MOTION_FORCE; + std::vector feature = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + std::vector compliance = { true, true, true, true, true, true }; + std::vector wrench = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + + // 力控调节参数 + std::vector env_stiff = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + std::vector damp_scale = { 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 }; + std::vector stiff_scale = { 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 }; + + std::vector contact_threshold = { + 1.0, 1.0, 1.0, 0.2, 0.2, 0.2 + }; // 接触判断阈值 + double constant_time = 5000; // 默认5s + }; + + struct TouchParams + { + TaskFrameType frame_type = TOOL_FORCE; + std::vector feature = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + std::vector compliance = { true, true, true, true, true, true }; + std::vector wrench = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + std::vector env_stiff = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + // std::vector damp_scale = { 0.5, 0.5, 0.5, 0.5, 0.5, + // 0.5 }; + std::vector stiff_scale = { 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 }; + std::vector speed = { 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 }; + double distance = 0.0; + double touch_time = 1000; // 默认5s + }; + + ForceControl(const RpcClientPtr rpc, const RtdeClientPtr rtde); + ~ForceControl(); + + /** + * @brief 获取实时力控参考系下的力描述 + * + * @return 未开启力控时返回全0 + */ + std::vector getTaskForce(const TaskFrameType &type, + const std::vector &feature); + + // 接近 + int fcTouch(const TouchParams ¶m); + + // 恒力 + int fcConstant(const ConstantParams ¶m); + + // 插入 + int fcInsert(const InsertParams ¶m); + + // 搜孔 + int fcSearch(const SearchParams ¶m); + + // 等待力控结束 + int fcWaitCondition(); + + int fcExit(); + + // 注册状态回调函数 + void registerStateCallBack(std::function func); + +private: + // 注册实时状态订阅 + void subscribeRealtimeState(); + + // 力控过程监控线程 + void monitor(); + + // 超时监控 + void timeoutMonitor(); + + // 距离监控 + void distanceMonitor(); + + // 单方向距离监控 + void signalDistanceMonitor(); + + // 力监控 + void forceMonitor(); + + // 接触监控 + void contactMonitor(); + +private: + RpcClientPtr rpc_; + RtdeClientPtr rtde_; + + std::atomic_bool is_exit_; + std::atomic_bool is_stop_; + std::mutex monitor_thread_mutex_; + std::condition_variable monitor_cond_; + std::thread *monitor_thread_ptr_; + + // 用于恒力和接近之间的切换 + std::atomic_bool last_is_contact_; + + // 记录当前参数 + std::shared_mutex mutex_; + TaskFrameType frame_type_; + std::vector feature_; + ForceStage cur_process_type_; + std::vector compliance_; + std::vector env_stiff_; + std::vector damp_scale_; + std::vector stiff_scale_; + std::vector wrench_; + std::vector start_tcp_pose_; // 开始力控位姿 + double distance_; // 力控执行距离 + double direction_; // 搜孔/插孔方向 + std::chrono::steady_clock::time_point start_time_; // 开启力控时间点 + double interval_; // 超时间隔 + + // 参考轨迹运行 + GuideTrajMovePtr guide_traj_move_; + + // 状态回调函数 + std::atomic state_code_ = Running; + std::function func_; + + // RTDE相关 + std::shared_mutex rtde_mutex_; + std::vector actual_tcp_pose_; + std::vector actual_tcp_speed_; + std::vector actual_tcp_force_; + std::vector actual_tcp_force_sensor_; +}; // namespace aubo_sdk + +class GuideTrajMove +{ +public: + GuideTrajMove(const RpcClientPtr rpc); + ~GuideTrajMove(); + + void speedLine(const std::vector &speed, const double &time); + void moveLine(const std::vector &target_pose, const double &speed); + void moveSpiral(const ForceControl::SpiralTrajParams &spiral_param); + void moveWeave(const ForceControl::WeaveTrajParams &weave_param, + const int &move_direction); + + void stop(); + +private: + int waitArrival(); + + RpcClientPtr rpc_; + + std::atomic_bool is_exit_; + std::atomic_bool is_stop_; + std::mutex thread_mutex_; + std::condition_variable cond_; + std::thread thread_; + + ForceControl::GuideTrajType traj_type_ = ForceControl::NONE; +}; + +} // namespace aubo_sdk +} // namespace arcs + +#endif // AUBO_SDK_SKILL_INTERFACE_H diff --git a/third_party/AuboSdk/linux/include/skill_interface/force_control_c.h b/third_party/AuboSdk/linux/include/skill_interface/force_control_c.h new file mode 100644 index 00000000..d7b0b92e --- /dev/null +++ b/third_party/AuboSdk/linux/include/skill_interface/force_control_c.h @@ -0,0 +1,194 @@ +#ifndef AUBO_SDK_ForceControl_C_H +#define AUBO_SDK_ForceControl_C_H +#include + +enum ForceStage_C +{ + TOUCH = 1, // 接近 + SEARCH = 2, // 搜孔 + INSERT = 3, // 插孔 + CONSTANT = 4, // 恒力 + +}; // enum ForceStage + +enum StateCode_C +{ + // 失败状态码 + TimeOut = -100, // 超时 + Search_MaxForce = -4, // 搜孔达到最大力 + Insert_MaxForce = -3, // 插入达到最大力 + Constant_NotTouch = -2, // 恒力过程中未接触 + Touch_Distance = -1, // 超出探寻距离 + + Running = 0, // 力控执行中 + + // 成功状态码 + Touch_Succeed = 1, // 接触成功 + Insert_Succeed = 2, // 插孔成功 + Search_Succeed = 3, // 搜孔成功 + Constant_Succeed = 4, // 接触成功 + +}; // StateCode + +// 轨迹类型 +enum GuideTrajType_C +{ + NONE = 0, // 无参考轨迹 + LINE1 = 1, // 直线 speedLine + LINE2 = 2, // 直线 moveLine + SPIRAL = 3, // 螺旋线 + WEAVE = 4, // 摆线 +}; + +// 螺旋线平面 +enum class SpiralPlane_C +{ + xy = 0, + yz = 1, + zx = 2 +}; + +// 螺旋线轨迹参数 +struct SpiralTrajParams_C +{ + double step = 0.0; // 圈数 + double direction = -1; // 旋转方向 -1顺时针旋转,1逆时针旋转 + SpiralPlane_C plane = SpiralPlane_C::xy; // 参考平面选择 + double spiral = 0.0; // 螺旋线外扩 + double helix = 0.0; // 螺旋上升 m + double radius = 0.0; // 第一圈半径 m +}; + +// 摆线方向 +enum class WeaveSelect_C +{ + x = 1, + y = 2, + z = 3, + rx = 4, + ry = 5, + rz = 6 +}; + +// 摆线轨迹参数 +struct WeaveTrajParams_C +{ + double step = 0.0; // 周期 + double amplitude = 0.0; // 幅度 + WeaveSelect_C direction = WeaveSelect_C::x; // 方向 + double hold_distance = 0.0; // 保持距离 m + double angle = 0.0; // 角度 + double type; // 类型 +}; + +// 插孔方向 +enum class InsertSelect_C +{ + x = 1, + y = 2, + z = 3, +}; + +// 插孔参数 +struct InsertParams_C +{ + InsertSelect_C insert_select = InsertSelect_C::z; // 插入方向,可选x\y\z + double hole_diameter = 0.0; // 轴孔直径 m + double insert_max_speed = 0.01; // 插入速度限制 m/s + double insert_time = 1000; // 插入时间限制 ms + GuideTrajType_C guide_traj_type = NONE; // 主动轨迹类型 + double insert_max_force[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // 最大力限制 + double insert_max_depth = 0.01; // 插入距离限制 m + double insert_guide_force = 10; // 插入引导力 + // 力控调节参数 + double insert_damp_scale[6] = { 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 }; + double insert_stiff_scale[6] = { 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 }; + + SpiralTrajParams_C spiral_param; // 螺旋轨迹参数 + WeaveTrajParams_C weave_param; // 摆动轨迹参数 +}; + +// 搜孔平面 +enum class SearchPlane_C +{ + yz = 1, + xz = 2, + xy = 3 +}; + +// 搜孔参数 +struct SearchParams_C +{ + SearchPlane_C search_plane = SearchPlane_C::xy; // 搜孔平面 + double hole_diameter = 0.0; // 轴孔直径 m + double search_range = 0.1; // 搜孔范围 + double search_time = 1000; // 搜孔时间限制 ms + GuideTrajType_C guide_traj_type = NONE; // 搜孔过程主动轨迹类型 + double search_max_force = 10; // 最大力限制 + double search_guide_force = 1; // 搜孔引导力 + // 力控调节参数 + double search_damp_scale[6] = { 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 }; + double search_stiff_scale[6] = { 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 }; + + SpiralTrajParams_C spiral_param; + WeaveTrajParams_C weave_param; +}; + +struct ConstantParams_C +{ + TaskFrameType_C frame_type = TaskFrameType_MOTION_FORCE; + double feature[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + bool compliance[6] = { true, true, true, true, true, true }; + double wrench[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + + // 力控调节参数 + double env_stiff[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + double damp_scale[6] = { 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 }; + double stiff_scale[6] = { 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 }; + + double contact_threshold[6] = { + 1.0, 1.0, 1.0, 0.2, 0.2, 0.2 + }; // 接触判断阈值 + double constant_time = 5000; // 默认5s +}; + +struct TouchParams_C +{ + TaskFrameType_C frame_type = TaskFrameType_TOOL_FORCE; + double feature[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + bool compliance[6] = { true, true, true, true, true, true }; + double wrench[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + double env_stiff[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + // std::vector damp_scale = { 0.5, 0.5, 0.5, 0.5, 0.5, + // 0.5 }; + double stiff_scale[6] = { 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 }; + double speed[6] = { 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 }; + double distance = 0.0; + double touch_time = 1000; // 默认5s +}; + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI int getTaskForce(FORCE_CONTROL_HANDLER h, TaskFrameType_C type, + const double *feature, double *result); + +ARCS_ABI int fcTouch(FORCE_CONTROL_HANDLER h, const TouchParams_C ¶m); + +ARCS_ABI int fcConstant(FORCE_CONTROL_HANDLER h, const ConstantParams_C ¶m); + +ARCS_ABI int fcInsert(FORCE_CONTROL_HANDLER h, const InsertParams_C ¶m); + +ARCS_ABI int fcSearch(FORCE_CONTROL_HANDLER h, const SearchParams_C ¶m); + +ARCS_ABI int fcWaitCondition(FORCE_CONTROL_HANDLER h); + +ARCS_ABI int fcExit(FORCE_CONTROL_HANDLER h); + +// ARCS_ABI void registerStateCallBack(std::function func); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/linux/include/skill_interface/type_convert.h b/third_party/AuboSdk/linux/include/skill_interface/type_convert.h new file mode 100644 index 00000000..b5156202 --- /dev/null +++ b/third_party/AuboSdk/linux/include/skill_interface/type_convert.h @@ -0,0 +1,135 @@ +#ifndef AUBO_SDK_FORCE_CONTROL_TYPE_CONVERT_C_H +#define AUBO_SDK_FORCE_CONTROL_TYPE_CONVERT_C_H + +#include +#include + +// 用于将SpiralTrajParams_C转化为SpiralTrajParams +inline arcs::aubo_sdk::ForceControl::SpiralTrajParams convertToSpiralTrajParams( + const SpiralTrajParams_C &source) +{ + arcs::aubo_sdk::ForceControl::SpiralTrajParams result; + + result.step = source.step; + result.direction = source.direction; + result.plane = (arcs::aubo_sdk::ForceControl::SpiralPlane)source.plane; + result.spiral = source.spiral; + result.helix = source.helix; + result.radius = source.radius; + + return result; +} + +// 用于将WeaveTrajParams_C转化为WeaveTrajParams +inline arcs::aubo_sdk::ForceControl::WeaveTrajParams convertToWeaveTrajParams( + const WeaveTrajParams_C &source) +{ + arcs::aubo_sdk::ForceControl::WeaveTrajParams result; + + result.step = source.step; + result.amplitude = source.amplitude; + result.direction = + (arcs::aubo_sdk::ForceControl::WeaveSelect)source.direction; + result.hold_distance = source.hold_distance; + result.angle = source.angle; + result.type = source.type; + + return result; +} + +// 用于将TouchParams_C转化为TouchParams +inline arcs::aubo_sdk::ForceControl::TouchParams convertToTouchParams( + const TouchParams_C &source) +{ + arcs::aubo_sdk::ForceControl::TouchParams result; + + result.frame_type = + (arcs::common_interface::TaskFrameType)source.frame_type; + + for (int i = 0; i < 6; i++) { + result.feature[i] = source.feature[i]; + result.compliance[i] = source.compliance[i]; + result.wrench[i] = source.wrench[i]; + result.env_stiff[i] = source.env_stiff[i]; + result.stiff_scale[i] = source.stiff_scale[i]; + result.speed[i] = source.speed[i]; + } + result.distance = source.distance; + result.touch_time = source.touch_time; + + return result; +} + +inline arcs::aubo_sdk::ForceControl::ConstantParams convertToConstantParams( + const ConstantParams_C &source) +{ + arcs::aubo_sdk::ForceControl::ConstantParams result; + + result.frame_type = + (arcs::common_interface::TaskFrameType)source.frame_type; + for (int i = 0; i < 6; i++) { + result.feature[i] = source.feature[i]; + result.compliance[i] = source.compliance[i]; + result.wrench[i] = source.wrench[i]; + result.env_stiff[i] = source.env_stiff[i]; + result.damp_scale[i] = source.damp_scale[i]; + result.stiff_scale[i] = source.stiff_scale[i]; + result.contact_threshold[i] = source.contact_threshold[i]; + } // 接触判断阈值 + result.constant_time = source.constant_time; // 默认5sams result; + + return result; +} + +inline arcs::aubo_sdk::ForceControl::InsertParams convertToInsertParams( + const InsertParams_C &source) +{ + arcs::aubo_sdk::ForceControl::InsertParams result; + + result.insert_select = + (arcs::aubo_sdk::ForceControl::InsertSelect)source.insert_select; + result.hole_diameter = source.hole_diameter; + result.insert_max_speed = source.insert_max_speed; + result.insert_time = source.insert_time; + result.guide_traj_type = + (arcs::aubo_sdk::ForceControl::GuideTrajType)source.guide_traj_type; + result.insert_max_depth = source.insert_max_depth; + result.insert_guide_force = source.insert_guide_force; + for (int i = 0; i < 6; i++) { + result.insert_max_force[i] = source.insert_max_force[i]; + result.insert_damp_scale[i] = source.insert_damp_scale[i]; + result.insert_stiff_scale[i] = source.insert_stiff_scale[i]; + } + + result.spiral_param = convertToSpiralTrajParams(source.spiral_param); + result.weave_param = convertToWeaveTrajParams(source.weave_param); + + return result; +} + +// 用于将SearchParams_C转化为SearchParams +inline arcs::aubo_sdk::ForceControl::SearchParams convertToSearchParams( + const SearchParams_C &source) +{ + arcs::aubo_sdk::ForceControl::SearchParams result; + + result.search_plane = + (arcs::aubo_sdk::ForceControl::SearchPlane)source.search_plane; + result.hole_diameter = source.hole_diameter; + result.search_range = source.search_range; + result.search_time = source.search_time; + result.guide_traj_type = + (arcs::aubo_sdk::ForceControl::GuideTrajType)source.guide_traj_type; + result.search_max_force = source.search_max_force; + result.search_guide_force = source.search_guide_force; + for (int i = 0; i < 6; i++) { + result.search_damp_scale[i] = source.search_damp_scale[i]; + result.search_stiff_scale[i] = source.search_stiff_scale[i]; + } + result.spiral_param = convertToSpiralTrajParams(source.spiral_param); + result.weave_param = convertToWeaveTrajParams(source.weave_param); + + return result; +} + +#endif diff --git a/third_party/AuboSdk/linux/lib/cmake/aubo_sdk/aubo_sdkConfig.cmake b/third_party/AuboSdk/linux/lib/cmake/aubo_sdk/aubo_sdkConfig.cmake new file mode 100644 index 00000000..4ee1eb53 --- /dev/null +++ b/third_party/AuboSdk/linux/lib/cmake/aubo_sdk/aubo_sdkConfig.cmake @@ -0,0 +1,11 @@ +include(CMakeFindDependencyMacro) + +# 如果想要获取Config阶段的变量,可以使用这个 +# set(my-config-var ) + +# 如果你的项目需要依赖其他的库,可以使用下面语句,用法与find_package相同 +# find_dependency(MYDEP REQUIRED) + +# Any extra setup +# Add the targets file +include("${CMAKE_CURRENT_LIST_DIR}/aubo_sdkTargets.cmake") diff --git a/third_party/AuboSdk/linux/lib/cmake/aubo_sdk/aubo_sdkConfigVersion.cmake b/third_party/AuboSdk/linux/lib/cmake/aubo_sdk/aubo_sdkConfigVersion.cmake new file mode 100644 index 00000000..00f8ba94 --- /dev/null +++ b/third_party/AuboSdk/linux/lib/cmake/aubo_sdk/aubo_sdkConfigVersion.cmake @@ -0,0 +1,48 @@ +# This is a basic version file for the Config-mode of find_package(). +# It is used by write_basic_package_version_file() as input file for configure_file() +# to create a version-file which can be installed along a config.cmake file. +# +# The created file sets PACKAGE_VERSION_EXACT if the current version string and +# the requested version string are exactly the same and it sets +# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version. +# The variable CVF_VERSION must be set before calling configure_file(). + +set(PACKAGE_VERSION "0.26.0") + +if (PACKAGE_FIND_VERSION_RANGE) + # Package version must be in the requested version range + if ((PACKAGE_FIND_VERSION_RANGE_MIN STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MIN) + OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_GREATER PACKAGE_FIND_VERSION_MAX) + OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_GREATER_EQUAL PACKAGE_FIND_VERSION_MAX))) + set(PACKAGE_VERSION_COMPATIBLE FALSE) + else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + endif() +else() + if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) + set(PACKAGE_VERSION_COMPATIBLE FALSE) + else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) + set(PACKAGE_VERSION_EXACT TRUE) + endif() + endif() +endif() + + +# if the installed project requested no architecture check, don't perform the check +if("FALSE") + return() +endif() + +# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "") + return() +endif() + +# check that the installed version has the same 32/64bit-ness as the one which is currently searching: +if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8") + math(EXPR installedBits "8 * 8") + set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") + set(PACKAGE_VERSION_UNSUITABLE TRUE) +endif() diff --git a/third_party/AuboSdk/linux/lib/cmake/aubo_sdk/aubo_sdkTargets-debug.cmake b/third_party/AuboSdk/linux/lib/cmake/aubo_sdk/aubo_sdkTargets-debug.cmake new file mode 100644 index 00000000..da9656a7 --- /dev/null +++ b/third_party/AuboSdk/linux/lib/cmake/aubo_sdk/aubo_sdkTargets-debug.cmake @@ -0,0 +1,29 @@ +#---------------------------------------------------------------- +# Generated CMake target import file for configuration "Debug". +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Import target "aubo_sdk::aubo_sdk" for configuration "Debug" +set_property(TARGET aubo_sdk::aubo_sdk APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) +set_target_properties(aubo_sdk::aubo_sdk PROPERTIES + IMPORTED_LOCATION_DEBUG "${_IMPORT_PREFIX}/lib/libaubo_sdkd.so" + IMPORTED_SONAME_DEBUG "libaubo_sdkd.so" + ) + +list(APPEND _IMPORT_CHECK_TARGETS aubo_sdk::aubo_sdk ) +list(APPEND _IMPORT_CHECK_FILES_FOR_aubo_sdk::aubo_sdk "${_IMPORT_PREFIX}/lib/libaubo_sdkd.so" ) + +# Import target "aubo_sdk::robot_proxy" for configuration "Debug" +set_property(TARGET aubo_sdk::robot_proxy APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) +set_target_properties(aubo_sdk::robot_proxy PROPERTIES + IMPORTED_LOCATION_DEBUG "${_IMPORT_PREFIX}/lib/librobot_proxyd.so" + IMPORTED_SONAME_DEBUG "librobot_proxyd.so" + ) + +list(APPEND _IMPORT_CHECK_TARGETS aubo_sdk::robot_proxy ) +list(APPEND _IMPORT_CHECK_FILES_FOR_aubo_sdk::robot_proxy "${_IMPORT_PREFIX}/lib/librobot_proxyd.so" ) + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) diff --git a/third_party/AuboSdk/linux/lib/cmake/aubo_sdk/aubo_sdkTargets-release.cmake b/third_party/AuboSdk/linux/lib/cmake/aubo_sdk/aubo_sdkTargets-release.cmake new file mode 100644 index 00000000..b050b4e8 --- /dev/null +++ b/third_party/AuboSdk/linux/lib/cmake/aubo_sdk/aubo_sdkTargets-release.cmake @@ -0,0 +1,29 @@ +#---------------------------------------------------------------- +# Generated CMake target import file for configuration "Release". +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Import target "aubo_sdk::aubo_sdk" for configuration "Release" +set_property(TARGET aubo_sdk::aubo_sdk APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(aubo_sdk::aubo_sdk PROPERTIES + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libaubo_sdk.so" + IMPORTED_SONAME_RELEASE "libaubo_sdk.so" + ) + +list(APPEND _IMPORT_CHECK_TARGETS aubo_sdk::aubo_sdk ) +list(APPEND _IMPORT_CHECK_FILES_FOR_aubo_sdk::aubo_sdk "${_IMPORT_PREFIX}/lib/libaubo_sdk.so" ) + +# Import target "aubo_sdk::robot_proxy" for configuration "Release" +set_property(TARGET aubo_sdk::robot_proxy APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(aubo_sdk::robot_proxy PROPERTIES + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/librobot_proxy.so" + IMPORTED_SONAME_RELEASE "librobot_proxy.so" + ) + +list(APPEND _IMPORT_CHECK_TARGETS aubo_sdk::robot_proxy ) +list(APPEND _IMPORT_CHECK_FILES_FOR_aubo_sdk::robot_proxy "${_IMPORT_PREFIX}/lib/librobot_proxy.so" ) + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) diff --git a/third_party/AuboSdk/linux/lib/cmake/aubo_sdk/aubo_sdkTargets.cmake b/third_party/AuboSdk/linux/lib/cmake/aubo_sdk/aubo_sdkTargets.cmake new file mode 100644 index 00000000..39078bbe --- /dev/null +++ b/third_party/AuboSdk/linux/lib/cmake/aubo_sdk/aubo_sdkTargets.cmake @@ -0,0 +1,114 @@ +# Generated by CMake + +if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5) + message(FATAL_ERROR "CMake >= 2.6.0 required") +endif() +cmake_policy(PUSH) +cmake_policy(VERSION 2.6...3.18) +#---------------------------------------------------------------- +# Generated CMake target import file. +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Protect against multiple inclusion, which would fail when already imported targets are added once more. +set(_targetsDefined) +set(_targetsNotDefined) +set(_expectedTargets) +foreach(_expectedTarget aubo_sdk::aubo_sdk aubo_sdk::common_interface aubo_sdk::robot_proxy) + list(APPEND _expectedTargets ${_expectedTarget}) + if(NOT TARGET ${_expectedTarget}) + list(APPEND _targetsNotDefined ${_expectedTarget}) + endif() + if(TARGET ${_expectedTarget}) + list(APPEND _targetsDefined ${_expectedTarget}) + endif() +endforeach() +if("${_targetsDefined}" STREQUAL "${_expectedTargets}") + unset(_targetsDefined) + unset(_targetsNotDefined) + unset(_expectedTargets) + set(CMAKE_IMPORT_FILE_VERSION) + cmake_policy(POP) + return() +endif() +if(NOT "${_targetsDefined}" STREQUAL "") + message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_targetsDefined}\nTargets not yet defined: ${_targetsNotDefined}\n") +endif() +unset(_targetsDefined) +unset(_targetsNotDefined) +unset(_expectedTargets) + + +# Compute the installation prefix relative to this file. +get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +if(_IMPORT_PREFIX STREQUAL "/") + set(_IMPORT_PREFIX "") +endif() + +# Create imported target aubo_sdk::aubo_sdk +add_library(aubo_sdk::aubo_sdk SHARED IMPORTED) + +set_target_properties(aubo_sdk::aubo_sdk PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" + INTERFACE_LINK_LIBRARIES "aubo_sdk::common_interface" +) + +# Create imported target aubo_sdk::common_interface +add_library(aubo_sdk::common_interface INTERFACE IMPORTED) + +set_target_properties(aubo_sdk::common_interface PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" +) + +# Create imported target aubo_sdk::robot_proxy +add_library(aubo_sdk::robot_proxy SHARED IMPORTED) + +set_target_properties(aubo_sdk::robot_proxy PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" + INTERFACE_LINK_LIBRARIES "aubo_sdk::aubo_sdk;Qt5::Core" +) + +if(CMAKE_VERSION VERSION_LESS 3.0.0) + message(FATAL_ERROR "This file relies on consumers using CMake 3.0.0 or greater.") +endif() + +# Load information for each installed configuration. +get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +file(GLOB CONFIG_FILES "${_DIR}/aubo_sdkTargets-*.cmake") +foreach(f ${CONFIG_FILES}) + include(${f}) +endforeach() + +# Cleanup temporary variables. +set(_IMPORT_PREFIX) + +# Loop over all imported files and verify that they actually exist +foreach(target ${_IMPORT_CHECK_TARGETS} ) + foreach(file ${_IMPORT_CHECK_FILES_FOR_${target}} ) + if(NOT EXISTS "${file}" ) + message(FATAL_ERROR "The imported target \"${target}\" references the file + \"${file}\" +but this file does not exist. Possible reasons include: +* The file was deleted, renamed, or moved to another location. +* An install or uninstall procedure did not complete successfully. +* The installation package was faulty and contained + \"${CMAKE_CURRENT_LIST_FILE}\" +but not all the files it references. +") + endif() + endforeach() + unset(_IMPORT_CHECK_FILES_FOR_${target}) +endforeach() +unset(_IMPORT_CHECK_TARGETS) + +# This file does not depend on other imported targets which have +# been exported from the same project but in a separate export set. + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) +cmake_policy(POP) diff --git a/third_party/AuboSdk/linux/lib/libaubo_sdk.so b/third_party/AuboSdk/linux/lib/libaubo_sdk.so new file mode 100644 index 00000000..c3f40a8c Binary files /dev/null and b/third_party/AuboSdk/linux/lib/libaubo_sdk.so differ diff --git a/third_party/AuboSdk/linux/lib/libaubo_sdkd.so b/third_party/AuboSdk/linux/lib/libaubo_sdkd.so new file mode 100644 index 00000000..7b171813 Binary files /dev/null and b/third_party/AuboSdk/linux/lib/libaubo_sdkd.so differ diff --git a/third_party/AuboSdk/linux/lib/librobot_proxy.so b/third_party/AuboSdk/linux/lib/librobot_proxy.so new file mode 100644 index 00000000..33c431cb Binary files /dev/null and b/third_party/AuboSdk/linux/lib/librobot_proxy.so differ diff --git a/third_party/AuboSdk/linux/lib/librobot_proxyd.so b/third_party/AuboSdk/linux/lib/librobot_proxyd.so new file mode 100644 index 00000000..091e4105 Binary files /dev/null and b/third_party/AuboSdk/linux/lib/librobot_proxyd.so differ diff --git a/third_party/AuboSdk/linux/lib/libstdc++.so.6 b/third_party/AuboSdk/linux/lib/libstdc++.so.6 new file mode 120000 index 00000000..470f7733 --- /dev/null +++ b/third_party/AuboSdk/linux/lib/libstdc++.so.6 @@ -0,0 +1 @@ +libstdc++.so.6.0.25 \ No newline at end of file diff --git a/third_party/AuboSdk/linux/lib/libstdc++.so.6.0.25 b/third_party/AuboSdk/linux/lib/libstdc++.so.6.0.25 new file mode 100644 index 00000000..c47b099c Binary files /dev/null and b/third_party/AuboSdk/linux/lib/libstdc++.so.6.0.25 differ diff --git a/third_party/AuboSdk/win/include/AuboRobotMetaType.h b/third_party/AuboSdk/win/include/AuboRobotMetaType.h new file mode 100644 index 00000000..8d743817 --- /dev/null +++ b/third_party/AuboSdk/win/include/AuboRobotMetaType.h @@ -0,0 +1,1593 @@ +#ifndef AUBOROBOTMETATYPE_H +#define AUBOROBOTMETATYPE_H + +#include +#include +#include "robotiomatetype.h" + +#if defined(SERVICE_INTERFACE_BUILD_STAGE) // 编译阶段 +#if defined __GNUC__ +#define SERVICE_INTERFACE_ABI_EXPORT __attribute__((visibility("default"))) +#define SERVICE_INTERFACE_ABI_LOCAL __attribute__((visibility("hidden"))) +#else +#define SERVICE_INTERFACE_ABI_EXPORT __declspec(dllexport) +#define SERVICE_INTERFACE_ABI_LOCAL __attribute__((visibility("hidden"))) +#endif +#else // 链接阶段 +#if defined __GNUC__ +#define SERVICE_INTERFACE_ABI_EXPORT +#define SERVICE_INTERFACE_ABI_LOCAL +#else +#define SERVICE_INTERFACE_ABI_EXPORT __declspec(dllimport) +#define SERVICE_INTERFACE_ABI_LOCAL +#endif +#endif + +/** + * General types + */ +typedef uint8_t boolean; +typedef int8_t int8; +typedef int16_t int16; +typedef int32_t int32; +typedef uint8_t uint8; +typedef uint16_t uint16; +typedef uint32_t uint32; +typedef int64_t int64; +typedef uint64_t uint64; +typedef float float32; +typedef double float64; + +#ifdef __GNUC__ +#define PACK(__Declaration__) __Declaration__ __attribute__((__packed__)) +#endif + +#ifdef _MSC_VER +#define PACK(__Declaration__) \ + __pragma(pack(push, 1)) __Declaration__ __pragma(pack(pop)) +#endif +#ifdef __cplusplus +extern "C" { +#endif + +/** + * 命名空间 aubo_robot_namespace + **/ +namespace aubo_robot_namespace { +enum CollisionMode +{ + CollisionMode_Free, + CollisionMode_Stuck, + // CollisionMode_Adamittance, +}; + +enum +{ + ARM_DOF = 6, //机械臂关节数 +}; + +/** + * 机械臂类型 + **/ +typedef enum +{ + ROBOT_I5 = 0, + ROBOT_I7 = 1, + ROBOT_I10_12 = 2, + ROBOT_I3S = 3, + ROBOT_I3 = 4, + ROBOT_I5S = 5, + ROBOT_I5RX = 501, + ROBOT_I5A_02 = 502, + ROBOT_I5A_03 = 503, + ROBOT_I5L = 6, + ROBOT_I10S = 7, + ROBOT_I16 = 8, + ROBOT_I20 = 9, + ROBOT_I20_1500 = 901, + ROBOT_I20_1650_A = 902, + ROBOT_I20TD = 10, + ROBOT_G3 = 11, + ROBOT_G6 = 12, + ROBOT_F12B = 20, + ROBOT_I12 = 21, + ROBOT_I18 = 22, + ROBOT_T6 = 23, + ROBOT_I5_NET = 24, + ROBOT_I20L_1900 = 25, + ROBOT_I10_CM01 = 26, + ROBOT_I20_BZL = 27, + ROBOT_IS10 = 50, + ROBOT_IS20 = 51, + ROBOT_IS7 = 52, + ROBOT_I25 = 53, + ROBOT_I27 = 54, + ROBOT_I35 = 55, + ROBOT_I10_JY = 56, + ROBOT_IS25_1500 = 57, + ROBOT_I10L = 58, + ROBOT_IS20L = 59, + ROBOT_IS20L_T0 = 60, + ROBOT_IS25_1700 = 61, + ROBOT_I3_F = 62, + ROBOT_I5_F = 63, + ROBOT_I7_F = 64, + ROBOT_I10_F = 65, + ROBOT_I12_F = 66, + ROBOT_I16_F = 67, + ROBOT_IS7_F = 68, +} RobotType; + +/** + * DH参数 + **/ +typedef struct +{ + double A3; + double A4; + double D1; + double D2; + double D5; + double D6; + + // general dh model + double alpha[ARM_DOF]; + double a[ARM_DOF]; + double d[ARM_DOF]; + double theta[ARM_DOF]; +} RobotDhPara; + +typedef enum +{ + RobotControllerErr_MotionCfgErr, // only this is recoverable. + RobotControllerErr_OverspeedProtect, + RobotControllerErr_IkFailure, + RobotControllerErr_OnlineTrajErr, + RobotControllerErr_OfflineTrajErr, + RobotControllerErr_StatusException, +} RobotControllerErrorCode; + +typedef enum +{ + RUN_TO_READY_POSITION, + RUN_PROJECT, + PAUSE_PROJECT, + CONTINUE_PROJECT, + SLOWLY_STOP_PROJECT, + LOAD_PROJECT, + ENTER_SAFEGUARD_MODE_BY_DI_EXTERNAL_SAFEGUARD_STOP, + RELEASE_SAFEGUARD_MODE_IN_AUTOMATIC_MODE, + RELEASE_SAFEGUARD_MODE_IN_MANUAL_MODE, + MANUALLY_RELEASE_SAFEGUARD_MODE_PROMPT, + ENTER_SAFEGUARD_MODE_BY_TRI_STATE_SWITCH, + RELEASE_SAFEGUARD_MODE_BY_TRI_STATE_SWITCH, + ENTER_REDUCE_MODE, + RELEASE_REDUCE_MODE, + REMOTE_CLEAR_ALARM_SIGNAL, + PROJECT_STARTUP_IS_SAFETY, + START_RUN_TO_READY_POSITION, + STOP_RUN_TO_READY_POSITION +} InterfaceBoardSafeIoEventCode; + +/** + * 机械臂诊断信息 + **/ +PACK(struct RobotDiagnosis { + uint8 + armCanbusStatus; // CAN通信状态:0x01~0x80:关节CAN通信错误(每个关节占用1bit) + // 0x00:无错误 + float armPowerCurrent; // 机械臂48V电源当前电流 + float armPowerVoltage; // 机械臂48V电源当前电压 + bool armPowerStatus; // 机械臂48V电源状态(开、关) + char contorllerTemp; // 控制箱温度 + uint8 contorllerHumidity; // 控制箱湿度 + bool remoteHalt; // 远程关机信号 + bool softEmergency; // 机械臂软急停 + bool remoteEmergency; // 远程急停信号 + bool robotCollision; // 碰撞检测位 + bool forceControlMode; // 机械臂进入力控模式标志位 + bool brakeStuats; // 刹车状态 + float robotEndSpeed; // 末端速度 + int robotMaxAcc; // 最大加速度 + bool orpeStatus; // 上位机软件状态位 + bool enableReadPose; // 位姿读取使能位 + bool robotMountingPoseChanged; // 安装位置状态 + bool encoderErrorStatus; // 磁编码器错误状态 + bool staticCollisionDetect; // 静止碰撞检测开关 + uint8 jointCollisionDetect; // 关节碰撞检测 每个关节占用1bit 0-无碰撞 + // 1-存在碰撞 + bool encoderLinesError; // 光电编码器不一致错误 0-无错误 1-有错误 + bool jointErrorStatus; // joint error status + bool singularityOverSpeedAlarm; // 机械臂奇异点过速警告 + bool robotCurrentAlarm; // 机械臂电流错误警告 + uint8 toolIoError; // tool error + bool robotMountingPoseWarning; // 机械臂安装位置错位(只在力控模式下起作用) + uint16 macTargetPosBufferSize; // mac缓冲器长度 预留 + uint16 macTargetPosDataSize; // mac缓冲器有效数据长度 预留 + uint8 macDataInterruptWarning; // mac数据中断 预留 + uint8 controlBoardAbnormalStateFlag; //主控板(接口板)异常状态标志 +}); + +PACK(struct OrpeSafetyStatus { + uint8 orpePause; // 上位机暂停状态 + uint8 orpeStop; // 上位机停止状态 + uint8 orpeError[16]; // 上位机错误 + uint8 systemEmergencyStop; // 解除系统紧急停止输出信号 + uint8 reducedModeError; // 解除缩减错误 + uint8 safetyguardResetSucc; // 防护重置成功 +}); + +PACK(struct RobotSafetyConfig { + uint16 robotReducedConfigJointSpeed[6]; //缩减配置 关节速度限制 + uint32 robotReducedConfigTcpSpeed; //缩减配置 TCP速度限制 + uint32 robotReducedConfigTcpForce; //缩减配置 TCP力(暂定为碰撞等级) + uint32 robotReducedConfigMomentum; //缩减配置 动量 + uint32 robotReducedConfigPower; //缩减配置 功率 + uint8 robotSafeguradResetConfig; //防护重 置设置 + uint8 robotOperationalModeConfig; //操作模式设置 +}); + +PACK(struct RegulateSpeedModeParamConfig_t { + double maxTcpVelocity; //末端速度 + double maxTcpAcceleration; //末端加速度 + double maxJointVelocity[ARM_DOF]; //关节速度 + double maxJointAcceleration[ARM_DOF]; //关节加速度 +}); + +PACK(struct AdmittancePatam_t { + double inertia[ARM_DOF]; //导纳系数之 惯量inertia + double damping[ARM_DOF]; //导纳系数之 阻尼(b)damping + double stiffness[ARM_DOF]; //导纳系数之 刚度(k)stiffness +}); + +/** + * @brief IO的类型枚举 + * + **/ +typedef enum +{ + RobotBoardControllerDI, // 接口板控制器DI(数字量输入)   只读(一般系统内部使用) + RobotBoardControllerDO, // 接口板控制器DO(数字量输出) 只读(一般系统内部使用) + RobotBoardControllerAI, // 接口板控制器AI(模拟量输入) + // 只读(一般系统内部使用) + RobotBoardControllerAO, // 接口板控制器AO(模拟量输出)   只读(一般系统内部使用) + + RobotBoardUserDI, // 接口板用户DI(数字量输入)   可读可写 + RobotBoardUserDO, // 接口板用户DO(数字量输出) 可读可写 + RobotBoardUserAI, // 接口板用户AI(模拟量输入) 可读可写 + RobotBoardUserAO, // 接口板用户AO(模拟量输出) 可读可写 + + RobotToolDI, // 工具端DI + RobotToolDO, // 工具端DO + RobotToolAI, // 工具端AI + RobotToolAO, // 工具端AO + +} RobotIoType; + +/** + * IO类型 + **/ +typedef enum +{ + IO_IN = 0, //输入 + IO_OUT //输出 +} ToolIOType; + +/** + * 工具的电源类型 + **/ +typedef enum +{ + OUT_0V = 0, + OUT_12V = 1, + OUT_24V = 2 +} ToolPowerType; + +typedef enum +{ + RobotToolIoTypeDI = RobotToolDI, //工具端DI + RobotToolIoTypeDO = RobotToolDO //工具端DO +} RobotToolIoType; + +typedef enum //IO状态 +{ + IO_STATUS_INVALID = 0, //有效 + IO_STATUS_VALID //无效 +} IO_STATUS; + +typedef enum +{ + TOOL_DIGITAL_IO_0 = 0, + TOOL_DIGITAL_IO_1 = 1, + TOOL_DIGITAL_IO_2 = 2, + TOOL_DIGITAL_IO_3 = 3 + +} ToolDigitalIOAddr; + +/** + * 综合描述一个IO + **/ +PACK(struct RobotIoDesc { + char ioId[32]; // IO-ID 目前未使用 + RobotIoType ioType; // IO类型 + char ioName[32]; // IO名称 + int ioAddr; // IO地址 + double ioValue; // IO状态 +}); + +//接口板数字量数据 +typedef struct +{ + uint8 addr; + uint8 value; + uint8 type; +} RobotDiagnosisIODesc; + +//接口板模拟量数据 +typedef struct +{ + uint8 addr; + float value; + uint8 type; +} RobotAnalogIODesc; + +PACK(struct ToolDigitalStatus { + ToolIOType ioType; + uint8 ioData; +}); + +typedef enum +{ + RobotToolNoError = 0, //无错误 + RobotToolOverVoltage = 1, //过压 + RobotToolUnderVoltage = 2, //欠压 + RobotToolOVerTemp = 3, //过温 + RobotToolCanBusError = 4 // CAN总线错误 +} RobotToolErrorCode; + +/** + * @brief 机械臂启动完成状态 + */ +enum ROBOT_SERVICE_STATE +{ + ROBOT_SERVICE_READY = 0, + ROBOT_SERVICE_STARTING, + ROBOT_SERVICE_WORKING, + ROBOT_SERVICE_CLOSING, + ROBOT_SERVICE_CLOSED, + ROBOT_SETVICE_FAULT_POWER, + ROBOT_SETVICE_FAULT_BRAKE, + ROBOT_SETVICE_FAULT_NO_ROBOT, + ROBOT_SETVICE_FAULT_SAFEGUARD_STOP +}; + +enum ROBOT_INIT_PHASE +{ + ROBOT_INIT_PHASE_READY = 0, + ROBOT_INIT_PHASE_HANDSHAKE, + ROBOT_INIT_PHASE_SET_POWER, + ROBOT_INIT_PHASE_SET_BRAKE, + ROBOT_INIT_PHASE_SET_COLLSION_CLASS, + ROBOT_INIT_PHASE_SET_OTHER_CMD, + ROBOT_INIT_PHASE_WORKING +}; + +typedef enum +{ + RobotModeSimulator, // 机械臂仿真模式 + RobotModeReal // 机械臂真实模式 +} RobotWorkMode; + +/** + * @brief 机械臂运动控制命令 + */ +typedef enum +{ + RobotMoveStop = 0, // 停止 + RobotMovePause = 1, // 暂停 + RobotMoveContinue = 2, // 继续 +} RobotMoveControlCommand; + +/** + * @brief 机械臂控制命令 + */ +enum RobotControlCommand +{ + RobotRelease = 0, // 释放刹车 + RobotBrake = 1, // 刹车 + OverspeedWarning = 2, // 拖动示教速度过快报警 + OverspeedRecover = 3, // 解除拖动过速报警 + DisableForceControl = 4, // 失能力控 + EnableForceControl = 5, // 使能力控 + OrpeOpen = 6, // 打开上位机软件 + OrpeClose = 7, // 关闭上位机软件 + EnableReadPose = 8, // 打开读取位姿 + DisableReadPose = 9, // 关闭读取位姿 + MountingPoseChanged = 10, // 安装位置已改变 + MountingPoseUnChanged = 11, // 安装位置未改变 + EnableStaticCollisionDetect = 12, // 打开静止碰撞检测 + DisableStaticCollisionDetect = 13, // 关闭静止碰撞检测 + ClearSingularityOverSpeedAlarm = 14, // 解除机械臂奇异点过速警告 + ClearRobotCurrentAlarm = 15, // 解除机械臂电流错误警告 + + // 适配新 aubope sdk 部分枚举,用于实现加油机器人需求 + EnterDragAndTeachMode = 0x15, //进入拖动示教模式 + ExitDragAndTeachMode = 0x16, //退出拖动示教模式 + RobotShutdown = 0x24, //上位机指令控制机械臂一类停机,并上传错误 + ClearRobotShutdown = 0x25, //清除上位机一类停机标志 + EnableCollisionStuckBrake = 0x28, //使能碰撞stuck模式锁刹车 + DisableCollisionStuckBrake = 0x29, //失能能碰撞stuck模式锁刹车 +}; + +/** + * @brief 位置信息 + **/ +struct Pos +{ + double x; + double y; + double z; +}; + +/** + * @brief 位置信息的共用体描述 + **/ +union cartesianPos_U +{ + Pos position; + double positionVector[3]; +}; + +/** + * @brief 姿态的四元素表示方法 + **/ +struct Ori +{ + double w; + double x; + double y; + double z; +}; + +/** + * @brief 姿态的欧拉角表示方法 + **/ +struct Rpy +{ + double rx; + double ry; + double rz; +}; + +typedef struct +{ + double jointPos[ARM_DOF]; +} JointParam; + +/** + * @brief 描述关节的速度和加速度 + */ +typedef struct +{ + double jointPara[ARM_DOF]; +} JointVelcAccParam; + +/** + * 关节碰撞补偿(范围0.00~0.51度) + **/ +typedef struct +{ + double jointOffset[ARM_DOF]; +} RobotJointOffset; + +/** + * @brief 机械臂的路点信息 + **/ +typedef struct +{ + cartesianPos_U cartPos; // 机械臂的位置信息(x,y,z) + Ori orientation; // 机械臂姿态信息,四元素(w,x,y,z) + double jointpos[ARM_DOF]; // 机械臂关节角信息 + int id; // 路点ID +} wayPoint_S; + +typedef struct +{ + cartesianPos_U cartPos; + Ori orientation; + double jointpos[ARM_DOF]; +} RoadPoint; + +typedef struct +{ + double data[6]; +} ForceSensorData; + +typedef struct +{ + Pos position; + Ori quaternion; +} PositionAndQuaternion; + +/** + * @brief 描述运动属性中的偏移属性 + */ +typedef struct +{ + bool ena; // 是否使能偏移 + float relativePosition[3]; // 偏移量 x,y,z + Ori relativeOri; // 姿态偏移 +} MoveRelative; + +typedef struct +{ + double minValue; + double maxValue; +} RangeOfMotion; + +/** + * 关节运动范围 + */ + +typedef struct +{ + bool enable; // 是否使能偏移 + RangeOfMotion rangeValues[ARM_DOF]; //运动范围 +} JointRangeOfMotion; + +/** + * @brief 示教模式枚举 + **/ +enum teach_mode +{ + NO_TEACH = 0, + JOINT1, + JOINT2, + JOINT3, + JOINT4, + JOINT5, + JOINT6, + MOV_X, + MOV_Y, + MOV_Z, + ROT_X, + ROT_Y, + ROT_Z +}; + +/** + * @brief 运动轨迹枚举 + **/ +enum move_track +{ + NO_TRACK = 0, + + // for moveJ and moveL + TRACKING, + + // cartesian motion for moveP + ARC_CIR, + CARTESIAN_MOVEP, + CARTESIAN_CUBICSPLINE, + CARTESIAN_UBSPLINEINTP, + CARTESIAN_GNUBSPLINEINTP, + CARTESIAN_LOOKAHEAD, + + // joint motion for moveP + JIONT_CUBICSPLINE, + JOINT_UBSPLINEINTP, + JOINT_GNUBSPLINEINTP, + + ARC, + CIRCLE, + ARC_ORI_ROTATED, + CIRCLE_ORI_ROTATED, + + ORI_POSITION_ROTATE_CIRCUMFERENCE = 101, +}; + +/** + * @brief 工具姿态标定的方法枚举 + * + */ + +enum ToolKinematicsOriCalibrateMathod +{ + ToolKinematicsOriCalibrateMathod_Invalid = -1, + ToolKinematicsOriCalibrateMathod_xOxy, // 原点、x轴正半轴、x、y轴平面的第一象限上任意一点 + ToolKinematicsOriCalibrateMathod_yOyz, // 原点、y轴正半轴、y、z轴平面的第一象限上任意一点 + ToolKinematicsOriCalibrateMathod_zOzx, // 原点、z轴正半轴、z、x轴平面的第一象限上任意一点 + ToolKinematicsOriCalibrateMathod_TxRBz_TxyPBzAndTyABnz, // 工具x轴平行反向于基坐标系z轴; + // 工具xOy平面平行于基坐标系z轴、工具y轴与基坐标系负z轴夹角为锐角 + ToolKinematicsOriCalibrateMathod_TyRBz_TyzPBzAndTzABnz, // 工具y轴平行反向于基坐标系z轴; + // 工具yOz平面平行于基坐标系z轴、工具z轴与基坐标系负z轴夹角为锐角 + ToolKinematicsOriCalibrateMathod_TzRBz_TzxPBzAndTxABnz, // 工具z轴平行反向于基坐标系z轴; + // 工具zOx平面平行于基坐标系z轴、工具x轴与基坐标系负z轴夹角为锐角 + ToolKinematicsOriCalibrateMathodCount +}; + +/** + * 该结构体描述工具惯量 + * + * 注:该结构体属于冗余数据类型,使用时把所有参数都设置为{0,0,0,0,0,0}. + **/ +typedef struct +{ + double xx; + double xy; + double xz; + double yy; + double yz; + double zz; +} ToolInertia; + +/** + * 工具动力学参数描述 + * + * 注意: + *    机械臂上电之前,安装在机器人末端的工具发生改变时都需要重新设置工具的动力学参数. + *    一般情况下,工具的动力学参数和运动学参数是需要一起设置的; + * 切记: + *    该参数如果不能正确设置会影响机械臂的安全等级和运动轨迹. + **/ +typedef struct +{ + double positionX; // 工具重心的X坐标 + double positionY; // 工具重心的Y坐标 + double positionZ; // 工具重心的Z坐标 + double payload; // 工具重量 + ToolInertia toolInertia; // 工具惯量 预留 使用是全部设置为0 +} ToolDynamicsParam; + +/** 工具描述 工具的运动学参数 + * + * 该工具用于描述一个工具或者工具的运动学参数. + */ +typedef struct +{ + Pos toolInEndPosition; // 工具相对法兰盘的位置 + Ori toolInEndOrientation; // 工具相对法兰盘的姿态 +} ToolInEndDesc; + +typedef ToolInEndDesc ToolKinematicsParam; +typedef ToolInEndDesc RobotCameraCalib; + +/** + * 焊接摇摆结构体 + */ +typedef struct +{ + bool weaveEnable; + int weaveType; + double weaveStep; + double weaveAmplitude; + double weaveHoldDistance; + double weaveAngle; +} WeaveMove; + +PACK(struct RobotRecongnitionParam { + uint8 type; //机械臂辨识参数类型 + uint8 length; //参数数据长度 + uint8 data[256]; //参数实际数据 +}); + +/** + * 坐标系类型枚举 + **/ +enum coordinate_refer +{ + BaseCoordinate = 0, // 基座坐标系 + EndCoordinate, // 末端坐标系或工具坐标系 + WorldCoordinate, // 用户坐标系 +}; + +/** + * 用户坐标系标定方法枚举 + * + * 描述:3点标定坐标系 3个示教点的含义. + **/ +enum CoordCalibrateMathod +{ + Origin_AnyPointOnPositiveXAxis_AnyPointOnPositiveYAxis, // 原点、x轴正半轴、y轴正半轴 + Origin_AnyPointOnPositiveYAxis_AnyPointOnPositiveZAxis, // 原点、y轴正半轴、z轴正半轴 + Origin_AnyPointOnPositiveZAxis_AnyPointOnPositiveXAxis, // 原点、z轴正半轴、x轴正半轴 + Origin_AnyPointOnPositiveXAxis_AnyPointOnFirstQuadrantOfXOYPlane, // 原点、x轴正半轴、x、y轴平面的第一象限上任意一点 + Origin_AnyPointOnPositiveXAxis_AnyPointOnFirstQuadrantOfXOZPlane, // 原点、x轴正半轴、x、z轴平面的第一象限上任意一点 + Origin_AnyPointOnPositiveYAxis_AnyPointOnFirstQuadrantOfYOZPlane, // 原点、y轴正半轴、y、z轴平面的第一象限上任意一点 + Origin_AnyPointOnPositiveYAxis_AnyPointOnFirstQuadrantOfYOXPlane, // 原点、y轴正半轴、y、x轴平面的第一象限上任意一点 + Origin_AnyPointOnPositiveZAxis_AnyPointOnFirstQuadrantOfZOXPlane, // 原点、z轴正半轴、z、x轴平面的第一象限上任意一点 + Origin_AnyPointOnPositiveZAxis_AnyPointOnFirstQuadrantOfZOYPlane, // 原点、z轴正半轴、z、y轴平面的第一象限上任意一点 + + CoordTypeCount, +}; + +/** + * 坐标系描述 + * + * 该结构体描述一个坐标系。系统通过该结构体描述一个坐标系(基座坐标系, + *用户坐标系, 末端坐标系或工具坐标系)。 + * + * 坐标系分3种类型: 基座坐标系(BaseCoordinate); + * 用户坐标系(WorldCoordinate); + * 末端坐标系或工具坐标系(EndCoordinate); + * + * 定义: + * 基座坐标系 是 根据机械臂基座建立的坐标系; + * 用户坐标系 是 + *用户坐标系定义在工件上,在机器人动作允许范围内的任意位置,设定任意角度的X、Y、Z轴,原点位于机器人抓取的工件上,坐标系的方向根据客户需要任意定义。 + * 末端坐标系 + *是 安装在机器人末端的工具坐标系,原点及方向都是随着末端位置与角度不断变化的,该座标系实际是将基础座标系通过旋转及位移变化而来的;法兰盘是一个特殊的末端坐标系. + * + * 结构体参数描述: + * coordType     坐标系类型,描述坐标系属于那种类型 + *    methods + *    用户坐标系的标定方法     仅在coordType为用户坐标系(WorldCoordinate)时有效; + *    wayPointArray[3]  标定用户坐标系的3个路点信息 仅在coordType为用户坐标系(WorldCoordinate)时有效; + *    toolDesc       末端工具描述   当coordType=WorldCoordinate 表示标定用户坐标系时,安装在机器人末端的工具; + * 当coordType=EndCoordinate + *描述是哪个工具的坐标系 + * + * 使用说明: + * 基座坐标系 + * coordType=BaseCoordinate + *         其他参数默认 + * 用户坐标系 + * coordType=WorldCoordinate + *         methods        为标定方法 + *         wayPointArray[3]   标定坐标系的3个路点 + *         toolDesc        标定用户坐标系时,安装在机器人末端的工具 + *    末端坐标系或工具坐标系 + * coordType=EndCoordinate + *         methods        缺省,不需要设置 + *         wayPointArray[3]   缺省,不需要设置 + *         toolDesc        机器人末端的工具 + * + * 备注: + *   法兰盘为特殊的工具,工具描述中的位置设置为(0,0,0),姿态信息设置为(1,0,0,0) + *    其结构体定义为 + * { + * pos{0,0,0}, + * Ori{1,0,0,0} + * } //伪代码 + * + * 该结构同时用于用户坐标系的标定.一般通过示教3个示教点实现,第一个示教点是用户坐标系的原点;第二个和第三个示教点的选择根据标定方法来确定,遵循右手手法. + */ +typedef struct +{ + coordinate_refer coordType; // 坐标系类型 + CoordCalibrateMathod methods; // 用户坐标系的标定方法 + JointParam wayPointArray[3]; // 用于标定用户坐标系的3个点(关节角) + ToolInEndDesc toolDesc; // 工具描述 +} CoordCalibrateByJointAngleAndTool; + +typedef struct +{ + //用于位置标定点的数量 + int posCalibrateNum; + //位置标定点 + wayPoint_S posCalibrateWaypoint[4]; + //用于姿态标定点的数量 + int oriCalibrateNum; + //姿态标定点 + wayPoint_S oriCalibrateWaypoint[3]; + //姿态标定方法 + ToolKinematicsOriCalibrateMathod CalibrateMathod; +} ToolCalibrate; + +PACK(struct MoveProfile_t { + double jointMaxAcc[ARM_DOF]; //关节型运动的最大加速度 + double jointMaxVelc[ARM_DOF]; //关节型运动的最大速度 + double endMaxLineAcc; //末端型运动的最大加速度 + double endMaxLineVelc; //末端型运动的最大速度 + + MoveRelative relative; //偏移参数 + CoordCalibrateByJointAngleAndTool relativeOnCoord; //偏移量基于那个坐标系 + + double blendRadius; //交融半径 + ToolInEndDesc toolInEndDesc; //工具属性 +}); + +/** + * @brief 机械臂状态枚举 + **/ +enum RobotState +{ + RobotStopped = 0, //停止 + RobotRunning, //运行 + RobotPaused, //暂停 + RobotResumed //恢复 +}; + +/** + * 机械臂重力分量x y z + **/ +typedef struct +{ + float x; + float y; + float z; +} RobotGravityComponent; + +/** + * 机械臂关节版本信息 + **/ +PACK(struct JointVersion { + char hw_version[8]; //硬件版本信息 + char sw_version[16]; //固件版本信息 +}); + +/** + * 关节ID信息 + **/ +PACK(struct JointProductID { char productID[16]; }); + +/** + * 该结构体描述设备信息 + **/ +PACK(struct RobotDevInfo { + uint8 type; // 设备型号、芯片型号:上位机主站:0x01 接口板0x02 + char revision[16]; // 设备版本号,eg:V1.0 + char manu_id[16]; // 厂家ID,"OUR "的ASCII码0x4F 55 52 00 + char joint_type[16]; // 机械臂类型 + JointVersion joint_ver[8]; // 机械臂关节及工具端信息 + char desc[64]; // 设备描述字符串以0x00结束 + JointProductID jointProductID[8]; // 关节ID信息 + char slave_version[16]; // 从设备版本号 - 字符串表示,如“V1.0.0 + char extio_version[16]; // IO扩展板版本号 -字符串标志,如“V1.0.0 +}); + +typedef struct PACKED +{ + uint8 io_modes; // PNP:0; NPN:1 + + uint64_t di_num; + + uint64_t do_num; + + uint64_t ai_num; + + uint64_t ao_num; + +} IoConfig; + +/** + * 描述机械臂的关节状态 + */ +PACK(struct JointStatus { + int jointCurrentI; // 关节电流 Current of driver + int jointSpeedMoto; // 关节速度 Speed of driver + float jointPosJ; // 关节角 Current position in radian + float jointCurVol; // 关节电压 Rated voltage of motor. Unit: mV + float jointCurTemp; // 当前温度 Current temprature of joint + int jointTagCurrentI; // 电机目标电流 Target current of motor + float jointTagSpeedMoto; // 电机目标速度 Target speed of motor + float jointTagPosJ; // 目标关节角  Target position of joint in radian + uint16 jointErrorNum; // 关节错误码 Joint error of joint num +}); + +PACK(struct JointCommonData { + uint16 JointCurVol; /*!< 关节当前电压 */ + uint16 JointCurTemp; /*!< 关节当前温度*/ + uint16 JointWorkMode; /*!< 关节工作模式 */ + uint16 JointDriEnable; /*!< 关节驱动器使能标志 */ + uint16 JointOpenPwm; /*!< 关节开环占空比 */ + int32_t JointTagCurrent; /*!< 关节当前的目标电流 */ + int32_t JointTagSpeed; /*!< 关节当前的目标速度 */ + int32_t JointTagPos; /*!< 关节当前的目标位置 */ + + uint16 JointMaxCur; /*!< 关节当前的最大电流 */ + uint16 JointMaxSpeed; /*!< 关节当前的最大速度 */ + uint16 JointMaxAcc; /*!< 关节当前的最大加速度 */ + int32_t JointMINPos; /*!< 关节最小位置 */ + int32_t JointMAXPos; /*!< 关节最大位置 */ + + uint16 JointSEVLock; /*!< 关节三环参数锁定标志 */ + uint16 JointCurP; /*!< 关节电流P参数 */ + uint16 JointCurI; /*!< 关节电流I参数 */ + uint16 JointCurD; /*!< 关节电流D参数 */ + uint16 JointSpeedP; /*!< 关节速度P参数 */ + uint16 JointSpeedI; /*!< 关节速度I参数 */ + uint16 JointSpeedD; /*!< 关节速度D参数 */ + uint16 JointSpeedDS; /*!< 关节速度死区 */ + uint16 JointPosP; /*!< 关节位置P参数 */ + uint16 JointPosI; /*!< 关节位置I参数 */ + uint16 JointPosD; /*!< 关节位置D参数 */ + uint16 JointPosDS; /*!< 关节位置DS参数 */ +}); + +/** + * @brief 离线轨迹相关枚举 + */ +enum Robot_Dyn_identify_traj +{ + Dyn_identify_traj_none = 0, + Dyn_identify_traj_robot, // submode: 0/1 <-> internal/hybrid + Dyn_identify_traj_tool, // submode: 0/1 <-> tool only/tool+friction + Dyn_identify_traj_tool_abort +}; + +/** + * @brief 接口板固件升级枚举 + */ +typedef enum +{ + update_master_board_firmware_trans_start = 1, + update_master_board_firmware_trans_data = 2, + update_master_board_firmware_trans_end = 3, + update_slave_board_firmware_trans_start = 4, + update_slave_board_firmware_trans_data = 5, + update_slave_board_firmware_trans_end = 6 +} update_board_firmware_cmd; + +typedef struct +{ + bool trackEnable; // T + wayPoint_S currentRoadPoint; // R + wayPoint_S nextRoadPoint; // R + int timeInterval; // T + double currentPosError[3]; // T + double maxVel; // T + double maxAcc; // T + bool paraChanged; // RT +} SeamTracking; + +PACK(struct RobotArmParamHeader { + uint16 cmd; //请求指令 0x01-读 0x02-写 + uint16 baseDataLen; //基座信息长度 + uint16 jointDataLen; //关节信息长度 +}); + +//位置姿态类型枚举 +typedef enum +{ + POSITION_MM_AND_RPY_ANGLE_SPACE_SPLIT = + 1, //位置(单位:毫米)+ 姿态(欧拉角 单位:角度制) 空格分割 + POSITION_M_AND_QUATERNION_COMMA_SPLIT = + 10, //位置(单位:米) + 姿态(四元素) 逗号分割 +} POSITION_ORIENTATION_TYPE; + +PACK(struct RobotArmParam { + RobotArmParamHeader header; + uint8 base[382]; //底座参数数据 //RobotBaseParameters + uint8 joints[512]; //关键参数数据 //RobotJointsParameter +}); + +PACK(struct RobotInfo { + uint16 robot_type; // robot type + uint16 auth_type; // auth type + uint32 robot_expire; // robot expire + uint8 reserve[12]; // reserve + uint32 robot_duration; // robot duration + uint32 joint_duration[6]; // joint duration +}); + +PACK(struct RobotDynamicsParameters { + double K[6]; // motor torque constant + double IA[4]; // rotor inertia + double M[1]; // link mass + double MXYZ[13]; // center of mass + double IXYZ[28]; // Inertia parameter + double CB[6]; // current bias +}); + +PACK(struct RobotHandguidingParameters { + double FP[6]; // friction compensation percent + double FD[6]; // damp coefficient + double FK[6]; // stiffness coefficient + double FM[6]; // mass coefficient + double pos_limit[6]; // position limit + double velocity_limit[6]; // velocity limit + double acceleration_limit[6]; // acceleration limit +}); + +PACK(struct RobotKinematicsParameters { + double da[6]; // compensation a + double dd[6]; // compensation d + double dalpha[6]; // compensation alpha + double dbeta[6]; // compensation beta + double dratio[6]; // compensation ratio + double dtheta[6]; // compensation theta +}); + +PACK(struct RobotFrictionParameters { + uint16 FL[6]; // load friction compensation + uint16 FR[6]; // reserved friction compensation + int16 tmp_a[6]; // tmp_coefficient_a + uint16 tmp_b[6]; // tmp_coefficient_b + int16 posvel_a1[6]; // positive_vel_a1 + uint16 posvel_b1[6]; // positive_vel_b1 + int16 posvel_a2[6]; // positive_vel_a2 + uint16 posvel_b2[6]; // positive_vel_b2 + uint16 posvel_c2[6]; // positive_vel_c2 + int16 negvel_a1[6]; // negative_vel_a1 + int16 negvel_b1[6]; // negative_vel_b1 + uint16 negvel_a2[6]; // negative_vel_a2 + uint16 negvel_b2[6]; // negative_vel_b2 + int16 negvel_c2[6]; // negative_vel_c2 +}); + +PACK(struct RobotBaseParameters { + RobotInfo info; + RobotDynamicsParameters dynamicParam; + RobotHandguidingParameters handguidingParam; + RobotKinematicsParameters kinematicsParam; +}); + +PACK(struct RobotJointsParameter { RobotFrictionParameters frictionParam; }); + +typedef enum +{ + LL_INFO = 0, + LL_DEBUG, + LL_WARN, + LL_ERROR, + LL_FATAL +} LOG_LEVEL; + +/** + * 描述机械臂事件类型   event define + * + * 机械臂的很多信息(故障,通知)是通过事件通知到客户的,所有在使用SDK时, + * 务必注册接收事件的回调函数。 + */ +typedef enum +{ + RobotEvent_armCanbusError, //机械臂CAN总线错误 已过时,不建议使用 + RobotEvent_remoteHalt, //远程关机 + RobotEvent_remoteEmergencyStop, //机械臂远程急停 + RobotEvent_jointError, //关节错误 PS:已过时,不建议使用 + RobotEvent_forceControl, //力控制 + RobotEvent_exitForceControl, //退出力控制 + RobotEvent_softEmergency, //软急停 + RobotEvent_exitSoftEmergency, //退出软急停 + RobotEvent_collision, //碰撞 + //已过时,不建议使用 已用RobotEventJointCollision(2123) + //替代 + RobotEvent_collisionStatusChanged, //碰撞状态改变 + //已过时,不建议使用 已用RobotEventJointCollision(2123) + //替代 + RobotEvent_tcpParametersSucc, //工具动力学参数设置成功 + //系统事件,用户可以忽略 + RobotEvent_powerChanged, //机械臂电源开关状态改变 + RobotEvent_ArmPowerOff, //机械臂电源关闭 + //不建议使用  已用RobotEventArmPowerOff(2600) 替代 + RobotEvent_mountingPoseChanged, //安装位置发生改变 + RobotEvent_encoderError, //编码器错误 不建议使用 + + RobotEvent_encoderLinesError, //编码器线数不一致 + //不建议使用  已用RobotEventEncoderLineError(2203)替代 + RobotEvent_singularityOverspeed, //奇异点超速 + RobotEvent_currentAlarm, //机械臂电流异常 + RobotEvent_toolioError, //机械臂工具端错误 + RobotEvent_robotStartupPhase, //机械臂启动阶段 系统事件,用户可以忽略 + RobotEvent_robotStartupDoneResult, //机械臂启动完成结果 + //系统事件,用户可以忽略 + RobotEvent_robotShutdownDone, //机械臂关机结果 系统事件,用户可以忽略 + RobotEvent_atTrackTargetPos, //机械臂轨迹运动到位信号通知 + //系统事件,用户可以忽略 + + RobotSetPowerOnDone, //设置电源状态完成 + RobotReleaseBrakeDone, //机械臂刹车释放完成 系统事件,用户可以忽略 + RobotEvent_robotControllerStateChaned, //机械臂控制状态改变 + //系统事件,用户可以忽略 + RobotEvent_robotControllerError, //机械臂控制错误----一般是算法规划出现问题时返回 + RobotEvent_socketDisconnected, // socket断开连接 + + RobotEvent_robotControlException, + RobotEvent_trackPlayInterrupte, + + RobotEvent_staticCollisionStatusChanged, //不建议使用 已过时 + RobotEvent_MountingPoseWarning, + + RobotEvent_MacDataInterruptWarning, + RobotEvent_ToolIoError, // + RobotEvent_InterfacBoardSafeIoEvent, //安全IO通知型事件 + + RobotEvent_RobotHandShakeSucc, //系统事件,用户可以忽略 + RobotEvent_RobotHandShakeFailed, //系统事件,用户可以忽略 + + RobotEvent_RobotErrorInfoNotify, //不建议使用 已过时 + + RobotEvent_InterfacBoardDIChanged, //通知型事件 DI状态改变 + RobotEvent_InterfacBoardDOChanged, //通知型事件 DO状态改变 + RobotEvent_InterfacBoardAIChanged, //通知型事件 AI状态改变 + RobotEvent_InterfacBoardAOChanged, //通知型事件 AO状态改变 + + RobotEvent_UpdateJoint6Rot360Flag, //系统事件,用户可以忽略 + + RobotEvent_RobotMoveControlDone, //系统事件,用户可以忽略 + RobotEvent_RobotMoveControlStopDone, //系统事件,用户可以忽略 + RobotEvent_RobotMoveControlPauseDone, //系统事件,用户可以忽略 + RobotEvent_RobotMoveControlContinueDone, //系统事件,用户可以忽略 + + //主从模式切换 + RobotEvent_RobotSwitchToOnlineMaster, //通知型事件 进入联动主模式 + RobotEvent_RobotSwitchToOnlineSlave, //通知型事件 进入联动从模式 + + RobotEvent_ConveyorTrackRobotStartup, //系统事件,用户可以忽略 + RobotEvent_ConveyorTrackRobotCatchup, //系统事件,用户可以忽略 + + RobotEvent_exceptEvent = 100, + + RobotEventInvalid = 1000, // 无效的事件 + + /** + * RobotControllerErrorEvent 控制器异常事件 1001~1499 + * + * 事件处理建议 + * 建议采取措施:停止当前运动 + * + * PS: 这些事件会引起机械臂运动的错误返回 + * 使用时尽量用枚举变量  枚举变量值只是为了查看日志方便 + * + **/ + RobotEventMoveJConfigError = + 1001, // moveJ configuration error 关节运动属性配置错误 + RobotEventMoveLConfigError = + 1002, // moveL configuration error 直线运动属性配置错误 + RobotEventMovePConfigError = + 1003, // moveP configuration error 轨迹运动属性配置错误 + RobotEventInvailConfigError = + 1004, // invail configuration 无效的运动属性配置 + RobotEventWaitRobotStopped = + 1005, // please wait robot stopped 等待机器人停止 + RobotEventJointOutRange = 1006, // joint out of range 超出关节运动范围 + RobotEventFirstWaypointSetError = + 1007, // please set first waypoint correctly in modep + // 请正确设置MODEP第一个路点 + RobotEventConveyorTrackConfigError = + 1008, // configuration error for conveyor tracking 传送带跟踪配置错误 + RobotEventConveyorTrackTrajectoryTypeError = + 1009, // unsupported conveyor tracking trajectory type + // 传送带轨迹类型错误 + RobotEventRelativeTransformIKFailed = + 1010, // inverse kinematics failure due to invalid relative transform + // 相对坐标变换逆解失败 + RobotEventTeachModeCollision = + 1011, // collision in teach-mode 示教模式发生碰撞 + RobotEventextErnalToolConfigError = + 1012, // configuration error for external tool and hand workobject + // 运动属性配置错误,外部工具或手持工件配置错误 + + RobotEventTrajectoryAbnormal = 1101, // Trajectory is abnormal 轨迹异常 + RobotEventOnlineTrajectoryPlanError = + 1102, // Trajectory is abnormal,online planning failed 轨迹规划错误 + RobotEventOnlineTrajectoryTypeIIError = + 1103, // Trajectory is abnormal,type II online planning failed + // 二型在线轨迹规划失败 + RobotEventIKFailed = + 1104, // Trajectory is abnormal,inverse kinematics failed 逆解失败 + RobotEventAbnormalLimitProtect = + 1105, // Trajectory is abnormal,abnormal limit protection 动力学限制保护 + RobotEventConveyorTrackingFailed = + 1106, // Trajectory is abnormal,conveyor tracking failed 传送带跟踪失败 + RobotEventConveyorOutWorkingRange = + 1107, // Trajectory is abnormal,exceeding the conveyor working range + // 超出传送带工作范围 + RobotEventTrajectoryJointOutOfRange = + 1108, // Trajectory is abnormal,joint out of range 关节超出范围 + RobotEventTrajectoryJointOverspeed = + 1109, // Trajectory is abnormal,joint overspeed 关节超速 + RobotEventOfflineTrajectoryPlanFailed = + 1110, // Trajectory is abnormal,Offline track planning failed + // 离线轨迹规划失败 + RobotEventTrajectoryJointAccOutOfRange = + 1111, // Trajectory is abnormal,joint acc out of range + // 轨迹异常,关节加速度超限 + + RobotEventForceModeException = 1120, // 力控模式异常 + RobotEventForceModeIKFailed = + 1121, // Trajectory is abnormal,force control mode ik failed + // 轨迹异常,力控模式下失败 + RobotEventForceModeTrackJointverspeed = + 1122, // Trajectory is abnormal,joint overspeed 关节超速 + + RobotEventControllerIKFailed = + 1200, // The controller has an exception and the inverse kinematics + // failed 控制器异常,逆解失败 + RobotEventControllerStatusException = + 1201, // The controller has an exception and the status is abnormal + // 控制器异常,状态异常 + RobotEventControllerTrackingLost = + 1202, // Exception that joint tracking is lost, 关节跟踪误差过大. + RobotEventMonitorErrTrackingLost = + 1203, // Exception that joint tracking is lost, 关节跟踪误差过大. + RobotEventMonitorErrNoArrivalInTime = 1204, // not used 预留 + RobotEventMonitorErrCurrentOverload = 1205, // not used 预留 + RobotEventMonitorErrJointOutOfRange = + 1206, // Exception that joint out of range  机械臂关节超出限制范围 + RobotEventMonitorErrFifoDataTimeNotRead = + 1207, // controller fifo data timeout was not read + // 队列中数据超时未被读取 + + RobotEventMoveEnterStopState = + 1300, // Movement enters the stop state 运动进入到stop阶段 + + /** + * RobotHardwareErrorEvent 来自硬件反馈的异常事件 2001~2999 + * + * 事件处理建议 + * RobotEventJointEncoderPollustion 建议采取措施:警告性通知 + * RobotEventDriveVersionError 建议采取措施:警告性通知 + * RobotEventJointCollision 建议采取措施: + 如需回复当前运动,调用暂停函数 + 恢复的时候先调用碰撞回复函数,在调用continue函数 + 如不需回复当前运动,调用停止函数 + 恢复的时候调用碰撞回复函数可以 + * 其余的事件   建议采取措施:停止当前运动 + **/ + + RobotEventHardwareErrorNotify = 2001, // Robot hardware error 机械臂硬件错误 + + RobotEventJointError = 2101, // Robot joint error 机械臂关节错误 + RobotEventJointOverCurrent = + 2102, // Robot joint over current. 机械臂关节过流 + RobotEventJointOverVoltage = + 2103, // Robot joint over voltage.  机械臂关节过压 + RobotEventJointLowVoltage = + 2104, // Robot joint low voltage.  机械臂关节欠压 + RobotEventJointOverTemperature = + 2105, // Robot joint over temperature. 机械臂关节过温 + RobotEventJointHallError = + 2106, // Robot joint hall error. 机械臂关节霍尔错误 + RobotEventJointEncoderError = + 2107, // Robot joint encoder error. 机械臂关节编码器错误 + RobotEventJointAbsoluteEncoderError = + 2108, // Robot joint absolute encoder error. 机械臂关节绝对编码器错误 + RobotEventJointCurrentDetectError = + 2109, // Robot joint current position error. 机械臂关节当前位置错误 + RobotEventJointEncoderPollustion = + 2110, // Robot joint encoder pollustion. 机械臂关节编码器污染 + // 建议采取措施:警告性通知 + RobotEventJointEncoderZSignalError = + 2111, // Robot joint encoder Z signal error. 机械臂关节编码器Z信号错误 + RobotEventJointEncoderCalibrateInvalid = + 2112, // Robot joint encoder calibrate invalid. + // 机械臂关节编码器校准失效 + RobotEventJoint_IMU_SensorInvalid = + 2113, // Robot joint IMU sensor invalid. 机械臂关节IMU传感器失效 + RobotEventJointTemperatureSensorError = + 2114, // Robot joint temperature sensor error. 机械臂关节温度传感器出错 + RobotEventJointCanBusError = + 2115, // Robot joint CAN BUS error. 机械臂关节CAN总线出错 + RobotEventJointCurrentError = + 2116, // Robot joint current error. 机械臂关节当前电流错误 + RobotEventJointCurrentPositionError = + 2117, // Robot joint current position error. 机械臂关节当前位置错误 + RobotEventJointOverSpeed = 2118, // Robot joint over speed. 机械臂关节超速 + RobotEventJointOverAccelerate = + 2119, // Robot joint over accelerate. 机械臂关节加速度过大错误 + RobotEventJointTraceAccuracy = + 2120, // Robot joint trace accuracy. 机械臂关节跟踪精度错误 + RobotEventJointTargetPositionOutOfRange = + 2121, // Robot joint target position out of range. + // 机械臂关节目标位置超范围 + RobotEventJointTargetSpeedOutOfRange = + 2122, // Robot joint target speed out of range. 机械臂关节目标速度超范围 + RobotEventJointCollision = 2123, // Robot joint collision. 机械臂碰撞 + //    建议采取措施:暂停当前运动 + + RobotEventDataAbnormal = 2200, // Robot data abnormal 机械臂信息异常 + RobotEventRobotTypeError = 2201, // Robot type error 机械臂类型错误 + RobotEventAccelerationSensorError = + 2202, // Robot acceleration sensor error 机械臂加速度计芯片错误 + RobotEventEncoderLineError = + 2203, // Robot encoder line error 机械臂编码器线数错误 + RobotEventEnterDragAndTeachModeError = + 2204, // Robot enter drag and teach mode error + // 机械臂进入拖动示教模式错误 + RobotEventExitDragAndTeachModeError = + 2205, // Robot exit drag and teach mode error 机械臂退出拖动示教模式错误 + RobotEventMACDataInterruptionError = + 2206, // Robot MAC data interruption error 机械臂MAC数据中断错误 + RobotEventDriveVersionError = + 2207, // Drive version error 驱动器版本错误(关节固件版本不一致) + + RobotEventInitAbnormal = 2300, // Robot init abnormal 机械臂初始化异常 + RobotEventDriverEnableFailed = + 2301, // Robot driver enable failed 机械臂驱动器使能失败 + RobotEventDriverEnableAutoBackFailed = + 2302, // Robot driver enable auto back failed + // 机械臂驱动器使能自动回应失败 + RobotEventDriverEnableCurrentLoopFailed = + 2303, // Robot driver enable current loop failed + // 机械臂驱动器使能电流环失败 + RobotEventDriverSetTargetCurrentFailed = + 2304, // Robot driver set target current failed + // 机械臂驱动器设置目标电流失败 + RobotEventDriverReleaseBrakeFailed = + 2305, // Robot driver release brake failed 机械臂释放刹车失败 + RobotEventDriverEnablePostionLoopFailed = + 2306, // Robot driver enable postion loop failed 机械臂使能位置环失败 + RobotEventSetMaxAccelerateFailed = + 2307, // Robot set max accelerate failed 设置最大加速度失败 + + RobotEventSafetyError = 2400, // Robot Safety error 机械臂安全出错 + RobotEventExternEmergencyStop = + 2401, // Robot extern emergency stop 机械臂外部紧急停止 + RobotEventSystemEmergencyStop = + 2402, // Robot system emergency stop 机械臂系统紧急停止 + RobotEventTeachpendantEmergencyStop = + 2403, // Robot teachpendant emergency stop 机械臂示教器紧急停止 + RobotEventControlCabinetEmergencyStop = + 2404, // Robot control cabinet emergency stop 机械臂控制柜紧急停止 + RobotEventProtectionStopTimeout = + 2405, // Robot protection stop timeout 机械臂保护停止超时 + RobotEventEeducedModeTimeout = + 2406, // Robot reduced mode timeout 机械臂缩减模式超时 + + RobotEventSystemAbnormal = 2500, // Robot systen abnormal 机械臂系统异常 + RobotEvent_MCU_CommunicationAbnormal = + 2501, // Robot mcu communication error 机械臂mcu通信异常 + RobotEvent485CommunicationAbnormal = + 2502, // Robot RS485 communication error 机械臂485通信异常 + + //#if 0 // 非实时版本 + RobotEventCurrentJointOutRange = 2550, // Joint out of Range + //#else + RobotEventSoftEmergency = 2550, // 软急停 + RobotEventSoftEmergencyExit = 2551, // 软急停退出 + //#endif + + RobotEventArmPowerOff = + 2600, // Disconnecting the contactor causes the arm 48V power off + // 控制柜接触器断开导致机械臂48V断电 + + RobotEventHardwareErrorNotifyMaximumIndex = 2999, // 索引 + + RobotEventNotifyEvent = 3000, // Robot notification event 机械臂通知性事件 + RobotEventNotifyCollisionLevelChange = + 3001, // Robot Collision level change 机械臂事件通知-碰撞等级被改变 + RobotEventNotifyEnterFlexibleControlMode = 3010, // 进入柔性控制模式通知 + RobotEventNotifyExitFlexibleControlMode = 3011, // 退出柔性控制模式通知 + RobotEventNotifyEnterSpeedReducedMode = 3015, // 进入速度缩减模式通知 + RobotEventNotifyExitSpeedReducedMode = 3016, // 退出速度缩减模式通知 + + RobotEventNotifyStopCurrentMove = 3100, // 停止掉当前运动 + + // unknown event + robot_event_unknown = 10000, + + // user event + RobotEvent_User = 9000, // first user event id + RobotEvent_MaxUser = 9999 // last user event id + +} RobotEventType; + +/** 事件类型 **/ +typedef struct +{ + RobotEventType eventType; //事件类型号 + int eventCode; // + std::string eventContent; //事件内容 +} RobotEventInfo; + +/** + * 接口函数 错误码定义 成功返回InterfaceCallSuccCode(0);失败返回对应的错误号 + * + * 下面是错误代码列表 + * 21000 ~ 21999错误码  表示错由于控制器异常事件导致的 + * 22000 ~ 22999错误码  表示错由于硬件层异常事件导致的 + */ +enum +{ + InterfaceCallSuccCode = 0, //接口调用成功的返回值 +}; + +typedef enum +{ + // clang-format off + ErrnoSucc = InterfaceCallSuccCode, // 成功 + + ErrCode_Base = 10000, + ErrCode_Failed = 10001, // 通用失败 failed + ErrCode_ParamError = 10002, // 参数错误 parameters error + ErrCode_ConnectSocketFailed = 10003, // 连接失败 socket connect failed Socket + ErrCode_SocketDisconnect = 10004, // Socket断开连接 socket disconnected Socket + ErrCode_CreateRequestFailed = 10005, // 创建请求失败 create request failed + ErrCode_RequestRelatedVariableError = 10006, // 请求相关的内部变量出错 internal error + ErrCode_RequestTimeout = 10007, // 请求超时 timout + ErrCode_SendRequestFailed = 10008, // 发送请求信息失败 send request failed + ErrCode_ResponseInfoIsNULL = 10009, // 响应信息为空 response is null + ErrCode_ResolveResponseFailed = 10010, // 解析响应失败 parse response failed + ErrCode_FkFailed = 10011, // 正解出错 fk failed + ErrCode_IkFailed = 10012, // 逆解出错 ik failed + ErrCode_ToolCalibrateError = 10013, // 工具标定参数有错 tool coordinate paramter error + ErrCode_ToolCalibrateParamError = 10014, // 工具标定参数有错 tool coordinate paramter error + ErrCode_CoordinateSystemCalibrateError = 10015, // 坐标系标定失败 user coordinate calibrate failed + ErrCode_BaseToUserConvertFailed = 10016, // 基坐标系转用户座标失败 base coordinate convert to user coordinate fialed + ErrCode_UserToBaseConvertFailed = 10017, // 用户坐标系转基座标失败 user coordinate convert to base coordinate fialed + + + ErrCode_MotionRelatedVariableError = 10018, // 运动相关的内部变量出错 move funcation paramters error + ErrCode_MotionRequestFailed = 10019, // 运动请求失败 call move funcation failed + ErrCode_CreateMotionRequestFailed = 10020, // 生成运动请求失败 create request failed + ErrCode_MotionInterruptedByEvent = 10021, // 运动被事件中断 move funcation interrupt + ErrCode_MotionWaypointVetorSizeError = 10022, // 运动相关的路点容器的长度不符合规定 parameter error + ErrCode_ResponseReturnError = 10023, // 服务器响应返回错误 server reponse error + ErrCode_RealRobotNoExist = 10024, // 真实机械臂不存在,因为有些接口只有在真是机械臂存在的情况下才可以被调用 real robot no exist + + ErrCode_moveControlSlowStopFailed = 11025, // 调用缓停接口失败 call function failed, server side error + ErrCode_moveControlFastStopFailed = 11026, // 调用急停接口失败 call function failed, server side error + ErrCode_moveControlPauseFailed = 11027, // 调用暂停接口失败 call function failed, server side error + ErrCode_moveControlContinueFailed = 11028, // 调用继续接口失败 call function failed, server side error + + + //20000~21000 的异常码是为了版本兼容 后续会逐渐取消 + ErrCode_collision = 20008, //碰撞 + ErrCode_robotControllerError = 20026, //控制器异常 + + + /** + * 控制器返回的异常 + **/ + ErrCodeMoveJConfigError = 21001, // moveJ configuration error 关节运动属性配置错误 + ErrCodeMoveLConfigError = 21002, // moveL configuration error 直线运动属性配置错误 + ErrCodeMovePConfigError = 21003, // moveP configuration error 轨迹运动属性配置错误 + ErrCodeInvailConfigError = 21004, // invail configuration 无效的运动属性配置 + ErrCodeWaitRobotStopped = 21005, // please wait robot stopped 等待机器人停止 + ErrCodeJointOutRange = 21006, // joint out of range 超出关节运动范围 + ErrCodeFirstWaypointSetError = 21007, // please set first waypoint correctly in modep 请正确设置MODEP第一个路点 + ErrCodeConveyorTrackConfigError = 21008, // configuration error for conveyor tracking 传送带跟踪配置错误 + ErrCodeConveyorTrackTrajectoryTypeError = 21009, // unsupported conveyor tracking trajectory type 传送带轨迹类型错误 + ErrCodeRelativeTransformIKFailed = 21010, // inverse kinematics failure due to invalid relative transform 相对坐标变换逆解失败 + ErrCodeTeachModeCollision = 21011, // collision in teach-mode 示教模式发生碰撞 + ErrCodeextErnalToolConfigError = 21012, // configuration error for external tool and hand workobject 运动属性配置错误,外部工具或手持工件配置错误 + + ErrCodeTrajectoryAbnormal = 21101, // Trajectory is abnormal 轨迹异常 + ErrCodeOnlineTrajectoryPlanError = 21102, // Trajectory is abnormal,online planning failed 轨迹规划错误 + ErrCodeOnlineTrajectoryTypeIIError = 21103, // Trajectory is abnormal,type II online planning failed 二型在线轨迹规划失败 + ErrCodeIKFailed = 21104, // Trajectory is abnormal,inverse kinematics failed 逆解失败 + ErrCodeAbnormalLimitProtect = 21105, // Trajectory is abnormal,abnormal limit protection 动力学限制保护 + ErrCodeConveyorTrackingFailed = 21106, // Trajectory is abnormal,conveyor tracking failed 传送带跟踪失败 + ErrCodeConveyorOutWorkingRange = 21107, // Trajectory is abnormal,exceeding the conveyor working range 超出传送带工作范围 + ErrCodeTrajectoryJointOutOfRange = 21108, // Trajectory is abnormal,joint out of range 关节超出范围 + ErrCodeTrajectoryJointOverspeed = 21109, // Trajectory is abnormal,joint overspeed 关节超速 + ErrCodeOfflineTrajectoryPlanFailed = 21110, // Trajectory is abnormal,Offline track planning failed 离线轨迹规划失败 + ErrCodeTrajectoryJointAccOutOfRange = 21111, // Trajectory is abnormal,joint acc out of range 轨迹异常,关节加速度超限 + + ErrCodeForceModeException = 21120, // 力控模式异常 + ErrCodeForceModeIKFailed = 21121, // Trajectory is abnormal,force control mode ik failed 轨迹异常,力控模式下失败 + ErrCodeForceModeTrackJointverspeed = 21122, // Trajectory is abnormal,joint overspeed 关节超速 + + ErrCodeControllerIKFailed = 21200, // The controller has an exception and the inverse kinematics failed 控制器异常,逆解失败 + ErrCodeControllerStatusException = 21201, // The controller has an exception and the status is abnormal 控制器异常,状态异常 + ErrCodeControllerTrackingLost = 21202, // Exception that joint tracking is lost, 关节跟踪误差过大. + ErrCodeMonitorErrTrackingLost = 21203, // Exception that joint tracking is lost, 关节跟踪误差过大. + ErrCodeMonitorErrNoArrivalInTime = 21204, // not used 预留 + ErrCodeMonitorErrCurrentOverload = 21205, // not used 预留 + ErrCodeMonitorErrJointOutOfRange = 21206, // Exception that joint out of range  机械臂关节超出限制范围 + ErrCodeFifoDataTimeNotRead = 21207, // 缓存区超时未更新 + + ErrCodeMoveEnterStopState = 21300, // Movement enters the stop state 运动进入到stop阶段 + ErrCodeMoveInterruptedByEvent = 21301, // Movement interrupted by the event 运动被未知事件中断 + + /** + * 来自硬件层返回的异常 + **/ + ErrCodeHardwareErrorNotify = 22001, // Robot hardware error 机械臂硬件错误 不能区分是哪种硬件异常才会返回该错误 + + ErrCodeJointError = 22101, // Robot joint error 机械臂关节错误 + ErrCodeJointOverCurrent = 22102, // Robot joint over current. 机械臂关节过流 + ErrCodeJointOverVoltage = 22103, // Robot joint over voltage.  机械臂关节过压 + ErrCodeJointLowVoltage = 22104, // Robot joint low voltage.  机械臂关节欠压 + ErrCodeJointOverTemperature = 22105, // Robot joint over temperature. 机械臂关节过温 + ErrCodeJointHallError = 22106, // Robot joint hall error. 机械臂关节霍尔错误 + ErrCodeJointEncoderError = 22107, // Robot joint encoder error. 机械臂关节编码器错误 + ErrCodeJointAbsoluteEncoderError = 22108, // Robot joint absolute encoder error. 机械臂关节绝对编码器错误 + ErrCodeJointCurrentDetectError = 22109, // Robot joint current position error. 机械臂关节当前位置错误 + ErrCodeJointEncoderPollustion = 22110, // Robot joint encoder pollustion. 机械臂关节编码器污染 建议采取措施:警告性通知 + ErrCodeJointEncoderZSignalError = 22111, // Robot joint encoder Z signal error. 机械臂关节编码器Z信号错误 + ErrCodeJointEncoderCalibrateInvalid = 22112, // Robot joint encoder calibrate invalid. 机械臂关节编码器校准失效 + ErrCodeJoint_IMU_SensorInvalid = 22113, // Robot joint IMU sensor invalid. 机械臂关节IMU传感器失效 + ErrCodeJointTemperatureSensorError = 22114, // Robot joint temperature sensor error. 机械臂关节温度传感器出错 + ErrCodeJointCanBusError = 22115, // Robot joint CAN BUS error. 机械臂关节CAN总线出错 + ErrCodeJointCurrentError = 22116, // Robot joint current error. 机械臂关节当前电流错误 + ErrCodeJointCurrentPositionError = 22117, // Robot joint current position error. 机械臂关节当前位置错误 + ErrCodeJointOverSpeed = 22118, // Robot joint over speed. 机械臂关节超速 + ErrCodeJointOverAccelerate = 22119, // Robot joint over accelerate. 机械臂关节加速度过大错误 + ErrCodeJointTraceAccuracy = 22120, // Robot joint trace accuracy. 机械臂关节跟踪精度错误 + ErrCodeJointTargetPositionOutOfRange = 22121, // Robot joint target position out of range. 机械臂关节目标位置超范围 + ErrCodeJointTargetSpeedOutOfRange = 22122, // Robot joint target speed out of range. 机械臂关节目标速度超范围 + ErrCodeJointCollision = 22123, // Robot joint collision. 机械臂碰撞    建议采取措施:暂停当前运动 + + ErrCodeDataAbnormal = 22200, // Robot data abnormal 机械臂信息异常 + ErrCodeRobotTypeError = 22201, // Robot type error 机械臂类型错误 + ErrCodeAccelerationSensorError = 22202, // Robot acceleration sensor error 机械臂加速度计芯片错误 + ErrCodeEncoderLineError = 22203, // Robot encoder line error 机械臂编码器线数错误 + ErrCodeEnterDragAndTeachModeError = 22204, // Robot enter drag and teach mode error 机械臂进入拖动示教模式错误 + ErrCodeExitDragAndTeachModeError = 22205, // Robot exit drag and teach mode error 机械臂退出拖动示教模式错误 + ErrCodeMACDataInterruptionError = 22206, // Robot MAC data interruption error 机械臂MAC数据中断错误 + ErrCodeDriveVersionError = 22207, // Drive version error 驱动器版本错误(关节固件版本不一致) + + ErrCodeInitAbnormal = 22300, // Robot init abnormal 机械臂初始化异常 + ErrCodeDriverEnableFailed = 22301, // Robot driver enable failed 机械臂驱动器使能失败 + ErrCodeDriverEnableAutoBackFailed = 22302, // Robot driver enable auto back failed 机械臂驱动器使能自动回应失败 + ErrCodeDriverEnableCurrentLoopFailed = 22303, // Robot driver enable current loop failed 机械臂驱动器使能电流环失败 + ErrCodeDriverSetTargetCurrentFailed = 22304, // Robot driver set target current failed 机械臂驱动器设置目标电流失败 + ErrCodeDriverReleaseBrakeFailed = 22305, // Robot driver release brake failed 机械臂释放刹车失败 + ErrCodeDriverEnablePostionLoopFailed = 22306, // Robot driver enable postion loop failed 机械臂使能位置环失败 + ErrCodeSetMaxAccelerateFailed = 22307, // Robot set max accelerate failed 设置最大加速度失败 + + ErrCodeSafetyError = 22400, // Robot Safety error 机械臂安全出错 + ErrCodeExternEmergencyStop = 22401, // Robot extern emergency stop 机械臂外部紧急停止 + ErrCodeSystemEmergencyStop = 22402, // Robot system emergency stop 机械臂系统紧急停止 + ErrCodeTeachpendantEmergencyStop = 22403, // Robot teachpendant emergency stop 机械臂示教器紧急停止 + ErrCodeControlCabinetEmergencyStop = 22404, // Robot control cabinet emergency stop 机械臂控制柜紧急停止 + ErrCodeProtectionStopTimeout = 22405, // Robot protection stop timeout 机械臂保护停止超时 + ErrCodeEeducedModeTimeout = 22406, // Robot reduced mode timeout 机械臂缩减模式超时 + + ErrCodeSystemAbnormal = 22500, // Robot systen abnormal 机械臂系统异常 + ErrCode_MCU_CommunicationAbnormal = 22501, // Robot mcu communication error 机械臂mcu通信异常 + ErrCode485CommunicationAbnormal = 22502, // Robot RS485 communication error 机械臂485通信异常 + + ErrCodeSoftEmergency = 22550, // 软急停 + + ErrCodeArmPowerOff = 22600, //Disconnecting the contactor causes the arm 48V power off 控制柜接触器断开导致机械臂48V断电 + + ErrCodeInterfaceNotImpleted = 30000, // 此接口不支持 + // clang-format on +} RobotErrorCode; + +enum class MoveModeType : int +{ + NONE = 0, + MOVE_GROUP, + SERVOJ, + FORCE_TEACH, + TRAJECTORY_ANALYSE, + TOOL_DYNAMIC_IDENTIFY +}; + +} // namespace aubo_robot_namespace +#ifdef __cplusplus +} +#endif + +/** + * @brief 获取实时关节状态回调函数类型. + * @param jointStatus 当前的关节状态; + * @param size     上一个参数(jointStatus)的长度; + * @param arg      使用者在注册回调函数中传递的第二个参数; + */ +typedef void (*RealTimeJointStatusCallback)( + const aubo_robot_namespace::JointStatus *jointStatus, int size, void *arg); + +/** + * @brief 获取实时路点信息的回调函数类型. + * @param wayPoint  当前的路点信息; + * @param arg      使用者在注册回调函数中传递的第二个参数; + */ +typedef void (*RealTimeRoadPointCallback)( + const aubo_robot_namespace::wayPoint_S *wayPoint, void *arg); + +/** + *@brief 获取实时末端速度的回调函数类型 + *@param speed 当前的末端速度; + *@param arg   使用者在注册回调函数中传递的第二个参数; + */ +typedef void (*RealTimeEndSpeedCallback)(double speed, void *arg); + +/** + *@brief 获取实时Movep执行进度的回调函数类型 + *@param num 当前的Movep执行进度; + *@param arg   使用者在注册回调函数中传递的第二个参数; + */ +typedef void (*RealTimeMovepStepNumNotifyCallback)(int num, void *arg); + +/** + * @brief 获取机械臂事件信息的回调函数类型 + * @param arg 使用者在注册回调函数中传递的第二个参数; + */ +typedef void (*RobotEventCallback)( + const aubo_robot_namespace::RobotEventInfo *eventInfo, void *arg); + +/** + * @brief 日志输出对应的回调函数类型 + * @param logLevel 日志级别; + * @param str 日志信息; + */ +typedef void (*RobotLogPrintCallback)(aubo_robot_namespace::LOG_LEVEL logLevel, + const char *str, void *arg); + +#endif // AUBOROBOTMETATYPE_H diff --git a/third_party/AuboSdk/win/include/aubo/aubo_api.h b/third_party/AuboSdk/win/include/aubo/aubo_api.h new file mode 100644 index 00000000..249808a3 --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo/aubo_api.h @@ -0,0 +1,357 @@ +/** @file aubo_api.h + * @brief \~chinese 机器人及外部轴等控制API接口,如获取机器人列表、获取系统信息等等 + * @brief \~english API for controlling the robot and external axis + */ +#ifndef AUBO_SDK_AUBO_API_INTERFACE_H +#define AUBO_SDK_AUBO_API_INTERFACE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace arcs { +namespace common_interface { + +class ARCS_ABI_EXPORT AuboApi +{ +public: + AuboApi(); + virtual ~AuboApi(); + + /** + * \chinese + * 获取纯数学相关接口 + * + * @return MathPtr对象的指针 + * + * @par Python函数原型 + * getMath(self: pyaubo_sdk.AuboApi) -> pyaubo_sdk.Math + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * MathPtr ptr = rpc_cli->getMath(); + * @endcode + * \endchinese + * + *\english + * Get pure mathematic related API + * + * @return Shared pointer to a Math object + * + * @par Python function prototype + * getMath(self: pyaubo_sdk.AuboApi) -> pyaubo_sdk.Math + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * MathPtr ptr = rpc_cli->getMath(); + * @endcode + *\endenglish + */ + MathPtr getMath(); + + /** + * \chinese + * 获取系统信息 + * + * @return SystemInfoPtr对象的指针 + * + * @par Python函数原型 + * getSystemInfo(self: pyaubo_sdk.AuboApi) -> pyaubo_sdk.SystemInfo + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * SystemInfoPtr ptr = rpc_cli->getSystemInfo(); + * @endcode + * \endchinese + * + * \english + * Get system info + * + * @return Shared pointer to SystemInfo object + * + * @par Python function prototype + * getSystemInfo(self: pyaubo_sdk.AuboApi) -> pyaubo_sdk.SystemInfo + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * SystemInfoPtr ptr = rpc_cli->getSystemInfo(); + * @endcode + * \endenglish + */ + SystemInfoPtr getSystemInfo(); + + /** + * \chinese + * 获取运行时接口 + * + * @return RuntimeMachinePtr对象的指针 + * + * @par Python函数原型 + * getRuntimeMachine(self: pyaubo_sdk.AuboApi) -> pyaubo_sdk.RuntimeMachine + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * RuntimeMachinePtr ptr = rpc_cli->getRuntimeMachine(); + * @endcode + * \endchinese + * + * \english + * Get runtime api + * + * @return Shared pointer to RuntimeMachine object + * Python function prototype + * getRuntimeMachine(self: pyaubo_sdk.AuboApi) -> pyaubo_sdk.RuntimeMachine + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * RuntimeMachinePtr ptr = rpc_cli->getRuntimeMachine(); + * @endcode + * \endenglish + */ + RuntimeMachinePtr getRuntimeMachine(); + + /** + * \chinese + * 对外寄存器接口 + * + * @return RegisterControlPtr对象的指针 + * + * @par Python函数原型 + * getRegisterControl(self: pyaubo_sdk.AuboApi) -> + * pyaubo_sdk.RegisterControl + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * RegisterControlPtr ptr = rpc_cli->getRegisterControl(); + * @endcode + * \endchinese + * + * \english + * External registers api + * + * @return Shared pointer to RegisterControl object + * + * @par Python function prototype + * getRegisterControl(self: pyaubo_sdk.AuboApi) -> + * pyaubo_sdk.RegisterControl + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * RegisterControlPtr ptr = rpc_cli->getRegisterControl(); + * @endcode + * \endenglish + */ + RegisterControlPtr getRegisterControl(); + + /** + * \chinese + * 获取机器人列表 + * + * @return 机器人列表 + * + * @par Python函数原型 + * getRobotNames(self: pyaubo_sdk.AuboApi) -> List[str] + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * @endcode + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"getRobotNames","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":["rob1"]} + * \endchinese + * + * \english + * Get robot list + * + * @return robot list + * + * @par Python function prototype + * getRobotNames(self: pyaubo_sdk.AuboApi) -> List[str] + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * @endcode + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"getRobotNames","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":["rob1"]} + * \endenglish + */ + std::vector getRobotNames(); + + /** + * \chinese + * 根据名字获取 RobotInterfacePtr 接口 + * + * @param name 机器人名字 + * @return RobotInterfacePtr对象的指针 + * + * @par Python函数原型 + * getRobotInterface(self: pyaubo_sdk.AuboApi, arg0: str) -> + * pyaubo_sdk.RobotInterface + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * RobotInterfacePtr ptr = rpc_cli->getRobotInterface(robot_name); + * @endcode + * \endchinese + * + * \english + * Get RobotInterfacePtr based on name + * + * @param name Robot name + * @return Shared pointer to a RobotInterface object + * + * @par Python function prototype + * getRobotInterface(self: pyaubo_sdk.AuboApi, arg0: str) -> + * pyaubo_sdk.RobotInterface + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * RobotInterfacePtr ptr = rpc_cli->getRobotInterface(robot_name); + * @endcode + * \endenglish + */ + RobotInterfacePtr getRobotInterface(const std::string &name); + + /** + * \~chinese 获取外部轴列表 \~english Get external axis list + * + * @return + */ + std::vector getAxisNames(); + + /** + * \chinese + * 获取外部轴接口 + * + * @param name + * @return + * \endchinese + * + * \english + * Get external axis interface + * + * @param name + * @return + * \endenglish + */ + AxisInterfacePtr getAxisInterface(const std::string &name); + + /// 获取独立 IO 模块接口 + + /** + * \chinese + * 获取 socket + * @return SocketPtr对象的指针 + * + * @par Python函数原型 + * getSocket(self: pyaubo_sdk.AuboApi) -> arcs::common_interface::Socket + * @endcode + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * SocketPtr ptr = rpc_cli->getSocket(); + * @endcode + * \endchinese + * + * \english + * Get socket + * @return Shared pointer to a socket object + * + * @par Python function prototype + * getSocket(self: pyaubo_sdk.AuboApi) -> arcs::common_interface::Socket + * @endcode + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * SocketPtr ptr = rpc_cli->getSocket(); + * @endcode + * \endenglish + */ + SocketPtr getSocket(); + + /** + * \chinese + * @return SerialPtr对象的指针 + * + * @par Python函数原型 + * getSerial(self: pyaubo_sdk.AuboApi) -> arcs::common_interface::Serial + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * SerialPtr ptr = rpc_cli->getSerial(); + * @endcode + * \endchinese + * + * \english + * @return Shared pointer to Serial object + * + * @par Python function prototype + * getSerial(self: pyaubo_sdk.AuboApi) -> arcs::common_interface::Serial + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * SerialPtr ptr = rpc_cli->getSerial(); + * @endcode + * \endenglish + */ + SerialPtr getSerial(); + + /** + * \~chinese 获取同步运动接口 \~english Get syncronous move interface + * + * \~chinese @return SyncMovePtr对象的指针 + * \~english @return Shared pointer to SyncMove object + */ + SyncMovePtr getSyncMove(const std::string &name); + + /** + * \~chinese 获取告警信息接口 + * \~english Get alert interface + * + * \~chinese @return TracePtr对象的指针 + * \~english @return Shared pointer of trace object + */ + TracePtr getTrace(const std::string &name); + +protected: + void *d_{ nullptr }; +}; +using AuboApiPtr = std::shared_ptr; + +} // namespace common_interface +} // namespace arcs + +#endif // AUBO_SDK_AUBO_API_H diff --git a/third_party/AuboSdk/win/include/aubo/axis_interface.h b/third_party/AuboSdk/win/include/aubo/axis_interface.h new file mode 100644 index 00000000..572dad6f --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo/axis_interface.h @@ -0,0 +1,351 @@ +/** @file axes.h + * @brief 外部轴接口 + */ +#ifndef AUBO_SDK_AXIS_INTERFACE_H +#define AUBO_SDK_AXIS_INTERFACE_H + +#include +#include + +namespace arcs { +namespace common_interface { + +/** + * \~chinese 外部轴API接口 + * \~english External axis API interface + */ +class ARCS_ABI_EXPORT AxisInterface +{ +public: + AxisInterface(); + virtual ~AxisInterface(); + + /** + * \~chinese 通电 + * \~english Power on + * @return + */ + int poweronExtAxis(); + + /** + * \~chinese 断电 + * \~english Power off + * @return + */ + int poweroffExtAxis(); + + /** + * \~chinese 使能 + * \~english Enable + * @return + */ + int enableExtAxis(); + + /** + * \~chinese 设置外部轴的安装位姿(相对于世界坐标系) + * \~chinese @param pose + * \~english Set mounting pose of external axis (wrt world frame) + * \~english @param pose + + * @return + */ + int setExtAxisMountingPose(const std::vector &pose); + + /** + * \chinese 运动到指定点, 旋转或者平移 + * + * @param pos + * @param v + * @param a + * @param duration + * @return + * \endchinese + * + * \english move to pos, rotation or linear + * + * @param pos + * @param v + * @param a + * @param duration + * @return + * \endenglish + */ + int moveExtJoint(double pos, double v, double a, double duration); + + /** + * \chinese + * 制定目标运动速度 + * + * @param v + * @param a + * @param duration + * @return + * \endchinese + * + * \english + * Set target speed, acceleration and duration + * @param v + * @param a + * @param duration + * @return + * \endenglish + */ + int speedExtJoint(double v, double a, double duration); + + int stopExtJoint(double a); + + /** + * \~chinese 获取外部轴的类型 0代表是旋转 1代表平移 + * \~english Get external axis type: 0 for rotation, 1 for linear + * @return + */ + int getExtAxisType(); + + /** + * \chinese + * 获取当前外部轴的状态 + * + * @return 当前外部轴的状态 + * \endchinese + * + * \english + * Get external axis status + * + * @return Current exteral axis status + * \endenglish + */ + AxisModeType getAxisModeType(); + + /** + * \chinese + * 获取外部轴安装位姿 + * + * @return 外部轴安装位姿 + * \endchinese + * + * \english + * Get external axis mounting pose + * + * @return External axis pose + * \endenglish + */ + std::vector getExtAxisMountingPose(); + + /** + * \chinese + * 获取相对于安装坐标系的位姿,外部轴可能为变位机或者导轨 + * + * @return 相对于安装坐标系的位姿 + * \endchinese + * + * \english + * Get pose wrt mounting coordinate system, axis can be positioner or linear rail + * + * @return Pose wrt mounting coordinate system + * \endenglish + */ + std::vector getExtAxisPose(); + + /** + * \chinese + * 获取外部轴位置 + * + * @return 外部轴位置 + * \endchinese + * + * \english + * Get external axis position + * + * @return External axis position + * \endenglish + */ + double getExtAxisPosition(); + + /** + * \chinese + * 获取外部轴运行速度 + * + * @return 外部轴运行速度 + * \endchinese + * + * \english + * Get external axis speed + * + * @return External axis speed + * \endenglish + */ + double getExtAxisVelocity(); + + /** + * \chinese + * 获取外部轴运行加速度 + * + * @return 外部轴运行加速度 + * \endchinese + * + * \english + * Get external axis acceleration + * + * @return External axis acceleration + * \endenglish + */ + double getExtAxisAcceleration(); + + /** + * \chinese + * 获取外部轴电流 + * + * @return 外部轴电流 + * \endchinese + * + * \english + * Get external axis current + * + * @return External axis current + * \endenglish + */ + double getExtAxisCurrent(); + + /** + * \chinese + * 获取外部轴温度 + * + * @return 外部轴温度 + * \endchinese + * + * \english + * Get external axis temperature + * + * @return External axis temperature + * \endenglish + */ + double getExtAxisTemperature(); + + /** + * \chinese + * 获取外部轴电压 + * + * @return 外部轴电压 + * \endchinese + * + * \english + * Get external axis voltage + * + * @return External axis voltage + * \endenglish + */ + double getExtAxisBusVoltage(); + + /** + * \chinese + * 获取外部轴电流 + * + * @return 外部轴电流 + * \endchinese + * + * \english + * Get external axis current + * + * @return external axis current + * \endenglish + */ + double getExtAxisBusCurrent(); + + /** + * \chinese + * 获取外部轴最大位置 + * + * @return 外部轴最大位置 + * \endchinese + * + * \english + * Get external axis max position + * + * @return External axis max position + * \endenglish + */ + double getExtAxisMaxPosition(); + + /** + * \chinese + * 获取外部轴最小位置 + * + * @return 外部轴最小位置 + * \endchinese + * + * \english + * Get external axis min position + * + * @return External axis min position + * \endenglish + */ + double getExtMinPosition(); + + /** + * \chinese + * 获取外部轴最大速度 + * + * @return 外部轴最大速度 + * \endchinese + * + * \english + * Get external axis max speed + * + * @return External axis max speed + * \endenglish + */ + double getExtAxisMaxVelocity(); + + /** + * \chinese + * 获取外部轴最大加速度 + * + * @return 外部轴最大加速度 + * \endchinese + * + * \english + * Get external axis max acceleration + * + * @return External axis max acceleration + * \endenglish + */ + double getExtAxisMaxAcceleration(); + + /** + * \chinese + * 跟踪另一个外部轴的运动(禁止运动过程中使用) + * + * @param target_name 目标的外部轴名字 + * @param phase 相位差 + * @param err 跟踪运行的最大误差 + * @return + * \endchinese + * + * \english + * Follow motion of another external axis (not to be used during motion) + * + * @param target_name name of target axis + * @param phase phase difference + * @param err max error when following motion + * @return + * \endenglish + */ + int followAnotherAxis(const std::string &target_name, double phase, + double err); + + /** + * \~chinese @brief stopFollowAnotherAxis(禁止运动过程中使用) + * \~english @brief stopFollowAnotherAxis(not to be used during motion) + * @return + */ + int stopFollowAnotherAxis(); + +protected: + void *d_; +}; +using AxisInterfacePtr = std::shared_ptr; + +} // namespace common_interface +} // namespace arcs + +#endif // AUBO_SDK_AXIS_INTERFACE_H diff --git a/third_party/AuboSdk/win/include/aubo/error_stack/error_stack.h b/third_party/AuboSdk/win/include/aubo/error_stack/error_stack.h new file mode 100644 index 00000000..141a8941 --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo/error_stack/error_stack.h @@ -0,0 +1,114 @@ +/** @file error_stack.h + * @brief 汇总错误码 + */ +#ifndef AUBO_SDK_ERROR_STACK_H +#define AUBO_SDK_ERROR_STACK_H + +#include +#include +#include +#include +#include +#include + +#include + +// 格式化占位符,默认是 fmt 的格式 +#ifndef _PH1_ +#define _PH1_ "{}" +#define _PH2_ "{}" +#define _PH3_ "{}" +#define _PH4_ "{}" +#endif + +namespace arcs { +namespace error_stack { + +constexpr int ARCS_ABI_EXPORT codeCompose(int aa, int bb, int cccc) +{ + return (int)((aa * 1000000) + (bb * 10000) + cccc); +} + +constexpr int ARCS_ABI_EXPORT mod(int x) +{ + return (x % 1000000); +} + +#include +#include +#include + +#define ARCS_ERROR_CODES \ + SYSTEM_ERRORS \ + JOINT_ERRORS \ + SAFETY_INTERFACE_BOARD_ERRORS \ + RTM_ERRORS \ + TOOL_ERRORS \ + PEDSTRAL_ERRORS \ + HARDWARE_INTERFACE_ERRORS \ + _D(ARCS_MAX_ERROR_CODE, -1, "Max error code", "suggest...") + +// 错误代码枚举 +enum ErrorCodes +{ +#define _D(n, v, s, r) n = (int)v, + ARCS_ERROR_CODES +#undef _D +}; + +inline int str2ErrorCode(const char *err_code_name) +{ +#define _D(n, v, s, r) \ + if (strcmp(#n, err_code_name) == 0) \ + return v; + ARCS_ERROR_CODES +#undef _D + return ARCS_MAX_ERROR_CODE; +} + +inline const char *errorCode2Str(int err_code) +{ + static const char *errcode_str[] = { +#define _D(n, v, s, r) s, + ARCS_ERROR_CODES +#undef _D + }; + + enum arcs_index + { +#define _D(n, v, s, r) n##_INDEX, + ARCS_ERROR_CODES +#undef _D + }; + + int index = -1; + +#define _D(n, v, s, r) \ + if (err_code == v) \ + index = n##_INDEX; + ARCS_ERROR_CODES +#undef _D + + if (index == -1) { + index = ARCS_MAX_ERROR_CODE_INDEX; + } + + return errcode_str[(unsigned)index]; +} + +inline std::ostream &dump(std::ostream &os) +{ +#define _D(n, v, s, r) \ + os << std::setw(20) << #n << "\t" << v << "\t" << s << "\t" << r \ + << std::endl; + + ARCS_ERROR_CODES +#undef _D + + return os; +} + +} // namespace error_stack +} // namespace arcs + +#endif // AUBO_SDK_ERROR_STACK_H diff --git a/third_party/AuboSdk/win/include/aubo/error_stack/hal_error.h b/third_party/AuboSdk/win/include/aubo/error_stack/hal_error.h new file mode 100644 index 00000000..0aa09c5b --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo/error_stack/hal_error.h @@ -0,0 +1,162 @@ +/** @file hal_error.h + * @brief 定义硬件抽象层的错误码 + */ +#ifndef AUBO_SDK_HAL_ERROR_H +#define AUBO_SDK_HAL_ERROR_H + +// 缩写说明 +// JNT: joint +// PDL: pedstral +// TP: teach pendant +// COMM: communication +// ENC: encoder +// CURR: current +// POS: position +// PKG: package +// PROG: program + +// clang-format off +#define JOINT_ERRORS \ + _D(JOINT_ERR_OVER_CURRENET, 10001, "joint" _PH1_ " error: over current", "(a) Check for short circuit. (b) Do a Complete rebooting sequence. (c) If this happens more than two times in a row, replace joint") \ + _D(JOINT_ERR_OVER_VOLTAGE, 10002, "joint" _PH1_ " error: over voltage", "(a) Do a Complete rebooting sequence. (b) Check 48 V Power supply, current distributer, energy eater and Control Board for issues") \ + _D(JOINT_ERR_LOW_VOLTAGE, 10003, "joint" _PH1_ " error: low voltage", "(a) Do a Complete rebooting sequence. (b) Check for short circuit in robot arm. (c) Check 48 V Power supply, current distributer, energy eater and Control Board for issues") \ + _D(JOINT_ERR_OVER_TEMP, 10004, "joint" _PH1_ " error: over temperature", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_HALL, 10005, "joint" _PH1_ " error: hall", "suggest...") \ + _D(JOINT_ERR_ENCODER, 10006, "joint" _PH1_ " error: encoder", "Check encoder connections") \ + _D(JOINT_ERR_ABS_ENCODER, 10007, "joint" _PH1_ " error: abs encoder", "suggest...") \ + _D(JOINT_ERR_Q_CURRENT, 10008, "joint" _PH1_ " error: detect current", "suggest...") \ + _D(JOINT_ERR_ENC_POLL, 10009, "joint" _PH1_ " error: encoder pollustion", "suggest...") \ + _D(JOINT_ERR_ENC_Z_SIGNAL, 10010, "joint" _PH1_ " error: enocder z signal", "suggest...") \ + _D(JOINT_ERR_ENC_CAL, 10011, "joint" _PH1_ " error: encoder calibrate", "suggest...") \ + _D(JOINT_ERR_IMU_SENS, 10012, "joint" _PH1_ " error: IMU sensor", "suggest...") \ + _D(JOINT_ERR_TEMP_SENS, 10013, "joint" _PH1_ " error: TEMP sensor", "suggest...") \ + _D(JOINT_ERR_CAN_BUS, 10014, "joint" _PH1_ " error: CAN bus error", "suggest...") \ + _D(JOINT_ERR_SYS_CUR, 10015, "joint" _PH1_ " error: system current error", "suggest...") \ + _D(JOINT_ERR_SYS_POS, 10016, "joint" _PH1_ " error: system position error","suggest...") \ + _D(JOINT_ERR_OVER_SP, 10017, "joint" _PH1_ " error: over speed","suggest...") \ + _D(JOINT_ERR_OVER_ACC, 10018, "joint" _PH1_ " error: over accelerate", "suggest...") \ + _D(JOINT_ERR_TRACE, 10019, "joint" _PH1_ " error: trace accuracy", "suggest...") \ + _D(JOINT_ERR_TAG_POS_OVER, 10020, "joint" _PH1_ " error: target position out of range", "suggest...") \ + _D(JOINT_ERR_TAG_SP_OVER, 10021, "joint" _PH1_ " error: target speed out of range", "suggest...") \ + _D(JOINT_ERR_COLLISION, 10022, "joint" _PH1_ " error: collision", "suggest...") \ + _D(JOINT_ERR_COMMON, 10023, "joint" _PH1_ " error: unkown error. Check communication with joint.", "suggest...") \ + _D(JOINT_ERR_SWITCH_SERVO_MODE, 10024, "joint" _PH1_ " error: switch servo mode timeout.", "suggest...") \ + _D(JOINT_ERR_MOTOR_STUCK, 10025, "joint" _PH1_ " error: motor stucked.", "suggest...") \ + _D(JOINT_ERR_REDUCER_OVER_TEMP, 10026, "joint" _PH1_ " error: reducer over temperature", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_REDUCER_NTC, 10027, "joint" _PH1_ " error: reducer TEMP sensor failure", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_ABS_MULTITURN, 10028, "joint" _PH1_ " error: absolute encoder multiturn error", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_ADC_ZERO_OFFSET, 10029, "joint" _PH1_ " error: ADC zero offset failure", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_SHORT_CIRCUIT, 10030, "joint" _PH1_ " error: short circuit", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_PHASE_LOST, 10031, "joint" _PH1_ " error: motor phase lost", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_BRAKE, 10032, "joint" _PH1_ " error: brake failure", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_FIRMWARE_UPDATE, 10033, "joint" _PH1_ " error: firmware update failure", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_BATTERY_LOW, 10034, "joint" _PH1_ " error: battery low", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_PHASE_ALIGN, 10035, "joint" _PH1_ " error: phase align", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_CAN_HW_FAULT, 10036, "joint" _PH1_ " error: CAN bus hw fault", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_POS_DISCONTINUOUS, 10037, "joint" _PH1_ " error: target position discontinuous", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_POS_INIT, 10038, "joint" _PH1_ " error: position initiallization failure", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_TORQUE_SENSOR, 10039, "joint" _PH1_ " error: torqure sensor failure", "(a) Check robot’s environment and make sure the robot is operating within recommended limits. (b) Do a Complete rebooting sequence") \ + _D(JOINT_ERR_OFFLINE, 10040, "joint" _PH1_ " error: joint may be offline", "(a) Check joint's hardware. (b) Check joint's id.") \ + _D(JOINT_ERR_BOOTLOADER, 10041, "joint" _PH1_ " error: The joint is in bootloader mode. Retry firmware update. ", "suggest...") \ + _D(JOINT_ERR_SLAVE_OFFLINE, 10042, "slave joint" _PH1_ " error: slave joint may be offline", "(a) Check slave joint's hardware. (b) Check slave joint's id.") \ + _D(JOINT_ERR_SLAVE_BOOTLOADER, 10043, "slave joint" _PH1_ " error: The slave joint is in bootloader mode. Retry firmware update. ", "suggest...") + +#define TOOL_ERRORS \ + _D(TOOL_FLASH_VERIFY_FAILED, 40001, "Flash write verify failed", "suggest...") \ + _D(TOOL_PROGRAM_CRC_FAILED, 40002, "Program flash checksum failed during bootloading", "suggest...") \ + _D(TOOL_PROGRAM_CRC_FAILED2, 40003, "Program flash checksum failed at runtime", "suggest...") \ + _D(TOOL_ID_UNDIFINED, 40004, "Tool ID is undefined", "suggest...") \ + _D(TOOL_ILLEGAL_BL_CMD, 40005, "Illegal bootloader command", "suggest...") \ + _D(TOOL_FW_WRONG, 40006, "Wrong firmware at the joint", "suggest...") \ + _D(TOOL_HW_INVALID, 40007, "Invalid hardware revision", "suggest...") \ + _D(TOOL_SHORT_CURCUIT_H, 40011, "Short circuit detected on Digital Output: " _PH1_ " high side", "suggest...") \ + _D(TOOL_SHORT_CURCUIT_L, 40012, "Short circuit detected on Digital Output: " _PH1_ " low side", "suggest...") \ + _D(TOOL_AVERAGE_CURR_HIGH, 40013, "10 second Average tool IO Current of " _PH1_ " A is outside of the allowed range.", "suggest...") \ + _D(TOOL_POWER_PIN_OVER_CURR, 40014, "Current of " _PH1_ " A on the POWER pin is outside of the allowed range.", "suggest...") \ + _D(TOOL_DOUT_PIN_OVER_CURR, 40015, "Current of " _PH1_ " A on the Digital Output pins is outside of the allowed range.", "suggest...") \ + _D(TOOL_GROUND_PIN_OVER_CURR, 40016, "Current of " _PH1_ " A on the ground pin is outside of the allowed range.", "suggest...") \ + _D(TOOL_RX_FRAMING, 40021, "RX framing error", "suggest...") \ + _D(TOOL_RX_PARITY, 40022, "RX Parity error", "suggest...") \ + _D(TOOL_48V_LOW, 40031, "48V input is too low", "suggest...") \ + _D(TOOL_48V_HIGH, 40032, "48V input is too high", "suggest...") \ + _D(TOOL_ERR_OFFLINE, 40033, "tool error: tool may be offline", "(a) Check tool's hardware. (b) Check joint's id.") \ + _D(TOOL_ERR_BOOTLOADER, 40034, "tool error: The tool is in bootloader mode. Retry firmware update. ", "suggest...") + + +#define PEDSTRAL_ERRORS \ + _D(PKG_LOST, 50001, "Lost package from pedestal", "suggest...") \ + _D(PEDSTRAL_OFFLINE, 50002, "pedestal error: pedestal may be offline", "(a) Check pedestal's hardware. (b) Check pedestal's id.") \ + _D(PEDESTAL_ERR_BOOTLOADER, 50003, "pedestal error: The pedestal is in bootloader mode. Retry firmware update. ", "suggest...") + + +#define SAFETY_INTERFACE_BOARD_ERRORS \ + _D(IFB_ERR_ROBOTTYPE, 20001, "Robot error type!", "suggest...") \ + _D(IFB_ERR_ADXL_SENS, 20002, "Acceleration sensor error!", "suggest...") \ + _D(IFB_ERR_EN_LINE, 20003, "Encoder line error!", "suggest...") \ + _D(IFB_ERR_ENTER_HDG_MODE, 20004, "Robot enter handguide mode!", "suggest...") \ + _D(IFB_ERR_EXIT_HDG_MODE, 20005, "Robot exit handguide mode!", "suggest...") \ + _D(IFB_ERR_MAC_DATA_BREAK, 20006, "MAC data break!", "suggest...") \ + _D(IFB_ERR_DRV_FIRMWARE_VERSION, 20007, "Motor driver firmware version error!", "suggest...") \ + _D(INIT_ERR_EN_DRV, 20008, "Motor driver enable failed!", "suggest...") \ + _D(INIT_ERR_EN_AUTO_BACK, 20009, "Motor driver enable auto back failed!", "suggest...") \ + _D(INIT_ERR_EN_CUR_LOOP, 20010, "Motor driver enable current loop failed!", "suggest...") \ + _D(INIT_ERR_SET_TAG_CUR, 20011, "Motor driver set target current failed!", "suggest...") \ + _D(INIT_ERR_RELEASE_BRAKE, 20012, "Motor driver release brake failed!", "suggest...") \ + _D(INIT_ERR_EN_POS_LOOP, 20013, "Motor driver enable postion loop failed!", "suggest...") \ + _D(INIT_ERR_SET_MAX_ACC, 20014, "Motor set max accelerate failed!", "suggest...") \ + _D(SAFETY_ERR_PROTECTION_STOP_TIMEOUT, 20015, "Protective stop timeout!", "suggest...") \ + _D(SAFETY_ERR_REDUCED_MODE_TIMEOUT, 20016, "Reduced mode timeout!", "suggest...") \ + _D(SYS_ERR_MCU_COM, 20017, "Robot system error: mcu communication error!", "suggest...") \ + _D(SYS_ERR_RS485_COM, 20018, "Robot system error: RS485 communication error!", "suggest...") \ + _D(IFB_ERR_DISCONNECTED, 20019, "Interface board may be disconnected. Please check connection between IPC and Interface board.", "suggest...")\ + _D(IFB_ERR_PAYLOAD_ERROR, 20020, "Payload error.", "suggest...") \ + _D(IFB_OFFLINE, 20021, "ifaceboard error: ifaceboard may be offline", "(a) Check ifaceboard's hardware. (b) Check ifaceboard's id.") \ + _D(IFB_ERR_BOOTLOADER, 20022, "ifaceboard error: The ifaceboard is in bootloader mode. Retry firmware update. ", "suggest...") \ + _D(IFB_SLAVE_OFFLINE, 20023, "interface slave board error: interface slave board may be offline", "(a) Check interface slave board's hardware. (b) Check interface slave board's id.") \ + _D(IFB_SLAVE_ERR_BOOTLOADER, 20024, "interface slave board error: The interface slave board is in bootloader mode. Retry firmware update. ", "suggest...") + + +#define HARDWARE_INTERFACE_ERRORS \ + _D(HW_SCB_SETUP_FAILED, 60001, "Setup of Interface Board failed", "suggest...") \ + _D(HW_PKG_CNT_DISAGEE, 60002, "Packet counter disagreements", "suggest...") \ + _D(HW_SCB_DISCONNECT, 60003, "Connection to Interface Board lost", "suggest...") \ + _D(HW_SCB_PKG_LOST, 60004, "Package lost from Interface Board", "suggest...") \ + _D(HW_SCB_CONN_INIT_FAILED, 60005, "Ethernet connection initialization with Interface Board failed", "suggest...") \ + _D(HW_LOST_JOINT_PKG, 60006, "Lost package from joint " _PH1_ "", "suggest...") \ + _D(HW_LOST_TOOL_PKG, 60007, "Lost package from tool", "suggest...") \ + _D(HW_JOINT_PKG_CNT_DISAGREE, 60008, "Packet counter disagreement in packet from joint " _PH1_ "", "suggest...") \ + _D(HW_TOOL_PKG_CNT_DISAGREE, 60009, "Packet counter disagreement in packet from tool", "suggest...") \ + _D(HW_JOINTS_FAULT, 60011, "" _PH1_ " joint entered the Fault State", "suggest...") \ + _D(HW_JOINTS_VIOLATION, 60012, "" _PH1_ " joint entered the Violation State", "suggest...") \ + _D(HW_TP_FAULT, 60013, "Teach Pendant entered the Fault State", "suggest...") \ + _D(HW_TP_VIOLATION, 60014, "Teach Pendant entered the Violation State", "suggest...") \ + _D(HW_JOINT_MV_TOO_FAR, 60021, "" _PH1_ " joint moved too far before robot entered RUNNING State", "suggest...") \ + _D(HW_JOINT_STOP_NOT_FAST, 60022, "Joint Not stopping fast enough", "suggest...") \ + _D(HW_JOINT_MV_LIMIT, 60023, "Joint moved more than allowable limit", "suggest...") \ + _D(HW_FT_SENSOR_DATA_INVALID, 60024, "Force-Torque Sensor data invalid", "suggest...") \ + _D(HW_NO_FT_SENSOR, 60025, "Force-Torque sensor is expected, but it cannot be detected", "suggest...") \ + _D(HW_FT_SENSOR_NOT_CALIB, 60026, "Force-Torque sensor is detected but not calibrated", "suggest...") \ + _D(HW_RELEASE_BRAKE_FAILED, 60030, "Robot was not able to brake release, see log for details", "suggest...") \ + _D(HW_OVERCURR_SHUTDOWN, 60040, "Overcurrent shutdown", "suggest...") \ + _D(HW_ENERGEY_SURPLUS, 60050, "Energy surplus shutdown", "suggest...") \ + _D(HW_IDLE_POWER_HIGH, 60060, "Idle power consumption to high", "suggest...") \ + _D(HW_ENTER_COLLISION_TIMEOUT, 60071, "Enter collision stop procedure timeout", "suggest...") \ + _D(HW_POWERON_TIMEOUT, 60072, "Poweron robot timeout", "suggest...") \ + _D(HW_NO_NIC_FOUND, 60073, "No network cards found.", "suggest...") \ + _D(HW_IFB_NOT_FOUND, 60074, "No Interface Board found.", "suggest...") \ + _D(HW_IFB_BOOTLOAD, 60075, "The Interface Board is in bootloader mode. Update firmware firstly.", "suggest...") \ + _D(HW_TOOL_NOT_FOUND, 60076, "No Tool Board found.", "suggest...") \ + _D(HW_BASE_NOT_FOUND, 60077, "No Base Board found.", "suggest...") \ + _D(HW_BRINGUP_TIMEOUT, 60078, "Poweron robot timeout", "suggest...") + +// clang-format on + +// 定义硬件抽象层的错误代码 +#define HAL_ERRORS \ + JOINT_ERRORS \ + SAFETY_INTERFACE_BOARD_ERRORS \ + TOOL_ERRORS \ + PEDSTRAL_ERRORS \ + HARDWARE_INTERFACE_ERRORS + +#endif // AUBO_SDK_JOINT_ERROR_H diff --git a/third_party/AuboSdk/win/include/aubo/error_stack/rtm_error.h b/third_party/AuboSdk/win/include/aubo/error_stack/rtm_error.h new file mode 100644 index 00000000..a1dcfb4d --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo/error_stack/rtm_error.h @@ -0,0 +1,168 @@ +/** @file rtm_error.h + * @brief 运行时错误码 + */ +#ifndef AUBO_SDK_RTM_ERROR_H +#define AUBO_SDK_RTM_ERROR_H + +// clang-format off + +#define RTM_ERRORS \ + _D(ROBOT_BE_PULLING, 30001, "Something is pulling the robot.","Please check TCP configuration,payload and mounting settings") \ + _D(PSTOP_ELBOW_POS, 30002, "Protective Stop: Elbow position close to safety plane limits.","Please move robot Elbow joint away from the safety plane") \ + _D(PSTOP_STOP_TIME, 30003, "Protective Stop: Exceeding user safety settings for stopping time.","(a) Check speeds and accelerations in the program (b) Check usage of TCP,payload and CoG correctly (c) Check external equipmentactivation if correctly set") \ + _D(PSTOP_STOP_DISTANCE, 30004, "Protective Stop: Exceeding user safety settings for stopping distance.","(a) Check speeds and accelerations in the program (b) Check usage of TCP,payload and CoG correctly (c) Check external equipmentactivation if correctly set") \ + _D(PSTOP_CLAMP, 30005, "Protective Stop: Danger of clamping between the Robot’s lower arm and tool.","(a) Check speeds and accelerations in the program (b) Check usage of TCP,payload and CoG correctly (c) Check external equipmentactivation if correctly set") \ + _D(PSTOP_POS_LIMIT, 30006, "Protective Stop: Position close to joint limits", "suggest...") \ + _D(PSTOP_ORI_LIMIT, 30007, "Protective Stop: Tool orientation close to limits", "suggest...") \ + _D(PSTOP_PLANE_LIMIT, 30008, "Protective Stop: Position close to safety plane limits", "suggest...") \ + _D(PSTOP_POS_DEVIATE, 30009, "Protective Stop: Position deviates from path", "Check payload, center of gravity and acceleration settings.") \ + _D(JOINT_CHK_PAYLOAD, 30010, "Joint " _PH1_ ": Check payload, center of gravity and acceleration settings. Log screen may contain additional information.", "suggest...") \ + _D(PSTOP_SINGULARITY, 30011, "Protective Stop: Position in singularity.","Please use MoveJ or change the motion") \ + _D(PSTOP_CANNOT_MAINTAIN, 30012, "Protective Stop: Robot cannot maintain its position, check if payload is correct", "suggest...") \ + _D(PSTOP_WRONG_PAYLOAD, 30013, "Protective Stop: Wrong payload or mounting detected, or something is pushing the robot when entering Freedrive mode","Verify that the TCP configuration and mounting in the used installation is correct") \ + _D(PSTOP_JOINT_COLLISION, 30014, "Protective Stop: Collision detected by joint " _PH1_, "Make sure no objects are in the path of the robot and resume the program") \ + _D(PSTOP_POS_DISAGREE, 30015, "Protective stop: The robot was powered off last time due to a joint position disagreement."," (a) Verify that the robot position in the 3D graphics matches the real robot, to ensure that the encoders function before releasing the brakes. Stand back and monitor the robot performing its first program cycle as expected. (b) If the position is not correct, the robot must be repaired. In this case, click Power Off Robot. (c) If the position is correct, please tick the check box below the 3D graphics and click Robot Position Verified") \ + _D(TARGET_JOINT_SPEED_EXCEED, 30016, "Target joint speed exceed limits", "suggest...") \ + _D(TARGET_POS_SUDDEN_CHG, 30017, "Sudden change in target position", "suggest...") \ + _D(SUDDEN_STOP, 30018, "Sudden stop."," To abort a motion, use \"stopj\" or \"stopl\" script commands to generate a smooth deceleration before using \"wait\". Avoid aborting motions between waypoints with blend”") \ + _D(ROBOT_STOP_ABNORMAL, 30019, "Robot has not stopped in the allowed reaction and braking time", "suggest...") \ + _D(PROG_INVALID_SETP, 30020, "Robot program resulted in invalid setpoint.", "Please review waypoints in the program") \ + _D(BLEND_INVALID_SETP, 30021, "Blending failed and resulted in an invalid setpoint.", "Try changing the blend radius or contact technical support") \ + _D(APPROACH_SINGULARITY, 30022, "Robot approaching singularity – Acceleration threshold failed.","Review waypoints in the program, try using MoveJ instead of MoveL in the position close to singularity") \ + _D(TSPEED_UNMATCH_POS, 30023, "Target speed does not match target position", "suggest...") \ + _D(INCONSIS_TPOS_SPD, 30024, "Inconsistency between target position and speed", "suggest...") \ + _D(JOINT_TSPD_UNMATCH_POS, 30025, "Target joint speed does not match target joint position change – Joint " _PH1_ "", "suggest...") \ + _D(FIELDBUS_INPUT_DISCONN, 30026, "Fieldbus input disconnected.","Please check fieldbus connections (RTDE, ModBus, EtherNet/IP and Profinet) or disable the fieldbus in the installation. Check RTDE watchdog feature. Check if a URCap is using this feature.") \ + _D(OPMODE_CHANGED, 30027, "Operational mode changed: " _PH1_ "", "suggest...") \ + _D(NO_KIN_CALIB, 30028, "No Kinematic Calibration found (calibration.conf file is either corrupt or missing).","A new kinematics calibration may be needed if the robot needs to improve its kinematics, otherwise, ignore this message)") \ + _D(KIN_CALIB_UNMATCH_JOINT, 30029, "Kinematic Calibration for the robot does not match the joint(s).", "If moving a program from a different robot to this one, rekinematic calibrate the second robot to improve kinematics, otherwise ignore this message.") \ + _D(KIN_CALIB_UNMATCH_ROBOT, 30030, "Kinematic Calibration does not match the robot.","Please check if the serial number of the robot arm matches the Control Box") \ + _D(JOINT_OFFSET_CHANGED, 30031, "Large movement of the robot detected while it was powered off. The joints were moved while it was powered off, or the encoders do not function", "suggest...") \ + _D(OFFSET_CHANGE_HIGH, 30032, "Change in offset is too high", "suggest...") \ + _D(JOINT_SPEED_LIMIT, 30033, "Close to joint speed safety limit.", "Review program speed and acceleration") \ + _D(TOOL_SPEED_LIMIT, 30034, "Close to tool speed safety limit.", "Review program speed and acceleration") \ + _D(MOMENTUM_LIMIT, 30035, "Close to momentum safety limit.", "Review program speed and acceleration") \ + _D(ROBOT_MV_STOP, 30036, "Robot is moving when in Stop Mode", "suggest...") \ + _D(HAND_PROTECTION, 30037, "Hand protection: Tool is too close to the lower arm: " _PH1_ " meter.","(a) Check wrist position. (b) Verify mounting (c) Do a Complete rebooting sequence (d) Update software (e) Contact your local AUBO Robots service provider for assistance") \ + _D(WRONG_SAFETYMODE, 30038, "Wrong safety mode: " _PH1_, "suggest...") \ + _D(SAFETYMODE_CHANGED, 30039, "Safety mode changed: " _PH1_, "suggest...") \ + _D(JOINT_ACC_LIMIT, 30040, "Close to joint acceleration safety limit", "suggest...") \ + _D(TOOL_ACC_LIMIT, 30041, "Close to tool acceleration safety limit", "suggest...") \ + _D(JOINT_TEMPERATURE_LIMIT, 30042, "Joint " _PH1_ " temperature too high(>" _PH2_ "℃)", "suggest...") \ + _D(CONTROL_BOX_TEMPERATURE_LIMIT, 30043, "Control box temperature too high(>" _PH1_ "℃)", "suggest...") \ + _D(ROBOT_EMERGENCY_STOP, 30044, "Robot emergency stop", "suggest...") \ + _D(ROBOTMODE_CHANGED, 30045, "Robot mode changed: " _PH1_, "suggest...") \ + _D(ROBOTMODE_ERROR, 30046, "Wrong robot mode: " _PH1_, "suggest...") \ + _D(POSE_OUT_OF_REACH, 30047, "Target pose [" _PH1_ "] out of reach", "suggest...") \ + _D(TP_PLAN_FAILED, 30048, "Trajectory plan FAILED." , "suggest...") \ + _D(START_FORCE_FAILED, 30049, "Start force control failed, because force sensor does not exist." , "suggest...") \ + _D(OVER_SAFE_PLANE_LIMIT,30050, _PH1_ " axis exceeds the safety plane limit (Move_type:" _PH2_ " id:" _PH3_ ").","Please move the robot to the safety plane range.") \ + _D(POWERON_FAIL_VIOLATION,30051, "Failed to power on because the robot safety mode is in violation", "suggest...") \ + _D(POWERON_FAIL_SYSTEMEMERGENCYSTOP, 30052, "Failed to power on because the robot safety mode is in system emergency stop", "suggest...") \ + _D(POWERON_FAIL_ROBOTEMERGENCYSTOP, 30053, "Failed to power on because the robot safety mode is in robot emergency stop", "Pop up the red emergency stop button on the teach pendant when the robot is in a safe range of motion") \ + _D(POWERON_FAIL_FAULT, 30054, "Failed to power on because the robot safety mode is in fault", "suggest...") \ + _D(STARTUP_FAIL_VIOLATION, 30055, "Failed to startup because the robot safety mode is in violation", "suggest...") \ + _D(STARTUP_FAIL_SYSTEMEMERGENCYSTOP, 30056, "Failed to startup because the robot safety mode is in system emergency stop", "suggest...") \ + _D(STARTUP_FAIL_ROBOTEMERGENCYSTOP, 30057, "Failed to startup because the robot safety mode is in robot emergency stop", "Pop up the red emergency stop button on the teach pendant when the robot is in a safe range of motion") \ + _D(STARTUP_FAIL_FAULT, 30058, "Failed to startup because the robot safety mode is in fault", "suggest...") \ + _D(BACKDRIVE_FAIL_VIOLATION, 30059, "Failed to backdrive because the robot safety mode is in violation", "suggest...") \ + _D(BACKDRIVE_FAIL_SYSTEMEMERGENCYSTOP, 30060, "Failed to backdrive because the robot safety mode is in system emergency stop", "suggest...") \ + _D(BACKDRIVE_FAIL_ROBOTEMERGENCYSTOP, 30061, "Failed to backdrive because the robot safety mode is in robot emergency stop", "Pop up the red emergency stop button on the teach pendant when the robot is in a safe range of motion") \ + _D(BACKDRIVE_FAIL_FAULT, 30062, "Failed to backdrive because the robot safety mode is in fault", "suggest...") \ + _D(SETSIM_FAIL_VIOLATION, 30063, "Switch sim mode failed because the robot safety mode is in violation", "suggest...") \ + _D(SETSIM_FAIL_SYSTEMEMERGENCYSTOP, 30064, "Switch sim mode failed because the robot safety mode is in system emergency stop", "suggest...") \ + _D(SETSIM_FAIL_ROBOTEMERGENCYSTOP, 30065, "Switch sim mode failed because the robot safety mode is in robot emergency stop", "Pop up the red emergency stop button on the teach pendant when the robot is in a safe range of motion") \ + _D(SETSIM_FAIL_FAULT, 30066, "Switch sim mode failed because the robot safety mode is in fault", "suggest...") \ + _D(FREEDRIVE_FAIL_VIOLATION, 30067, "Enable handguide mode failed because the robot safety mode is in violation", "suggest...") \ + _D(FREEDRIVE_FAIL_SYSTEMEMERGENCYSTOP, 30068, "Enable handguide mode failed because the robot safety mode is in system emergency stop", "suggest...") \ + _D(FREEDRIVE_FAIL_ROBOTEMERGENCYSTOP, 30069, "Enable handguide mode failed because the robot safety mode is in robot emergency stop", "Pop up the red emergency stop button on the teach pendant when the robot is in a safe range of motion") \ + _D(FREEDRIVE_FAIL_FAULT, 30070, "Enable handguide mode failed because the robot safety mode is in fault", "suggest...") \ + _D(UPFIRMWARE_FAIL_VIOLATION, 30071, "Firmware update failed because the robot safety mode is in violation", "suggest...") \ + _D(UPFIRMWARE_FAIL_SYSTEMEMERGENCYSTOP, 30072, "Firmware update failed because the robot safety mode is in system emergency stop", "suggest...") \ + _D(UPFIRMWARE_FAIL_ROBOTEMERGENCYSTOP, 30073, "Firmware update failed because the robot safety mode is in robot emergency stop", "Pop up the red emergency stop button on the teach pendant when the robot is in a safe range of motion") \ + _D(UPFIRMWARE_FAIL_FAULT, 30074, "Firmware update failed because the robot safety mode is in fault", "suggest...") \ + _D(SETPERSOSTENT_FAIL_VIOLATION, 30075, "Set persistent parameter failed because the robot safety mode is in violation", "suggest...") \ + _D(SETPERSOSTENT_FAIL_SYSTEMEMERGENCYSTOP, 30076, "Set persistent parameter failed because the robot safety mode is in system emergency stop", "suggest...") \ + _D(SETPERSOSTENT_FAIL_ROBOTEMERGENCYSTOP, 30077, "Set persistent parameter failed because the robot safety mode is in robot emergency stop", "Pop up the red emergency stop button on the teach pendant when the robot is in a safe range of motion") \ + _D(SETPERSOSTENT_FAIL_FAULT, 30078, "Set persistent parameter failed because the robot safety mode is in fault", "suggest...") \ + _D(SETPERSOSTENT_FAIL_PARAM_ERR, 30079, "Set persistent parameter failed", "(a) Check the parameter format, whether all are floating point numbers") \ + _D(ROBOT_CABLE_DISCONN, 30080, "Robot cable not connected", "(a) Make sure the cable between Control Box and Robot Arm is correctly connected and it has no damage. (b) Check for loose connections (c) Do a Complete rebooting sequence (d) Update software (e) Contact your local AUBO Robots service provider for assistance Contact your local AUBO Robots service provider for assistance.") \ + _D(TP_TOO_SHORT, 30081, "The generated trajectory is ignored because it is too short", "(a) Please check if the added waypoints are coincident (b) If it is an arc movement, please check whether the three points are collinear") \ + _D(INV_KIN_FAIL, 30082, "Inverse kinematics solution failed. The target pose may be in a singular position or exceed the joint limits", "(a) Change the target pose and try moving again") \ + _D(FREEDRIVE_ENABLED, 30083, "Freedrive status changed to " _PH1_ "", "suggest...") \ + _D(TP_INV_FAIL_REFERENCE_JOINT_OUT_OF_LIMIT, 30084, "Inverse kinematics solution failed. Reference angle [" _PH1_ "] exceeds joint limit [" _PH2_ "].", "suggest...") \ + _D(TP_INV_FAIL_NO_SOLUTION, 30085, "Inverse kinematics solution failed. The reference angle [" _PH1_ "] and the target angle [" _PH2_ "] are used as parameters. there is no solution in the calculation of the inverse solution process.", "suggest...")\ + _D(SERVO_FAIL_VIOLATION, 30086, "Switch servo mode failed because the robot safety mode is in violation", "suggest...") \ + _D(SERVO_FAIL_SYSTEMEMERGENCYSTOP, 30087, "Switch servo mode failed because the robot safety mode is in system emergency stop", "suggest...") \ + _D(SERVO_FAIL_ROBOTEMERGENCYSTOP, 30088, "Switch servo mode failed because the robot safety mode is in robot emergency stop", "Pop up the red emergency stop button on the teach pendant when the robot is in a safe range of motion") \ + _D(SERVO_FAIL_FAULT, 30089, "Switch servo mode failed because the robot safety mode is in fault", "suggest...") \ + _D(FREEDRIVE_FAIL_NO_RUNNING, 30090, "Enable handguide mode failed because the robot mode type is " _PH1_ "(not running)", "suggest...") \ + _D(RUNTIME_MACHINE_ERROR, 30091, "The state of the running machine is " _PH1_ ", not " _PH2_ ". " _PH3_ " function execution failed because the state is wrong." , "suggest...") \ + _D(RESUME_FAR_PAUSE_PT, 30092, "Cannot resume from joint position [" _PH1_ "].\\nToo far away from paused point [" _PH2_ "]." , "suggest...") \ + _D(PAYLOAD_LIGHTER_ERROR, 30093, "The payload setting is too small!" , "suggest...") \ + _D(PAYLOAD_OVERLOAD_ERROR, 30094, "The payload setting is too large!" , "suggest...") \ + _D(PAUSE_FAIL_NOT_POSITION_PLAN_MODE, 30095, "This motion does not support the pause function. The motion is stopping." , "suggest...") \ + _D(TP_PLAN_FAILED_CIRCULAR_WAYPOINTS_COINCIDE, 30096, "The planning failed because the three waypoints of the arc were determined to coincide." , "Check the circular waypoints to make sure they are different.") \ + _D(SERVO_WRONG_SAFETYMODE, 30097, "Switch servo mode failed because the robot safety mode is in " _PH1_ "." , "Check the circular waypoints to make sure they are different.") \ + _D(SET_PERSTPARAM_WRONG_SAFETYMODE, 30098, "Set persistent parameter failed because the robot safety mode is in " _PH1_ , "suggest...") \ + _D(SET_KINPARAM_WRONG_SAFETYMODE, 30099, "Set Kinematics Compensate parameters failed because the robot safety mode is in " _PH1_ , "suggest...") \ + _D(SET_ROBOT_ZERO_WRONG_SAFETYMODE, 30100, "Set current joint angles to zero failed because the robot safety mode is in " _PH1_ , "suggest...") \ + _D(UPFIRMWARE_WRONG_SAFETYMODE, 30101, "Firmware update failed because the robot safety mode is in " _PH1_, "suggest...") \ + _D(POWERON_WRONG_SAFETYMODE, 30102, "Failed to power on because the robot safety mode is in " _PH1_, "suggest...") \ + _D(STARTUP_WRONG_SAFETYMODE, 30103, "Failed to startup because the robot safety mode is in " _PH1_, "suggest...") \ + _D(BACKDRIVE_WRONG_SAFETYMODE, 30104, "Failed to backdrive because the robot safety mode is in system emergency stop", "suggest...") \ + _D(SETSIM_WRONG_SAFETYMODE, 30105, "Switch sim mode failed because the robot safety mode is in violation", "suggest...") \ + _D(FREEDRIVE_WRONG_SAFETYMODE, 30106, "Enable handguide mode failed because the robot safety mode is in wrong safety mode: " _PH1_, "suggest...") \ + _D(TP_PLAN_FAILED_JOINT_JUMP_BIGGER, 30107, "Inverse kinematics solution failed. The target point and the current point are in different robot configuration spaces.", "Add a few more points between the target point and the current point.") \ + _D(RUN_PROGRAM_FAILED, 30108, "Run program " _PH1_ " failed.", "suggset...") \ + _D(FREEDRIVE_FAIL_WRONG_RTMSTATE, 30109, "Unable to enter the HandGuide mode as the robot is not currently in a stopped or paused state.", "suggset...") \ + _D(SAFEGUARDSTOP_CONFIGURABLE_INPUT, 30110, "Configurable safety input is triggered.", "suggset...") \ + _D(SAFEGUARDSTOP_3PE, 30111, "3PE is triggered.", "suggset...") \ + _D(SAFEGUARDSTOP_SI, 30112, "SI0/SI1 is triggered.", "suggset...") \ + _D(ROBOT_TYPE_CHANGED, 30200, "Robot type changed to '" _PH1_ "', and robot subtype changed to '" _PH2_ "'", "suggest...") \ + _D(LINKMODE_CHANGED, 30201, "Link mode changed to " _PH1_ "", "suggest...") \ + _D(ROBOT_SELF_COLLISION, 30301, "Detect risk of robot self collision", "suggest...") \ + _D(CONSTANT_INVALID, 30302, "Joint torque constants are invalid. HandGuide will be disabled, and the collision protection may be triggered by mistake.", "suggest...") \ + _D(GRAVITY_INVALID, 30303, "Abnormal value of gravity acceleration sensor. HandGuide will be disabled, and the collision protection may be triggered by mistake.", "suggest...") \ + _D(DYNAMICS_INVALID, 30304, "Robot dynamics parameters are invalid. HandGuide will be disabled, and the collision protection may be triggered by mistake.", "suggest...") \ + _D(FRICTION_INVALID, 30305, "Joint friction parameters are invalid. HandGuide will be disabled, and the collision protection may be triggered by mistake.", "suggest...") \ + _D(HANDGUIDE_UNDER_DEVELOP, 30306, "Robot type of " _PH1_ " function under development. HandGuide will be disabled, and the collision protection may be triggered by mistake.", "suggest...") \ + _D(SLOW_DOWN_INFO, 30307, "Slow down level changed to " _PH1_ "(" _PH2_ "%)", "suggest...") \ + _D(WRONG_JOINT_DESIGNED_LIMIT, 30308, "Joint designed ranges exceeds ranges read from hardware interface.", "suggest...") \ + _D(FREEDRIVE_IN_SIMULATION, 30309, "Enable handguide mode failed because the robot is in simulation mode.", "suggest...") \ + _D(ROBOT_STOPPING_TIMEOUT, 30310, "Robot stopping timeout.", "suggest...") \ + _D(PSTOP_INCORRECT_FORCE_OFFSET, 30311, "Protective Stop: Sudden change in force control target position. Force sensor offset may be incorrect or force sensor fault.", "suggest...") \ + _D(WRONG_JOINT_SAFETY_LIMIT, 30312, "Joint safety ranges exceeds designed ranges.", "suggest...") \ + _D(PSTOP_TCP_PLANE_VIOLATION, 30401, "Protective Stop: TCP position close to safety plane limits.", "suggest...") \ + _D(PSTOP_ELBOW_PLANE_VIOLATION, 30402, "Protective Stop: elbow position close to safety plane limits.", "suggest...") \ + _D(PSTOP_JOINT_TORQUE_VIOLATION, 30403, "Protective Stop: joint" _PH1_ " exceeds torque limit.", "suggest...") \ + _D(PSTOP_JOINT_POSITION_VIOLATION, 30404, "Protective Stop: joint" _PH1_ " exceeds position limit.", "suggest...") \ + _D(PSTOP_JOINT_SPEED_VIOLATION, 30405, "Protective Stop: joint" _PH1_ " exceeds speed limit.", "suggest...") \ + _D(PSTOP_TCP_SPEED_VIOLATION, 30406, "Protective Stop: TCP speed close to safety limits.", "suggest...") \ + _D(PSTOP_ELBOW_SPEED_VIOLATION, 30407, "Protective Stop: elbow speed close to safety limits.", "suggest...") \ + _D(PSTOP_TCP_FORCE_VIOLATION, 30408, "Protective Stop: TCP foece close to safety limits.", "suggest...") \ + _D(PSTOP_ELBOW_TORQUE_VIOLATION, 30409, "Protective Stop: elbow torque close to safety limits.", "suggest...") \ + _D(PSTOP_POWER_VIOLATION, 30410, "Protective Stop: robot power close to safety limits.", "suggest...") \ + _D(PSTOP_MOMENTUM_VIOLATION, 30411, "Protective Stop: robot momentum close to safety limits.", "suggest...") \ + _D(PSTOP_TCP_CUBE_VIOLATION, 30412, "Protective Stop: TCP position close to safety cube.", "suggest...") \ + _D(PSTOP_ELBOW_CUBE_VIOLATION, 30413, "Protective Stop: TCP position close to safety cube.", "suggest...") \ + _D(REDUCE_ELBOW_PLANE_TRIGGER, 30414, "Reduce mode: elbow close to safety plane triggers reduction mode.", "suggest...") \ + _D(REDUCE_TCP_PLANE_TRIGGER, 30415, "Reduce mode: TCP close to safety plane triggers reduction mode.", "suggest...") \ + _D(PSTOP_MOVE_OUT_RANGE, 30416, "Joint " _PH1_ " has exceeded the limit, please do not continue to move out of the range", "suggest...") \ + _D(RESUME_PAUSE_FAILED, 30417, "Resume Failed: Safety mode type is " _PH1_ "", "suggest...") \ + _D(FIRMWARE_UPDATE_FAIL_EMERGENCYSTOP, 30418, "Failed to firmware update because the robot safety mode is in " _PH1_ , "Release emergency stop when the robot is in a safe range of motion") \ + _D(TOOL_SENSOR_CHANGED, 30419, "Tool sensor type changed to " _PH1_ "", "suggest...") \ + _D(TOOL_SENSOR_REMOVED, 30420, "Tool sensor is removed.", "suggest...") \ + _D(CAL_TARGET_CURRENT_ERR, 30421, "The calculation of the target current failed. Please try again later.", "suggest...") \ + _D(CONVEYOR_MODE_CHANGED, 30422, "Conveyor" _PH1_ ": track mode changed to " _PH2_ ", track item id is " _PH3_, "suggest...") \ + _D(CONVEYOR_ENQUEUE, 30423, "Conveyor" _PH1_ ": the queue has been changed, item" _PH2_ " is enqueue", "suggest...") \ + _D(CONVEYOR_DEQUEUE_FINISH, 30424, "Conveyor" _PH1_ ": the queue has been changed, item" _PH2_ " dequeue due to track finished", "suggest...") \ + _D(CONVEYOR_DEQUEUE_STARTWINDOW, 30425, "Conveyor" _PH1_ ": the queue has been changed, item" _PH2_ " dequeue due to exceeds startwindow", "suggest...") \ + _D(CONVEYOR_DEQUEUE_LIMIT, 30426, "Conveyor" _PH1_ ": the queue has been changed, item" _PH2_ " dequeue due to exceed limit area", "suggest...") \ + _D(CONVEYOR_DEQUEUE_CLEAR, 30427, "Conveyor" _PH1_ ": item queue is cleared", "suggest...") \ + _D(CONVEYOR_NEXT_TRACK, 30428, "Conveyor" _PH1_ ": item" _PH2_ " inside the start window that can be tracked ", "suggest...") \ + _D(CONVEYOR_EXCEED_LIMIT, 30429, "Conveyor" _PH1_ ": item" _PH2_ " exceeds the limit area during tracking", "suggest...") + +// clang-format on + +#endif // AUBO_SDK_RTM_ERROR_H diff --git a/third_party/AuboSdk/win/include/aubo/error_stack/system_error.h b/third_party/AuboSdk/win/include/aubo/error_stack/system_error.h new file mode 100644 index 00000000..c4676c64 --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo/error_stack/system_error.h @@ -0,0 +1,53 @@ +/** @file system_error.h + * @brief 系统错误码 + */ +#ifndef AUBO_SDK_SYSTEM_ERROR_H +#define AUBO_SDK_SYSTEM_ERROR_H + +#define SYSTEM_ERRORS \ + _D(DEBUG, 0, "Debug message " _PH1_, "suggest...") \ + _D(POPUP, 1, "Popup title: " _PH1_ ", msg: " _PH2_ ", mode: " _PH3_, \ + "suggest...") \ + _D(POPUP_DISMISS, 2, _PH1_, "suggest...") \ + _D(SYSTEM_HALT, 3, _PH1_, "suggest...") \ + _D(INV_ARGUMENTS, 4, "Invalid arguments.", "suggest...") \ + _D(USER_NOTIFY, 5, _PH1_, "suggest...") \ + _D(MODBUS_SIGNAL_CREATED, 10, "Modbus signal " _PH1_ " created.", \ + "suggest...") \ + _D(MODBUS_SIGNAL_REMOVED, 11, "Modbus signal " _PH1_ " removed.", \ + "suggest...") \ + _D(MODBUS_SIGNAL_VALUE_CHANGED, 12, \ + "Modbus signal " _PH1_ " value changed to " _PH2_, "suggest...") \ + _D(RUNTIME_CONTEXT, 13, \ + "tid: " _PH1_ " lineno: " _PH2_ " index: " _PH3_ " comment: " _PH4_, \ + "suggest...") \ + _D(INTERP_CONTEXT, 14, \ + "tid: " _PH1_ " lineno: " _PH2_ " index: " _PH3_ " comment: " _PH4_, \ + "suggest...") \ + _D(PROGRAM_LOADED, 15, "program loaded: " _PH1_, "suggest...") \ + _D(MODBUS_SLAVE_BIT, 20, "Modbus slave address: " _PH1_ " value " _PH2_, \ + "suggest...") \ + _D(MODBUS_SLAVE_REG, 21, "Modbus slave address: " _PH1_ " value " _PH2_, \ + "suggest...") \ + _D(PNIO_SLAVE_SLOT_VALUE, 30, \ + "PNIO slot: " _PH1_ " subslot " _PH2_ " index " _PH3_ " value " _PH4_, \ + "suggest...") \ + _D(PNIO_CONNECT_STATUS, 31, "PNIO connection status changed to " _PH1_, \ + "suggest...") \ + _D(PNIO_DEVICE_NAME, 32, "PNIO device name changed to " _PH1_, \ + "suggest...") \ + _D(PNIO_IP, 33, "PNIO ip " _PH1_ " mask " _PH2_ " gateway " _PH3_, \ + "suggest...") \ + _D(ICM_SERVER_STATUS, 40, " ICM server status changed to " _PH1_, \ + "suggest...") \ + _D(EIP_X, 50, "ICM slot: " _PH1_ " index " _PH2_ " subindex " _PH3_, \ + "suggest...") \ + _D(LOG_PROGRAM_SUCCESS , 100, "[" _PH1_ "] Load program " _PH2_ " successful", \ + "suggest...") \ + _D(LOG_PROGRAM_FAILED , 101, "[" _PH1_ "] Load program " _PH2_ " failed, file not found", \ + "suggest...") \ + _D(LOG_PROGRAM_FAILED2 , 102, \ + "[" _PH1_ "] Load program " _PH2_ " failed, configuration file (.ins) does not match", \ + "suggest...") + +#endif // AUBO_SDK_SYSTEM_ERROR_H diff --git a/third_party/AuboSdk/win/include/aubo/global_config.h b/third_party/AuboSdk/win/include/aubo/global_config.h new file mode 100644 index 00000000..b01031f2 --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo/global_config.h @@ -0,0 +1,178 @@ +/* + global_config.h + this file is generated. Do not change! +*/ + +#ifndef ARCS_GLOBALCONFIG_H +#define ARCS_GLOBALCONFIG_H + +/* #undef ARCS_BUILD_SHARED_LIBS */ +/* #undef ARCS_ENABLE_THREADING_SUPPORT */ + +//------------------------------------------------------------------- +// Header Availability +//------------------------------------------------------------------- + +/* #undef ARCS_HAVE_CXXABI_H */ + +//------------------------------------------------------------------- +// Version information +//------------------------------------------------------------------- + +#define INTERFACE_VERSION_MAJOR 0 +#define INTERFACE_VERSION_MINOR 26 +#define INTERFACE_VERSION_PATCH 0 +#define INTERFACE_VERSION "0.26.0" + +//------------------------------------------------------------------- +// Platform defines +//------------------------------------------------------------------- + +#if defined(__APPLE__) +#define ARCS_PLATFORM_APPLE +#endif + +#if defined(__linux__) +#define ARCS_PLATFORM_LINUX +#endif + +#if defined(_WIN32) || defined(_WIN64) +#define ARCS_PLATFORM_WINDOWS +#else +#define ARCS_PLATFORM_POSIX +#endif + +/* #undef ARCS_BIG_ENDIAN */ +/* #undef ARCS_LITTLE_ENDIAN */ + +#define ARCS_LIB_PREFIX "" +#define ARCS_LIB_EXT ".dll" +#define ARCS_EXE_EXT ".exe" + +#ifdef NDEBUG // Defined by cmake UNLESS Debug build type is chosen +#define ARCS_LIB_POSTFIX "" +#else +#define ARCS_LIB_POSTFIX \ + "" // Set in top level CMakeList.txt +#endif + +#define ARCS_FUNCTION // 函数接口 +#define ARCS_INSTRUCT // 指令接口 + +///------------------------------------------------------------------- +// Macros for import/export declarations +//------------------------------------------------------------------- + +#if defined(ARCS_PLATFORM_WINDOWS) +#define ARCS_ABI_EXPORT __declspec(dllexport) +#define ARCS_ABI_IMPORT __declspec(dllimport) +#define ARCS_ABI_LOCAL +#elif defined(ARCS_HAVE_VISIBILITY_ATTRIBUTE) +#define ARCS_ABI_EXPORT __attribute__((visibility("default"))) +#define ARCS_ABI_IMPORT __attribute__((visibility("default"))) +#define ARCS_ABI_LOCAL __attribute__((visibility("hidden"))) +#else +#define ARCS_ABI_EXPORT +#define ARCS_ABI_IMPORT +#define ARCS_ABI_LOCAL +#endif + +#ifdef ARCS_BUILDING_STAGE +#define ARCS_ABI ARCS_ABI_EXPORT +#else +#define ARCS_ABI ARCS_ABI_IMPORT +#endif + +//------------------------------------------------------------------- +// Macros for suppressing warnings +//------------------------------------------------------------------- + +#ifdef _MSC_VER +#define ARCS_MSVC_PUSH_DISABLE_WARNING(wn) \ + __pragma(warning(push)) __pragma(warning(disable : wn)) +#define ARCS_MSVC_POP_WARNING __pragma(warning(pop)) +#define ARCS_MSVC_DISABLE_WARNING(wn) __pragma(warning(disable : wn)) +#else +#define ARCS_MSVC_PUSH_DISABLE_WARNING(wn) +#define ARCS_MSVC_POP_WARNING +#define ARCS_MSVC_DISABLE_WARNING(wn) +#endif + +#ifdef __GNUC__ +#define aubo_gcc_pragma_expand(x) _Pragma(#x) +#define ARCS_GCC_PUSH_DISABLE_WARNING(wn) \ + _Pragma("GCC diagnostic push") \ + aubo_gcc_pragma_expand(GCC diagnostic ignored "-W" #wn) +#define ARCS_GCC_POP_WARNING _Pragma("GCC diagnostic pop") +#else +#define ARCS_GCC_PUSH_DISABLE_WARNING(wn) +#define ARCS_GCC_POP_WARNING +#endif + +#if defined(__GNUC__) +#define ARCS_DEPRECATED __attribute__((deprecated)) +#elif defined(_MSC_VER) +#define ARCS_DEPRECATED __declspec(deprecated) +#else +#pragma message( \ + "WARNING: You need to implement ARCS_DEPRECATED for your compiler!") +#define ARCS_DEPRECATED +#endif + +// Do not warn about the usage of deprecated unsafe functions +ARCS_MSVC_DISABLE_WARNING(4996) + +// Mark a variable or expression result as unused +#define ARCS_UNUSED(x) (void)(x) + +//------------------------------------------------------------------- +// C++ Language features +//------------------------------------------------------------------- + +/* #undef ARCS_HAVE_THREAD_LOCAL */ + +//------------------------------------------------------------------- +// C++ Library features +//------------------------------------------------------------------- + +/* #undef ARCS_HAVE_REGEX */ + +//------------------------------------------------------------------- +// Hash Container +//------------------------------------------------------------------- + +#define ARCS_HASH_FUNCTION_BEGIN(type) \ + namespace std { \ + template <> \ + struct hash \ + { \ + std::size_t operator()(const type &arg) const \ + { +#define ARCS_HASH_FUNCTION_END \ + } \ + } \ + ; \ + } + +//------------------------------------------------------------------- +// Utility macros +//------------------------------------------------------------------- + +#define ARCS_STR_(x) #x +#define ARCS_STR(x) ARCS_STR_(x) +#define ARCS_CONCAT_(x, y) x##y +#define ARCS_CONCAT(x, y) ARCS_CONCAT_(x, y) + +//------------------------------------------------------------------- +// Backwards compatibility macros +//------------------------------------------------------------------- + +#if !defined(__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 +#define ARCS_FUTURE_READY true +#define ARCS_FUTURE_TIMEOUT false +#else +#define ARCS_FUTURE_READY std::future_status::ready +#define ARCS_FUTURE_TIMEOUT std::future_status::timeout +#endif + +#endif // ARCS_GLOBALCONFIG_H diff --git a/third_party/AuboSdk/win/include/aubo/math.h b/third_party/AuboSdk/win/include/aubo/math.h new file mode 100644 index 00000000..f1e96afd --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo/math.h @@ -0,0 +1,909 @@ +/** @file math.h + * \~chinese @brief 数学方法接口,如欧拉角与四元数转换、位姿的加减运算 + * \~english @brief Mathematic operation interface, such as euler to quaternion conversion, addition/subtraction of poses + */ +#ifndef AUBO_SDK_MATH_INTERFACE_H +#define AUBO_SDK_MATH_INTERFACE_H + +#include +#include + +#include +#include + +namespace arcs { +namespace common_interface { + +class ARCS_ABI_EXPORT Math +{ +public: + Math(); + virtual ~Math(); + + /** + * \english + * Pose addition + * + * Both arguments contain three position parameters (x, y, z) jointly called + * P, and three rotation parameters (R_x, R_y, R_z) jointly called R. This + * function calculates the result x_3 as the addition of the given poses as + * follows: + * + * p_3.P = p_1.P + p_2.P + * + * p_3.R = p_1.R * p_2.R + * + * @param p1 Tool pose 1 + * @param p2 Tool pose 2 + * @return sum of position parts and product of rotation parts (pose) + * + * @par Python interface prototype + * poseAdd(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float]) -> + * List[float] + * + * @par Lua interface prototype + * poseAdd(p1: table, p2: table) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Math.poseAdd","params":[[0.2, 0.5, 0.1, 1.57, + * 0, 0],[0.2, 0.5, 0.6, 1.57, 0, 0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.4,1.0,0.7,3.14,-0.0,0.0]} + * \endengish + * + * \chinese + * 位姿相加。 + * 两个参数都包含三个位置参数(x、y、z),统称为P, + * 以及三个旋转参数(R_x、R_y、R_z),统称为R。 + * 此函数根据以下方式计算结果 p_3,即给定位姿的相加: + * p_3.P = p_1.P + p_2.P, + * p_3.R = p_1.R * p_2.R + * + * @param p1 工具位姿1(pose) + * @param p2 工具位姿2(pose) + * @return 位置部分之和和旋转部分之积(pose) + * + * @par Python函数原型 + * poseAdd(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float]) -> + * List[float] + * + * @par Lua函数原型 + * poseAdd(p1: table, p2: table) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Math.poseAdd","params":[[0.2, 0.5, 0.1, 1.57, + * 0, 0],[0.2, 0.5, 0.6, 1.57, 0, 0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.4,1.0,0.7,3.14,-0.0,0.0]} + * \endchinese + */ + std::vector poseAdd(const std::vector &p1, + const std::vector &p2); + + /** + * \chinese + * 位姿相减 + * + * 两个参数都包含三个位置参数(x、y、z),统称为P, + * 以及三个旋转参数(R_x、R_y、R_z),统称为R。 + * 此函数根据以下方式计算结果 p_3,即给定位姿的相加: + * p_3.P = p_1.P - p_2.P, + * p_3.R = p_1.R * p_2.R.inverse + * + * @param p1 工具位姿1 + * @param p2 工具位姿2 + * @return 位姿相减计算结果 + * + * @par Python函数原型 + * poseSub(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float]) -> + * List[float] + * + * @par Lua函数原型 + * poseSub(p1: table, p2: table) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Math.poseSub","params":[[0.2, 0.5, 0.1, 1.57, + * 0, 0],[0.2, 0.5, 0.6, 1.57, 0, 0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,-0.5,0.0,-0.0,0.0]} + * \endchinese + * + * \english + * Pose subtraction + * + * Both arguments contain three position parameters (x, y, z) jointly called + * P, and three rotation parameters (R_x, R_y, R_z) jointly called R. This + * function calculates the result x_3 as the addition of the given poses as + * follows: + * + * p_3.P = p_1.P - p_2.P, + * + * p_3.R = p_1.R * p_2.R.inverse + * + * @param p1 tool pose 1 + * @param p2 tool pose 2 + * @return difference between two poses + * + * @par Python interface prototype + * poseSub(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float]) -> + * List[float] + * + * @par Lua interface prototype + * poseSub(p1: table, p2: table) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Math.poseSub","params":[[0.2, 0.5, 0.1, 1.57, + * 0, 0],[0.2, 0.5, 0.6, 1.57, 0, 0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,-0.5,0.0,-0.0,0.0]} + * \endenglish + */ + std::vector poseSub(const std::vector &p1, + const std::vector &p2); + + /** + * \chinese + * 计算线性插值 + * + * @param p1 起点的TCP位姿 + * @param p2 终点的TCP位姿 + * @param alpha 系数, + * 当01,返回p2; + * 当alpha<0,返回p1; + * @return 插值计算结果 + * + * @par Python函数原型 + * interpolatePose(self: pyaubo_sdk.Math, arg0: List[float], arg1: + * List[float], arg2: float) -> List[float] + * + * @par Lua函数原型 + * interpolatePose(p1: table, p2: table, alpha: number) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Math.interpolatePose","params":[[0.2, 0.2, + * 0.4, 0, 0, 0],[0.2, 0.2, 0.6, 0, 0, 0],0.5],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.2,0.2,0.5,0.0,-0.0,0.0]} + * \endchinese + * + * \english + * Calculate linear interpolation + * + * @param p1 starting TCP pose + * @param p2 ending TCP pose + * @param alpha coefficient; + * When 01, return p2; + * When alpha<0,return p1; + * @return interpolation result + * + * @par Python interface prototype + * interpolatePose(self: pyaubo_sdk.Math, arg0: List[float], arg1: + * List[float], arg2: float) -> List[float] + * + * @par Lua interface prototype + * interpolatePose(p1: table, p2: table, alpha: number) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Math.interpolatePose","params":[[0.2, 0.2, + * 0.4, 0, 0, 0],[0.2, 0.2, 0.6, 0, 0, 0],0.5],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.2,0.2,0.5,0.0,-0.0,0.0]} + * \endenglish + * + */ + std::vector interpolatePose(const std::vector &p1, + const std::vector &p2, + double alpha); + /** + * \chinese + * 位姿变换 + * + * 第一个参数 p_from 用于转换第二个参数 p_from_to,并返回结果。 + * 这意味着结果是从 p_from 的坐标系开始, + * 然后在该坐标系中移动 p_from_to后的位姿。 + * + * 这个函数可以从两个不同的角度来看。 + * 一种是函数将 p_from_to 根据 p_from 的参数进行转换,即平移和旋转。 + * 另一种是函数被用于获取结果姿态,先对 p_from 进行移动,然后再对 p_from_to + * 进行移动。 如果将姿态视为转换矩阵,它看起来像是: + * + * T_world->to = T_world->from * T_from->to, + * T_x->to = T_x->from * T_from->to + * + * 这两个方程描述了姿态变换的基本原理,根据给定的起始姿态和相对于起始姿态的姿态变化,可以计算出目标姿态。 + * + * 举个例子,已知B相对于A的位姿、C相对于B的位姿,求C相对于A的位姿。 + * 第一个参数是B相对于A的位姿,第二个参数是C相对于B的位姿, + * 返回值是C相对于A的位姿。 + * + * @param pose_from 起始位姿(空间向量) + * @param pose_from_to 相对于起始位姿的姿态变化(空间向量) + * @return 结果位姿 (空间向量) + * + * @par Python函数原型 + * poseTrans(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float]) -> + * List[float] + * + * @par Lua函数原型 + * poseTrans(pose_from: table, pose_from_to: table) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Math.poseTrans","params":[[0.2, 0.5, + * 0.1, 1.57, 0, 0],[0.2, 0.5, 0.6, 1.57, 0, 0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.4,-0.09960164640373415,0.6004776374923573,3.14,-0.0,0.0]} + * \endchinese + * + * \english + * Pose transformation + * + * The first argument, p_from, is used to transform the second argument, + * p_from_to, and the result is then returned. This means that the result is + * the resulting pose, when starting at the coordinate system of p_from, and + * then in that coordinate system moving p_from_to. + * + * This function can be seen in two different views. Either the function + * transforms, that is translates and rotates, p_from_to by the parameters + * of p_from. Or the function is used to get the resulting pose, when first + * making a move of p_from and then from there, a move of p_from_to. If the + * poses were regarded as transformation matrices, it would look like: + * + * T_world->to = T_world->from * T_from->to, + * T_x->to = T_x->from * T_from->to + * + * + * These two equations describes the foundations for pose transformation. + * Based on a starting pose and the pose transformation relative to the starting pose, we can get the target pose. + * + * For example, we know pose of B relative to A, pose of C relative to B, find pose of C relative to A. + * param 1 is pose of B relative to A,param 2 is pose of C relative to B, + * the return value is the pose of C relative to A + * + * @param pose_from starting pose(vector in 3D space) + * @param pose_from_to pose transformation relative to starting pose(vector in 3D space) + * @return final pose (vector in 3D space) + * + * @par Python interface prototype + * poseTrans(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float]) -> + * List[float] + * + * @par Lua interface prototype + * poseTrans(pose_from: table, pose_from_to: table) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Math.poseTrans","params":[[0.2, 0.5, + * 0.1, 1.57, 0, 0],[0.2, 0.5, 0.6, 1.57, 0, 0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.4,-0.09960164640373415,0.6004776374923573,3.14,-0.0,0.0]} + * \endenglish + */ + std::vector poseTrans(const std::vector &pose_from, + const std::vector &pose_from_to); + + /** + * \english + * Pose inverse transformation + * + * Given pose of C relative to A, pose of C relative to B, find pose of B relative to A. + * param 1 is pose of C relative to A,param 2 is pose of C relative to B, + * the return value is the pose of B relative to A + * + * @param pose_from starting pose + * @param pose_to_from pose transformation relative to final pose + * @return resulting pose + * + * @par Python interface prototype + * poseTransInv(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float]) + * -> List[float] + * + * @par Lua interface prototype + * poseTransInv(pose_from: table, pose_to_from: table) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Math.poseTransInv","params":[[0.4, -0.0996016, + * 0.600478, 3.14, 0, 0],[0.2, 0.5, 0.6, 1.57, 0, 0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.2,0.5000000464037341,0.10000036250764266,1.57,-0.0,0.0]} + * \endenglish + * + * \chinese + * 姿态逆变换 + * + * 已知C相对于A的位姿、C相对于B的位姿,求B相对于A的位姿。 + * 第一个参数是C相对于A的位姿,第二个参数是C相对于B的位姿, + * 返回值是B相对于A的位姿。 + * + * @param pose_from 起始位姿 + * @param pose_to_from 相对于结果位姿的姿态变化 + * @return 结果位姿 + * + * @par Python函数原型 + * poseTransInv(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float]) + * -> List[float] + * + * @par Lua函数原型 + * poseTransInv(pose_from: table, pose_to_from: table) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Math.poseTransInv","params":[[0.4, -0.0996016, + * 0.600478, 3.14, 0, 0],[0.2, 0.5, 0.6, 1.57, 0, 0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.2,0.5000000464037341,0.10000036250764266,1.57,-0.0,0.0]} + * \endchinese + */ + std::vector poseTransInv(const std::vector &pose_from, + const std::vector &pose_to_from); + + /** + * \chinese + * 获取位姿的逆 + * + * @param pose 工具位姿(空间向量) + * @return 工具位姿的逆转换(空间向量) + * + * @par Python函数原型 + * poseInverse(self: pyaubo_sdk.Math, arg0: List[float]) -> List[float] + * + * @par Lua函数原型 + * poseInverse(pose: table) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Math.poseInverse","params":[[0.2, 0.5, + * 0.1, 1.57, 0, 3.14]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.19920341988726448,-0.09960155178838484,-0.5003973704832628, + * 1.5699999989900404,-0.0015926530848129354,-3.1415913853161266]} + * + * \endchinese + * + * \english + * Get the inverse of a pose + * + * @param pose tool pose (spatial vector) + * @return inverse tool pose transformation (spatial vector) + * + * @par Python interface prototype + * poseInverse(self: pyaubo_sdk.Math, arg0: List[float]) -> List[float] + * + * @par Lua interface prototype + * poseInverse(pose: table) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Math.poseInverse","params":[[0.2, 0.5, + * 0.1, 1.57, 0, 3.14]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.19920341988726448,-0.09960155178838484,-0.5003973704832628, + * 1.5699999989900404,-0.0015926530848129354,-3.1415913853161266]} + * \endenglish + * + */ + std::vector poseInverse(const std::vector &pose); + + /** + * \chinese + * 计算两个位姿的位置距离 + * + * @param p1 位姿1 + * @param p2 位姿2 + * @return 两个位姿的位置距离 + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Math.poseDistance","params":[[0.1, 0.3, 0.1, + * 0.3142, 0.0, 1.571],[0.2, 0.5, 0.6, 0, -0.172, 0.0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.5477225575051661} + * \endchinese + * + * \english + * Calculate distance between two poses + * + * @param p1 pose 1 + * @param p2 pose 2 + * @return distance between the poses + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Math.poseDistance","params":[[0.1, 0.3, 0.1, + * 0.3142, 0.0, 1.571],[0.2, 0.5, 0.6, 0, -0.172, 0.0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.5477225575051661} + * \endenglish + * + */ + double poseDistance(const std::vector &p1, + const std::vector &p2); + + /** + * \chinese + * 计算两个位姿的轴角距离 + * + * @param p1 位姿1 + * @param p2 位姿2 + * @return 轴角距离 + * \endchinese + * + * \english + * Calculate axis-angle difference between two poses + * + * @param p1 pose 1 + * @param p2 pose 2 + * @return axis angle difference + * \endenglish + */ + double poseAngleDistance(const std::vector &p1, + + const std::vector &p2); + + /** + * \chinese + * 判断两个位姿是否相等 + * + * @param p1 位姿1 + * @param p2 位姿2 + * @param eps 误差 + * @return 相等返回true,反之返回false + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Math.poseDistance","params":[[0.1, 0.3, 0.1, + * 0.3142, 0.0, 1.571],[0.1, 0.3, 0.1, 0.3142, 0.0, 1.5711]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * \endchinese + * + * \english + * Determine if two poses are equivalent + * + * @param p1 pose 1 + * @param p2 pose 2 + * @param eps error margin + * @return true or false + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Math.poseDistance","params":[[0.1, 0.3, 0.1, + * 0.3142, 0.0, 1.571],[0.1, 0.3, 0.1, 0.3142, 0.0, 1.5711]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * \endenglish + */ + bool poseEqual(const std::vector &p1, const std::vector &p2, + double eps = 5e-5); + + /** + * \chinese + * @param F_b_a_old + * @param V_in_a + * @param type + * @return + * + * @par Python函数原型 + * transferRefFrame(self: pyaubo_sdk.Math, arg0: List[float], arg1: + * List[float[3]], arg2: int) -> List[float] + * + * @par Lua函数原型 + * transferRefFrame(F_b_a_old: table, V_in_a: table, type: number) -> table + * \endchinese + * + * \english + * @param F_b_a_old + * @param V_in_a + * @param type + * @return + * + * @par Python interface prototype + * transferRefFrame(self: pyaubo_sdk.Math, arg0: List[float], arg1: + * List[float[3]], arg2: int) -> List[float] + * + * @par Lua interface prototype + * transferRefFrame(F_b_a_old: table, V_in_a: table, type: number) -> table + * \endenglish + */ + std::vector transferRefFrame(const std::vector &F_b_a_old, + const Vector3d &V_in_a, int type); + + /** + * \chinese + * 姿态旋转 + * + * @param pose + * @param rotv + * @return + * + * @par Python函数原型 + * poseRotation(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float]) + * -> List[float] + * + * @par Lua函数原型 + * poseRotation(pose: table, rotv: table) -> table + * \endchinese + * + * \english + * Pose rotation + * + * @param pose + * @param rotv + * @return + * + * @par Python interface prototype + * poseRotation(self: pyaubo_sdk.Math, arg0: List[float], arg1: List[float]) + * -> List[float] + * + * @par Lua interface prototype + * poseRotation(pose: table, rotv: table) -> table + * \endenglish + */ + std::vector poseRotation(const std::vector &pose, + const std::vector &rotv); + + /** + * \chinese + * 欧拉角转四元数 + * + * @param rpy 欧拉角 + * @return 四元数 + * + * @par Python函数原型 + * rpyToQuaternion(self: pyaubo_sdk.Math, arg0: List[float]) -> List[float] + * + * @par Lua函数原型 + * rpyToQuaternion(rpy: table) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Math.rpyToQuaternion","params":[[0.611, 0.785, + * 0.960]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.834721517970497,0.07804256900772265,0.4518931575790371,0.3048637712043723]} + * \endchinese + * + * \english + * Euler angles to quaternions + * + * @param rpy euler angles + * @return quaternions + * + * @par Python interface prototype + * rpyToQuaternion(self: pyaubo_sdk.Math, arg0: List[float]) -> List[float] + * + * @par Lua interface prototype + * rpyToQuaternion(rpy: table) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Math.rpyToQuaternion","params":[[0.611, 0.785, + * 0.960]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.834721517970497,0.07804256900772265,0.4518931575790371,0.3048637712043723]} + * \endenglish + */ + std::vector rpyToQuaternion(const std::vector &rpy); + + /** + * \chinese + * 四元数转欧拉角 + * + * @param quat 四元数 + * @return 欧拉角 + * + * @par Python函数原型 + * quaternionToRpy(self: pyaubo_sdk.Math, arg0: List[float]) -> List[float] + * + * @par Lua函数原型 + * quaternionToRpy(quat: table) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Math.quaternionToRpy","params":[[0.834722, + * 0.0780426, 0.451893, 0.304864]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.6110000520523781,0.7849996877683915,0.960000543982093]} + * \endchinese + * + * \english + * Quaternions to euler angles + * + * @param quat quaternions + * @return euler angles + * + * @par Python interface prototype + * quaternionToRpy(self: pyaubo_sdk.Math, arg0: List[float]) -> List[float] + * + * @par Lua interface prototype + * quaternionToRpy(quat: table) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Math.quaternionToRpy","params":[[0.834722, + * 0.0780426, 0.451893, 0.304864]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.6110000520523781,0.7849996877683915,0.960000543982093]} + * \endenglish + */ + std::vector quaternionToRpy(const std::vector &quat); + + /** + * \chinese + * 四点法标定TCP偏移 + * + * 找一个尖点,将机械臂工具末端点绕着尖点示教四个位置,姿态差别要大。 + * 设置完毕后即可计算出来结果。 + * + * @param poses 四个点的位姿集合 + * @return TCP标定结果和标定结果是否有效 + * + * @par Python函数原型 + * tcpOffsetIdentify(self: pyaubo_sdk.Math, arg0: List[List[float]]) -> + * Tuple[List[float], int] + * + * @par Lua函数原型 + * tcpOffsetIdentify(poses: table) -> table + * \endchinese + * + * \english + * Four point method calibration for TCP offset + * + * About a sharp point, move the robot's tcp in four different poses. Difference between each pose should be drastic. + * Result can be obtained based on these four poses + * + * @param poses combination of four different poses + * @return TCP calibration result and whether successfull + * + * @par Python interface prototype + * tcpOffsetIdentify(self: pyaubo_sdk.Math, arg0: List[List[float]]) -> + * Tuple[List[float], int] + * + * @par Lua interface prototype + * tcpOffsetIdentify(poses: table) -> table + * \endenglish + */ + ResultWithErrno tcpOffsetIdentify( + const std::vector> &poses); + + /** + * \chinese + * Three point method calibration for TCP offset + * + * @param poses 三个点的位姿集合 + * @param type 类型:\n + * 0 - oxy 原点 x轴正方向 xy平面(y轴正方向)\n + * 1 - oxz 原点 x轴正方向 xz平面(z轴正方向)\n + * 2 - oyz 原点 y轴正方向 yz平面(z轴正方向)\n + * 3 - oyx 原点 y轴正方向 yx平面(x轴正方向)\n + * 4 - ozx 原点 z轴正方向 zx平面(x轴正方向)\n + * 5 - ozy 原点 z轴正方向 zy平面(y轴正方向)\n + * @return 坐标系标定结果和标定结果是否有效 + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Math.calibrateCoordinate","params":[[[0.55462,0.06219,0.37175,-3.142,0.0,1.580], + * [0.63746,0.11805,0.37175,-3.142,0.0,1.580],[0.40441,0.28489,0.37174,-3.142,0.0,1.580]],0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[[0.55462,0.06219,0.37175,-3.722688983883945e-05,-1.6940658945086007e-21,0.5932768162455785],0]} + * \endchinese + * + * \english + * Calibrate coordinate system with 3 points + * + * @param poses set of 3 poses + * @param type type:\n + * 0 - oxy origin, +x axis, xy plane (+y direction) \n + * 1 - oxz origin, +x axis, xz plane (+z direction) \n + * 2 - oyz origin, +y axis, yz plane (+z direction) \n + * 3 - oyx origin, +y axis, yx plane (+x direction) \n + * 4 - ozx origin, +z axis, zx plane (+x direction) \n + * 5 - ozy origin, +z axis, zy plane (+y direction) \n + * @return Coordinate system calibration result and whether the calibration result is valid + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Math.calibrateCoordinate","params":[[[0.55462,0.06219,0.37175,-3.142,0.0,1.580], + * [0.63746,0.11805,0.37175,-3.142,0.0,1.580],[0.40441,0.28489,0.37174,-3.142,0.0,1.580]],0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[[0.55462,0.06219,0.37175,-3.722688983883945e-05,-1.6940658945086007e-21,0.5932768162455785],0]} + * \endenglish + */ + ResultWithErrno calibrateCoordinate( + const std::vector> &poses, int type); + + /** + * \chinese + * 根据圆弧的三个点,计算出拟合成的圆的另一半圆弧的中间点位置 + * + * @param p1 圆弧的起始点 + * @param p2 圆弧的中间点 + * @param p3 圆弧的结束点 + * @param mode 当mode等于1的时候,表示需要对姿态进行圆弧规划; + * 当mode等于0的时候,表示不需要对姿态进行圆弧规划 + * + * @return 拟合成的圆的另一半圆弧的中间点位置和计算结果是否有效 + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Math.calculateCircleFourthPoint","params":[[0.5488696249770836,-0.1214996547187204,0.2631931199112321,-3.14159198038469,-3.673205103150083e-06,1.570796326792424], + * [0.5488696249770835,-0.1214996547187207,0.3599720701808493,-3.14159198038469,-3.6732051029273e-06,1.570796326792423], + * [0.5488696249770836,-0.0389996547187214,0.3599720701808496,-3.141591980384691,-3.673205102557476e-06, + * 1.570796326792422],1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[[0.5488696249770837,-0.031860179583911546,0.27033259504604207,-3.1415919803846903,-3.67320510285378e-06,1.570796326792423],1]} + * + * \endchinese + * + * \english + * Based on three points on an arc, calculate the position of the midpoint of the other half of the fitted circle's arc + * + * @param p1 start point of the arc + * @param p2 middle point of the arc + * @param p3 end point of the arc + * @param mode when mode = 1, need to plan for orientation around arc; + * when mode = 0, do not need to plan for orientation around arc. + * @return position of the midpoint of the other half of the fitted circle's arc and whether the result is valid. + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Math.calculateCircleFourthPoint","params":[[0.5488696249770836,-0.1214996547187204,0.2631931199112321,-3.14159198038469,-3.673205103150083e-06,1.570796326792424], + * [0.5488696249770835,-0.1214996547187207,0.3599720701808493,-3.14159198038469,-3.6732051029273e-06,1.570796326792423], + * [0.5488696249770836,-0.0389996547187214,0.3599720701808496,-3.141591980384691,-3.673205102557476e-06, + * 1.570796326792422],1],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[[0.5488696249770837,-0.031860179583911546,0.27033259504604207,-3.1415919803846903,-3.67320510285378e-06,1.570796326792423],1]} + * + * \endenglish + */ + ResultWithErrno calculateCircleFourthPoint(const std::vector &p1, + const std::vector &p2, + const std::vector &p3, + int mode); + /** + * \chinese + * @brief forceTrans: + * 变换力和力矩的参考坐标系 force_in_b = pose_a_in_b * force_in_a + * @param pose_a_in_b: a 坐标系在 b 坐标系的位姿 + * @param force_in_a: 力和力矩在 a 坐标系的描述 + * @return force_in_b,力和力矩在 b 坐标系的描述 + * \endchinese + * + * \english + * @brief forceTrans: + * Transform the reference frame of force and torque: force_in_b = pose_a_in_b * force_in_a + * @param pose_a_in_b: pose of frame a in frame b + * @param force_in_a: force and torque described in frame a + * @return Force_in_b, force and torque described in frame b + * \endenglish + */ + std::vector forceTrans(const std::vector &pose_a_in_b, + const std::vector &force_in_a); + + /** + * \chinese + * @brief 通过距离计算工具坐标系下的位姿增量 + * @param distances: N 个距离, N >=3 + * @param position: 距离参考轨迹的保持高度 + * @param radius: 传感器中心距离末端tcp的等效半径 + * @param track_scale: 跟踪比例, 设置范围(0, 1], 1表示跟踪更快 + * @return 基于工具坐标系的位姿增量 + * \endchinese + * + * \english + * @brief Calculate pose increment in tool coordinate system based on sensor data + * @param distances: N distances, N >= 3 + * @param position: reference height to maintain from the trajectory + * @param radius: effective radius from sensor center to tool TCP + * @param track_scale: tracking ratio, range (0, 1], 1 means faster tracking + * @return Pose increment in tool coordinate system + * \endenglish + */ + std::vector getDeltaPoseBySensorDistance( + const std::vector &distances, double position, double radius, + double track_scale); + + /** + * \chinese + * @brief changeFTFrame: 变换力和力矩的参考坐标系 + * @param pose_a_in_b: a 坐标系在 b 坐标系的位姿 + * @param ft_in_a: 作用在 a 点的力和力矩在 a 坐标系的描述 + * @return ft_in_b,作用在 b 点的力和力矩在 b 坐标系的描述 + * \endchinese + * + * \english + * @brief changeFTFrame: Transform the reference frame of force and torque + * @param pose_a_in_b: pose of frame a in frame b + * @param ft_in_a: force and torque applied at point a, described in frame a + * @return ft_in_b, force and torque applied at point b, described in frame b + * \endenglish + */ + std::vector deltaPoseTrans(const std::vector &pose_a_in_b, + const std::vector &ft_in_a); + + /** + * \chinese + * @brief addDeltaPose: 计算以给定速度变换单位时间后的位姿 + * @param pose_a_in_b: 当前时刻 a 相对于 b 的位姿 + * @param v_in_b: 当前时刻 a 坐标系的速度在 b 的描述 + * @return pose_in_b, 单位时间后的位姿在 b 的描述 + * \endchinese + * + * \english + * @brief addDeltaPose: Calculate the pose after unit time given a velocity + * @param pose_a_in_b: current pose of a relative to b + * @param v_in_b: velocity of frame a described in frame b at current time + * @return pose_in_b, pose after unit time described in frame b + * \endenglish + */ + std::vector deltaPoseAdd(const std::vector &pose_a_in_b, + const std::vector &v_in_b); + + /** + * \chinese + * @brief changePoseWithXYRef: 修改 pose_tar 的xy轴方向,尽量与 pose_ref 一致, + * @param pose_tar: 需要修改的目标位姿 + * @param pose_ref: 参考位姿 + * @return 修改后的位姿,采用pose_tar的 xyz 坐标和 z 轴方向 + * \endchinese + * + * \english + * @brief changePoseWithXYRef: Modify the XY axis direction of pose_tar to be as consistent as possible with pose_ref + * @param pose_tar: target pose to be modified + * @param pose_ref: reference pose + * @return Modified pose, using the xyz coordinates and z axis direction of pose_tar + * \endenglish + */ + std::vector changePoseWithXYRef( + const std::vector &pose_tar, + const std::vector &pose_ref); + + /** + * \chinese + * @brief homMatrixToPose: 由齐次变换矩阵得到位姿 + * @param homMatrix: 4*4 齐次变换矩阵, 输入元素采用横向排列 + * @return 对应的位姿 + * \endchinese + * + * \english + * @brief homMatrixToPose: Get pose from homogeneous transformation matrix + * @param homMatrix: 4x4 homogeneous transformation matrix, input elements are arranged row-wise + * @return corresponding pose + * \endenglish + */ + std::vector homMatrixToPose(const std::vector &homMatrix); + + /** + * \chinese + * @brief poseToHomMatrix: 位姿变换得到齐次变换矩阵 + * @param pose: 输入的位姿 + * @return 输出的齐次变换矩阵,元素横向排列 + * \endchinese + * + * \english + * @brief poseToHomMatrix: Get homogeneous transformation matrix from pose + * @param pose: input pose + * @return output homogeneous transformation matrix, elements arranged row-wise + * \endenglish + */ + std::vector poseToHomMatrix(const std::vector &pose); + +protected: + void *d_; +}; +using MathPtr = std::shared_ptr; + +} // namespace common_interface +} // namespace arcs +#endif diff --git a/third_party/AuboSdk/win/include/aubo/register_control.h b/third_party/AuboSdk/win/include/aubo/register_control.h new file mode 100644 index 00000000..10ccef7e --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo/register_control.h @@ -0,0 +1,2726 @@ +/** @file register_control.h + * @brief 寄存器操作接口,用于三个模块之间的数据交换功能 + */ +#ifndef AUBO_SDK_REGISTER_CONTROL_INTERFACE_H +#define AUBO_SDK_REGISTER_CONTROL_INTERFACE_H + +#include +#include +#include + +#include +#include + +enum ModbusErrorNum +{ + /** MODBUS unit not initiallized + */ + MB_ERR_NOT_INIT = -1, + + /** MODBUS unit disconnected + */ + MB_ERR_DISCONNECTED = -2, + + /** The function code received in the query is not an allowable action for + * the server (or slave). + */ + MB_ERR_ILLEGAL_FUNCTION = 1, + + /** The function code received in the query is not an allowable action for + * the server (or slave), check that the entered signal address corresponds + * to the setup of the remote MODBUS server. + */ + MB_ERR_ILLEGAL_DATA_ADDRESS = 2, + + /** A value contained in the query data field is not an allowable value for + * server (or slave), check that the enterd signal value is valid for the + * specified address on the remote MODBUS server. + */ + MB_ERR_ILLEGAL_DATA_VALUE = 3, + + /** An unrecoverable error occurred while the server (or slave) was + * attempting to perform the requested action. + */ + MB_ERR_SLAVE_DEVICE_FAILURE = 4, + + /** Specialized use in conjunction with programming commands sent to the + * remote MODBUS unit. + */ + MB_ERR_ACKNOWLEDGE = 5, + + /** Specialized use in conjunction with programming commands sent to the + * remote MODBUS unit, the slave (server) is not able to respond now + */ + MB_ERR_SLAVE_DEVICE_BUSY = 6, +}; + +namespace arcs { +namespace common_interface { + +/** + * \~chinese 通用寄存器 \~english General Registers + */ +class ARCS_ABI_EXPORT RegisterControl +{ +public: + RegisterControl(); + virtual ~RegisterControl(); + + /** + * \chinese + * + * 从一个输入寄存器中读取布尔值,也可以通过现场总线进行访问。 + * 注意,它使用自己的内存空间。 + * + * @param address 寄存器的地址(0:127) + * @return 寄存器中保存的布尔值(true、false) + * + * @note 布尔输入寄存器的较低范围[0:63]保留供FieldBus/PLC接口使用。 + * 较高范围[64:127]无法通过FieldBus/PLC接口访问,因为它保留供外部RTDE客户端使用。 + * + * @par Python函数原型 + * getBoolInput(self: pyaubo_sdk.RegisterControl, arg0: int) -> bool + * + * @par Lua函数原型 + * getBoolInput(address: number) -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getBoolInput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * \endchinese + * + * \english + * Reads the boolean from one of the input registers, which can also be + * accessed by a Field bus. Note, uses its own memory space. + * + * @param address Address of the register (0:127) + * @return Boolean value held by the register (true, false) + * + * @note The lower range of the boolean input registers [0:63] is reserved + * for FieldBus/PLC interface usage. The upper range [64:127] cannot be + * accessed by FieldBus/PLC interfaces, since it is reserved for external + * RTDE clients. + * + * @par Python interface prototype + * getBoolInput(self: pyaubo_sdk.RegisterControl, arg0: int) -> bool + * + * @par Lua interface prototype + * getBoolInput(address: number) -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getBoolInput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * \endenglish + */ + bool getBoolInput(uint32_t address); + + /** + * \chinese + * + * @param address + * @param value + * @return + * + * @note 只有在实现 RTDE/Modbus Slave/PLC 服务端时使用 + * + * @par Python函数原型 + * setBoolInput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: bool) -> + * int + * + * @par Lua函数原型 + * setBoolInput(address: number, value: boolean) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setBoolInput","params":[0,true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * + * @param address Address of the register (0:127) + * @param value Boolean value to set (true or false) + * @return Returns 0 on success, or an error code + * + * @note Only used when implementing RTDE/Modbus Slave/PLC server + * + * @par Python interface prototype + * setBoolInput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: bool) -> int + * + * @par Lua interface prototype + * setBoolInput(address: number, value: boolean) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setBoolInput","params":[0,true],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setBoolInput(uint32_t address, bool value); + + /** + * \chinese + * + * 从一个输入寄存器中读取整数值,也可以通过现场总线进行访问。 + * 注意,它使用自己的内存空间。 + * + * @param address 寄存器的地址(0:47) + * @return 寄存器中保存的整数值[-2,147,483,648 : 2,147,483,647] + * + * @note 整数输入寄存器的较低范围[0:23]保留供FieldBus/PLC接口使用。 + * 较高范围[24:47]无法通过FieldBus/PLC接口访问,因为它保留供外部RTDE客户端使用。 + * + * @par Python函数原型 + * getInt32Input(self: pyaubo_sdk.RegisterControl, arg0: int) -> int + * + * @par Lua函数原型 + * getInt32Input(address: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getInt32Input","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * + * \english + * Reads the integer from one of the input registers, which can also be + * accessed by a FieldBus. Note, uses it’s own memory space. + * + * @param address Address of the register (0:47) + * @return The value held by the register [-2,147,483,648 : 2,147,483,647] + * + * @note The lower range of the integer input registers [0:23] is reserved + * for FieldBus/PLC interface usage. The upper range [24:47] cannot be + * accessed by FieldBus/PLC interfaces, since it is reserved for external + * RTDE clients. + * + * @par Python interface prototype + * getInt32Input(self: pyaubo_sdk.RegisterControl, arg0: int) -> int + * + * @par Lua interface prototype + * getInt32Input(address: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getInt32Input","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + */ + int getInt32Input(uint32_t address); + + /** + * \chinese + * + * @param address 寄存器的地址(0:47) + * @param value 要设置的整数值 + * @return 返回0表示成功,其他为错误码 + * + * @note 只有在实现 RTDE/Modbus Slave/PLC 服务端时使用 + * + * @par Python函数原型 + * setInt32Input(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: int) -> int + * + * @par Lua函数原型 + * setInt32Input(address: number, value: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setInt32Input","params":[0,33],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * + * @param address Address of the register (0:47) + * @param value Integer value to set + * @return Returns 0 on success, or an error code + * + * @note Only used when implementing RTDE/Modbus Slave/PLC server + * + * @par Python interface prototype + * setInt32Input(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: int) -> int + * + * @par Lua interface prototype + * setInt32Input(address: number, value: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setInt32Input","params":[0,33],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setInt32Input(uint32_t address, int value); + + /** + * \chinese + * Reads the float from one of the input registers, which can also be + * accessed by a Field bus. Note, uses it’s own memory space. + * + * 从一个输入寄存器中读取浮点数,也可以通过现场总线进行访问。 + * 注意,它使用自己的内存空间。 + * + * @param address Address of the register (0:47) + * 寄存器地址(0:47) + * @return The value held by the register (float) + * 寄存器中保存的浮点数值 + * + * @note The lower range of the float input registers [0:23] is reserved + * for FieldBus/PLC interface usage. The upper range [24:47] cannot be + * accessed by FieldBus/PLC interfaces, since it is reserved for external + * RTDE clients. + * 浮点数输入寄存器的较低范围[0:23]保留供现场总线/PLC接口使用。 + * 较高范围[24:47]不能通过现场总线/PLC接口访问,因为它们是为外部RTDE客户端保留的。 + * + * @par Python函数原型 + * getFloatInput(self: pyaubo_sdk.RegisterControl, arg0: int) -> float + * + * @par Lua函数原型 + * getFloatInput(address: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getFloatInput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endchinese + * + * \english + * Reads the float from one of the input registers, which can also be + * accessed by a Field bus. Note, uses it’s own memory space. + * + * @param address Address of the register (0:47) + * @return The value held by the register (float) + * + * @note The lower range of the float input registers [0:23] is reserved + * for FieldBus/PLC interface usage. The upper range [24:47] cannot be + * accessed by FieldBus/PLC interfaces, since it is reserved for external + * RTDE clients. + * + * @par Python interface prototype + * getFloatInput(self: pyaubo_sdk.RegisterControl, arg0: int) -> float + * + * @par Lua interface prototype + * getFloatInput(address: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getFloatInput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + */ + float getFloatInput(uint32_t address); + + /** + * \chinese + * + * @param address 寄存器的地址(0:47) + * @param value 要设置的浮点数值 + * @return 返回0表示成功,其他为错误码 + * + * @note 只有在实现 RTDE/Modbus Slave/PLC 服务端时使用 + * + * @par Python函数原型 + * setFloatInput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: float) -> int + * + * @par Lua函数原型 + * setFloatInput(address: number, value: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setFloatInput","params":[0,3.3],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * + * @param address Address of the register (0:47) + * @param value Float value to set + * @return Returns 0 on success, or an error code + * + * @note Only used when implementing RTDE/Modbus Slave/PLC server + * + * @par Python interface prototype + * setFloatInput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: float) -> int + * + * @par Lua interface prototype + * setFloatInput(address: number, value: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setFloatInput","params":[0,3.3],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setFloatInput(uint32_t address, float value); + + /** + * \chinese + * + * 从一个输入寄存器中读取双精度浮点数,也可以通过现场总线进行访问。 + * 注意,它使用自己的内存空间。 + * + * @param address 寄存器的地址(0:47) + * @return 寄存器中保存的双精度浮点数值 + * + * @par Python函数原型 + * getDoubleInput(self: pyaubo_sdk.RegisterControl, arg0: int) -> float + * + * @par Lua函数原型 + * getDoubleInput(address: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getDoubleInput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endchinese + * \english + * + * Reads the double value from one of the input registers, which can also be accessed by a FieldBus. Note, uses its own memory space. + * + * @param address Address of the register (0:47) + * @return The double value held by the register + * + * @par Python interface prototype + * getDoubleInput(self: pyaubo_sdk.RegisterControl, arg0: int) -> float + * + * @par Lua interface prototype + * getDoubleInput(address: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getDoubleInput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endenglish + */ + double getDoubleInput(uint32_t address); + + /** + * \english + * @param address + * @param value + * @return + * + * @note Only used when implementing RTDE/Modbus Slave/PLC server + * + * @par Python interface prototype + * setDoubleInput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: float) + * -> int + * + * @par Lua interface prototype + * setDoubleInput(address: number, value: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setDoubleInput","params":[0,6.6],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + * + * \chinese + * @param address + * @param value + * @return + * + * @note 只有在实现 RTDE/Modbus Slave/PLC 服务端时使用 + * + * @par Python函数原型 + * setDoubleInput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: float) + * -> int + * + * @par Lua函数原型 + * setDoubleInput(address: number, value: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setDoubleInput","params":[0,6.6],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + */ + int setDoubleInput(uint32_t address, double value); + + /** + * \chinese + * 从一个输出寄存器中读取布尔值,也可以通过现场总线进行访问。 + * 注意,它使用自己的内存空间。 + * + * @param address 寄存器地址(0:127) + * @return 寄存器中保存的布尔值(true, false) + * + * @note 布尔输出寄存器的较低范围[0:63]保留供现场总线/PLC接口使用。 + * 较高范围[64:127]不能通过现场总线/PLC接口访问,因为它们是为外部RTDE客户端保留的。 + * + * @par Python函数原型 + * getBoolOutput(self: pyaubo_sdk.RegisterControl, arg0: int) -> bool + * + * @par Lua函数原型 + * getBoolOutput(address: number) -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getBoolOutput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * \endchinese + * + * \english + * Reads the boolean from one of the output registers, which can also be + * accessed by a Field bus. + * Note, uses its own memory space. + * + * @param address Address of the register (0:127) + * @return The boolean value held by the register (true, false) + * + * @note The lower range of the boolean output registers [0:63] is reserved + * for FieldBus/PLC interface usage. The upper range [64:127] cannot be + * accessed by FieldBus/PLC interfaces, since it is reserved for external + * RTDE clients. + * + * @par Python interface prototype + * getBoolOutput(self: pyaubo_sdk.RegisterControl, arg0: int) -> bool + * + * @par Lua interface prototype + * getBoolOutput(address: number) -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getBoolOutput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * \endenglish + */ + bool getBoolOutput(uint32_t address); + + /** + * \chinese + * + * @param address 寄存器地址(0:127) + * @param value 要设置的布尔值(true 或 false) + * @return 返回0表示成功,其他为错误码 + * + * @par Python函数原型 + * setBoolOutput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: bool) -> int + * + * @par Lua函数原型 + * setBoolOutput(address: number, value: boolean) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setBoolOutput","params":[0,false],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * + * @param address Address of the register (0:127) + * @param value Boolean value to set (true or false) + * @return Returns 0 on success, or an error code + * + * @par Python interface prototype + * setBoolOutput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: bool) -> int + * + * @par Lua interface prototype + * setBoolOutput(address: number, value: boolean) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setBoolOutput","params":[0,false],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setBoolOutput(uint32_t address, bool value); + + /** + * \chinese + * 从一个输出寄存器中读取整数值,也可以通过现场总线进行访问。 + * 注意,它使用自己的内存空间。 + * + * @param address 寄存器地址(0:47) + * @return 寄存器中保存的整数值(-2,147,483,648 : 2,147,483,647) + * + * @note 整数输出寄存器的较低范围[0:23]保留供现场总线/PLC接口使用。 + * 较高范围[24:47]不能通过现场总线/PLC接口访问,因为它们是为外部RTDE客户端保留的。 + * + * @par Python函数原型 + * getInt32Output(self: pyaubo_sdk.RegisterControl, arg0: int) -> int + * + * @par Lua函数原型 + * getInt32Output(address: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getInt32Output","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * + * \english + * Reads the integer from one of the output registers, which can also be + * accessed by a FieldBus. Note, uses its own memory space. + * + * @param address Address of the register (0:47) + * @return The int value held by the register [-2,147,483,648 : 2,147,483,647] + * + * @note The lower range of the integer output registers [0:23] is reserved + * for FieldBus/PLC interface usage. The upper range [24:47] cannot be + * accessed by FieldBus/PLC interfaces, since it is reserved for external + * RTDE clients. + * + * @par Python interface prototype + * getInt32Output(self: pyaubo_sdk.RegisterControl, arg0: int) -> int + * + * @par Lua interface prototype + * getInt32Output(address: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getInt32Output","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int getInt32Output(uint32_t address); + + /** + * \chinese + * + * @param address 寄存器地址(0:47) + * @param value 要设置的整数值 + * @return 返回0表示成功,其他为错误码 + * + * @par Python函数原型 + * setInt32Output(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: int) -> int + * + * @par Lua函数原型 + * setInt32Output(address: number, value: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setInt32Output","params":[0,100],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * + * @param address Address of the register (0:47) + * @param value Integer value to set + * @return Returns 0 on success, or an error code + * + * @par Python interface prototype + * setInt32Output(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: int) -> int + * + * @par Lua interface prototype + * setInt32Output(address: number, value: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setInt32Output","params":[0,100],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setInt32Output(uint32_t address, int value); + + /** + * \chinese + * 从一个输出寄存器中读取浮点数,也可以通过现场总线进行访问。 + * 注意,它使用自己的内存空间。 + * + * @param address 寄存器地址(0:47) + * @return 寄存器中保存的浮点数值(float) + * + * @note 浮点数输出寄存器的较低范围[0:23]保留供现场总线/PLC接口使用。 + * 较高范围[24:47]不能通过现场总线/PLC接口访问,因为它们是为外部RTDE客户端保留的。 + * + * @par Python函数原型 + * getFloatOutput(self: pyaubo_sdk.RegisterControl, arg0: int) -> float + * + * @par Lua函数原型 + * getFloatOutput(address: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getFloatOutput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":3.3} + * \endchinese + * + * \english + * Reads the float from one of the output registers, which can also be + * accessed by a FieldBus. Note, uses its own memory space. + * + * @param address Address of the register (0:47) + * @return The value held by the register (float) + * + * @note The lower range of the float output registers [0:23] is reserved + * for FieldBus/PLC interface usage. The upper range [24:47] cannot be + * accessed by FieldBus/PLC interfaces, since it is reserved for external + * RTDE clients. + * + * @par Python interface prototype + * getFloatOutput(self: pyaubo_sdk.RegisterControl, arg0: int) -> float + * + * @par Lua interface prototype + * getFloatOutput(address: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getFloatOutput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":3.3} + * \endenglish + */ + float getFloatOutput(uint32_t address); + + /** + * \chinese + * + * @param address 寄存器地址(0:47) + * @param value 要设置的浮点数值 + * @return 返回0表示成功,其他为错误码 + * + * @par Python函数原型 + * setFloatOutput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: float) -> int + * + * @par Lua函数原型 + * setFloatOutput(address: number, value: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setFloatOutput","params":[0,5.5],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * + * @param address Address of the register (0:47) + * @param value Float value to set + * @return Returns 0 on success, or an error code + * + * @par Python interface prototype + * setFloatOutput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: float) -> int + * + * @par Lua interface prototype + * setFloatOutput(address: number, value: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setFloatOutput","params":[0,5.5],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setFloatOutput(uint32_t address, float value); + + /** + * \chinese + * + * 从一个输出寄存器中读取双精度浮点数。 + * + * @param address 寄存器地址 + * @return 寄存器中保存的双精度浮点数值 + * + * @par Python函数原型 + * getDoubleOutput(self: pyaubo_sdk.RegisterControl, arg0: int) -> float + * + * @par Lua函数原型 + * getDoubleOutput(address: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getDoubleOutput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endchinese + * \english + * + * Reads the double value from one of the output registers. + * + * @param address Address of the register + * @return The double value held by the register + * + * @par Python interface prototype + * getDoubleOutput(self: pyaubo_sdk.RegisterControl, arg0: int) -> float + * + * @par Lua interface prototype + * getDoubleOutput(address: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getDoubleOutput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endenglish + */ + double getDoubleOutput(uint32_t address); + + /** + * \chinese + * + * @param address 寄存器地址 + * @param value 要设置的双精度浮点数值 + * @return 返回0表示成功,其他为错误码 + * + * @par Python函数原型 + * setDoubleOutput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: float) + * -> int + * + * @par Lua函数原型 + * setDoubleOutput(address: number, value: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setDoubleOutput","params":[0,4.4],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * + * @param address Address of the register + * @param value Double value to set + * @return Returns 0 on success, or an error code + * + * @par Python interface prototype + * setDoubleOutput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: float) + * -> int + * + * @par Lua interface prototype + * setDoubleOutput(address: number, value: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setDoubleOutput","params":[0,4.4],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setDoubleOutput(uint32_t address, double value); + + /** + * \chinese + * 用于 Modbus Slave + * + * @param address + * @return + * + * @par Python函数原型 + * getInt16Register(self: pyaubo_sdk.RegisterControl, arg0: int) -> int + * + * @par Lua函数原型 + * getInt16Register(address: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getInt16Register","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Used for Modbus Slave + * + * @param address + * @return + * + * @par Python interface prototype + * getInt16Register(self: pyaubo_sdk.RegisterControl, arg0: int) -> int + * + * @par Lua interface prototype + * getInt16Register(address: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getInt16Register","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int16_t getInt16Register(uint32_t address); + + /** + * \chinese + * + * @param address 寄存器地址 + * @param value 要设置的值 + * @return 返回0表示成功,其他为错误码 + * + * @par Python函数原型 + * setInt16Register(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: int) + * -> int + * + * @par Lua函数原型 + * setInt16Register(address: number, value: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setInt16Register","params":[0,0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * + * @param address Register address + * @param value Value to set + * @return Returns 0 on success, otherwise error code + * + * @par Python interface prototype + * setInt16Register(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: int) -> int + * + * @par Lua interface prototype + * setInt16Register(address: number, value: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setInt16Register","params":[0,0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setInt16Register(uint32_t address, int16_t value); + + /** + * \chinese + * 具名变量是否存在 + * + * @param key 变量名 + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.hasNamedVariable","params":["custom"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endchinese + * \english + * Whether the named variable exists + * + * @param key Variable name + * @return + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.hasNamedVariable","params":["custom"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endenglish + */ + bool hasNamedVariable(const std::string &key); + + /** + * \chinese + * 获取具名变量的类型 + * + * @param key + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getNamedVariableType","params":["custom"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"NONE"} + * + * \endchinese + * \english + * Get the type of a named variable + * + * @param key + * @return + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getNamedVariableType","params":["custom"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"NONE"} + * + * \endenglish + */ + std::string getNamedVariableType(const std::string &key); + + /** + * \chinese + * 具名变量是否更新 + * + * @param key + * @param since + * @return + * + * @par Python函数原型 + * variableUpdated(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int) + * -> bool + * + * @par Lua函数原型 + * variableUpdated(key: string, since: number) -> boolean + * \endchinese + * + * \english + * Whether the named variable has been updated + * + * @param key + * @param since + * @return + * + * @par Python interface prototype + * variableUpdated(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int) + * -> bool + * + * @par Lua interface prototype + * variableUpdated(key: string, since: number) -> boolean + * \endchinese + */ + bool variableUpdated(const std::string &key, uint64_t since); + + /** + * \chinese + * 获取变量值 + * + * @param key + * @param default_value + * @return + * + * @par Python函数原型 + * getBool(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: bool) -> bool + * + * @par Lua函数原型 + * getBool(key: string, default_value: boolean) -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getBool","params":["custom",false],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endchinese + * \english + * Get variable value + * + * @param key + * @param default_value + * @return + * + * @par Python interface prototype + * getBool(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: bool) -> bool + * + * @par Lua interface prototype + * getBool(key: string, default_value: boolean) -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getBool","params":["custom",false],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endenglish + */ + bool getBool(const std::string &key, bool default_value); + + /** + * \chinese + * 设置/更新变量值 + * + * @param key + * @param value + * @return + * + * @par Python函数原型 + * setBool(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: bool) -> int + * + * @par Lua函数原型 + * setBool(key: string, value: boolean) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setBool","params":["custom",true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set or update the variable value + * + * @param key + * @param value + * @return Returns 0 on success, otherwise error code + * + * @par Python interface prototype + * setBool(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: bool) -> int + * + * @par Lua interface prototype + * setBool(key: string, value: boolean) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setBool","params":["custom",true],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setBool(const std::string &key, bool value); + + /** + * \chinese + * 获取变量值 + * + * @param key + * @param default_value + * @return + * + * @par Python函数原型 + * getVecChar(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: List[str]) + * -> List[str] + * + * @par Lua函数原型 + * getVecChar(key: string, default_value: table) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getVecChar","params":["custom",[]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0,1,0]} + * + * \endchinese + * \english + * Get variable value + * + * @param key + * @param default_value + * @return + * + * @par Python interface prototype + * getVecChar(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: List[str]) -> List[str] + * + * @par Lua interface prototype + * getVecChar(key: string, default_value: table) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getVecChar","params":["custom",[]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0,1,0]} + * + * \endenglish + */ + std::vector getVecChar(const std::string &key, + const std::vector &default_value); + + /** + * \chinese + * 设置/更新变量值 + * + * @param key + * @param value + * @return + * + * @par Python函数原型 + * setVecChar(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: List[str]) + * -> int + * + * @par Lua函数原型 + * setVecChar(key: string, value: table) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setVecChar","params":["custom",[0,1,0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set or update the variable value + * + * @param key + * @param value + * @return Returns 0 on success, otherwise error code + * + * @par Python interface prototype + * setVecChar(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: List[str]) -> int + * + * @par Lua interface prototype + * setVecChar(key: string, value: table) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setVecChar","params":["custom",[0,1,0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setVecChar(const std::string &key, const std::vector &value); + + /** + * \chinese + * 获取变量值 + * + * @param key + * @param default_value + * @return + * + * @par Python函数原型 + * getInt32(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int) -> int + * + * @par Lua函数原型 + * getInt32(key: string, default_value: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getInt32","params":["custom",0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":6} + * + * \endchinese + * \english + * Get variable value + * + * @param key + * @param default_value + * @return + * + * @par Python interface prototype + * getInt32(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int) -> int + * + * @par Lua interface prototype + * getInt32(key: string, default_value: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getInt32","params":["custom",0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":6} + * + * \endenglish + */ + int getInt32(const std::string &key, int default_value); + + /** + * \chinese + * 设置/更新变量值 + * + * @param key + * @param value + * @return + * + * @par Python函数原型 + * setInt32(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int) -> int + * + * @par Lua函数原型 + * setInt32(key: string, value: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setInt32","params":["custom",6],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set or update the variable value + * + * @param key + * @param value + * @return + * + * @par Python interface prototype + * setInt32(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int) -> int + * + * @par Lua interface prototype + * setInt32(key: string, value: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setInt32","params":["custom",6],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setInt32(const std::string &key, int value); + + /** + * \chinese + * 获取变量值 + * + * @param key + * @param default_value + * @return + * + * @par Python函数原型 + * getVecInt32(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: List[int]) + * -> List[int] + * + * @par Lua函数原型 + * getVecInt32(key: string, default_value: table) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getVecInt32","params":["custom",[]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[1,2,3,4]} + * + * \endchinese + * \english + * Get variable value + * + * @param key + * @param default_value + * @return + * + * @par Python interface prototype + * getVecInt32(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: List[int]) -> List[int] + * + * @par Lua interface prototype + * getVecInt32(key: string, default_value: table) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getVecInt32","params":["custom",[]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[1,2,3,4]} + * + * \endenglish + */ + std::vector getVecInt32(const std::string &key, + const std::vector &default_value); + + /** + * \chinese + * 设置/更新变量值 + * + * @param key + * @param value + * @return + * + * @par Python函数原型 + * setVecInt32(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: List[int]) + * -> int + * + * @par Lua函数原型 + * setVecInt32(key: string, value: table) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setVecInt32","params":["custom",[1,2,3,4]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set or update the variable value + * + * @param key + * @param value + * @return + * + * @par Python interface prototype + * setVecInt32(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: List[int]) -> int + * + * @par Lua interface prototype + * setVecInt32(key: string, value: table) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setVecInt32","params":["custom",[1,2,3,4]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setVecInt32(const std::string &key, const std::vector &value); + + /** + * \chinese + * 获取变量值 + * + * @param key + * @param default_value + * @return + * + * @par Python函数原型 + * getFloat(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: float) -> + * float + * + * @par Lua函数原型 + * getFloat(key: string, default_value: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getFloat","params":["custom",0.0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":4.400000095367432} + * + * \endchinese + * \english + * Get variable value + * + * @param key + * @param default_value + * @return + * + * @par Python interface prototype + * getFloat(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: float) -> float + * + * @par Lua interface prototype + * getFloat(key: string, default_value: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getFloat","params":["custom",0.0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":4.400000095367432} + * + * \endenglish + */ + float getFloat(const std::string &key, float default_value); + + /** + * \chinese + * 设置/更新变量值 + * + * @param key + * @param value + * @return + * + * @par Python函数原型 + * setFloat(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: float) -> int + * + * @par Lua函数原型 + * setFloat(key: string, value: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setFloat","params":["custom",4.4],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set or update the variable value + * + * @param key + * @param value + * @return + * + * @par Python interface prototype + * setFloat(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: float) -> int + * + * @par Lua interface prototype + * setFloat(key: string, value: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setFloat","params":["custom",4.4],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setFloat(const std::string &key, float value); + + /** + * \chinese + * 获取变量值 + * + * @param key + * @param default_value + * @return + * + * @par Python函数原型 + * getVecFloat(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: + * List[float]) -> List[float] + * + * @par Lua函数原型 + * getVecFloat(key: string, default_value: table) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getVecFloat","params":["custom",[]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.10000000149011612,3.299999952316284]} + * + * \endchinese + * \english + * Get variable value + * + * @param key + * @param default_value + * @return + * + * @par Python interface prototype + * getVecFloat(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: + * List[float]) -> List[float] + * + * @par Lua interface prototype + * getVecFloat(key: string, default_value: table) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getVecFloat","params":["custom",[]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.10000000149011612,3.299999952316284]} + * + * \endenglish + */ + std::vector getVecFloat(const std::string &key, + const std::vector &default_value); + + /** + * \chinese + * 设置/更新变量值 + * + * @param key + * @param value + * @return + * + * @par Python函数原型 + * setVecFloat(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: + * List[float]) -> int + * + * @par Lua函数原型 + * setVecFloat(key: string, value: table) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setVecFloat","params":["custom",[0.0,0.1,3.3]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set or update the variable value + * + * @param key + * @param value + * @return + * + * @par Python interface prototype + * setVecFloat(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: List[float]) -> int + * + * @par Lua interface prototype + * setVecFloat(key: string, value: table) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setVecFloat","params":["custom",[0.0,0.1,3.3]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setVecFloat(const std::string &key, const std::vector &value); + + /** + * \chinese + * 获取变量值 + * + * @param key + * @param default_value + * @return + * + * @par Python函数原型 + * getDouble(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: float) -> + * float + * + * @par Lua函数原型 + * getDouble(key: string, default_value: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getDouble","params":["custom",0.0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endchinese + * \english + * Get variable value + * + * @param key + * @param default_value + * @return + * + * @par Python interface prototype + * getDouble(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: float) -> float + * + * @par Lua interface prototype + * getDouble(key: string, default_value: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getDouble","params":["custom",0.0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endenglish + */ + double getDouble(const std::string &key, double default_value); + + /** + * \chinese + * 设置/更新变量值 + * + * @param key + * @param value + * @return + * + * @par Python函数原型 + * setDouble(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: float) -> int + * + * @par Lua函数原型 + * setDouble(key: string, value: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setDouble","params":["custom",6.6],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set or update the variable value + * + * @param key + * @param value + * @return + * + * @par Python interface prototype + * setDouble(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: float) -> int + * + * @par Lua interface prototype + * setDouble(key: string, value: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setDouble","params":["custom",6.6],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setDouble(const std::string &key, double value); + + /** + * \chinese + * 获取变量值 + * + * @param key + * @param default_value + * @return + * + * @par Python函数原型 + * getVecDouble(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: + * List[float]) -> List[float] + * + * @par Lua函数原型 + * getVecDouble(key: string, default_value: table) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getVecDouble","params":["custom",[]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.1,0.2,0.3]} + * + * \endchinese + * \english + * Get variable value + * + * @param key + * @param default_value + * @return + * + * @par Python interface prototype + * getVecDouble(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: + * List[float]) -> List[float] + * + * @par Lua interface prototype + * getVecDouble(key: string, default_value: table) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getVecDouble","params":["custom",[]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.1,0.2,0.3]} + * + * \endenglish + */ + std::vector getVecDouble(const std::string &key, + const std::vector &default_value); + + /** + * \chinese + * 设置/更新变量值 + * + * @param key + * @param value + * @return + * + * @par Python函数原型 + * setVecDouble(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: + * List[float]) -> int + * + * @par Lua函数原型 + * setVecDouble(key: string, value: table) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setVecDouble","params":["custom",[0.1,0.2,0.3]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set or update the variable value + * + * @param key + * @param value + * @return + * + * @par Python interface prototype + * setVecDouble(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: List[float]) -> int + * + * @par Lua interface prototype + * setVecDouble(key: string, value: table) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setVecDouble","params":["custom",[0.1,0.2,0.3]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setVecDouble(const std::string &key, const std::vector &value); + + /** + * \chinese + * 获取变量值 + * + * @param key + * @param default_value + * @return + * + * @par Python函数原型 + * getString(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: str) -> str + * + * @par Lua函数原型 + * getString(key: string, default_value: string) -> string + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getString","params":["custom",""],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"test"} + * + * \endchinese + * \english + * Get variable value + * + * @param key + * @param default_value + * @return + * + * @par Python interface prototype + * getString(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: str) -> str + * + * @par Lua interface prototype + * getString(key: string, default_value: string) -> string + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getString","params":["custom",""],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"test"} + * + * \endenglish + */ + std::string getString(const std::string &key, + const std::string &default_value); + + /** + * \chinese + * 设置/更新变量值 + * + * @param key + * @param value + * @return + * + * @par Python函数原型 + * setString(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: str) -> int + * + * @par Lua函数原型 + * setString(key: string, value: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.setString","params":["custom","test"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set or update the variable value + * + * @param key + * @param value + * @return Returns 0 on success, otherwise error code + * + * @par Python interface prototype + * setString(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: str) -> int + * + * @par Lua interface prototype + * setString(key: string, value: string) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.setString","params":["custom","test"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setString(const std::string &key, const std::string &value); + + /** + * \chinese + * 清除变量 + * + * @param key + * @return + * + * @par Python函数原型 + * clearNamedVariable(self: pyaubo_sdk.RegisterControl, arg0: str) -> int + * + * @par Lua函数原型 + * clearNamedVariable(key: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.clearNamedVariable","params":["custom"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1} + * + * \endchinese + * \english + * Clear variable + * + * @param key + * @return + * + * @par Python interface prototype + * clearNamedVariable(self: pyaubo_sdk.RegisterControl, arg0: str) -> int + * + * @par Lua interface prototype + * clearNamedVariable(key: string) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.clearNamedVariable","params":["custom"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1} + * + * \endenglish + */ + int clearNamedVariable(const std::string &key); + + /** + * \chinese + * 设置看门狗 + * + * 看门狗被触发之后控制器会执行对应的动作,并自动删除看门狗 + * + * @param key + * @param timeout 超时时间,单位秒(s),超时时间最小为 0.1s + * @param action + * NONE (0): 无动作 + * PAUSE(1): 暂停运行时 + * STOP (2): 停止运行时/停止机器人运动 + * PROTECTIVE_STOP (3): 触发防护停止 + * @return + * \endchinese + * \english + * Set the watchdog + * + * After the watchdog is triggered, the controller will perform the corresponding action and automatically delete the watchdog. + * + * @param key + * @param timeout Timeout in seconds (s), minimum timeout is 0.1s + * @param action + * NONE (0): No action + * PAUSE(1): Pause runtime + * STOP (2): Stop runtime/stop robot motion + * PROTECTIVE_STOP (3): Trigger protective stop + * @return + * \endenglish + */ + int setWatchDog(const std::string &key, double timeout, int action); + + /** + * \chinese + * 获取看门狗动作 + * + * @param key + * @return + * \endchinese + * \english + * Get the watchdog action + * + * @param key + * @return + * \endenglish + */ + int getWatchDogAction(const std::string &key); + + /** + * \chinese + * 获取看门狗超时时间 + * + * @param key + * @return + * \endchinese + * \english + * Get the watchdog timeout value + * + * @param key + * @return + * \endenglish + */ + int getWatchDogTimeout(const std::string &key); + + /** + * \chinese + * 添加一个新的Modbus信号以供控制器监视。不需要返回响应。 + * + * @param device_info 设备信息 + * 设备信息是RTU格式,例如:"serial_port,baud,parity,data_bit,stop_bit" + * (1)serial_port参数指定串口的名称,例如,在Linux上为"/dev/ttyS0"或"/dev/ttyUSB0",在Windows上为"\.\COM10" + * (2)baud参数指定通信的波特率,例如9600、19200、57600、115200等 + * (3)parity参数指定奇偶校验方式,N表示无校验,E表示偶校验,O表示奇校验 + * (4)data_bit参数指定数据位数,允许的值为5、6、7和8 + * (5)stop_bit参数指定停止位数,允许的值为1和2 + * + * 设备信息是TCP格式,例如:"ip address,port" + * (1)ip address参数指定服务器的IP地址 + * (2)port参数指定服务器监听的端口号 + * @param slave_number 通常不使用,设置为255即可,但可以在0到255之间自由选择 + * @param signal_address 指定新信号应该反映的线圈或寄存器的地址。请参考Modbus单元的配置以获取此信息。 + * @param signal_type 指定要添加的信号类型。0 = 数字输入,1 = 数字输出,2 = 寄存器输入,3 = 寄存器输出。 + * @param signal_name 唯一标识信号的名词。如果提供的字符串与已添加的信号相等,则新信号将替换旧信号。字符串的长度不能超过20个字符。 + * @param sequential_mode 设置为True会强制Modbus客户端在发送下一个请求之前等待响应。某些fieldbus单元需要此模式。可选参数。 + * @return + * + * @par Python函数原型 + * modbusAddSignal(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int, arg2: int, arg3: int, arg4: str, arg5: bool) -> int + * + * @par Lua函数原型 + * modbusAddSignal(device_info: string, slave_number: number, signal_address: number, signal_type: number, signal_name: string, sequential_mode: boolean) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusAddSignal","params":["/dev/ttyRobotTool,115200,N,8,1",1,264,3,"Modbus_0",false],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Adds a new modbus signal for the controller to supervise. Expects no response. + * + * @param device_info is rtu format. + * eg,"serial_port,baud,parity,data_bit,stop_bit" + * (1)The serial_port argument specifies the name of the serial port eg. On Linux ,"/dev/ttyS0" or "/dev/ttyUSB0". On Windows, \\.\COM10". + * (2)The baud argument specifies the baud rate of the communication, eg. 9600, 19200, 57600, 115200, etc. + * (3)parity:N for none,E for even,O for odd. + * (4)data_bit:The data_bits argument specifies the number of bits of data, the allowed values are 5, 6, 7 and 8. + * (5)stop_bit:The stop_bits argument specifies the bits of stop, the allowed values are 1 and 2. + * + * device_info is tcp format.eg,"ip address,port" + * (1)The ip address parameter specifies the ip address of the server + * (2)The port parameter specifies the port number that the server is listening on. + * @param slave_number An integer normally not used and set to 255, but is a free choice between 0 and 255. + * @param signal_address An integer specifying the address of the either the coil or the register that this new signal should reflect. Consult the configuration of the modbus unit for this information. + * @param signal_type An integer specifying the type of signal to add. 0 = digital input, 1 = digital output, 2 = register input and 3 = register output. + * @param signal_name A string uniquely identifying the signal. If a string is supplied which is equal to an already added signal, the new signal will replace the old one. The length of the string cannot exceed 20 characters. + * @param sequential_mode Setting to True forces the modbus client to wait for a response before sending the next request. This mode is required by some fieldbus units (Optional). + * @return + * + * @par Python interface prototype + * modbusAddSignal(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int, arg2: int, arg3: int, arg4: str, arg5: bool) -> int + * + * @par Lua interface prototype + * modbusAddSignal(device_info: string, slave_number: number, signal_address: number, signal_type: number, signal_name: string, sequential_mode: boolean) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusAddSignal","params":["/dev/ttyRobotTool,115200,N,8,1",1,264,3,"Modbus_0",false],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int modbusAddSignal(const std::string &device_info, int slave_number, + int signal_address, int signal_type, + const std::string &signal_name, bool sequential_mode); + + /** + * \chinese + * 删除指定名称的信号。 + * + * @param signal_name 要删除的信号的名称 + * @return + * + * @par Python函数原型 + * modbusDeleteSignal(self: pyaubo_sdk.RegisterControl, arg0: str) -> int + * + * @par Lua函数原型 + * modbusDeleteSignal(signal_name: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusDeleteSignal","params":["Modbus_1"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Deletes the signal identified by the supplied signal name. + * + * @param signal_name A string equal to the name of the signal that should be deleted. + * @return + * + * @par Python interface prototype + * modbusDeleteSignal(self: pyaubo_sdk.RegisterControl, arg0: str) -> int + * + * @par Lua interface prototype + * modbusDeleteSignal(signal_name: string) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusDeleteSignal","params":["Modbus_1"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int modbusDeleteSignal(const std::string &signal_name); + + /** + * \chinese + * 删除所有modbus信号 + * + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusDeleteAllSignals","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Delete all modbus signals + * + * @return + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusDeleteAllSignals","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int modbusDeleteAllSignals(); + + /** + * \chinese + * 读取特定信号的当前值。 + * + * @param signal_name 要获取值的信号的名称 + * @return 对于数字信号:1或0。 + * 对于寄存器信号:表示为整数的寄存器值。如果值为-1,则表示该信号不存在。 + * + * @par Python函数原型 + * modbusGetSignalStatus(self: pyaubo_sdk.RegisterControl, arg0: str) -> int + * + * @par Lua函数原型 + * modbusGetSignalStatus(signal_name: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalStatus","params":["Modbus_0"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1} + * \endchinese + * \english + * Reads the current value of a specific signal. + * + * @param signal_name A string equal to the name of the signal for which the value should be gotten. + * @return An integer or a boolean. For digital signals: 1 or 0. For register signals: The register value expressed as an integer. If the value is -1, it means the signal does not exist. + * + * @par Python interface prototype + * modbusGetSignalStatus(self: pyaubo_sdk.RegisterControl, arg0: str) -> int + * + * @par Lua interface prototype + * modbusGetSignalStatus(signal_name: string) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalStatus","params":["Modbus_0"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1} + * \endenglish + */ + int modbusGetSignalStatus(const std::string &signal_name); + + /** + * \chinese + * 获取所有信号的名字集合 + * + * @return 所有信号的名字集合 + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalNames","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":["Modbus_0"]} + * + * \endchinese + * \english + * Get the collection of all signal names + * + * @return Collection of all signal names + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalNames","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":["Modbus_0"]} + * + * \endenglish + */ + std::vector modbusGetSignalNames(); + + /** + * \chinese + * 获取所有信号的类型集合 + * + * @return 所有信号的类型集合 + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalTypes","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[1,0,2,3]} + * + * \endchinese + * \english + * Get the collection of all signal types + * + * @return Collection of all signal types + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalTypes","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[1,0,2,3]} + * + * \endenglish + */ + std::vector modbusGetSignalTypes(); + + /** + * \chinese + * 获取所有信号的数值集合 + * + * @return 所有信号的数值集合 + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalValues","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[1,1,88,33]} + * + * \endchinese + * \english + * Get the collection of all signal values + * + * @return Collection of all signal values + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalValues","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[1,1,88,33]} + * + * \endenglish + */ + std::vector modbusGetSignalValues(); + + /** + * \chinese + * 获取所有信号的请求是否有错误(0:无错误,其他:有错误)集合 + * + * @return ModbusErrorNum + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalErrors","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[6,6,6,6]} + * + * \endchinese + * \english + * Get the error status of all signal requests (0: no error, others: error) as a collection + * + * @return ModbusErrorNum + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalErrors","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[6,6,6,6]} + * + * \endenglish + */ + std::vector modbusGetSignalErrors(); + + /** + * \chinese + * 将用户指定的命令发送到指定IP地址上的Modbus单元。 + * 由于不会接收到响应,因此不能用于请求数据。 + * 用户负责提供对所提供的功能码有意义的数据。 + * 内置函数负责构建Modbus帧,因此用户不需要关心命令的长度。 + * + * @param device_info 设备信息 + * 设备信息是RTU格式,例如:"serial_port,baud,parity,data_bit,stop_bit" + * (1)serial_port参数指定串口的名称,例如,在Linux上为"/dev/ttyS0"或"/dev/ttyUSB0",在Windows上为"\.\COM10" + * (2)baud参数指定通信的波特率,例如9600、19200、57600、115200等 + * (3)parity参数指定奇偶校验方式,N表示无校验,E表示偶校验,O表示奇校验 + * (4)data_bit参数指定数据位数,允许的值为5、6、7和8 + * (5)stop_bit参数指定停止位数,允许的值为1和2 + * + * 设备信息是TCP格式,例如:"ip address,port" + * (1)ip address参数指定服务器的IP地址 + * (2)port参数指定服务器监听的端口号 + * @param slave_number 指定用于自定义命令的从站号 + * @param function_code 指定自定义命令的功能码 + * + * Modbus功能码 + * MODBUS_FC_READ_COILS 0x01 + * MODBUS_FC_READ_DISCRETE_INPUTS 0x02 + * MODBUS_FC_READ_HOLDING_REGISTERS 0x03 + * MODBUS_FC_READ_INPUT_REGISTERS 0x04 + * MODBUS_FC_WRITE_SINGLE_COIL 0x05 + * MODBUS_FC_WRITE_SINGLE_REGISTER 0x06 + * MODBUS_FC_READ_EXCEPTION_STATUS 0x07 + * MODBUS_FC_WRITE_MULTIPLE_COILS 0x0F + * MODBUS_FC_WRITE_MULTIPLE_REGISTERS 0x10 + * MODBUS_FC_REPORT_SLAVE_ID 0x11 + * MODBUS_FC_MASK_WRITE_REGISTER 0x16 + * MODBUS_FC_WRITE_AND_READ_REGISTERS 0x17 + * + * @param data 必须是有效的字节值(0-255) + * @return + * + * @par Python函数原型 + * modbusSendCustomCommand(self: pyaubo_sdk.RegisterControl, arg0: str, + * arg1: int, arg2: int, arg3: List[int]) -> int + * + * @par Lua函数原型 + * modbusSendCustomCommand(device_info: string, slave_number: number, + * function_code: number, data: table) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusSendCustomCommand","params":["/dev/ttyRobotTool,115200,N,8,1",1,10,[1,2,0,2,4,0,0,0,0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Sends a command specified by the user to the modbus unit located on the + * specified IP address. Cannot be used to request data, since the response + * will not be received. The user is responsible for supplying data which + * is meaningful to the supplied function code. The builtin function takes + * care of constructing the modbus frame, so the user should not be + * concerned with the length of the command. + * + * @param device_info is rtu format. + * eg,"serial_port,baud,parity,data_bit,stop_bit" + * (1)The serial_port argument specifies the name of the serial port eg. On + * Linux ,"/dev/ttyS0" or "/dev/ttyUSB0". On Windows, \\.\COM10". + * (2)The baud argument specifies the baud rate of the communication, eg. + * 9600, 19200, 57600, 115200, etc. + * (3)parity:N for none,E for even,O for odd. + * (4)data_bit:The data_bits argument specifies the number of bits of data, + * the allowed values are 5, 6, 7 and 8. + * (5)stop_bit:The stop_bits argument + * specifies the bits of stop, the allowed values are 1 and 2. + * + * device_info is tcp format.eg,"ip address,port" + * (1)The ip address parameter specifies the ip address of the server + * (2)The port parameter specifies the port number that the server is listening on. + * @param slave_number An integer specifying the slave number to use for + * the custom command. + * @param function_code An integer specifying the function code for the + * custom command. + * + * Modbus function codes + * MODBUS_FC_READ_COILS 0x01 + * MODBUS_FC_READ_DISCRETE_INPUTS 0x02 + * MODBUS_FC_READ_HOLDING_REGISTERS 0x03 + * MODBUS_FC_READ_INPUT_REGISTERS 0x04 + * MODBUS_FC_WRITE_SINGLE_COIL 0x05 + * MODBUS_FC_WRITE_SINGLE_REGISTER 0x06 + * MODBUS_FC_READ_EXCEPTION_STATUS 0x07 + * MODBUS_FC_WRITE_MULTIPLE_COILS 0x0F + * MODBUS_FC_WRITE_MULTIPLE_REGISTERS 0x10 + * MODBUS_FC_REPORT_SLAVE_ID 0x11 + * MODBUS_FC_MASK_WRITE_REGISTER 0x16 + * MODBUS_FC_WRITE_AND_READ_REGISTERS 0x17 + * + * @param data An array of integers in which each entry must be a valid + * byte (0-255) value. + * @return + * + * @par Python interface prototype + * modbusSendCustomCommand(self: pyaubo_sdk.RegisterControl, arg0: str, + * arg1: int, arg2: int, arg3: List[int]) -> int + * + * @par Lua interface prototype + * modbusSendCustomCommand(device_info: string, slave_number: number, + * function_code: number, data: table) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusSendCustomCommand","params":["/dev/ttyRobotTool,115200,N,8,1",1,10,[1,2,0,2,4,0,0,0,0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int modbusSendCustomCommand(const std::string &device_info, + int slave_number, int function_code, + const std::vector &data); + + /** + * \chinese + * 将选择的数字输入信号设置为“default”或“freedrive” + * + * @param robot_name 连接的机器人名称 + * @param signal_name 先前被添加的数字输入信号 + * @param action 操作类型。操作可以是“default”或“freedrive” + * @return + * + * @par Python函数原型 + * modbusSetDigitalInputAction(self: pyaubo_sdk.RegisterControl, arg0: str, + * arg1: str, arg2: int) + * + * @par Lua函数原型 + * modbusSetDigitalInputAction(robot_name: string, signal_name: string, + * action: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetDigitalInputAction","params":["rob1","Modbus_0","Handguide"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Sets the selected digital input signal to either a "default" or + * "freedrive" action. + * + * @param robot_name A string identifying a robot name that connected robot + * @param signal_name A string identifying a digital input signal that was + * previously added. + * @param action The type of action. The action can either be "default" or + * "freedrive". (string) + * @return + * + * @par Python interface prototype + * modbusSetDigitalInputAction(self: pyaubo_sdk.RegisterControl, arg0: str, + * arg1: str, arg2: int) + * + * @par Lua interface prototype + * modbusSetDigitalInputAction(robot_name: string, signal_name: string, + * action: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetDigitalInputAction","params":["rob1","Modbus_0","Handguide"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int modbusSetDigitalInputAction(const std::string &robot_name, + const std::string &signal_name, + StandardInputAction action); + + /** + * \chinese + * 设置 Modbus 信号输出动作 + * + * @param robot_name + * @param signal_name + * @param runstate + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputRunstate","params":["rob1","Modbus_0","None"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set Modbus signal output action + * + * @param robot_name + * @param signal_name + * @param runstate + * @return + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputRunstate","params":["rob1","Modbus_0","None"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int modbusSetOutputRunstate(const std::string &robot_name, + const std::string &signal_name, + StandardOutputRunState runstate); + + /** + * \chinese + * 将指定名称的输出寄存器信号设置为给定的值 + * + * @param signal_name 提前被添加的输出寄存器信号 + * @param value 必须是有效的整数,范围是 0-65535 + * @return + * + * @par Python函数原型 + * modbusSetOutputSignal(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int) -> int + * + * @par Lua函数原型 + * modbusSetOutputSignal(signal_name: string, value: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputSignal","params":["Modbus_0",0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Sets the output register signal identified by the given name to the given value. + * + * @param signal_name A string identifying an output register signal that in advance has been added. + * @param value An integer which must be a valid word (0-65535) + * @return + * + * @par Python interface prototype + * modbusSetOutputSignal(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int) -> int + * + * @par Lua interface prototype + * modbusSetOutputSignal(signal_name: string, value: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputSignal","params":["Modbus_0",0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int modbusSetOutputSignal(const std::string &signal_name, uint16_t value); + + /** + * \chinese + * 设置modbus信号输出脉冲(仅支持线圈输出类型) + * + * @param signal_name: 提前被添加的输出寄存器信号 + * @param value: 必须是有效的整数,范围是 0-65535 + * @param duration: 信号持续时间,单位为秒 + * @return + * + * @par Python函数原型 + * modbusSetOutputSignalPulse(self: pyaubo_sdk.RegisterControl, arg0: str, + * arg1: int, arg2 double) -> int + * + * @par Lua函数原型 + * modbusSetOutputSignalPulse(signal_name: string, value: number, duration: + * number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputSignalPulse","params":["Modbus_0",1,0.5],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set modbus signal output pulse (only supports coil output type) + * + * @param signal_name: A string identifying an output register signal that + * has been added in advance. + * @param value: An integer which must be a valid word (0-65535) + * @param duration: Duration of the signal, in seconds + * @return + * + * @par Python interface prototype + * modbusSetOutputSignalPulse(self: pyaubo_sdk.RegisterControl, arg0: str, + * arg1: int, arg2: double) -> int + * + * @par Lua interface prototype + * modbusSetOutputSignalPulse(signal_name: string, value: number, duration: + * number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputSignalPulse","params":["Modbus_0",1,0.5],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int modbusSetOutputSignalPulse(const std::string &signal_name, + uint16_t value, double duration); + + /** + * \chinese + * 设置机器人向Modbus控制器发送请求的频率,用于读取或写入信号值 + * + * @param signal_name 提前被添加的输出数字信号 + * @param update_frequency 更新频率(以赫兹为单位),范围是0-125 + * @return + * + * @par Python函数原型 + * modbusSetSignalUpdateFrequency(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int) -> int + * + * @par Lua函数原型 + * modbusSetSignalUpdateFrequency(signal_name: string, update_frequency: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetSignalUpdateFrequency","params":["Modbus_0",1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Sets the frequency with which the robot will send requests to the Modbus + * controller to either read or write the signal value. + * + * @param signal_name A string identifying an output digital signal that + * in advance has been added. + * @param update_frequency An integer in the range 0-125 specifying the + * update frequency in Hz. + * @return + * + * @par Python interface prototype + * modbusSetSignalUpdateFrequency(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int) -> int + * + * @par Lua interface prototype + * modbusSetSignalUpdateFrequency(signal_name: string, update_frequency: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetSignalUpdateFrequency","params":["Modbus_0",1],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int modbusSetSignalUpdateFrequency(const std::string &signal_name, + int update_frequency); + + /** + * \chinese + * 获取指定 modbus 信号索引,从0开始,不能存在则返回-1 + * + * @param signal_name + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalIndex","params":["Modbus_0"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get the index of the specified modbus signal, starting from 0. Returns -1 if it does not exist. + * + * @param signal_name + * @return + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalIndex","params":["Modbus_0"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int modbusGetSignalIndex(const std::string &signal_name); + + /** + * \chinese + * 获取指定 modbus 信号的错误状态 + * + * @param signal_name + * @return 返回错误代码 ModbusErrorNum + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalError","params":["Modbus_0"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":6} + * \endchinese + * \english + * Get the error status of the specified modbus signal + * + * @param signal_name + * @return Returns error code ModbusErrorNum + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalError","params":["Modbus_0"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":6} + * \endenglish + */ + int modbusGetSignalError(const std::string &signal_name); + + /** + * \chinese + * 获取指定 modbus 设备的连接状态 + * + * @param device_name + * 设备名是TCP格式,"ip:port", 例如:"127.0.0.1:502" \n + * 设备名是RTU格式,"serial_port", 例如:"/dev/ttyUSB0" \n + * + * @return + * 0: 表示设备处于连接状态 + * -1: 表示设备不存在 + * -2: 表示设备处于断开状态 + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RegisterControl.getModbusDeviceStatus","params":["172.16.26.248:502"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get the connection status of the specified modbus device + * + * @param device_name + * Device name in TCP format: "ip:port", e.g. "127.0.0.1:502" \n + * Device name in RTU format: "serial_port", e.g. "/dev/ttyUSB0" \n + * + * @return + * 0: Device is connected + * -1: Device does not exist + * -2: Device is disconnected + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"RegisterControl.getModbusDeviceStatus","params":["172.16.26.248:502"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int getModbusDeviceStatus(const std::string &device_name); + + /** + * \chinese + * 将某个 modbus 寄存器信号作为编码器 + * + * @param encoder_id 不能为0 + * @param signal_name modbus 信号名字,必须为寄存器类型 + * @return + * \endchinese + * \english + * Use a modbus register signal as an encoder + * + * @param encoder_id Must not be 0 + * @param signal_name Name of the modbus signal, must be of register type + * @return + * \endenglish + */ + int addModbusEncoder(int encoder_id, int range_id, + const std::string &signal_name); + + /** + * \chinese + * 添加Int32寄存器的虚拟编码器 + * + * @param encoder_id 编码器ID + * @param range_id 范围ID + * @param key 变量名 + * @return + * \endchinese + * \english + * Add a virtual encoder for an Int32 register + * + * @param encoder_id Encoder ID + * @param range_id Range ID + * @param key Variable name + * @return + * \endenglish + */ + int addInt32RegEncoder(int encoder_id, int range_id, + const std::string &key); + + /** + * \chinese + * 删除虚拟编码器 + * + * @param encoder_id + * @return + * \endchinese + * \english + * Delete virtual encoder + * + * @param encoder_id + * @return + * \endenglish + */ + int deleteVirtualEncoder(int encoder_id); + +protected: + void *d_; +}; +using RegisterControlPtr = std::shared_ptr; + +} // namespace common_interface +} // namespace arcs + +#endif // AUBO_SDK_REGISTER_CONTROL_INTERFACE_H diff --git a/third_party/AuboSdk/win/include/aubo/robot/force_control.h b/third_party/AuboSdk/win/include/aubo/robot/force_control.h new file mode 100644 index 00000000..a91ed8da --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo/robot/force_control.h @@ -0,0 +1,2385 @@ +/** + * \chinese + * @file force_control.h + * @brief 力控接口 + * + * 力控的限制 + * 当机器人处于力控模式时,以下功能不可用: + * + * • 碰撞检测(选项 613-1)\n + * • SoftMove(选项 885-1)\n + * • 跟踪功能,如输送带跟踪(选项 606-1)、光学跟踪(6601)和焊接引导(815-2)\n + * • 传感器同步或模拟同步\n + * • 世界区域(选项 608-1)\n + * • 独立轴(选项 610-1)\n + * • 路径偏移(选项 612-1)\n + * • 弧焊选项\n + * • PickMaster 选项\n + * • 关节软伺服(指令 SoftAct)\n + * • 当机器人以 MultiMove 协调模式(选项 604-1)运行时,不能激活力控。\n + * • 如果力控与 SafeMove(选项 810-2)或电子位置开关(选项 810-1)一起使用,必须使用操作安全范围功能。请参阅这些选项的相关手册。\n + * • RAPID 指令如 FCAct、FCDeact、FCConditionWaitWhile 和 FCRefStop 只能从运动任务的普通级别调用。 + * + * 应用:抛光、打磨、清洁\n + * FC Pressure\n + * 设置轨迹坐标系的 z 方向为力控轴,spring 设置为 0\n + * 在还没接触前设置输出力为 0,spring 设置为固定值(根据 vel 确定)\n + * 离开接触面:设置输出力为 0,spring 设置为固定值\n + * + * 活塞装配\n + * Forward clutch hub\n + * 设置力控终止模式 + * + * 基于末端力传感器的拖动示教\n + * spring = 0; force_ref = 0; 参考轨迹点任意 + * \endchinese + * \english + * @file force_control.h + * @brief Force control interface + * + * Force control limitations + * When the robot is force controlled, the following functionality is not accessible: + * + * • Collision Detection (option 613-1) \n + * • SoftMove (option 885-1) \n + * • Tracking functionality like Conveyor Tracking (option 606-1), Optical Tracking (6601) and Weld Guide (815-2) \n + * • Sensor Synchronization or Analog Synchronization \n + * • World Zones (option 608-1) \n + * • Independent Axes (option 610-1) \n + * • Path Offset (option 612-1) \n + * • Arc options \n + * • PickMaster options \n + * • Joint soft servo (instruction SoftAct) \n + * • Force Control cannot be activated when the robot is running in MultiMove Coordinated mode (option 604-1). \n + * • If Force Control is used together with SafeMove (option 810-2) or Electronic Position Switches (option 810-1), the function Operational Safety Range must be used. See the respective manual for these options. \n + * • RAPID instructions such as FCAct, FCDeact, FCConditionWaitWhile and FCRefStop can only be called from normal level in a motion task. + * + * Applications: polishing, grinding, cleaning \n + * FC Pressure \n + * Set the z direction of the trajectory coordinate system as the force control axis, set spring to 0 \n + * Before contact, set output force to 0, spring to a fixed value (determined by vel) \n + * Leaving the contact surface: set output force to 0, spring to a fixed value \n + * + * Piston assembly \n + * Forward clutch hub \n + * Set force control termination mode + * + * Drag teaching based on end force sensor \n + * spring = 0; force_ref = 0; reference trajectory point arbitrary + * \endenglish + */ +#ifndef AUBO_SDK_FORCE_CONTROL_INTERFACE_H +#define AUBO_SDK_FORCE_CONTROL_INTERFACE_H + +#include +#include + +#include +#include + +namespace arcs { +namespace common_interface { + +/** + * \chinese + * 力控接口抽象类 + * \endchinese + * \english + * Abstract class for force control interface + * \endenglish + */ +class ARCS_ABI_EXPORT ForceControl +{ +public: + ForceControl(); + virtual ~ForceControl(); + + /** + * \chinese + * 使能力控。 + * fcEnable 被用于使能力控。 在力控被使能的同时, + * fcEnable 用于定义力控的坐标系,并调整力和力矩的阻尼。 + * 如果在 fcEnable 中未指定坐标系, + * 则会创建一个默认的力控制坐标系,其方向与工作对象坐标系相同。 + * 所有力控制监管功能都被 fcEnable 激活。 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * fcEnable(self: pyaubo_sdk.ForceControl) -> int + * + * @par Lua函数原型 + * fcEnable() -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.ForceControl.fcEnable","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * + * \english + * Start force control + * + * fcEnable is used to enable Force Control. At the same time as Force + * Control is enabled, fcEnable is used to define the coordinate system + * for Force Control, and tune the force and torque damping. If a coordinate + * system is not specified in fcEnable a default force control coordinate + * system is created with the same orientation as the work object coordinate + * system. All Force Control supervisions are activated by fcEnable. + * + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * fcEnable(self: pyaubo_sdk.ForceControl) -> int + * + * @par Lua Function Prototype + * fcEnable() -> nil + * + * @par JSON-RPC Request example + * {"jsonrpc":"2.0","method":"rob1.ForceControl.fcEnable","params":[],"id":1} + * + * @par JSON-RPC Response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + + int fcEnable(); + + /** + * \chinese + * 失能力控。 + * fcDisable 被用于失能力控。 在成功失能力控之后,机器人将回到位置控制模式。 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * fcDisable(self: pyaubo_sdk.ForceControl) -> int + * + * @par Lua函数原型 + * fcDisable() -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.ForceControl.fcDisable","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * + * \english + * End force control + * + * fcDisable is used to disable Force Control. After a successful + * deactivation the robot is back in position control. + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * fcDisable(self: pyaubo_sdk.ForceControl) -> int + * + * @par Lua Function Prototype + * fcDisable() -> nil + * + * @par JSON-RPC Request example + * {"jsonrpc":"2.0","method":"rob1.ForceControl.fcDisable","params":[],"id":1} + * + * @par JSON-RPC Response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + + int fcDisable(); + + /** + * \chinese + * 判断力控是否被使能 + * + * @return 使能返回true,失能返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * isFcEnabled(self: pyaubo_sdk.ForceControl) -> bool + * + * @par Lua函数原型 + * isFcEnabled() -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.ForceControl.isFcEnabled","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * \endchinese + * + * \english + * Check if force control is enabled + * + * @return Returns true if enabled, false if disabled + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * isFcEnabled(self: pyaubo_sdk.ForceControl) -> bool + * + * @par Lua Function Prototype + * isFcEnabled() -> boolean + * + * @par JSON-RPC Request example + * {"jsonrpc":"2.0","method":"rob1.ForceControl.isFcEnabled","params":[],"id":1} + * + * @par JSON-RPC Response example + * {"id":1,"jsonrpc":"2.0","result":false} + * \endenglish + */ + bool isFcEnabled(); + + /** + * \chinese + * 设置力控参考(目标)值 + * + * @param feature: 参考几何特征,用于生成力控参考坐标系 + * @param compliance: 柔性轴(方向)选择 + * @param wrench: 目标力/力矩 + * @param limits: 速度限制 + * @param type: 力控参考坐标系类型 + * + * 使用说明: + * 1. 基坐标系: + * feature = {0,0,0,0,0,0} + * type = TaskFrameType::NONE + * + * 2. 法兰坐标系: + * feature = {0,0,0,0,0,0} + * type = TaskFrameType::TOOL_FORCE + * + * 3. TCP坐标系: + * feature = tcp_offset + * type = TaskFrameType::TOOL_FORCE + * + * 4. 用户坐标系(FRAME_FORCE): + * type = TaskFrameType::FRAME_FORCE + * feature 设为用户定义的参考坐标,例如 getTcpPose() 表示以当前 TCP 坐标作为力控坐标系。 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setTargetForce(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * List[bool], arg2: List[float], arg3: List[float], arg4: + * arcs::common_interface::TaskFrameType) -> int + * + * @par Lua函数原型 + * setTargetForce(feature: table, compliance: table, wrench: table, limits: + * table, type: number) -> nil + * + * \endchinese + * \english + * Set force control reference (target) value + * + * @param feature: Reference geometric feature for generating force control reference frame + * @param compliance: Compliance axis (direction) selection + * @param wrench: Target force/torque + * @param limits: Velocity limits + * @param type: Force control reference frame type + * + * Usage Examples: + * 1. Base Coordinate Frame: + * feature = {0,0,0,0,0,0} + * type = TaskFrameType::NONE + * + * 2. Flange Coordinate Frame: + * feature = {0,0,0,0,0,0} + * type = TaskFrameType::TOOL_FORCE + * + * 3. TCP Coordinate Frame: + * feature = tcp_offset + * type = TaskFrameType::TOOL_FORCE + * + * 4. User Coordinate Frame (FRAME_FORCE): + * type = TaskFrameType::FRAME_FORCE + * feature should be the user-defined reference frame, + * for example, getTcpPose() means setting the force control frame to current TCP pose. + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setTargetForce(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * List[bool], arg2: List[float], arg3: List[float], arg4: + * arcs::common_interface::TaskFrameType) -> int + * + * @par Lua Function Prototype + * setTargetForce(feature: table, compliance: table, wrench: table, limits: + * table, type: number) -> nil + * + * \endenglish + */ + int setTargetForce(const std::vector &feature, + const std::vector &compliance, + const std::vector &wrench, + const std::vector &limits, + TaskFrameType type = TaskFrameType::FRAME_FORCE); + + /** + * \chinese + * 设置力控动力学模型 + * + * @param env_stiff: 环境刚度,表示为接触轴方向上的工件刚度,取值范围[0, 1],默认为0 + * @param damp_scale: 表征阻尼水平的参数,取值范围[0, 1],默认为0.5 + * @param stiff_scale: 表征软硬程度的参数,取值范围[0, 1],默认为0.5 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setDynamicModel1(self: pyaubo_sdk.ForceControl, arg0: List[float], + * arg1: List[float], arg2: List[float]) -> int + * + * @par Lua函数原型 + * setDynamicModel1(env_stiff: table, damp_scale: table, stiff_scale: + * table) -> nil + * \endchinese + * \english + * Set force control dynamics model + * + * @param env_stiff: Environment stiffness, representing the workpiece stiffness in the contact axis direction, range [0, 1], default 0 + * @param damp_scale: Parameter representing damping level, range [0, 1], default 0.5 + * @param stiff_scale: Parameter representing stiffness level, range [0, 1], default 0.5 + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setDynamicModel1(self: pyaubo_sdk.ForceControl, arg0: List[float], + * arg1: List[float], arg2: List[float]) -> int + * + * @par Lua Function Prototype + * setDynamicModel1(env_stiff: table, damp_scale: table, stiff_scale: + * table) -> nil + * \endenglish + */ + int setDynamicModel1(const std::vector &env_stiff, + const std::vector &damp_scale, + const std::vector &stiff_scale); + + /** + * \chinese + * 计算力控动力学模型 + * + * @param env_stiff: 环境刚度,表示为接触轴方向上的工件刚度,取值范围[0, 1],默认为0 + * @param damp_scale: 表征阻尼水平的参数,取值范围[0, 1],默认为0.5 + * @param stiff_scale: 表征软硬程度的参数,取值范围[0, 1],默认为0.5 + * + * @return 力控动力学模型MDK + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * fcCalDynamicModel(self: pyaubo_sdk.ForceControl, arg0: List[float], + * arg1: List[float], arg2: List[float]) -> Tuple[List[float], List[float], List[float]] + * + * @par Lua函数原型 + * fcCalDynamicModel(env_stiff: table, damp_scale: table, stiff_scale: table) -> table + * \endchinese + * \english + * Calculate force control dynamics model + * + * @param env_stiff: Environment stiffness, representing the workpiece stiffness in the contact axis direction, range [0, 1], default 0 + * @param damp_scale: Parameter representing damping level, range [0, 1], default 0.5 + * @param stiff_scale: Parameter representing stiffness level, range [0, 1], default 0.5 + * + * @return Force control dynamics model MDK + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * fcCalDynamicModel(self: pyaubo_sdk.ForceControl, arg0: List[float], + * arg1: List[float], arg2: List[float]) -> Tuple[List[float], List[float], List[float]] + * + * @par Lua Function Prototype + * fcCalDynamicModel(env_stiff: table, damp_scale: table, stiff_scale: table) -> table + * \endenglish + */ + DynamicsModel fcCalDynamicModel(const std::vector &env_stiff, + const std::vector &damp_scale, + const std::vector &stiff_scale); + + /** + * \chinese + * 设置力控搜孔场景下的动力学模型 + * + * @param damp_scale: 表征阻尼水平的参数,取值范围[0, 1],默认为0.5 + * @param stiff_scale: 表征软硬程度的参数,取值范围[0, 1],默认为0.5 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setDynamicModelSearch(self: pyaubo_sdk.ForceControl, arg0: List[float], + * arg1: List[float]) -> int + * + * @par Lua函数原型 + * setDynamicModelSearch(damp_scale: table, stiff_scale: table) -> nil + * \endchinese + * \english + * Set force control dynamics model for hole searching scenario + * + * @param damp_scale: Parameter representing damping level, range [0, 1], default 0.5 + * @param stiff_scale: Parameter representing stiffness level, range [0, 1], default 0.5 + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setDynamicModelSearch(self: pyaubo_sdk.ForceControl, arg0: List[float], + * arg1: List[float]) -> int + * + * @par Lua Function Prototype + * setDynamicModelSearch(damp_scale: table, stiff_scale: table) -> nil + * \endenglish + */ + int setDynamicModelSearch(const std::vector &damp_scale, + const std::vector &stiff_scale); + + /** + * \chinese + * 设置力控插/拔孔场景下的动力学模型 + * + * @param damp_scale: 表征阻尼水平的参数,取值范围[0, 1],默认为0.5 + * @param stiff_scale: 表征软硬程度的参数,取值范围[0, 1],默认为0.5 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setDynamicModelInsert(self: pyaubo_sdk.ForceControl, arg0: List[float], + * arg1: List[float]) -> int + * + * @par Lua函数原型 + * setDynamicModelInsert(damp_scale: table, stiff_scale: table) -> nil + * + * \endchinese + * \english + * Set force control dynamics model for insertion/extraction scenario + * + * @param damp_scale: Parameter representing damping level, range [0, 1], default 0.5 + * @param stiff_scale: Parameter representing stiffness level, range [0, 1], default 0.5 + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setDynamicModelInsert(self: pyaubo_sdk.ForceControl, arg0: List[float], + * arg1: List[float]) -> int + * + * @par Lua Function Prototype + * setDynamicModelInsert(damp_scale: table, stiff_scale: table) -> nil + * + * \endenglish + */ + int setDynamicModelInsert(const std::vector &damp_scale, + const std::vector &stiff_scale); + /** + * \chinese + * 设置力控接触场景下的动力学模型 + * + * @param env_stiff: 表征环境刚度的参数,取值范围[0, 1],默认为0 + * @param damp_scale: 表征阻尼水平的参数,取值范围[0, 1],默认为0.5 + * @param stiff_scale: 表征软硬程度的参数,取值范围[0, 1],默认为0.5 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setDynamicModelContact(self: pyaubo_sdk.ForceControl, arg0: List[float], + * arg1: List[float], arg2: List[float]) -> int + * + * @par Lua函数原型 + * setDynamicModelContact(env_stiff: table, damp_scale: table, stiff_scale: + * table) -> nil + * \endchinese + * \english + * Set force control dynamics model for contact scenario + * + * @param env_stiff: Parameter representing environment stiffness, range [0, 1], default 0 + * @param damp_scale: Parameter representing damping level, range [0, 1], default 0.5 + * @param stiff_scale: Parameter representing stiffness level, range [0, 1], default 0.5 + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setDynamicModelContact(self: pyaubo_sdk.ForceControl, arg0: List[float], + * arg1: List[float], arg2: List[float]) -> int + * + * @par Lua Function Prototype + * setDynamicModelContact(env_stiff: table, damp_scale: table, stiff_scale: + * table) -> nil + * \endenglish + */ + int setDynamicModelContact(const std::vector &env_stiff, + const std::vector &damp_scale, + const std::vector &stiff_scale); + + /** + * \chinese + * 设置力控动力学模型 + * + * @param m 质量参数 + * @param d 阻尼参数 + * @param k 刚度参数 + * + * 参数单位说明: + * - 质量: + * - 笛卡尔空间:单位为 kg,长度为工作空间维度(一般为6),顺序为 [x, y, z, Rx, Ry, Rz] + * - 关节空间:单位为 kg·m²,长度为机器人自由度(一般为6),顺序为 [J1, J2, J3, J4, J5, J6] + * - 阻尼: + * - 笛卡尔空间:单位为 N·s/m,顺序为 [x, y, z, Rx, Ry, Rz] + * - 关节空间:单位为 N·m·s/rad,顺序为 [J1, J2, J3, J4, J5, J6] + * - 刚度: + * - 笛卡尔空间:单位为 N/m,顺序为 [x, y, z, Rx, Ry, Rz] + * - 关节空间:单位为 N·m/rad,顺序为 [J1, J2, J3, J4, J5, J6] + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setDynamicModel(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * List[float], arg2: List[float]) -> int + * + * @par Lua函数原型 + * setDynamicModel(m: table, d: table, k: table) -> nil + * \endchinese + * \english + * Set force control dynamics model + * + * @param m Mass parameters + * @param d Damping parameters + * @param k Stiffness parameters + * + * Parameter unit description: + * - Mass: + * - Cartesian space: unit is kg, length is 6, order is [x, y, z, Rx, Ry, Rz] + * - Joint space: unit is kg·m², length is 6, order is [J1, J2, J3, J4, J5, J6] + * - Damping: + * - Cartesian space: unit is N·s/m, order is [x, y, z, Rx, Ry, Rz] + * - Joint space: unit is N·m·s/rad, order is [J1, J2, J3, J4, J5, J6] + * - Stiffness: + * - Cartesian space: unit is N/m, order is [x, y, z, Rx, Ry, Rz] + * - Joint space: unit is N·m/rad, order is [J1, J2, J3, J4, J5, J6] + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setDynamicModel(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * List[float], arg2: List[float]) -> int + * + * @par Lua Function Prototype + * setDynamicModel(m: table, d: table, k: table) -> nil + * \endenglish + */ + int setDynamicModel(const std::vector &m, + const std::vector &d, + const std::vector &k); + + /** + * \chinese + * 设置力控阈值 + * + * @param thresholds: 力控阈值 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * fcSetSensorThresholds(self: pyaubo_sdk.ForceControl, arg0: + * List[float]) -> int + * + * @par Lua函数原型 + * fcSetSensorThresholds(feature: table, compliance: table, wrench: + * table, limits: table, type: number) -> nil + * + * \endchinese + * \english + * Set force control thresholds + * + * @param thresholds: Force control thresholds + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * fcSetSensorThresholds(self: pyaubo_sdk.ForceControl, arg0: + * List[float]) -> int + * + * @par Lua Function Prototype + * fcSetSensorThresholds(feature: table, compliance: table, wrench: + * table, limits: table, type: number) -> nil + * + * \endenglish + */ + int fcSetSensorThresholds(const std::vector &thresholds); + + /** + * \chinese + * 设置力控最大受力限制 + * + * @param limits: 力限制 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * fcSetSensorLimits(self: pyaubo_sdk.ForceControl, arg0: + * List[float]) -> int + * + * @par Lua函数原型 + * fcSetSensorLimits(feature: table, compliance: table, wrench: + * table, limits: table, type: number) -> nil + * + * \endchinese + * \english + * Set force control maximum force limits + * + * @param limits: Force limits + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * fcSetSensorLimits(self: pyaubo_sdk.ForceControl, arg0: + * List[float]) -> int + * + * @par Lua Function Prototype + * fcSetSensorLimits(feature: table, compliance: table, wrench: + * table, limits: table, type: number) -> nil + * + * \endenglish + */ + int fcSetSensorLimits(const std::vector &limits); + + /** + * \chinese + * 获取力控阈值 + * + * @return 力控最小力阈值 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getFcSensorThresholds(self: pyaubo_sdk.ForceControl) -> list + * + * @par Lua函数原型 + * getFcSensorThresholds() -> table + * + * \endchinese + * \english + * Get force control thresholds + * + * @return Minimum force control thresholds + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * getFcSensorThresholds(self: pyaubo_sdk.ForceControl) -> list + * + * @par Lua Function Prototype + * getFcSensorThresholds() -> table + * + * \endenglish + */ + std::vector getFcSensorThresholds(); + + /** + * \chinese + * 获取最大力限制 + * + * @return 力控最大力限制 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getFcSensorLimits(self: pyaubo_sdk.ForceControl) -> list + * + * @par Lua函数原型 + * getFcSensorLimits() -> table + * + * \endchinese + * \english + * Get maximum force limits + * + * @return Force control maximum force limits + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * getFcSensorLimits(self: pyaubo_sdk.ForceControl) -> list + * + * @par Lua Function Prototype + * getFcSensorLimits() -> table + * + * \endenglish + */ + std::vector getFcSensorLimits(); + + /** + * \chinese + * 获取力控动力学模型 + * + * @return 力控动力学模型 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getDynamicModel(self: pyaubo_sdk.ForceControl) -> Tuple[List[float], + * List[float], List[float]] + * + * @par Lua函数原型 + * getDynamicModel() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.ForceControl.getDynamicModel","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[[],[20.0,20.0,20.0,5.0,5.0,5.0],[]]} + * \endchinese + * \english + * Get force control dynamics model + * + * @return Force control dynamics model + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * getDynamicModel(self: pyaubo_sdk.ForceControl) -> Tuple[List[float], + * List[float], List[float]] + * + * @par Lua Function Prototype + * getDynamicModel() -> table + * + * @par JSON-RPC Request example + * {"jsonrpc":"2.0","method":"rob1.ForceControl.getDynamicModel","params":[],"id":1} + * + * @par JSON-RPC Response example + * {"id":1,"jsonrpc":"2.0","result":[[],[20.0,20.0,20.0,5.0,5.0,5.0],[]]} + * \endenglish + */ + DynamicsModel getDynamicModel(); + + /** + * \chinese + * 设置力控终止条件:力,当测量的力在设置的范围之内,力控算法将保持运行,直到设置的条件不满足,力控将退出 + * + * The condition is lateractivated by calling the instruction + * FCCondWaitWhile, which will wait and hold the program execution while the + * specified condition is true. This allows the reference force, torque and + * movement to continue until the force is outside the specified limits. + * + * A force condition is set up by defining minimum and maximum limits for + * the force in the directions of the force control coordinate system. Once + * activated with FCCondWaitWhile, the program execution will continue to + * wait while the measured force is within its specified limits. + * + * It is possible to specify that the condition is fulfilled when the force + * is outside the specified limits instead. This is done by using the switch + * argument Outside. The condition on force is specified in the force + * control coordinate system. This coordinate system is setup by the user in + * the instruction FCAct. + * + * @param min 各方向最小的力/力矩 + * @param max 各方向最大的力/力矩 + * @param outside false 在设置条件的范围之内有效 + * true 在设置条件的范围之外有效 + * @param timeout + * 时间限制,单位s(秒),从开始力控到达该时间时,不管是否满足力控终止条件,都会终止力控 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setCondForce(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * List[float], arg2: bool, arg3: float) -> int + * + * @par Lua函数原型 + * setCondForce(min: table, max: table, outside: boolean, timeout: number) + * -> nil + * \endchinese + * \english + * Set force control termination condition: Force. When the measured force is within + * the specified range, the force control algorithm will continue to run until the set + * condition is not met, at which point force control will exit. + * + * The condition is lateractivated by calling the instruction + * FCCondWaitWhile, which will wait and hold the program execution while the + * specified condition is true. This allows the reference force, torque and + * movement to continue until the force is outside the specified limits. + * + * A force condition is set up by defining minimum and maximum limits for + * the force in the directions of the force control coordinate system. Once + * activated with FCCondWaitWhile, the program execution will continue to + * wait while the measured force is within its specified limits. + * + * It is possible to specify that the condition is fulfilled when the force + * is outside the specified limits instead. This is done by using the switch + * argument Outside. The condition on force is specified in the force + * control coordinate system. This coordinate system is setup by the user in + * the instruction FCAct. + * + * @param min Minimum force/torque in each direction + * @param max Maximum force/torque in each direction + * @param outside false: valid within the specified range + * true: valid outside the specified range + * @param timeout + * Time limit in seconds; when this time is reached from the start of force control, + * force control will terminate regardless of whether the end condition is met + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setCondForce(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * List[float], arg2: bool, arg3: float) -> int + * + * @par Lua Function Prototype + * setCondForce(min: table, max: table, outside: boolean, timeout: number) + * -> nil + * \endenglish + */ + int setCondForce(const std::vector &min, + const std::vector &max, bool outside, + double timeout); + + /** + * \chinese + * 设置力控终止条件:姿态,当测量的姿态在设置的范围之内,力控算法将保持运行,直到设置的条件不满足,力控将退出. + * + * setCondOrient is used to set up an end condition for the tool orientation. + * The condition is lateractivated by calling the instruction + * FCCondWaitWhile, which will wait and hold the program execution while the + * specified condition is true. This allows the reference force, torque and + * movement to continue until the orientation is outside the specified + * limits. + * + * An orientation condition is set up by defining a maximum angle and a + * maximum rotation from a reference orientation. The reference orientation + * is either defined by the current z direction of the tool, or by + * specifying an orientation in relation to the z direction of the work + * object. + * + * Once activated, the tool orientation must be within the limits (or + * outside, if the argument Outside is used). + * + * @param frame + * @param max_angle + * @param max_rot + * @param outside + * @param timeout + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setCondOrient(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * float, arg2: float, arg3: bool, arg4: float) -> int + * + * @par Lua函数原型 + * setCondOrient(frame: table, max_angle: number, max_rot: number, outside: + * boolean, timeout: number) -> nil + * \endchinese + * + * \english + * setCondOrient is used to set up an end condition for the tool orientation. + * The condition will wait and hold the program execution while the + * specified condition is true. This allows the reference force, torque and + * movement to continue until the orientation is outside the specified + * limits. + * + * An orientation condition is set up by defining a maximum angle and a + * maximum rotation from a reference orientation. The reference orientation + * is either defined by the current z direction of the tool, or by + * specifying an orientation in relation to the z direction of the work + * object. + * + * Once activated, the tool orientation must be within the limits (or + * outside, if the argument Outside is used). + * + * @param frame + * @param max_angle + * @param max_rot + * @param outside + * @param timeout + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setCondOrient(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * float, arg2: float, arg3: bool, arg4: float) -> int + * + * @par Lua Function Prototype + * setCondOrient(frame: table, max_angle: number, max_rot: number, outside: + * boolean, timeout: number) -> nil + * \endenglish + */ + int setCondOrient(const std::vector &frame, double max_angle, + double max_rot, bool outside, double timeout); + + /** + * \chinese + * 指定力控有效平面,x-y平面,z方向有效 + * + * @param plane={A,B,C,D} + * 平面表示方法 Ax +By +Cz + D = 0 + * 其中,n = (A, B, C)是平面的法向量, + * D 是将平面平移到坐标原点所需距离(所以D=0时,平面过原点) + * @param timeout + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setCondPlane(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * float) -> int + * + * @par Lua函数原型 + * setCondPlane(plane: table, timeout: number) -> nil + * \endchinese + * \english + * Specify a valid force control plane, x-y plane, z direction is valid + * + * @param plane={A,B,C,D} + * Plane equation: Ax + By + Cz + D = 0 + * where n = (A, B, C) is the normal vector of the plane, + * D is the distance required to move the plane to the origin (so D=0 means the plane passes through the origin) + * @param timeout + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setCondPlane(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * float) -> int + * + * @par Lua Function Prototype + * setCondPlane(plane: table, timeout: number) -> nil + * \endenglish + */ + int setCondPlane(const std::vector &plane, double timeout); + + /** + * \chinese + * 指定力控有效圆柱体,提供中心轴和圆柱半径,可以指定圆柱内部还是外部 + * + * @param axis + * @param radius + * @param outside + * @param timeout + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setCondCylinder(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * float, arg2: bool, arg3: float) -> int + * + * @par Lua函数原型 + * setCondCylinder(axis: table, radius: number, outside: boolean, timeout: + * number) -> nil + * \endchinese + * \english + * Specify a valid force control cylinder by providing the central axis and cylinder radius, and specify whether the inside or outside of the cylinder is valid. + * + * @param axis + * @param radius + * @param outside + * @param timeout + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setCondCylinder(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * float, arg2: bool, arg3: float) -> int + * + * @par Lua Function Prototype + * setCondCylinder(axis: table, radius: number, outside: boolean, timeout: + * number) -> nil + * \endenglish + */ + int setCondCylinder(const std::vector &axis, double radius, + bool outside, double timeout); + + /** + * \chinese + * 指定力控有效球体,提供球心和半径,可以指定球体内部还是外部 + * + * @param center + * @param radius + * @param outside + * @param timeout + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setCondSphere(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * float, arg2: bool, arg3: float) -> int + * + * @par Lua函数原型 + * setCondSphere(center: table, radius: number, outside: boolean, timeout: + * number) -> nil + * \endchinese + * \english + * Specify a valid force control sphere by providing the center and radius, and specify whether the inside or outside of the sphere is valid. + * + * @param center + * @param radius + * @param outside + * @param timeout + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setCondSphere(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * float, arg2: bool, arg3: float) -> int + * + * @par Lua Function Prototype + * setCondSphere(center: table, radius: number, outside: boolean, timeout: + * number) -> nil + * \endenglish + */ + int setCondSphere(const std::vector ¢er, double radius, + bool outside, double timeout); + + /** + * \chinese + * 设置TCP速度的终止条件。该条件可通过调用FCCondWaitWhile指令激活, + * 在指定条件为真时,程序将等待并保持执行。这样可以使参考力、力矩和运动继续, + * 直到速度超出指定范围。 + * + * 通过定义TCP在工作对象所有方向上的最小和最大速度限制来设置TCP速度条件。 + * 一旦通过FCCondWaitWhile激活,程序将在测量速度处于指定范围内时继续等待。 + * + * 也可以指定当速度超出指定范围时条件成立,通过使用outside参数实现。 + * TCP速度条件在工作对象坐标系中指定。 + * + * @param min 最小速度 + * @param max 最大速度 + * @param outside 是否在范围外有效 + * @param timeout 超时时间 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setCondTcpSpeed(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * List[float], arg2: bool, arg3: float) -> int + * + * @par Lua函数原型 + * setCondTcpSpeed(min: table, max: table, outside: boolean, timeout: + * number) -> nil + * \endchinese + * \english + * setCondTcpSpeed is used to setup an end condition for the TCP speed. The + * condition is later activated by calling the instruction FCCondWaitWhile, + * which will wait and hold the program execution while the specified + * condition is true. This allows the reference force, torque and movement + * to continue until the speed is outside the specified limits. + * + * A TCP speed condition is set up by defining minimum and maximum limits + * for the TCP speed in all directions of the work object. Once activated + * with FCCondWaitWhile, the program execution will continue to wait while + * the measured speed is within its specified limits. + * + * It is possible to specify that the condition is fulfilled when the speed + * is outside the specified limits instead. This is done by using the + * switch argument Outside. The condition on TCP speed is specified in the + * work object coordinate system. + * + * @param min + * @param max + * @param outside + * @param timeout + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setCondTcpSpeed(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * List[float], arg2: bool, arg3: float) -> int + * + * @par Lua Function Prototype + * setCondTcpSpeed(min: table, max: table, outside: boolean, timeout: + * number) -> nil + * \endenglish + */ + int setCondTcpSpeed(const std::vector &min, + const std::vector &max, bool outside, + double timeout); + + /** + * \chinese + * 力控终止条件-距离 + * + * @param distance 距离 + * @param timeout 超时时间 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * \endchinese + * \english + * Force control termination condition - distance + * + * @param distance Distance + * @param timeout Timeout + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * \endenglish + */ + int setCondDistance(double distance, double timeout); + + /** + * \chinese + * 高级力控终止条件 + * + * @param type 类型 + * @param args 参数 + * @param timeout 超时时间 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Advanced force control termination condition + * + * @param type Type + * @param args Arguments + * @param timeout Timeout + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int setCondAdvanced(const std::string &type, + const std::vector &args, double timeout); + + /** + * \chinese + * 激活力控终止条件 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setCondActive(self: pyaubo_sdk.ForceControl) -> int + * + * @par Lua函数原型 + * setCondActive() -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.ForceControl.setCondActive","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Activate force control termination condition + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setCondActive(self: pyaubo_sdk.ForceControl) -> int + * + * @par Lua Function Prototype + * setCondActive() -> nil + * + * @par JSON-RPC Request example + * {"jsonrpc":"2.0","method":"rob1.ForceControl.setCondActive","params":[],"id":1} + * + * @par JSON-RPC Response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setCondActive(); + + /** + * \chinese + * 力控终止条件是否已经满足 + * + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * isCondFullfiled(self: pyaubo_sdk.ForceControl) -> bool + * + * @par Lua函数原型 + * isCondFullfiled() -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.ForceControl.isCondFullfiled","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * \endchinese + * \english + * Check if the force control termination condition has been fulfilled + * + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * isCondFullfiled(self: pyaubo_sdk.ForceControl) -> bool + * + * @par Lua Function Prototype + * isCondFullfiled() -> boolean + * + * @par JSON-RPC Request example + * {"jsonrpc":"2.0","method":"rob1.ForceControl.isCondFullfiled","params":[],"id":1} + * + * @par JSON-RPC Response example + * {"id":1,"jsonrpc":"2.0","result":false} + * \endenglish + */ + bool isCondFullfiled(); + + /** + * \chinese + * setSupvForce 用于在力控中设置力监督。监督在通过 FCAct 指令激活力控时被激活。 + * + * 力监督通过在力控坐标系的各个方向上定义最小和最大力限制来设置。 + * 一旦激活,如果力超出允许的范围,监督将停止执行。力监督在力控坐标系中指定。 + * 该坐标系由用户通过 FCAct 指令设置。 + * + * @param min 最小力限制 + * @param max 最大力限制 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setSupvForce(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * List[float]) -> int + * + * @par Lua函数原型 + * setSupvForce(min: table, max: table) -> nil + * \endchinese + * \english + * setSupvForce is used to set up force supervision in Force Control. The + * supervision is activated when Force Control is activated with the + * instruction FCAct. + * + * The force supervision is set up by defining minimum and maximum limits + * for the force in the directions of the force control coordinate system. + * Once activated, the supervision will stop the execution if the force is + * outside the allowed values. The force supervision is specified in the + * force control coordinate system. This coordinate system is setup by the + * user with the instruction FCAct. + * + * @param min + * @param max + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setSupvForce(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * List[float]) -> int + * + * @par Lua Function Prototype + * setSupvForce(min: table, max: table) -> nil + * \endenglish + */ + int setSupvForce(const std::vector &min, + const std::vector &max); + + /** + * \chinese + * setSupvOrient 用于设置工具姿态的监督条件。 + * 当通过 FCAct 指令激活力控时,监督条件被激活。 + * + * 姿态监督通过定义相对于参考姿态的最大角度和最大旋转来设置。 + * 参考姿态可以由工具当前的z方向定义,也可以通过指定相对于工作对象z方向的姿态来定义。 + * + * 一旦激活,工具姿态必须在限制范围内,否则监督将停止执行。 + * + * @param frame + * @param max_angle + * @param max_rot + * @param outside + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setSupvOrient(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * float, arg2: float, arg3: bool) -> int + * + * @par Lua函数原型 + * setSupvOrient(frame: table, max_angle: number, max_rot: number, + * outside: boolean) -> nil + * \endchinese + * \english + * setSupvOrient is used to set up an supervision for the tool orientation. + * The supervision is activated when Force Control is activated with the + * instruction FCAct. + * + * An orientation supervision is set up by defining a maximum angle and a + * maximum rotation from a reference orientation. The reference orientation + * is either defined by the current z direction of the tool, or by + * specifying an orientation in relation to the z direction of the work + * object. + * + * Once activated, the tool orientation must be within the limits otherwise + * the supervision will stop the execution. + * + * @param frame + * @param max_angle + * @param max_rot + * @param outside + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setSupvOrient(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * float, arg2: float, arg3: bool) -> int + * + * @par Lua Function Prototype + * setSupvOrient(frame: table, max_angle: number, max_rot: number, + * outside: boolean) -> nil + * \endenglish + */ + int setSupvOrient(const std::vector &frame, double max_angle, + double max_rot, bool outside); + + /** + * \chinese + * setSupvPosBox 用于在力控中设置位置监督。监督在通过 FCAct 指令激活力控时被激活。 + * 位置监督通过为TCP定义空间体积来设置。一旦激活,如果TCP超出该体积,监督将停止执行。 + * + * @param frame + * @param box + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setSupvPosBox(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * List[float[6]]) -> int + * + * @par Lua函数原型 + * setSupvPosBox(frame: table, box: table) -> nil + * \endchinese + * \english + * setSupvPosBox is used to set up position supervision in Force Control. + * Supervision is activated when Force Control is activated with the + * instruction FCAct. Position supervision is set up by defining a volume in + * space for the TCP. Once activated, the supervision will stop the + * execution if the TCP is outside this volume. + * + * @param frame + * @param box + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setSupvPosBox(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * List[float[6]]) -> int + * + * @par Lua Function Prototype + * setSupvPosBox(frame: table, box: table) -> nil + * \endenglish + */ + int setSupvPosBox(const std::vector &frame, const Box &box); + + /** + * \chinese + * + * @param frame + * @param cylinder + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setSupvPosCylinder(self: pyaubo_sdk.ForceControl, arg0: List[float], + * arg1: List[float[5]]) -> int + * + * @par Lua函数原型 + * setSupvPosCylinder(frame: table, cylinder: table) -> nil + * + * \endchinese + * \english + * + * @param frame + * @param cylinder + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setSupvPosCylinder(self: pyaubo_sdk.ForceControl, arg0: List[float], + * arg1: List[float[5]]) -> int + * + * @par Lua Function Prototype + * setSupvPosCylinder(frame: table, cylinder: table) -> nil + * + * \endenglish + */ + int setSupvPosCylinder(const std::vector &frame, + const Cylinder &cylinder); + + /** + * \chinese + * + * @param frame + * @param sphere + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setSupvPosSphere(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * List[float[3]]) -> int + * + * @par Lua函数原型 + * setSupvPosSphere(frame: table, sphere: table) -> nil + * + * \endchinese + * \english + * + * @param frame + * @param sphere + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setSupvPosSphere(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: + * List[float[3]]) -> int + * + * @par Lua Function Prototype + * setSupvPosSphere(frame: table, sphere: table) -> nil + * + * \endenglish + */ + int setSupvPosSphere(const std::vector &frame, + const Sphere &sphere); + + /** + * \chinese + * setSupvReoriSpeed 用于在力控中设置重新定向速度监督。监督在通过 FCAct 指令激活力控时被激活。 + * + * 重新定向速度监督通过定义工作对象坐标系轴周围重新定向速度的最小和最大限制来设置。 + * 一旦激活,如果重新定向速度的值过高,监督将停止执行。 + * + * 有两种速度监督:FCSupvReoriSpeed 和 FCSupvTCPSpeed,后者在第199页的 FCSupvTCPSpeed 部分有描述。 + * 可能需要两种监督,因为: + * - 机器人轴可以在 TCP 静止时高速旋转。 + * - 当 TCP 距离旋转轴较远时,轴的微小旋转可能导致 TCP 的高速运动。 + * + * @param speed_limit 速度限制 + * @param outside 是否在范围外有效 + * @param timeout 超时时间 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setSupvReoriSpeed(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: bool, arg2: float) -> int + * + * @par Lua函数原型 + * setSupvReoriSpeed(speed_limit: table, outside: boolean, timeout: number) -> nil + * \endchinese + * \english + * setSupvReoriSpeed is used to set up reorientation speed supervision in Force Control. The supervision is activated when Force Control is activated with the instruction FCAct. + * + * The reorientation speed supervision is set up by defining minimum and maximum limits for the reorientation speed around the axis of the work object coordinate system. Once activated, the supervision will stop the execution if the values of the reorientation speed are too high. + * + * There are two speed supervisions: FCSupvReoriSpeed and FCSupvTCPSpeed, which is described in section FCSupvTCPSpeed on page 199. + * Both supervisions may be required because: + * - A robot axis can rotate with high speed while the TCP is stationary. + * - The TCP can be far from the rotating axis and a small axis rotation may result in a high speed movement of the TCP. + * + * @param speed_limit + * @param outside + * @param timeout + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setSupvReoriSpeed(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: bool, arg2: float) -> int + * + * @par Lua Function Prototype + * setSupvReoriSpeed(speed_limit: table, outside: boolean, timeout: number) -> nil + * \endenglish + */ + int setSupvReoriSpeed(const std::vector &speed_limit, bool outside, + double timeout); + + /** + * \chinese + * setSupvTcpSpeed 用于在力控中设置TCP速度监督。监督在通过 FCAct 指令激活力控时被激活。 + * TCP速度监督通过定义工作对象坐标系各方向上的最小和最大速度限制来设置。 + * 一旦激活,如果检测到过高的TCP速度值,监督将停止执行。 + * + * 有两种速度监督:FCSupvTCPSpeed 和 FCSupvReoriSpeed,后者在第197页的 FCSupvReoriSpeed 部分有描述。 + * + * 可能需要两种监督,因为: + * - 机器人轴可以在TCP静止时高速旋转。 + * - 当TCP距离旋转轴较远时,轴的微小旋转可能导致TCP的高速运动。 + * + * @param speed_limit 速度限制 + * @param outside 是否在范围外有效 + * @param timeout 超时时间 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setSupvTcpSpeed(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: bool, arg2: float) -> int + * + * @par Lua函数原型 + * setSupvTcpSpeed(speed_limit: table, outside: boolean, timeout: number) -> nil + * \endchinese + * \english + * setSupvTcpSpeed is used to set up TCP speed supervision in Force Control. + * The supervision is activated when Force Control is activated with the + * instruction FCAct. The TCP speed supervision is set up by defining + * minimum and maximum limits for the TCP speed in the directions of the + * work object coordinate system. Once activated, the supervision will stop + * the execution if too high TCP speed values are detected. + * + * There are two speed supervisions: FCSupvTCPSpeed and FCSupvReoriSpeed, + * which is described in section FCSupvReoriSpeed on page 197. + * + * Both supervisions may be required because: + * - A robot axis can rotate with high speed while the TCP is stationary. + * - The TCP can be far from the rotating axis and a small axis rotation may + * result in a high speed movement of the TCP. + * + * @param speed_limit + * @param outside + * @param timeout + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setSupvTcpSpeed(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: bool, arg2: float) -> int + * + * @par Lua Function Prototype + * setSupvTcpSpeed(speed_limit: table, outside: boolean, timeout: number) -> nil + * \endenglish + */ + int setSupvTcpSpeed(const std::vector &speed_limit, bool outside, + double timeout); + + // 设置低通滤波器 + // --- force frame filter: 过滤测量到的力/力矩 + // +++ force loop filter: 力控输出参考速度的滤波器 + + /** + * \chinese + * 设置低通滤波器 + * + * --- force frame filter: 过滤测量到的力/力矩 + * +++ force loop filter: 力控输出参考速度的滤波器 + * + * @param cutoff_freq 截止频率 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setLpFilter(self: pyaubo_sdk.ForceControl, arg0: List[float]) -> int + * + * @par Lua函数原型 + * setLpFilter(cutoff_freq: table) -> nil + * \endchinese + * \english + * Set low-pass filter + * + * --- force frame filter: filter measured force/torque + * +++ force loop filter: filter for force control output reference speed + * + * FCSetLPFilterTune is used to change the response of force loop according to + * the description in Damping and LP-filter on page 103. + * + * @param cutoff_freq Cutoff frequency + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setLpFilter(self: pyaubo_sdk.ForceControl, arg0: List[float]) -> int + * + * @par Lua Function Prototype + * setLpFilter(cutoff_freq: table) -> nil + * \endenglish + */ + int setLpFilter(const std::vector &cutoff_freq); + + /** + * \chinese + * 重置低通滤波器 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * resetLpFilter(self: pyaubo_sdk.ForceControl) -> int + * + * @par Lua函数原型 + * resetLpFilter() -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.ForceControl.resetLpFilter","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Reset low-pass filter + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * resetLpFilter(self: pyaubo_sdk.ForceControl) -> int + * + * @par Lua Function Prototype + * resetLpFilter() -> nil + * + * @par JSON-RPC Request example + * {"jsonrpc":"2.0","method":"rob1.ForceControl.resetLpFilter","params":[],"id":1} + * + * @par JSON-RPC Response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int resetLpFilter(); + + /** + * \chinese + * speedChangeEnable 用于激活 FC SpeedChange 功能,并设置期望的参考力和恢复行为。 + * 当 FC SpeedChange 功能被激活时,机器人速度会根据测量信号与参考值的接近程度自动降低或提高。 + * + * @param ref_force 参考力 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * speedChangeEnable(self: pyaubo_sdk.ForceControl, arg0: float) -> int + * + * @par Lua函数原型 + * speedChangeEnable(ref_force: number) -> nil + * \endchinese + * \english + * The speedChangeEnable is used to activate FC SpeedChange function with desired + * reference and recover behavior. When FC SpeedChange function is active, + * the robot speed will be reduced/increased in order to keep the measured + * signal close to the reference. + * + * @param ref_force + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * speedChangeEnable(self: pyaubo_sdk.ForceControl, arg0: float) -> int + * + * @par Lua Function Prototype + * speedChangeEnable(ref_force: number) -> nil + * \endenglish + */ + int speedChangeEnable(double ref_force); + + /** + * \chinese + * 停用 FC SpeedChange 功能。 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * speedChangeDisable(self: pyaubo_sdk.ForceControl) -> int + * + * @par Lua函数原型 + * speedChangeDisable() -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.ForceControl.speedChangeDisable","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Deactivate FC SpeedChange function. + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * speedChangeDisable(self: pyaubo_sdk.ForceControl) -> int + * + * @par Lua Function Prototype + * speedChangeDisable() -> nil + * + * @par JSON-RPC Request example + * {"jsonrpc":"2.0","method":"rob1.ForceControl.speedChangeDisable","params":[],"id":1} + * + * @par JSON-RPC Response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int speedChangeDisable(); + + /** + * \chinese + * speedChangeTune 用于将 FC SpeedChange 系统参数设置为新值。 + * + * @param speed_levels 速度级别 + * @param speed_ratio_min 最小速度比例 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * speedChangeTune(self: pyaubo_sdk.ForceControl, arg0: int, arg1: float) -> int + * + * @par Lua函数原型 + * speedChangeTune(speed_levels: number, speed_ratio_min: number) -> nil + * \endchinese + * \english + * speedChangeTune is used to set FC SpeedChange system parameters to a new value. + * + * @param speed_levels + * @param speed_ratio_min + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * speedChangeTune(self: pyaubo_sdk.ForceControl, arg0: int, arg1: float) -> int + * + * @par Lua Function Prototype + * speedChangeTune(speed_levels: number, speed_ratio_min: number) -> nil + * \endenglish + */ + int speedChangeTune(int speed_levels, double speed_ratio_min); + + /* Defines how many Newtons are required to make the robot move 1 m/s. The + higher the value, the less responsive the robot gets. + The damping can be tuned (as a percentage of the system parameter values) + by the RAPID instruction FCAct. */ + // 设置阻尼系数,阻尼的系统参数需要通过配置文件设置 + // [damping_fx, damping_fy, damping_fz, damping_tx, damping_ty, damping_tz] + // A value between min and 10,000,000 Ns/m. + // A value between minimum and 10,000,000 Nms/rad. + + /** + * \chinese + * setDamping 用于在力控坐标系中调整阻尼。可调参数包括扭矩x方向到扭矩z方向的阻尼(见第255页)以及力x方向到力z方向的阻尼(见第254页)。 + * + * 阻尼可以通过配置文件或FCAct指令设置。不同之处在于本指令可在力控激活时使用。FCSetDampingTune调整的是FCAct指令设置的实际值,而不是配置文件中的值。 + * + * @param damping 阻尼参数 + * @param ramp_time 斜坡时间 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setDamping(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: float) -> int + * + * @par Lua函数原型 + * setDamping(damping: table, ramp_time: number) -> nil + * \endchinese + * \english + * setDamping is used to tune the damping in the force control coordinate systems. The parameters tuned are those described in Damping in Torque x Direction - Damping in Torque z Direction on page 255 and Damping in Force x Direction - Damping in Force z Direction on page 254. + * + * Damping can be set in the configuration file or by the instruction FCAct. The difference is that this instruction can be used when force control is active. FCSetDampingTune tunes the actual values set by the instruction FCAct, not the value in the configuration file. + * + * @param damping + * @param ramp_time + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * setDamping(self: pyaubo_sdk.ForceControl, arg0: List[float], arg1: float) -> int + * + * @par Lua Function Prototype + * setDamping(damping: table, ramp_time: number) -> nil + * \endenglish + */ + int setDamping(const std::vector &damping, double ramp_time); + + /** + * \chinese + * 重置阻尼参数 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * resetDamping(self: pyaubo_sdk.ForceControl) -> int + * + * @par Lua函数原型 + * resetDamping() -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.ForceControl.resetDamping","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Reset damping parameters + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python Function Prototype + * resetDamping(self: pyaubo_sdk.ForceControl) -> int + * + * @par Lua Function Prototype + * resetDamping() -> nil + * + * @par JSON-RPC Request example + * {"jsonrpc":"2.0","method":"rob1.ForceControl.resetDamping","params":[],"id":1} + * + * @par JSON-RPC Response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int resetDamping(); + + /** + * \chinese + * 启用软浮动功能。 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.ForceControl.softFloatEnable","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Enable soft float function. + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC Request example + * {"jsonrpc":"2.0","method":"rob1.ForceControl.softFloatEnable","params":[],"id":1} + * + * @par JSON-RPC Response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int softFloatEnable(); + + /** + * \chinese + * 停用软浮动功能。 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.ForceControl.softFloatDisable","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":-1} + * \endchinese + * \english + * Disable soft float function. + * + * @return Return 0 if succeeded; return error code if failed + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC Request example + * {"jsonrpc":"2.0","method":"rob1.ForceControl.softFloatDisable","params":[],"id":1} + * + * @par JSON-RPC Response example + * {"id":1,"jsonrpc":"2.0","result":-1} + * \endenglish + */ + int softFloatDisable(); + + /** + * \chinese + * 返回是否开启了软浮动 + * + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.ForceControl.isSoftFloatEnabled","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * \endchinese + * \english + * Returns whether soft float is enabled + * + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC Request example + * {"jsonrpc":"2.0","method":"rob1.ForceControl.isSoftFloatEnabled","params":[],"id":1} + * + * @par JSON-RPC Response example + * {"id":1,"jsonrpc":"2.0","result":false} + * \endenglish + */ + bool isSoftFloatEnabled(); + + /** + * \chinese + * 设置软浮动参数 + * + * @param joint_softfloat 是否在关节空间启用软浮动 + * @param select 选择哪些自由度启用软浮动 + * @param stiff_percent 刚度百分比 + * @param stiff_damp_ratio 刚度阻尼比 + * @param force_threshold 力阈值 + * @param force_limit 力限制 + * @return 返回0表示成功,其他为错误码 + * \endchinese + * \english + * Set soft float parameters + * + * @param joint_softfloat Whether to enable soft float in joint space + * @param select Select which degrees of freedom to enable soft float + * @param stiff_percent Stiffness percentage + * @param stiff_damp_ratio Stiffness damping ratio + * @param force_threshold Force threshold + * @param force_limit Force limit + * @return Return 0 if succeeded, otherwise error code + * \endenglish + */ + int setSoftFloatParams(bool joint_space, const std::vector &select, + const std::vector &stiff_percent, + const std::vector &stiff_damp_ratio, + const std::vector &force_threshold, + const std::vector &force_limit); + + /** + * \chinese + * 检测工具和外部物体的接触 + * + * @param direction + * 预期的接触方向,如果所有的元素为0,表示检测所有方向的接触 + * @return + * 返回从当前点回退到碰撞开始点的周期步数,如果返回值为0,表示没有接触 + * \endchinese + * \english + * Detect contact between the tool and external objects + * + * @param direction + * Expected contact direction. If all elements are 0, detect contact in all directions. + * @return + * Returns the number of cycle steps back from the current point to the collision start point. If the return value is 0, no contact is detected. + * \endenglish + */ + int toolContact(const std::vector &direction); + + /** + * \chinese + * @brief 获取历史关节角度 + * + * 根据给定的周期步数,从关节状态历史中回退指定数量的周期,获取当时的关节角度数据。 + * + * @param steps + * 需要回退的周期数(单位:控制周期数),值越大表示获取越早的历史数据 + * @return std::vector + * 对应时间点的各关节角度(单位:弧度) + * \endchinese + * \english + * @brief Get historical joint positions + * + * According to the given number of cycle steps, go back the specified number of cycles from the joint state history to obtain the joint position data at that time. + * + * @param steps + * Number of cycles to go back (unit: control cycles), the larger the value, the earlier the historical data is obtained + * @return std::vector + * Joint positions (unit: radians) at the corresponding time point + * \endenglish + */ + std::vector getActualJointPositionsHistory(int steps); + +protected: + void *d_{ nullptr }; +}; +using ForceControlPtr = std::shared_ptr; +} // namespace common_interface +} // namespace arcs + +#endif // AUBO_SDK_FORCE_CONTROL_INTERFACE_H diff --git a/third_party/AuboSdk/win/include/aubo/robot/io_control.h b/third_party/AuboSdk/win/include/aubo/robot/io_control.h new file mode 100644 index 00000000..5fe2cd43 --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo/robot/io_control.h @@ -0,0 +1,4141 @@ +/** @file io_control.h + * @brief IO控制接口 + */ +#ifndef AUBO_SDK_IO_CONTROL_INTERFACE_H +#define AUBO_SDK_IO_CONTROL_INTERFACE_H + +#include +#include + +#include +#include + +namespace arcs { +namespace common_interface { + +/** + * \chinese + * IoControl类提供了一系列的接口对机器人标配的一些数字、模拟IO进行配置,输出状态设置、读取 + * + * 1. 获取各种IO的数量 \n + * 2. 配置IO的输入输出功能 \n + * 3. 可配置IO的配置 \n + * 4. 模拟IO的输入输出范围设置、读取 + * + * 标准数字输入输出:控制柜IO面板上的标准IO \n + * 工具端数字输入输出:通过工具末端航插暴露的数字IO \n + * 可配置输入输出:可以配置为安全IO或者普通数字IO \n + * \endchinese + * \english + * The IoControl class provides a series of interfaces for configuring and reading the robot's standard digital and analog IO, as well as setting output states. + * + * 1. Get the number of various IOs \n + * 2. Configure IO input/output functions \n + * 3. Configuration of configurable IOs \n + * 4. Set and read the input/output range of analog IOs + * + * Standard digital input/output: Standard IOs on the control cabinet IO panel \n + * Tool digital input/output: Digital IOs exposed via the tool-end connector \n + * Configurable input/output: Can be configured as safety IO or general digital IO \n + * \endenglish + */ +class ARCS_ABI_EXPORT IoControl +{ +public: + IoControl(); + virtual ~IoControl(); + + /** + * \chinese + * 获取标准数字输入数量 + * + * @return 标准数字输入数量 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStandardDigitalInputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getStandardDigitalInputNum() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalInputNum","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":16} + * + * \endchinese + * \english + * Get the number of standard digital inputs. + * + * @return Number of standard digital inputs. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStandardDigitalInputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getStandardDigitalInputNum() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalInputNum","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":16} + * + * \endenglish + */ + int getStandardDigitalInputNum(); + + /** + * \chinese + * 获取工具端数字IO数量(包括数字输入和数字输出) + * + * @return 工具端数字IO数量(包括数字输入和数字输出) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolDigitalInputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getToolDigitalInputNum() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalInputNum","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":4} + * + * \endchinese + * \english + * Get the number of tool digital IOs (including digital inputs and outputs). + * + * @return Number of tool digital IOs (including digital inputs and outputs). + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolDigitalInputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getToolDigitalInputNum() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalInputNum","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":4} + * + * \endenglish + */ + int getToolDigitalInputNum(); + + /** + * \chinese + * 获取可配置数字输入数量 + * + * @return 可配置数字输入数量 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getConfigurableDigitalInputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getConfigurableDigitalInputNum() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalInputNum","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":16} + * + * \endchinese + * \english + * Get the number of configurable digital inputs. + * + * @return Number of configurable digital inputs. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getConfigurableDigitalInputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getConfigurableDigitalInputNum() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalInputNum","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":16} + * + * \endenglish + */ + int getConfigurableDigitalInputNum(); + + /** + * \chinese + * 获取标准数字输出数量 + * + * @return 标准数字输出数量 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStandardDigitalOutputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getStandardDigitalOutputNum() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalOutputNum","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":8} + * + * \endchinese + * \english + * Get the number of standard digital outputs. + * + * @return Number of standard digital outputs. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStandardDigitalOutputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getStandardDigitalOutputNum() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalOutputNum","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":8} + * + * \endenglish + */ + int getStandardDigitalOutputNum(); + + /** + * \chinese + * 获取工具端数字IO数量(包括数字输入和数字输出) + * + * @return 工具端数字IO数量(包括数字输入和数字输出) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolDigitalOutputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getToolDigitalOutputNum() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalOutputNum","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":4} + * + * \endchinese + * \english + * Get the number of tool digital IOs (including digital inputs and outputs). + * + * @return Number of tool digital IOs (including digital inputs and outputs). + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolDigitalOutputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getToolDigitalOutputNum() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalOutputNum","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":4} + * + * \endenglish + */ + int getToolDigitalOutputNum(); + + /** + * \chinese + * 设置指定的工具端数字IO为输入或输出 + * + * 工具端数字IO比较特殊,IO可以配置为输入或者输出 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param input: 表示指定IO是否为输入。 + * input 为true时,设置指定IO为输入,否则为输出 + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setToolIoInput(self: pyaubo_sdk.IoControl, arg0: int, arg1: bool) -> int + * + * @par Lua函数原型 + * setToolIoInput(index: number, input: boolean) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolIoInput","params":[0,true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the specified tool digital IO as input or output. + * + * Tool digital IOs are special and can be configured as input or output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param input: Indicates whether the specified IO is input. + * If input is true, set the IO as input; otherwise, set as output. + * @return Returns 0 on success; error code on failure. + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setToolIoInput(self: pyaubo_sdk.IoControl, arg0: int, arg1: bool) -> int + * + * @par Lua function prototype + * setToolIoInput(index: number, input: boolean) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolIoInput","params":[0,true],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setToolIoInput(int index, bool input); + + /** + * \chinese + * 判断指定的工具端数字IO类型是否为输入 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @return 当指定的IO为输入时返回 true, 否则为 false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * isToolIoInput(self: pyaubo_sdk.IoControl, arg0: int) -> bool + * + * @par Lua函数原型 + * isToolIoInput(index: number) -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.isToolIoInput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endchinese + * \english + * Determine whether the specified tool digital IO is configured as input. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @return Returns true if the specified IO is input, otherwise false. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * isToolIoInput(self: pyaubo_sdk.IoControl, arg0: int) -> bool + * + * @par Lua function prototype + * isToolIoInput(index: number) -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.isToolIoInput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endenglish + */ + bool isToolIoInput(int index); + + /** + * \chinese + * 获取可配置数字输出数量 + * + * @return 可配置数字输出数量 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getConfigurableDigitalOutputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getConfigurableDigitalOutputNum() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalOutputNum","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":16} + * + * \endchinese + * \english + * Get the number of configurable digital outputs. + * + * @return Number of configurable digital outputs. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getConfigurableDigitalOutputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getConfigurableDigitalOutputNum() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalOutputNum","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":16} + * + * \endenglish + */ + int getConfigurableDigitalOutputNum(); + + /** + * \chinese + * 获取标准模拟输入数量 + * + * @return 标准模拟输入数量 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStandardAnalogInputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getStandardAnalogInputNum() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardAnalogInputNum","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":2} + * + * \endchinese + * \english + * Get the number of standard analog inputs. + * + * @return Number of standard analog inputs. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStandardAnalogInputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getStandardAnalogInputNum() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardAnalogInputNum","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":2} + * + * \endenglish + */ + int getStandardAnalogInputNum(); + + /** + * \chinese + * 获取工具端模拟输入数量 + * + * @return 工具端模拟输入数量 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolAnalogInputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getToolAnalogInputNum() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolAnalogInputNum","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":2} + * + * \endchinese + * \english + * Get the number of tool analog inputs. + * + * @return Number of tool analog inputs. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolAnalogInputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getToolAnalogInputNum() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolAnalogInputNum","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":2} + * + * \endenglish + */ + int getToolAnalogInputNum(); + + /** + * \chinese + * 获取标准模拟输出数量 + * + * @return 标准模拟输出数量 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStandardAnalogOutputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getStandardAnalogOutputNum() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardAnalogOutputNum","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":2} + * + * \endchinese + * \english + * Get the number of standard analog outputs. + * + * @return Number of standard analog outputs. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStandardAnalogOutputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getStandardAnalogOutputNum() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardAnalogOutputNum","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":2} + * + * \endenglish + */ + int getStandardAnalogOutputNum(); + + /** + * \chinese + * 获取工具端模拟输出数量 + * + * @return 工具端模拟输出数量 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolAnalogOutputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getToolAnalogOutputNum() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolAnalogOutputNum","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get the number of tool analog outputs. + * + * @return Number of tool analog outputs. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolAnalogOutputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getToolAnalogOutputNum() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolAnalogOutputNum","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int getToolAnalogOutputNum(); + + /** + * \chinese + * 设置所有数字输入动作为无触发 + * + * @note + * 当输入动作为无触发时,用户设置数字输入值为高电平,不会触发机器人发生动作 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setDigitalInputActionDefault(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * setDigitalInputActionDefault() -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setDigitalInputActionDefault","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set all digital input actions to no trigger. + * + * @note + * When the input action is set to no trigger, setting the digital input value to high will not trigger any robot action. + * + * @return Returns 0 on success; error code on failure. + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setDigitalInputActionDefault(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * setDigitalInputActionDefault() -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setDigitalInputActionDefault","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setDigitalInputActionDefault(); + + /** + * \chinese + * 设置标准数字输入触发动作 + * + * @note + * 当给输入设置为无触发动作(StandardInputAction::Default)时, + * 用户设置数字输入值为高电平,不会触发机器人发生动作。\n + * 当给输入设置触发动作时,用户设置数字输入值为高电平,会触发机器人执行相应的动作。\n + * 例如,当设置DI0的触发动作为拖动示教(StandardInputAction::Handguide)时, + * 用户设置DI0为高电平,机器人会进入拖动示教。 + * 设置DI0为低电平,机器人会退出拖动示教。 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param action: 触发动作 + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setStandardDigitalInputAction(self: pyaubo_sdk.IoControl, arg0: int, + * arg1: arcs::common_interface::StandardInputAction) -> int + * + * @par Lua函数原型 + * setStandardDigitalInputAction(index: number, action: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setStandardDigitalInputAction","params":[0,"Handguide"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the trigger action for standard digital input. + * + * @note + * When the input is set to no trigger action (StandardInputAction::Default), + * setting the digital input value to high will not trigger any robot action.\n + * When a trigger action is set, setting the digital input value to high will trigger the corresponding robot action.\n + * For example, if DI0 is set to trigger Handguide (StandardInputAction::Handguide), + * setting DI0 to high will enable hand-guiding mode. + * Setting DI0 to low will exit hand-guiding mode. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param action: Trigger action + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setStandardDigitalInputAction(self: pyaubo_sdk.IoControl, arg0: int, + * arg1: arcs::common_interface::StandardInputAction) -> int + * + * @par Lua function prototype + * setStandardDigitalInputAction(index: number, action: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setStandardDigitalInputAction","params":[0,"Handguide"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setStandardDigitalInputAction(int index, StandardInputAction action); + + /** + * \chinese + * 设置工具数字输入触发动作 + * + * @note + * 当给输入设置为无触发动作(StandardInputAction::Default)时, + * 用户设置工具数字输入值为高电平,不会触发机器人发生动作。\n + * 当给输入设置触发动作时,用户设置工具数字输入值为高电平,会触发机器人执行相应的动作。\n + * 例如,当设置TOOL_IO[0]的类型为输入而且触发动作为拖动示教(StandardInputAction::Handguide)时, + * 用户设置TOOL_IO[0]为高电平,机器人会进入拖动示教。 + * 设置TOOL_IO[0]为低电平,机器人会退出拖动示教。 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param action: 触发动作 + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setToolDigitalInputAction(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * arcs::common_interface::StandardInputAction) -> int + * + * @par Lua函数原型 + * setToolDigitalInputAction(index: number, action: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolDigitalInputAction","params":[0,"Handguide"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the trigger action for tool digital input. + * + * @note + * When the input is set to no trigger action (StandardInputAction::Default), + * setting the tool digital input value to high will not trigger any robot action.\n + * When a trigger action is set, setting the tool digital input value to high will trigger the corresponding robot action.\n + * For example, if TOOL_IO[0] is set as input and its trigger action is Handguide (StandardInputAction::Handguide), + * setting TOOL_IO[0] to high will enable hand-guiding mode. + * Setting TOOL_IO[0] to low will exit hand-guiding mode. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param action: Trigger action + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setToolDigitalInputAction(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * arcs::common_interface::StandardInputAction) -> int + * + * @par Lua function prototype + * setToolDigitalInputAction(index: number, action: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolDigitalInputAction","params":[0,"Handguide"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setToolDigitalInputAction(int index, StandardInputAction action); + + /** + * \chinese + * 设置可配置数字输入触发动作 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param action: 触发动作 + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @note 需要将可配置输入的安全输入动作设置为 + * SafetyInputAction::Unassigned时这个函数的配置才会生效 + * + * @par Python函数原型 + * setConfigurableDigitalInputAction(self: pyaubo_sdk.IoControl, arg0: int, + * arg1: arcs::common_interface::StandardInputAction) -> int + * + * @par Lua函数原型 + * setConfigurableDigitalInputAction(index: number, action: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setConfigurableDigitalInputAction","params":[0,"Handguide"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the trigger action for configurable digital input. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param action: Trigger action + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @note This function takes effect only when the safety input action of the configurable input is set to SafetyInputAction::Unassigned. + * + * @par Python function prototype + * setConfigurableDigitalInputAction(self: pyaubo_sdk.IoControl, arg0: int, + * arg1: arcs::common_interface::StandardInputAction) -> int + * + * @par Lua function prototype + * setConfigurableDigitalInputAction(index: number, action: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setConfigurableDigitalInputAction","params":[0,"Handguide"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setConfigurableDigitalInputAction(int index, + StandardInputAction action); + + /** + * \chinese + * 获取标准数字输入触发动作 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @return 标准数字输入触发动作 + * + * @par Python函数原型 + * getStandardDigitalInputAction(self: pyaubo_sdk.IoControl, arg0: int) -> + * arcs::common_interface::StandardInputAction + * + * @par Lua函数原型 + * getStandardDigitalInputAction(index: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalInputAction","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"Default"} + * + * \endchinese + * \english + * Get the trigger action for standard digital input. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @return Standard digital input trigger action + * + * @par Python function prototype + * getStandardDigitalInputAction(self: pyaubo_sdk.IoControl, arg0: int) -> + * arcs::common_interface::StandardInputAction + * + * @par Lua function prototype + * getStandardDigitalInputAction(index: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalInputAction","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"Default"} + * + * \endenglish + */ + StandardInputAction getStandardDigitalInputAction(int index); + + /** + * \chinese + * 获取工具端数字输入触发动作 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @return 工具端数字输入触发动作 + * + * @par Python函数原型 + * getToolDigitalInputAction(self: pyaubo_sdk.IoControl, arg0: int) -> + * arcs::common_interface::StandardInputAction + * + * @par Lua函数原型 + * getToolDigitalInputAction(index: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalInputAction","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"Default"} + * + * \endchinese + * \english + * Get the trigger action for tool digital input. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @return Tool digital input trigger action + * + * @par Python function prototype + * getToolDigitalInputAction(self: pyaubo_sdk.IoControl, arg0: int) -> + * arcs::common_interface::StandardInputAction + * + * @par Lua function prototype + * getToolDigitalInputAction(index: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalInputAction","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"Default"} + * + * \endenglish + */ + StandardInputAction getToolDigitalInputAction(int index); + + /** + * \chinese + * 获取可配置数字输入的输入触发动作 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @return 返回输入触发动作 + * + * @par Python函数原型 + * getConfigurableDigitalInputAction(self: pyaubo_sdk.IoControl, arg0: int) + * -> arcs::common_interface::StandardInputAction + * + * @par Lua函数原型 + * getConfigurableDigitalInputAction(index: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalInputAction","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"Default"} + * + * \endchinese + * \english + * Get the trigger action for configurable digital input. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @return Returns the input trigger action. + * + * @par Python function prototype + * getConfigurableDigitalInputAction(self: pyaubo_sdk.IoControl, arg0: int) + * -> arcs::common_interface::StandardInputAction + * + * @par Lua function prototype + * getConfigurableDigitalInputAction(index: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalInputAction","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"Default"} + * + * \endenglish + */ + StandardInputAction getConfigurableDigitalInputAction(int index); + + /** + * \chinese + * 设置所有数字输出状态选择为无 + * + * @note + * 当给输出状态设置为无(StandardOutputRunState::None)时, + * 用户可以设置数字输出值。\n + * 当给输出设置状态时,用户不可设置数字输出值,控制器会自动设置数字输出值。\n + * 例如,当设置DO0的输出状态为高电平指示正在拖动示教(StandardOutputRunState::Handguiding)时, + * 机器人进入拖动示教,DO0会自动变为高电平。 + * 机器人退出拖动示教,DO0会自动变为低电平。 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setDigitalOutputRunstateDefault(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * setDigitalOutputRunstateDefault() -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setDigitalOutputRunstateDefault","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set all digital output runstates to None. + * + * @note + * When the output runstate is set to None (StandardOutputRunState::None), + * users can set the digital output value.\n + * When the output runstate is set, users cannot set the digital output value, and the controller will set it automatically.\n + * For example, when DO0's output runstate is set to indicate hand-guiding (StandardOutputRunState::Handguiding), + * the robot enters hand-guiding mode and DO0 will automatically become high. + * When the robot exits hand-guiding, DO0 will automatically become low. + * + * @return Returns 0 on success; error code on failure. + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setDigitalOutputRunstateDefault(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * setDigitalOutputRunstateDefault() -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setDigitalOutputRunstateDefault","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setDigitalOutputRunstateDefault(); + + /** + * \chinese + * 设置标准数字输出状态选择 + * + * @note + * 当给输出状态设置为无(StandardOutputRunState::None)时, + * 用户可以设置数字输出值。\n + * 当给输出设置状态时,用户不可设置数字输出值,控制器会自动设置数字输出值。\n + * 例如,当设置DO0的输出状态为高电平指示正在拖动示教(StandardOutputRunState::Handguiding)时, + * 机器人进入拖动示教,DO0会自动变为高电平。 + * 机器人退出拖动示教,DO0会自动变为低电平。 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param runstate: 输出状态选择 + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setStandardDigitalOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int, + * arg1: arcs::common_interface::StandardOutputRunState) -> int + * + * @par Lua函数原型 + * setStandardDigitalOutputRunstate(index: number, runstate: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setStandardDigitalOutputRunstate","params":[0,"PowerOn"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the runstate for standard digital output. + * + * @note + * When the output runstate is set to None (StandardOutputRunState::None), + * users can set the digital output value.\n + * When the output runstate is set, users cannot set the digital output value, and the controller will set it automatically.\n + * For example, when DO0's output runstate is set to indicate hand-guiding (StandardOutputRunState::Handguiding), + * the robot enters hand-guiding mode and DO0 will automatically become high. + * When the robot exits hand-guiding, DO0 will automatically become low. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param runstate: Output runstate selection + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setStandardDigitalOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int, + * arg1: arcs::common_interface::StandardOutputRunState) -> int + * + * @par Lua function prototype + * setStandardDigitalOutputRunstate(index: number, runstate: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setStandardDigitalOutputRunstate","params":[0,"PowerOn"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setStandardDigitalOutputRunstate(int index, + StandardOutputRunState runstate); + + /** + * \chinese + * 设置工具端数字输出状态选择 + * + * @note + * 当给输出状态设置为无(StandardOutputRunState::None)时, + * 用户可以设置数字输出值。\n + * 当给输出设置状态时,用户不可设置数字输出值,控制器会自动设置数字输出值。\n + * 例如,当设置TOOL_IO[0]类型为输出且输出状态为高电平指示正在拖动示教(StandardOutputRunState::Handguiding)时, + * 机器人进入拖动示教,TOOL_IO[0]会自动变为高电平。 + * 机器人退出拖动示教,TOOL_IO[0]会自动变为低电平。 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param runstate: 输出状态选择 + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setToolDigitalOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * arcs::common_interface::StandardOutputRunState) -> int + * + * @par Lua函数原型 + * setToolDigitalOutputRunstate(index: number, runstate: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolDigitalOutputRunstate","params":[0,"None"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the runstate for tool digital output. + * + * @note + * When the output runstate is set to None (StandardOutputRunState::None), + * users can set the digital output value.\n + * When the output runstate is set, users cannot set the digital output value, and the controller will set it automatically.\n + * For example, when TOOL_IO[0] is set as output and its runstate is set to indicate hand-guiding (StandardOutputRunState::Handguiding), + * the robot enters hand-guiding mode and TOOL_IO[0] will automatically become high. + * When the robot exits hand-guiding, TOOL_IO[0] will automatically become low. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param runstate: Output runstate selection + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setToolDigitalOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * arcs::common_interface::StandardOutputRunState) -> int + * + * @par Lua function prototype + * setToolDigitalOutputRunstate(index: number, runstate: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolDigitalOutputRunstate","params":[0,"None"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setToolDigitalOutputRunstate(int index, + StandardOutputRunState runstate); + + /** + * \chinese + * 设置可配置数字输出状态选择 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param runstate: 输出状态选择 + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setConfigurableDigitalOutputRunstate(self: pyaubo_sdk.IoControl, arg0: + * int, arg1: arcs::common_interface::StandardOutputRunState) -> int + * + * @par Lua函数原型 + * setConfigurableDigitalOutputRunstate(index: number, runstate: number) -> + * nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setConfigurableDigitalOutputRunstate","params":[0,"None"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the runstate for configurable digital output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param runstate: Output runstate selection + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setConfigurableDigitalOutputRunstate(self: pyaubo_sdk.IoControl, arg0: + * int, arg1: arcs::common_interface::StandardOutputRunState) -> int + * + * @par Lua function prototype + * setConfigurableDigitalOutputRunstate(index: number, runstate: number) -> + * nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setConfigurableDigitalOutputRunstate","params":[0,"None"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setConfigurableDigitalOutputRunstate(int index, + StandardOutputRunState runstate); + + /** + * \chinese + * 获取标准数字输出状态选择 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @return 输出状态选择 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStandardDigitalOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int) + * -> arcs::common_interface::StandardOutputRunState + * + * @par Lua函数原型 + * getStandardDigitalOutputRunstate(index: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalOutputRunstate","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"None"} + * + * \endchinese + * \english + * Get the runstate for standard digital output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @return Output runstate selection + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStandardDigitalOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int) + * -> arcs::common_interface::StandardOutputRunState + * + * @par Lua function prototype + * getStandardDigitalOutputRunstate(index: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalOutputRunstate","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"None"} + * + * \endenglish + */ + StandardOutputRunState getStandardDigitalOutputRunstate(int index); + + /** + * \chinese + * 获取工具端数字输出状态选择 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @return 输出状态选择 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolDigitalOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int) -> + * arcs::common_interface::StandardOutputRunState + * + * @par Lua函数原型 + * getToolDigitalOutputRunstate(index: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalOutputRunstate","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"None"} + * + * \endchinese + * \english + * Get the runstate for tool digital output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @return Output runstate selection + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolDigitalOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int) -> + * arcs::common_interface::StandardOutputRunState + * + * @par Lua function prototype + * getToolDigitalOutputRunstate(index: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalOutputRunstate","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"None"} + * + * \endenglish + */ + StandardOutputRunState getToolDigitalOutputRunstate(int index); + + /** + * \chinese + * 获取可配置数字输出状态选择 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @return 输出状态选择 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getConfigurableDigitalOutputRunstate(self: pyaubo_sdk.IoControl, arg0: + * int) + * -> arcs::common_interface::StandardOutputRunState + * + * @par Lua函数原型 + * getConfigurableDigitalOutputRunstate(index: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalOutputRunstate","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"None"} + * + * \endchinese + * \english + * Get the runstate for configurable digital output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @return Output runstate selection + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getConfigurableDigitalOutputRunstate(self: pyaubo_sdk.IoControl, arg0: + * int) + * -> arcs::common_interface::StandardOutputRunState + * + * @par Lua function prototype + * getConfigurableDigitalOutputRunstate(index: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalOutputRunstate","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"None"} + * + * \endenglish + */ + StandardOutputRunState getConfigurableDigitalOutputRunstate(int index); + + /** + * \chinese + * 设置标准模拟输出状态选择 + * + * @note + * 当给输出状态设置为无(StandardOutputRunState::None)时, + * 用户可以设置模拟输出值。\n + * 当给输出设置状态时,用户不可设置模拟输出值,控制器会自动设置模拟输出值。\n + * 例如,当设置AO0的输出状态为高电平指示正在拖动示教(StandardOutputRunState::Handguiding)时, + * 机器人进入拖动示教,AO0的值会自动变为最大值。 + * 机器人退出拖动示教,AO0的值会自动变为0。 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param runstate: 输出状态选择 + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setStandardAnalogOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int, + * arg1: arcs::common_interface::StandardOutputRunState) -> int + * + * @par Lua函数原型 + * setStandardAnalogOutputRunstate(index: number, runstate: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setStandardAnalogOutputRunstate","params":[0,"None"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the runstate for standard analog output. + * + * @note + * When the output runstate is set to None (StandardOutputRunState::None), + * users can set the analog output value.\n + * When the output runstate is set, users cannot set the analog output value, and the controller will set it automatically.\n + * For example, when AO0's output runstate is set to indicate hand-guiding (StandardOutputRunState::Handguiding), + * the robot enters hand-guiding mode and AO0 will automatically become the maximum value. + * When the robot exits hand-guiding, AO0 will automatically become 0. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param runstate: Output runstate selection + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setStandardAnalogOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int, + * arg1: arcs::common_interface::StandardOutputRunState) -> int + * + * @par Lua function prototype + * setStandardAnalogOutputRunstate(index: number, runstate: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setStandardAnalogOutputRunstate","params":[0,"None"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setStandardAnalogOutputRunstate(int index, + StandardOutputRunState runstate); + + /** + * \chinese + * 设置工具端模拟输出状态选择 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param runstate: 输出状态选择 + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setToolAnalogOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * arcs::common_interface::StandardOutputRunState) -> int + * + * @par Lua函数原型 + * setToolAnalogOutputRunstate(index: number, runstate: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolAnalogOutputRunstate","params":[0,"None"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the runstate for tool analog output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param runstate: Output runstate selection + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setToolAnalogOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * arcs::common_interface::StandardOutputRunState) -> int + * + * @par Lua function prototype + * setToolAnalogOutputRunstate(index: number, runstate: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolAnalogOutputRunstate","params":[0,"None"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setToolAnalogOutputRunstate(int index, StandardOutputRunState runstate); + + /** + * \chinese + * 获取标准模拟输出状态选择 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @return 标准模拟输出状态选择 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStandardAnalogOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int) -> + * arcs::common_interface::StandardOutputRunState + * + * @par Lua函数原型 + * getStandardAnalogOutputRunstate(index: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardAnalogOutputRunstate","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"None"} + * + * \endchinese + * \english + * Get the runstate for standard analog output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @return Standard analog output runstate selection + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStandardAnalogOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int) -> + * arcs::common_interface::StandardOutputRunState + * + * @par Lua function prototype + * getStandardAnalogOutputRunstate(index: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardAnalogOutputRunstate","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"None"} + * + * \endenglish + */ + StandardOutputRunState getStandardAnalogOutputRunstate(int index); + + /** + * \chinese + * 获取工具端模拟输出状态选择 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @return 工具端模拟输出状态选择 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolAnalogOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int) -> + * arcs::common_interface::StandardOutputRunState + * + * @par Lua函数原型 + * getToolAnalogOutputRunstate(index: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolAnalogOutputRunstate","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"None"} + * + * \endchinese + * \english + * Get the runstate for tool analog output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @return Tool analog output runstate selection + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolAnalogOutputRunstate(self: pyaubo_sdk.IoControl, arg0: int) -> + * arcs::common_interface::StandardOutputRunState + * + * @par Lua function prototype + * getToolAnalogOutputRunstate(index: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolAnalogOutputRunstate","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"None"} + * + * \endenglish + */ + StandardOutputRunState getToolAnalogOutputRunstate(int index); + + /** + * \chinese + * 设置标准模拟输入的范围 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param domain: 输入的范围 + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setStandardAnalogInputDomain(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * int) -> int + * + * @par Lua函数原型 + * setStandardAnalogInputDomain(index: number, domain: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setStandardAnalogInputDomain","params":[0,8],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the range of standard analog input. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param domain: Input range + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setStandardAnalogInputDomain(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * int) -> int + * + * @par Lua function prototype + * setStandardAnalogInputDomain(index: number, domain: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setStandardAnalogInputDomain","params":[0,8],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setStandardAnalogInputDomain(int index, int domain); + + /** + * \chinese + * 设置工具端模拟输入的范围 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param domain: 输入的范围 + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setToolAnalogInputDomain(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * int) -> int + * + * @par Lua函数原型 + * setToolAnalogInputDomain(index: number, domain: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolAnalogInputDomain","params":[0,8],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the range of tool analog input. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param domain: Input range + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setToolAnalogInputDomain(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * int) -> int + * + * @par Lua function prototype + * setToolAnalogInputDomain(index: number, domain: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolAnalogInputDomain","params":[0,8],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setToolAnalogInputDomain(int index, int domain); + + /** + * \chinese + * 获取标准模式输入范围 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @return 标准模式输入范围 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStandardAnalogInputDomain(self: pyaubo_sdk.IoControl, arg0: int) -> int + * + * @par Lua函数原型 + * getStandardAnalogInputDomain(index: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardAnalogInputDomain","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get the domain of standard analog input. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @return Standard analog input domain + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStandardAnalogInputDomain(self: pyaubo_sdk.IoControl, arg0: int) -> int + * + * @par Lua function prototype + * getStandardAnalogInputDomain(index: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardAnalogInputDomain","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int getStandardAnalogInputDomain(int index); + + /** + * \chinese + * 获取工具端模式输入范围 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @return 工具端模式输入范围 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolAnalogInputDomain(self: pyaubo_sdk.IoControl, arg0: int) -> int + * + * @par Lua函数原型 + * getToolAnalogInputDomain(index: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolAnalogInputDomain","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":10} + * + * \endchinese + * \english + * Get the domain of tool analog input. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @return Tool analog input domain + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolAnalogInputDomain(self: pyaubo_sdk.IoControl, arg0: int) -> int + * + * @par Lua function prototype + * getToolAnalogInputDomain(index: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolAnalogInputDomain","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":10} + * + * \endenglish + */ + int getToolAnalogInputDomain(int index); + + /** + * \chinese + * 设置标准模拟输出的范围 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param domain: 输出的范围 + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setStandardAnalogOutputDomain(self: pyaubo_sdk.IoControl, arg0: int, + * arg1: int) -> int + * + * @par Lua函数原型 + * setStandardAnalogOutputDomain(index: number, domain: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setStandardAnalogOutputDomain","params":[0,8],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the range of standard analog output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param domain: Output range + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setStandardAnalogOutputDomain(self: pyaubo_sdk.IoControl, arg0: int, + * arg1: int) -> int + * + * @par Lua function prototype + * setStandardAnalogOutputDomain(index: number, domain: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setStandardAnalogOutputDomain","params":[0,8],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setStandardAnalogOutputDomain(int index, int domain); + + /** + * \chinese + * 设置工具端模拟输出范围 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param domain: 输出的范围 + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setToolAnalogOutputDomain(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * int) -> int + * + * @par Lua函数原型 + * setToolAnalogOutputDomain(index: number, domain: number) -> nil + * + * \endchinese + * \english + * Set the range of tool analog output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param domain: Output range + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setToolAnalogOutputDomain(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * int) -> int + * + * @par Lua function prototype + * setToolAnalogOutputDomain(index: number, domain: number) -> nil + * + * \endenglish + */ + int setToolAnalogOutputDomain(int index, int domain); + + /** + * \chinese + * 获取标准模拟输出范围 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @return 标准模拟输出范围 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStandardAnalogOutputDomain(self: pyaubo_sdk.IoControl, arg0: int) -> int + * + * @par Lua函数原型 + * getStandardAnalogOutputDomain(index: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardAnalogOutputDomain","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get the domain of standard analog output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @return Standard analog output domain + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStandardAnalogOutputDomain(self: pyaubo_sdk.IoControl, arg0: int) -> int + * + * @par Lua function prototype + * getStandardAnalogOutputDomain(index: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardAnalogOutputDomain","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int getStandardAnalogOutputDomain(int index); + + /** + * \chinese + * 获取工具端模拟输出范围 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @return 工具端模拟输出范围 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolAnalogOutputDomain(self: pyaubo_sdk.IoControl, arg0: int) -> int + * + * @par Lua函数原型 + * getToolAnalogOutputDomain(index: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolAnalogOutputDomain","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get the domain of tool analog output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @return Tool analog output domain + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolAnalogOutputDomain(self: pyaubo_sdk.IoControl, arg0: int) -> int + * + * @par Lua function prototype + * getToolAnalogOutputDomain(index: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolAnalogOutputDomain","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int getToolAnalogOutputDomain(int index); + + /** + * \chinese + * 设置工具端电源电压值(单位V) + * + * @param domain: 工具端电源电压值,可选三个档位,分别为0、12和24。\n + * 0表示0V, 12表示12V, 24表示24V。 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setToolVoltageOutputDomain(self: pyaubo_sdk.IoControl, arg0: int) -> int + * + * @par Lua函数原型 + * setToolVoltageOutputDomain(domain: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolVoltageOutputDomain","params":[24],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the tool voltage output value (unit: V) + * + * @param domain: Tool voltage output value, can be 0, 12, or 24.\n + * 0 means 0V, 12 means 12V, 24 means 24V. + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setToolVoltageOutputDomain(self: pyaubo_sdk.IoControl, arg0: int) -> int + * + * @par Lua function prototype + * setToolVoltageOutputDomain(domain: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolVoltageOutputDomain","params":[24],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setToolVoltageOutputDomain(int domain); + + /** + * \chinese + * 获取工具端电源电压值(单位V) + * + * @return 工具端电源电压值(单位V) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolVoltageOutputDomain(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getToolVoltageOutputDomain() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolVoltageOutputDomain","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get the tool voltage output value (unit: V) + * + * @return Tool voltage output value (unit: V) + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolVoltageOutputDomain(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getToolVoltageOutputDomain() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolVoltageOutputDomain","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int getToolVoltageOutputDomain(); + + /** + * \chinese + * 设置标准数字输出值 + * + * @param index: 表示IO口的管脚, + * @param value: 输出值 + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setStandardDigitalOutput(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * bool) -> int + * + * @par Lua函数原型 + * setStandardDigitalOutput(index: number, value: boolean) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setStandardDigitalOutput","params":[0,true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the value of a standard digital output. + * + * @param index: Indicates the IO pin. + * @param value: Output value. + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setStandardDigitalOutput(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * bool) -> int + * + * @par Lua function prototype + * setStandardDigitalOutput(index: number, value: boolean) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setStandardDigitalOutput","params":[0,true],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setStandardDigitalOutput(int index, bool value); + + /** + * \chinese + * 设置数字输出脉冲 + * + * @param index + * @param value + * @param duration + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setStandardDigitalOutputPulse(self: pyaubo_sdk.IoControl, arg0: int, + * arg1: bool, arg2: float) -> int + * + * @par Lua函数原型 + * setStandardDigitalOutputPulse(index: number, value: boolean, duration: + * number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setStandardDigitalOutputPulse","params":[0,true,0.5],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set digital output pulse. + * + * @param index + * @param value + * @param duration + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setStandardDigitalOutputPulse(self: pyaubo_sdk.IoControl, arg0: int, + * arg1: bool, arg2: float) -> int + * + * @par Lua function prototype + * setStandardDigitalOutputPulse(index: number, value: boolean, duration: + * number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setStandardDigitalOutputPulse","params":[0,true,0.5],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setStandardDigitalOutputPulse(int index, bool value, double duration); + + /** + * \chinese + * 设置工具端数字输出值 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param value: 数字输出值 + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setToolDigitalOutput(self: pyaubo_sdk.IoControl, arg0: int, arg1: bool) + * -> int + * + * @par Lua函数原型 + * setToolDigitalOutput(index: number, value: boolean) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolDigitalOutput","params":[0,true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the value of tool digital output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param value: Output value. + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setToolDigitalOutput(self: pyaubo_sdk.IoControl, arg0: int, arg1: bool) + * -> int + * + * @par Lua function prototype + * setToolDigitalOutput(index: number, value: boolean) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolDigitalOutput","params":[0,true],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setToolDigitalOutput(int index, bool value); + + /** + * \chinese + * 设置工具端数字输出脉冲 + * + * @param index + * @param value + * @param duration + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setToolDigitalOutputPulse(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * bool, arg2: float) -> int + * + * @par Lua函数原型 + * setToolDigitalOutputPulse(index: number, value: boolean, duration: + * number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolDigitalOutputPulse","params":[0,true,0.5],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set tool digital output pulse. + * + * @param index + * @param value + * @param duration + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setToolDigitalOutputPulse(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * bool, arg2: float) -> int + * + * @par Lua function prototype + * setToolDigitalOutputPulse(index: number, value: boolean, duration: + * number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolDigitalOutputPulse","params":[0,true,0.5],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setToolDigitalOutputPulse(int index, bool value, double duration); + + /** + * \chinese + * 设置可配置数字输出值 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param value: 数字输出值 + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setConfigurableDigitalOutput(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * bool) -> int + * + * @par Lua函数原型 + * setConfigurableDigitalOutput(index: number, value: boolean) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setConfigurableDigitalOutput","params":[0,true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the value of configurable digital output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param value: Output value. + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setConfigurableDigitalOutput(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * bool) -> int + * + * @par Lua function prototype + * setConfigurableDigitalOutput(index: number, value: boolean) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setConfigurableDigitalOutput","params":[0,true],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setConfigurableDigitalOutput(int index, bool value); + + /** + * \chinese + * 设置可配置数字输出脉冲 + * + * @param index + * @param value + * @param duration + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setConfigurableDigitalOutputPulse(self: pyaubo_sdk.IoControl, arg0: int, + * arg1: bool, arg2: float) -> int + * + * @par Lua函数原型 + * setConfigurableDigitalOutputPulse(index: number, value: boolean, + * duration: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setConfigurableDigitalOutputPulse","params":[0,true,0.5],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set configurable digital output pulse. + * + * @param index + * @param value + * @param duration + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setConfigurableDigitalOutputPulse(self: pyaubo_sdk.IoControl, arg0: int, + * arg1: bool, arg2: float) -> int + * + * @par Lua function prototype + * setConfigurableDigitalOutputPulse(index: number, value: boolean, + * duration: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setConfigurableDigitalOutputPulse","params":[0,true,0.5],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setConfigurableDigitalOutputPulse(int index, bool value, + double duration); + + /** + * \chinese + * 设置标准模拟输出值 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param value: 模拟输出值 + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setStandardAnalogOutput(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * float) -> int + * + * @par Lua函数原型 + * setStandardAnalogOutput(index: number, value: number) -> nil + * + * \endchinese + * \english + * Set the value of standard analog output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param value: Output value. + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setStandardAnalogOutput(self: pyaubo_sdk.IoControl, arg0: int, arg1: + * float) -> int + * + * @par Lua function prototype + * setStandardAnalogOutput(index: number, value: number) -> nil + * + * \endenglish + */ + int setStandardAnalogOutput(int index, double value); + + /** + * \chinese + * 设置工具端模拟输出值 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * @param value: 模拟输出 + * + * @return 成功返回0;失败返回错误码 + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setToolAnalogOutput(self: pyaubo_sdk.IoControl, arg0: int, arg1: float) + * -> int + * + * @par Lua函数原型 + * setToolAnalogOutput(index: number, value: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolAnalogOutput","params":[0,0.5],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":13} + * + * \endchinese + * \english + * Set the value of tool analog output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * @param value: Output value. + * + * @return Returns 0 on success; error code on failure. + * AUBO_REQUEST_IGNORE + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setToolAnalogOutput(self: pyaubo_sdk.IoControl, arg0: int, arg1: float) + * -> int + * + * @par Lua function prototype + * setToolAnalogOutput(index: number, value: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.setToolAnalogOutput","params":[0,0.5],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":13} + * + * \endenglish + */ + int setToolAnalogOutput(int index, double value); + + /** + * \chinese + * 获取标准数字输入值 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * + * @return 高电平返回true; 低电平返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStandardDigitalInput(self: pyaubo_sdk.IoControl, arg0: int) -> bool + * + * @par Lua函数原型 + * getStandardDigitalInput(index: number) -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalInput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endchinese + * \english + * Get the value of a standard digital input. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * + * @return Returns true for high level; false for low level. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStandardDigitalInput(self: pyaubo_sdk.IoControl, arg0: int) -> bool + * + * @par Lua function prototype + * getStandardDigitalInput(index: number) -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalInput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endenglish + */ + bool getStandardDigitalInput(int index); + + /** + * \chinese + * 获取所有的标准数字输入值 + * + * @return 所有的标准数字输入值 \n + * 例如,当返回值是2863267846时,换成2进制后是10101010101010100000000000000110。 + * 后16位就是所有的标准数字输入状态值, + * 最后一位表示DI00的输入状态值,倒数第二位表示DI01的输入状态值,以此类推。\n + * 1表示高电平状态,0表示低电平状态 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStandardDigitalInputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getStandardDigitalInputs() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalInputs","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get all standard digital input values. + * + * @return All standard digital input values.\n + * For example, if the return value is 2863267846, its binary representation is 10101010101010100000000000000110. + * The lower 16 bits represent the status of all standard digital inputs, + * the least significant bit indicates the input status of DI00, the second least significant bit indicates DI01, and so on.\n + * 1 means high level, 0 means low level. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStandardDigitalInputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getStandardDigitalInputs() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalInputs","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + uint32_t getStandardDigitalInputs(); + + /** + * \chinese + * 获取工具端数字输入值 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * + * @return 高电平返回true; 低电平返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolDigitalInput(self: pyaubo_sdk.IoControl, arg0: int) -> bool + * + * @par Lua函数原型 + * getToolDigitalInput(index: number) -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalInput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endchinese + * \english + * Get the value of tool digital input. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * + * @return Returns true for high level; false for low level. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolDigitalInput(self: pyaubo_sdk.IoControl, arg0: int) -> bool + * + * @par Lua function prototype + * getToolDigitalInput(index: number) -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalInput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endenglish + */ + bool getToolDigitalInput(int index); + + /** + * \chinese + * 获取所有的工具端数字输入值 + * + * @return 返回所有的工具端数字输入值 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolDigitalInputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getToolDigitalInputs() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalInputs","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get all tool digital input values. + * + * @return Returns all tool digital input values. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolDigitalInputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getToolDigitalInputs() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalInputs","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + uint32_t getToolDigitalInputs(); + + /** + * \chinese + * 获取可配置数字输入值 + * + * @note 可用于获取安全IO的输入值 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * + * @return 高电平返回true; 低电平返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getConfigurableDigitalInput(self: pyaubo_sdk.IoControl, arg0: int) -> bool + * + * @par Lua函数原型 + * getConfigurableDigitalInput(index: number) -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalInput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endchinese + * \english + * Get the value of configurable digital input. + * + * @note Can be used to get the value of safety IO. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * + * @return Returns true for high level; false for low level. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getConfigurableDigitalInput(self: pyaubo_sdk.IoControl, arg0: int) -> bool + * + * @par Lua function prototype + * getConfigurableDigitalInput(index: number) -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalInput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endenglish + */ + bool getConfigurableDigitalInput(int index); + + /** + * \chinese + * 获取所有的可配置数字输入值 + * + * @note 可用于获取安全IO的输入值 + * + * @return 所有的可配置数字输入值\n + * 例如,当返回值是2863267846时,换成2进制后是10101010101010100000000000000110。 + * 后16位就是所有的输入状态值, + * 最后一位表示管脚0的输入状态值,倒数第二位表示管脚1的输入状态值,以此类推。\n + * 1表示高电平状态,0表示低电平状态 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getConfigurableDigitalInputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getConfigurableDigitalInputs() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalInputs","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get all configurable digital input values. + * + * @note Can be used to get the value of safety IO. + * + * @return All configurable digital input values.\n + * For example, if the return value is 2863267846, its binary representation is 10101010101010100000000000000110. + * The lower 16 bits represent the status of all input pins, + * the least significant bit indicates the input status of pin 0, the second least significant bit indicates pin 1, and so on.\n + * 1 means high level, 0 means low level. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getConfigurableDigitalInputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getConfigurableDigitalInputs() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalInputs","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + uint32_t getConfigurableDigitalInputs(); + + /** + * \chinese + * 获取标准数字输出值 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * + * @return 高电平返回true; 低电平返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStandardDigitalOutput(self: pyaubo_sdk.IoControl, arg0: int) -> bool + * + * @par Lua函数原型 + * getStandardDigitalOutput(index: number) -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalOutput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endchinese + * \english + * Get the value of a standard digital output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * + * @return Returns true for high level; false for low level. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStandardDigitalOutput(self: pyaubo_sdk.IoControl, arg0: int) -> bool + * + * @par Lua function prototype + * getStandardDigitalOutput(index: number) -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalOutput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endenglish + */ + bool getStandardDigitalOutput(int index); + + /** + * \chinese + * 获取所有的标准数字输出值 + * + * @return 所有的标准数字输出值 \n + * 例如,当返回值是2863267846时,换成2进制后是10101010101010100000000000000110。 + * 后16位就是所有的标准数字输出状态值, + * 最后一位表示DI00的输出状态值,倒数第二位表示DI01的输出状态值,以此类推。\n + * 1表示高电平状态,0表示低电平状态. + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStandardDigitalOutputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getStandardDigitalOutputs() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalOutputs","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":69} + * + * \endchinese + * \english + * Get all standard digital output values. + * + * @return All standard digital output values.\n + * For example, if the return value is 2863267846, its binary representation is 10101010101010100000000000000110. + * The lower 16 bits represent the status of all standard digital outputs, + * the least significant bit indicates the output status of DO00, the second least significant bit indicates DO01, and so on.\n + * 1 means high level, 0 means low level. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStandardDigitalOutputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getStandardDigitalOutputs() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardDigitalOutputs","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":69} + * + * \endenglish + */ + uint32_t getStandardDigitalOutputs(); + + /** + * \chinese + * 获取工具端数字输出值 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * + * @return 高电平返回true; 低电平返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolDigitalOutput(self: pyaubo_sdk.IoControl, arg0: int) -> bool + * + * @par Lua函数原型 + * getToolDigitalOutput(index: number) -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalOutput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endchinese + * \english + * Get the value of tool digital output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * + * @return Returns true for high level; false for low level. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolDigitalOutput(self: pyaubo_sdk.IoControl, arg0: int) -> bool + * + * @par Lua function prototype + * getToolDigitalOutput(index: number) -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalOutput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endenglish + */ + bool getToolDigitalOutput(int index); + + /** + * \chinese + * 获取所有的工具端数字输出值 + * + * @return 所有的工具端数字输出值 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolDigitalOutputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getToolDigitalOutputs() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalOutputs","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":9} + * + * \endchinese + * \english + * Get all tool digital output values. + * + * @return All tool digital output values. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolDigitalOutputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getToolDigitalOutputs() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolDigitalOutputs","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":9} + * + * \endenglish + */ + uint32_t getToolDigitalOutputs(); + + /** + * \chinese + * 获取可配值数字输出值 + * + * @note 可用于获取安全IO的输出值 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * + * @return 高电平返回true; 低电平返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getConfigurableDigitalOutput(self: pyaubo_sdk.IoControl, arg0: int) -> + * bool + * + * @par Lua函数原型 + * getConfigurableDigitalOutput(index: number) -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalOutput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endchinese + * \english + * Get the value of configurable digital output. + * + * @note Can be used to get the value of safety IO. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * + * @return Returns true for high level; false for low level. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getConfigurableDigitalOutput(self: pyaubo_sdk.IoControl, arg0: int) -> + * bool + * + * @par Lua function prototype + * getConfigurableDigitalOutput(index: number) -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalOutput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endenglish + */ + bool getConfigurableDigitalOutput(int index); + + /** + * \chinese + * 获取所有的可配值数字输出值 + * + * @note 可用于获取安全IO的输出值 + * + * @return 所有的可配值数字输出\n + * 例如,当返回值是2863267846时,换成2进制后是10101010101010100000000000000110。 + * 后16位就是所有的输出值, + * 最后一位表示管脚0的输出状态值,倒数第二位表示管脚1的输出状态值,以此类推。\n + * 1表示高电平状态,0表示低电平状态. + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getConfigurableDigitalOutputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getConfigurableDigitalOutputs() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalOutputs","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1} + * + * \endchinese + * \english + * Get all configurable digital output values. + * + * @note Can be used to get the value of safety IO. + * + * @return All configurable digital output values.\n + * For example, if the return value is 2863267846, its binary representation is 10101010101010100000000000000110. + * The lower 16 bits represent the status of all output pins, + * the least significant bit indicates the output status of pin 0, the second least significant bit indicates pin 1, and so on.\n + * 1 means high level, 0 means low level. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getConfigurableDigitalOutputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getConfigurableDigitalOutputs() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getConfigurableDigitalOutputs","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1} + * + * \endenglish + */ + uint32_t getConfigurableDigitalOutputs(); + + /** + * \chinese + * 获取标准模拟输入值 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * + * @return 标准模拟输入值 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStandardAnalogInput(self: pyaubo_sdk.IoControl, arg0: int) -> float + * + * @par Lua函数原型 + * getStandardAnalogInput(index: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardAnalogInput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endchinese + * \english + * Get the value of standard analog input. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * + * @return Standard analog input value. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStandardAnalogInput(self: pyaubo_sdk.IoControl, arg0: int) -> float + * + * @par Lua function prototype + * getStandardAnalogInput(index: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardAnalogInput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endenglish + */ + double getStandardAnalogInput(int index); + + /** + * \chinese + * 获取工具端模拟输入值 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * + * @return 工具端模拟输入值 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolAnalogInput(self: pyaubo_sdk.IoControl, arg0: int) -> float + * + * @par Lua函数原型 + * getToolAnalogInput(index: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolAnalogInput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endchinese + * \english + * Get the value of tool analog input. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * + * @return Tool analog input value. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolAnalogInput(self: pyaubo_sdk.IoControl, arg0: int) -> float + * + * @par Lua function prototype + * getToolAnalogInput(index: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolAnalogInput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endenglish + */ + double getToolAnalogInput(int index); + + /** + * \chinese + * 获取标准模拟输出值 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * + * @return 标准模拟输出值 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStandardAnalogOutput(self: pyaubo_sdk.IoControl, arg0: int) -> float + * + * @par Lua函数原型 + * getStandardAnalogOutput(index: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardAnalogOutput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endchinese + * \english + * Get the value of standard analog output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * + * @return Standard analog output value. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStandardAnalogOutput(self: pyaubo_sdk.IoControl, arg0: int) -> float + * + * @par Lua function prototype + * getStandardAnalogOutput(index: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStandardAnalogOutput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endenglish + */ + double getStandardAnalogOutput(int index); + + /** + * \chinese + * 获取工具端模拟输出值 + * + * @param index: 表示IO口的管脚,管脚编号从0开始。 + * 例如,0表示第一个管脚。 + * + * @return 工具端模拟输出值 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolAnalogOutput(self: pyaubo_sdk.IoControl, arg0: int) -> float + * + * @par Lua函数原型 + * getToolAnalogOutput(index: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolAnalogOutput","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endchinese + * \english + * Get the value of tool analog output. + * + * @param index: Indicates the IO pin, starting from 0. + * For example, 0 means the first pin. + * + * @return Tool analog output value. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolAnalogOutput(self: pyaubo_sdk.IoControl, arg0: int) -> float + * + * @par Lua function prototype + * getToolAnalogOutput(index: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolAnalogOutput","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endenglish + */ + double getToolAnalogOutput(int index); + + /** + * \chinese + * 获取联动输入数量 + * + * @return 联动输入数量 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStaticLinkInputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getStaticLinkInputNum() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStaticLinkInputNum","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":8} + * + * \endchinese + * \english + * Get the number of static link inputs. + * + * @return Number of static link inputs. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStaticLinkInputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getStaticLinkInputNum() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStaticLinkInputNum","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":8} + * + * \endenglish + */ + int getStaticLinkInputNum(); + + /** + * \chinese + * 获取联动输出数量 + * + * @return 联动输出数量 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStaticLinkOutputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getStaticLinkOutputNum() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStaticLinkOutputNum","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get the number of static link outputs. + * + * @return Number of static link outputs. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStaticLinkOutputNum(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getStaticLinkOutputNum() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStaticLinkOutputNum","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int getStaticLinkOutputNum(); + + /** + * \chinese + * 获取所有的联动输入值 + * + * @return 所有的联动输入值\n + * 例如,当返回值是2863267846时,换成2进制后是10101010101010100000000000000110。 + * 后16位就是所有的联动输入状态值, + * 最后一位表示管脚0的输入状态值,倒数第二位表示管脚1的输入状态值,以此类推。\n + * 1表示高电平状态,0表示低电平状态. + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStaticLinkInputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getStaticLinkInputs() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStaticLinkInputs","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get all static link input values. + * + * @return All static link input values.\n + * For example, if the return value is 2863267846, its binary representation is 10101010101010100000000000000110. + * The lower 16 bits represent the status of all static link inputs, + * the least significant bit indicates the input status of pin 0, the second least significant bit indicates pin 1, and so on.\n + * 1 means high level, 0 means low level. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStaticLinkInputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getStaticLinkInputs() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStaticLinkInputs","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + uint32_t getStaticLinkInputs(); + + /** + * \chinese + * 获取所有的联动输出值 + * + * @return 返回所有的联动输出值 \n + * 例如,当返回值是2863267846时,换成2进制后是10101010101010100000000000000110。 + * 后16位就是所有的联动输出状态值, + * 最后一位表示管脚0的输出状态值,倒数第二位表示管脚1的输出状态值,以此类推。\n + * 1表示高电平状态,0表示低电平状态. + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getStaticLinkOutputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getStaticLinkOutputs() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStaticLinkOutputs","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get all static link output values. + * + * @return Returns all static link output values.\n + * For example, if the return value is 2863267846, its binary representation is 10101010101010100000000000000110. + * The lower 16 bits represent the status of all static link outputs, + * the least significant bit indicates the output status of pin 0, the second least significant bit indicates pin 1, and so on.\n + * 1 means high level, 0 means low level. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getStaticLinkOutputs(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getStaticLinkOutputs() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getStaticLinkOutputs","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + uint32_t getStaticLinkOutputs(); + + /** + * \chinese + * 机器人是否配置了编码器 + * 集成编码器的编号为 0 + * + * @return 机器人配置编码器返回 true, 反之返回 false + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.hasEncoderSensor","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endchinese + * \english + * Whether the robot is equipped with an encoder. + * The integrated encoder number is 0. + * + * @return Returns true if the robot is equipped with an encoder, otherwise false. + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.hasEncoderSensor","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endenglish + */ + bool hasEncoderSensor(); + /** + * \chinese + * 设置集成编码器的解码方式 + * + * @param type + * 0-禁用编码器 + * 1-AB正交 + * 2-AB正交+Z + * 3-AB差分正交 + * 4-AB差分正交+Z差分 + * + * @param range_id + * 0 表示32位有符号编码器,范围为 [-2147483648, 2147483647] + * 1 表示8位无符号编码器,范围为 [0, 255] + * 2 表示16位无符号编码器,范围为 [0, 65535] + * 3 表示24位无符号编码器,范围为 [0, 16777215] + * 4 表示32位无符号编码器,范围为 [0, 4294967295] + * + * @return 成功返回0;失败返回错误码 + * AUBO_NO_ACCESS + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Set the decoding method of the integrated encoder. + * + * @param type + * 0 - Disable encoder + * 1 - AB quadrature + * 2 - AB quadrature + Z + * 3 - AB differential quadrature + * 4 - AB differential quadrature + Z differential + * + * @param range_id + * 0 is a 32-bit signed encoder, range [-2147483648, 2147483647] + * 1 is an 8-bit unsigned encoder, range [0, 255] + * 2 is a 16-bit unsigned encoder, range [0, 65535] + * 3 is a 24-bit unsigned encoder, range [0, 16777215] + * 4 is a 32-bit unsigned encoder, range [0, 4294967295] + * + * @return Returns 0 on success; error code on failure. + * AUBO_NO_ACCESS + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int setEncDecoderType(int type, int range_id); + + /** + * \chinese + * 设置集成编码器脉冲数 + * + * @param tick 脉冲数 + * + * @return 成功返回0;失败返回错误码 + * AUBO_NO_ACCESS + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Set the tick count of the integrated encoder. + * + * @param tick Tick count + * + * @return Returns 0 on success; error code on failure. + * AUBO_NO_ACCESS + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int setEncTickCount(int tick); + + /** + * \chinese + * 获取编码器的解码方式 + * + * @return 成功返回0;失败返回错误码 + * AUBO_NO_ACCESS + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getEncDecoderType","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get the decoder type of the encoder. + * + * @return Returns 0 on success; error code on failure. + * AUBO_NO_ACCESS + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getEncDecoderType","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int getEncDecoderType(); + + /** + * \chinese + * 获取脉冲数 + * + * @return 成功返回0;失败返回错误码 + * AUBO_NO_ACCESS + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getEncTickCount","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get the tick count + * + * @return Returns 0 on success; error code on failure. + * AUBO_NO_ACCESS + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getEncTickCount","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int getEncTickCount(); + + /** + * \chinese + * 防止在计数超出范围时计数错误 + * + * @param delta_count + * + * @return 成功返回0;失败返回错误码 + * AUBO_NO_ACCESS + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Prevent counting errors when the count exceeds the range + * + * @param delta_count + * + * @return Returns 0 on success; error code on failure. + * AUBO_NO_ACCESS + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int unwindEncDeltaTickCount(int delta_count); + + /** + * \chinese + * 获取末端按钮状态 + * + * @return 按下返回true; 否则返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolButtonStatus() -> bool + * + * @par Lua函数原型 + * getToolButtonStatus() -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolButtonStatus","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endchinese + * \english + * Get the status of the tool button. + * + * @return Returns true if pressed; otherwise false. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolButtonStatus() -> bool + * + * @par Lua function prototype + * getToolButtonStatus() -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getToolButtonStatus","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endenglish + */ + bool getToolButtonStatus(); + + /** + * \chinese + * 获取手柄按键状态 + * + * @note 获取手柄按键状态 + * + * @return 所有的手柄按键输入值\n + * 例如,当返回值是2863267846时,换成2进制后是10101010101010100000000000000110。 + * 后16位就是所有的输入状态值, + * 最后一位表示管脚0的输入状态值,倒数第二位表示管脚1的输入状态值,以此类推。\n + * 1表示高电平状态,0表示低电平状态 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getHandleIoStatus(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua函数原型 + * getHandleIoStatus() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getHandleIoStatus","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get the status of handle buttons. + * + * @note Get the status of handle buttons. + * + * @return All handle button input values.\n + * For example, if the return value is 2863267846, its binary representation is 10101010101010100000000000000110. + * The lower 16 bits represent the status of all input pins, + * the least significant bit indicates the input status of pin 0, the second least significant bit indicates pin 1, and so on.\n + * 1 means high level, 0 means low level. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getHandleIoStatus(self: pyaubo_sdk.IoControl) -> int + * + * @par Lua function prototype + * getHandleIoStatus() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getHandleIoStatus","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + uint32_t getHandleIoStatus(); + + /** + * \chinese + * 获取手柄类型 + * + * @return type + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getHandleType() -> int + * + * @par Lua函数原型 + * getHandleType() -> int + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.IoControl.getHandleType","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get the handle type. + * + * @return type + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getHandleType() -> int + * + * @par Lua function prototype + * getHandleType() -> int + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.IoControl.getHandleType","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int getHandleType(); + +protected: + void *d_; +}; +using IoControlPtr = std::shared_ptr; +} // namespace common_interface +} // namespace arcs + +#endif // AUBO_SDK_IO_CONTROL_INTERFACE_H diff --git a/third_party/AuboSdk/win/include/aubo/robot/motion_control.h b/third_party/AuboSdk/win/include/aubo/robot/motion_control.h new file mode 100644 index 00000000..89233276 --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo/robot/motion_control.h @@ -0,0 +1,5094 @@ +/** @file motion_control.h + * @brief 运动控制接口 + * + */ +#ifndef AUBO_SDK_MOTION_CONTROL_INTERFACE_H +#define AUBO_SDK_MOTION_CONTROL_INTERFACE_H + +#include +#include +#include + +#include +#include + +namespace arcs { +namespace common_interface { + + +/** + * \chinese + * pathBuffer类型 + * + * 机器人运动被编程为位姿到位姿的运动,即从当前位置移动到新位置。两点之间的路径由机器人自动计算。 + * \endchinese + * \english + * + * The robot movements are programmed as pose-to-pose movements, that is move + * from the current position to a new position. The path between these two + * positions is then automatically calculated by the robot. + * \endenglish + */ + +enum PathBufferType +{ + PathBuffer_TOPPRA = 1, ///< 1: toppra 时间最优路径规划 + PathBuffer_CubicSpline = 2, ///< 2: cubic_spline(录制的轨迹) + + /// 3: 关节B样条插值,最少三个点 + /// 废弃,建议用5替代,现在实际是关节空间 CUBIC_SPLINE + PathBuffer_JointSpline = 3, + + /// 4:关节B样条插值,最少三个点,但是传入的是笛卡尔空间位姿 + /// 废弃,建议用6替代,现在实际是关节空间 CUBIC_SPLINE + PathBuffer_JointSplineC = 4, + + ///< 5: 关节B样条插值,最少三个点 + PathBuffer_JointBSpline = 5, + + /// 6:关节B样条插值,最少三个点,但是传入的是笛卡尔空间位姿 + PathBuffer_JointBSplineC = 6, +}; + +/** + * MotionControl + */ +class ARCS_ABI_EXPORT MotionControl +{ +public: + MotionControl(); + virtual ~MotionControl(); + + /** + * \chinese + * 获取等效半径,单位 m + * moveLine/moveCircle时,末端姿态旋转的角度等效到末端位置移动 + * 可以通过 setEqradius 设置,默认为1 + * + * @return 返回等效半径 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getEqradius(self: pyaubo_sdk.MotionControl) -> float + * + * @par Lua函数原型 + * getEqradius() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getEqradius","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1.0} + * \endchinese + * \english + * Get the equivalent radius, in meters. + * When using moveLine/moveCircle, the rotation angle of the end effector's pose is converted to an equivalent end position movement. + * Can be set via setEqradius, default is 1. + * + * @return Returns the equivalent radius. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getEqradius(self: pyaubo_sdk.MotionControl) -> float + * + * @par Lua function prototype + * getEqradius() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getEqradius","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1.0} + * \endenglish + */ + double getEqradius(); + + /** + * \chinese + * 设置等效半径,单位 m + * moveLine/moveCircle时,末端姿态旋转的角度等效到末端位置移动,数值越大,姿态旋转速度越快 + * + * @param eqradius 0表示只规划移动,姿态旋转跟随移动 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setEqradius","params":[0.8],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par Python函数原型 + * setEqradius(self: pyaubo_sdk.MotionControl, arg0: float) -> int + * + * @par Lua函数原型 + * setEqradius(eqradius: number) -> number + * \endchinese + * \english + * Set the equivalent radius, in meters. + * When using moveLine/moveCircle, the rotation angle of the end effector's pose is converted to an equivalent end position movement. The larger the value, the faster the posture rotation speed. + * + * @param eqradius 0 means only plan the movement, and the posture rotation follows the movement. + * + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setEqradius","params":[0.8],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par Python function prototype + * setEqradius(self: pyaubo_sdk.MotionControl, arg0: float) -> int + * + * @par Lua function prototype + * setEqradius(eqradius: number) -> number + * \endenglish + */ + int setEqradius(double eqradius); + + /** + * \chinese + * 动态调整机器人运行速度和加速度比例 (0., 1.] + * + * @param fraction 机器人运行速度和加速度比例 + * @return 成功返回0; 失败返回错误码 + * AUBO_INVL_ARGUMENT + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setSpeedFraction(self: pyaubo_sdk.MotionControl, arg0: float) -> int + * + * @par Lua函数原型 + * setSpeedFraction(fraction: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setSpeedFraction","params":[0.8],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Dynamically adjust the robot's speed and acceleration ratio (0., 1.] + * + * @param fraction The ratio of robot speed and acceleration + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_INVL_ARGUMENT + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setSpeedFraction(self: pyaubo_sdk.MotionControl, arg0: float) -> int + * + * @par Lua function prototype + * setSpeedFraction(fraction: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setSpeedFraction","params":[0.8],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setSpeedFraction(double fraction); + + /** + * \chinese + * 获取速度和加速度比例,默认为 1 + * 可以通过 setSpeedFraction 接口设置 + * + * @return 返回速度和加速度比例 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getSpeedFraction(self: pyaubo_sdk.MotionControl) -> float + * + * @par Lua函数原型 + * getSpeedFraction() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getSpeedFraction","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1.0} + * \endchinese + * \english + * Get the speed and acceleration ratio, default is 1. + * Can be set via setSpeedFraction interface. + * + * @return Returns the speed and acceleration ratio. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getSpeedFraction(self: pyaubo_sdk.MotionControl) -> float + * + * @par Lua function prototype + * getSpeedFraction() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getSpeedFraction","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1.0} + * \endenglish + */ + double getSpeedFraction(); + + /** + * \chinese + * 速度比例设置临界区,使能之后速度比例被强制设定为1. , + * 失能之后恢复之前的速度比例 + * + * @param enable + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.speedFractionCritical","params":[true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Speed fraction critical section. When enabled, the speed fraction is forced to 1. + * When disabled, the previous speed fraction is restored. + * + * @param enable + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.speedFractionCritical","params":[true],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int speedFractionCritical(bool enable); + + /** + * \chinese + * 是否处于速度比例设置临界区 + * + * @return 处于速度比例设置临界区返回 true; 反之返回 false + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.isSpeedFractionCritical","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":true} + * \endchinese + * \english + * Whether it is in the speed fraction critical section + * + * @return Returns true if in the speed fraction critical section; otherwise returns false + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.isSpeedFractionCritical","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":true} + * \endenglish + */ + bool isSpeedFractionCritical(); + + /** + * \chinese + * 是否处交融区 + * + * @return 处交融区返回 true; 反之返回 false + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.isBlending","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * \endchinese + * \english + * Whether it is in the blending area + * + * @return Returns true if in the blending area; otherwise returns false + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.isBlending","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * \endenglish + */ + bool isBlending(); + + /** + * \chinese + * 设置偏移的最大速度和最大加速度 + * 仅对pathOffsetSet中 type=1 有效 + * @param v 最大速度 + * @param a 最大加速度 + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathOffsetLimits(self: pyaubo_sdk.MotionControl, arg0: float, arg1: float) -> int + * + * @par Lua函数原型 + * pathOffsetLimits(v: number, a: number) -> nil + * \endchinese + * \english + * Set the maximum speed and maximum acceleration for offset. + * Only valid when type=1 in pathOffsetSet. + * @param v Maximum speed + * @param a Maximum acceleration + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathOffsetLimits(self: pyaubo_sdk.MotionControl, arg0: float, arg1: float) -> int + * + * @par Lua function prototype + * pathOffsetLimits(v: number, a: number) -> nil + * \endenglish + */ + int pathOffsetLimits(double v, double a); + + /** + * \chinese + * 设置偏移的参考坐标系 + * 仅对pathOffsetSet中 type=1 有效 + * @param ref_coord 参考坐标系 0-基坐标系 1-TCP + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathOffsetCoordinate(self: pyaubo_sdk.MotionControl, arg0: int) -> float + * + * @par Lua函数原型 + * pathOffsetCoordinate(ref_coord: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathOffsetCoordinate","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set the reference coordinate system for offset. + * Only valid when type=1 in pathOffsetSet. + * @param ref_coord Reference coordinate system: 0-base coordinate, 1-TCP + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathOffsetCoordinate(self: pyaubo_sdk.MotionControl, arg0: int) -> float + * + * @par Lua function prototype + * pathOffsetCoordinate(ref_coord: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathOffsetCoordinate","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int pathOffsetCoordinate(int ref_coord); + + /** + * \chinese + * 路径偏移使能 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathOffsetEnable(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua函数原型 + * pathOffsetEnable() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathOffsetEnable","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Enable path offset + * + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathOffsetEnable(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua function prototype + * pathOffsetEnable() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathOffsetEnable","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int pathOffsetEnable(); + + /** + * \chinese + * 设置路径偏移 + * + * @param offset 在各方向的位姿偏移 + * @param type 运动类型 0-位置规划 1-速度规划 + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathOffsetSet(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * int) -> int + * + * @par Lua函数原型 + * pathOffsetSet(offset: table, type: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathOffsetSet","params":[[0,0,0.01,0,0,0],0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set path offset + * + * @param offset Pose offset in each direction + * @param type Motion type 0-position planning 1-velocity planning + * @return Returns 0 on success; otherwise returns error code + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathOffsetSet(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * int) -> int + * + * @par Lua function prototype + * pathOffsetSet(offset: table, type: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathOffsetSet","params":[[0,0,0.01,0,0,0],0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int pathOffsetSet(const std::vector &offset, int type = 0); + + /** + * \chinese + * 路径偏移失能 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathOffsetDisable(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua函数原型 + * pathOffsetDisable() -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathOffsetDisable","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Disable path offset + * + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathOffsetDisable(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua function prototype + * pathOffsetDisable() -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathOffsetDisable","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int pathOffsetDisable(); + + /** + * \chinese + * @brief 监控轨迹偏移范围 + * @param min: 沿坐标轴负方向最大偏移量 + * @param max: 沿坐标轴正方向最大偏移量 + * @param strategy: 达到最大偏移量后监控策略 + *     0-禁用监控 + *     1-饱和限制,即维持最大姿态 + *     2-保护停止 + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathOffsetSupv(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * List[float], arg2: int) -> int + * + * @par Lua函数原型 + * pathOffsetSupv(min: table, max: table, strategy: number) -> number + * \endchinese + * \english + * @brief Monitor trajectory offset range + * @param min: Maximum offset in the negative direction of the coordinate axis + * @param max: Maximum offset in the positive direction of the coordinate axis + * @param strategy: Monitoring strategy after reaching the maximum offset + *     0 - Disable monitoring + *     1 - Saturation limit, i.e., maintain maximum pose + *     2 - Protective stop + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathOffsetSupv(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * List[float], arg2: int) -> int + * + * @par Lua function prototype + * pathOffsetSupv(min: table, max: table, strategy: number) -> number + * \endenglish + */ + int pathOffsetSupv(const std::vector &min, + const std::vector &max, int strategy); + + /** + * \chinese + * 关节偏移使能 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * jointOffsetEnable(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua函数原型 + * jointOffsetEnable() -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.jointOffsetEnable","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Enable joint offset + * + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * jointOffsetEnable(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua function prototype + * jointOffsetEnable() -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.jointOffsetEnable","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int jointOffsetEnable(); + + /** + * \chinese + * 设置关节偏移 + * + * @param offset 在各关节的位姿偏移 + * @param type + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * jointOffsetSet(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * int) -> int + * + * @par Lua函数原型 + * jointOffsetSet(offset: table, type: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.jointOffsetSet","params":[[0.1,0,0,0,0],1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set joint offset + * + * @param offset Pose offset for each joint + * @param type + * @return Returns 0 on success; otherwise returns error code + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * jointOffsetSet(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * int) -> int + * + * @par Lua function prototype + * jointOffsetSet(offset: table, type: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.jointOffsetSet","params":[[0.1,0,0,0,0],1],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int jointOffsetSet(const std::vector &offset, int type = 1); + + /** + * \chinese + * 关节偏移失能 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * jointOffsetDisable(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua函数原型 + * jointOffsetDisable() -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.jointOffsetDisable","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Disable joint offset + * + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * jointOffsetDisable(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua function prototype + * jointOffsetDisable() -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.jointOffsetDisable","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int jointOffsetDisable(); + + /** + * \chinese + * 获取已经入队的指令段(INST)数量,运动指令包括 + * moveJoint/moveLine/moveCircle 等运动指令以及 setPayload 等配置指令 + * + * 指令一般会在接口宏定义里面用 _INST 指示, 比如 moveJoint + * _INST(MotionControl, 5, moveJoint, q, a, v, blend_radius, duration) + * + * @return 已经入队的指令段数量 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getQueueSize(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua函数原型 + * getQueueSize() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getQueueSize","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get the number of enqueued instruction segments (INST), including motion instructions such as moveJoint/moveLine/moveCircle and configuration instructions such as setPayload. + * + * Instructions are generally indicated with _INST in macro definitions, for example: + * _INST(MotionControl, 5, moveJoint, q, a, v, blend_radius, duration) + * + * @return The number of enqueued instruction segments. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getQueueSize(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua function prototype + * getQueueSize() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getQueueSize","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int getQueueSize(); + + /** + * \chinese + * 获取已经入队的运动规划插补点数量 + * + * @return 已经入队的运动规划插补点数量 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getTrajectoryQueueSize(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua函数原型 + * getTrajectoryQueueSize() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getTrajectoryQueueSize","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Get the number of enqueued motion planning interpolation points + * + * @return The number of enqueued motion planning interpolation points + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getTrajectoryQueueSize(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua function prototype + * getTrajectoryQueueSize() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getTrajectoryQueueSize","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int getTrajectoryQueueSize(); + + /** + * \chinese + * 获取当前正在插补的运动指令段的ID + * + * @return 当前正在插补的运动指令段的ID + * @retval -1 表示轨迹队列为空 \n + * 像movePathBuffer运动中的buffer或者规划器(moveJoint和moveLine等)里的队列都属于轨迹队列 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getExecId(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua函数原型 + * getExecId() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getExecId","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":-1} + * + * \endchinese + * \english + * Get the ID of the currently interpolating motion instruction segment. + * + * @return The ID of the currently interpolating motion instruction segment. + * @retval -1 Indicates the trajectory queue is empty. \n + * Both the buffer in movePathBuffer motion and the queue in the planner (such as moveJoint and moveLine) belong to the trajectory queue. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getExecId(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua function prototype + * getExecId() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getExecId","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":-1} + * + * \endenglish + */ + int getExecId(); + + /** + * \chinese + * 获取指定ID的运动指令段的预期执行时间 + * + * @param id 运动指令段ID + * @return 返回预期执行时间 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getDuration(self: pyaubo_sdk.MotionControl, arg0: int) -> float + * + * @par Lua函数原型 + * getDuration(id: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getDuration","params":[16],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endchinese + * \english + * Get the expected execution duration of the motion segment with the specified ID. + * + * @param id Motion segment ID + * @return Returns the expected execution duration + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getDuration(self: pyaubo_sdk.MotionControl, arg0: int) -> float + * + * @par Lua function prototype + * getDuration(id: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getDuration","params":[16],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endenglish + */ + double getDuration(int id); + + /** + * \chinese + * 获取指定ID的运动指令段的剩余执行时间 + * + * @param id 运动指令段ID + * @return 返回剩余执行时间 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getMotionLeftTime(self: pyaubo_sdk.MotionControl, arg0: int) -> float + * + * @par Lua函数原型 + * getMotionLeftTime(id: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getMotionLeftTime","params":[16],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * \endchinese + * \english + * Get the remaining execution time of the motion segment with the specified ID. + * + * @param id Motion segment ID + * @return Returns the remaining execution time + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getMotionLeftTime(self: pyaubo_sdk.MotionControl, arg0: int) -> float + * + * @par Lua function prototype + * getMotionLeftTime(id: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getMotionLeftTime","params":[16],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * \endenglish + */ + double getMotionLeftTime(int id); + + /** + * \chinese + * StopMove 用于临时停止机器人和外部轴的运动以及相关工艺进程。如果调用 StartMove 指令,则运动和工艺进程将恢复。 + * + * 该指令可用于中断处理程序中,在发生中断时临时停止机器人。 + * + * @param quick true: 以最快速度在路径上停止机器人。未指定 quick 参数时,机器人将在路径上停止,但制动距离较长(与普通程序停止相同)。 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * StopMove is used to stop robot and external axes movements and any + * belonging process temporarily. If the instruction StartMove is given then + * the movement and process resumes. + * + * This instruction can, for example, be used in a trap routine to stop the + * robot temporarily when an interrupt occurs. + * + * @param quick true: Stops the robot on the path as fast as possible. + * Without the optional parameter \Quick, the robot stops on the path, but + * the braking distance is longer (same as for normal Program Stop). + * + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int stopMove(bool quick, bool all_tasks); + + /** + * \chinese + * StartMove 用于在以下情况下恢复机器人、外部轴的运动以及相关工艺进程: + * • 通过 StopMove 指令停止后。 + * • 执行 StorePath ... RestoPath 序列后。 + * • 发生异步运动错误(如 ERR_PATH_STOP)或特定工艺错误并在 ERROR 处理器中处理后。 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.startMove","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * StartMove is used to resume robot, external axes movement and belonging + * process after the movement has been stopped + * + * • by the instruction StopMove. + * • after execution of StorePath ... RestoPath sequence. + * • after asynchronously raised movements errors, such as ERR_PATH_STOP or + * specific process error after handling in the ERROR handler. + * + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.startMove","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int startMove(); + + /** + * \chinese + * storePath + * + * @param keep_sync + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * storePath + * + * @param keep_sync + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int storePath(bool keep_sync); + + /** + * \chinese + * ClearPath (清除路径) 清除当前运动路径层级(基础层级或 StorePath 层级)上的所有运动路径。 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.clearPath","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * ClearPath clears the whole motion path on the current motion path level (base level or StorePath level). + * + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.clearPath","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int clearPath(); + + /** + * \chinese + * restoPath + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.restoPath","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * restoPath + * + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.restoPath","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int restoPath(); + + /** + * \chinese + * 获取当前运动指令段的执行进度 + * + * @return 返回执行进度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getProgress(self: pyaubo_sdk.MotionControl) -> float + * + * @par Lua函数原型 + * getProgress() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getProgress","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endchinese + * \english + * Get the execution progress of the current motion instruction segment. + * + * @return Returns the execution progress. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getProgress(self: pyaubo_sdk.MotionControl) -> float + * + * @par Lua function prototype + * getProgress() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getProgress","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * + * \endenglish + */ + double getProgress(); + + /** + * \chinese + * 当工件安装在另外一台机器人的末端或者外部轴上时,指定其名字和安装位置 + * + * @note 暂未实现 + * + * @param module_name 控制模块名字 + * @param mounting_pose 抓取的相对位置, + * 如果是机器人,则相对于机器人末端中心点(非TCP点) + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setWorkObjectHold(self: pyaubo_sdk.MotionControl, arg0: str, arg1: + * List[float]) -> int + * + * @par Lua函数原型 + * setWorkObjectHold(module_name: string, mounting_pose: table) -> nil + * \endchinese + * \english + * Specify the name and mounting position when the workpiece is installed on the end of another robot or external axis. + * + * @note Not implemented yet + * + * @param module_name Name of the control module + * @param mounting_pose Relative position of the grasp, + * if it is a robot, it is relative to the robot's end center point (not the TCP point) + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setWorkObjectHold(self: pyaubo_sdk.MotionControl, arg0: str, arg1: + * List[float]) -> int + * + * @par Lua function prototype + * setWorkObjectHold(module_name: string, mounting_pose: table) -> nil + * \endenglish + */ + int setWorkObjectHold(const std::string &module_name, + const std::vector &mounting_pose); + + /** + * \chinese + * 获取工件安装信息 + * + * @note 暂未实现 + * + * @return 返回一个包含控制模块名字和安装位姿的元组 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getWorkObjectHold(self: pyaubo_sdk.MotionControl) -> Tuple[str, List[float]] + * + * @par Lua函数原型 + * getWorkObjectHold() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getWorkObjectHold","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":["",[]]} + * \endchinese + * \english + * getWorkObjectHold + * + * @note Not implemented yet + * + * @return Returns a tuple containing the control module name and mounting pose + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getWorkObjectHold(self: pyaubo_sdk.MotionControl) -> Tuple[str, List[float]] + * + * @par Lua function prototype + * getWorkObjectHold() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getWorkObjectHold","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":["",[]]} + * \endenglish + */ + std::tuple> getWorkObjectHold(); + + /** + * \chinese + * 获取暂停点关节位置 + * + * 常用于运行工程时发生碰撞后继续运动过程中(先通过resumeMoveJoint或resumeMoveLine运动到暂停位置,再恢复工程) + * + * @return 暂停关节位置 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getPauseJointPositions(self: pyaubo_sdk.MotionControl) -> List[float] + * + * @par Lua函数原型 + * getPauseJointPositions() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getPauseJointPositions","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[8.2321e-13,-0.200999,1.33999,0.334999,1.206,-6.39383e-12]} + * \endchinese + * \english + * Get the joint positions at the pause point. + * + * Commonly used during process recovery after a collision occurs (first move to the pause position using resumeMoveJoint or resumeMoveLine, then resume the process). + * + * @return Pause joint positions + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getPauseJointPositions(self: pyaubo_sdk.MotionControl) -> List[float] + * + * @par Lua function prototype + * getPauseJointPositions() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getPauseJointPositions","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[8.2321e-13,-0.200999,1.33999,0.334999,1.206,-6.39383e-12]} + * \endenglish + */ + std::vector getPauseJointPositions(); + + /** + * \chinese + * 设置继续运动参数 + * + * @param q 继续运动起始位置 + * @param move_type 0:关节空间 1:笛卡尔空间 + * @param blend_radius 交融半径 + * @param qdmax 关节运动最大速度(6维度数据) + * @param qddmax 关节运动最大加速度(6维度数据) + * @param vmax 直线运动最大线速度,角速度(2维度数据) + * @param amax 直线运动最大线加速度,角加速度(2维度数据) + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setResumeStartPoint(self: pyaubo_sdk.MotionControl, + * arg0:List[float],arg1: int, arg2: float,arg3: List[float], arg4: + * List[float],arg5:float,arg5:float) -> int + * + * @par Lua函数原型 + * setResumeStartPoint(q : table, move_type: number,blend_radius: + * number, qdmax: table, qddmax: + * table,vmax:number,amax:number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setResumeStartPoint","params":[[0,0,0,0,0,0],1,1,[0,0,0,0,0,0],[0,0,0,0,0,0],1,1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set resume motion parameters + * + * @param q Resume start position + * @param move_type 0: Joint space, 1: Cartesian space + * @param blend_radius Blend radius + * @param qdmax Maximum joint speed (6 elements) + * @param qddmax Maximum joint acceleration (6 elements) + * @param vmax Maximum linear and angular speed for linear motion (2 elements) + * @param amax Maximum linear and angular acceleration for linear motion (2 elements) + * @return Returns 0 on success; otherwise returns error code + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setResumeStartPoint(self: pyaubo_sdk.MotionControl, + * arg0: List[float], arg1: int, arg2: float, arg3: List[float], arg4: + * List[float], arg5: float, arg6: float) -> int + * + * @par Lua function prototype + * setResumeStartPoint(q: table, move_type: number, blend_radius: + * number, qdmax: table, qddmax: + * table, vmax: number, amax: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setResumeStartPoint","params":[[0,0,0,0,0,0],1,1,[0,0,0,0,0,0],[0,0,0,0,0,0],1,1],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setResumeStartPoint(const std::vector &q, int move_type, + double blend_radius, + const std::vector &qdmax, + const std::vector &qddmax, + const std::vector &vmax, + const std::vector &amax); + /** + * \chinese + * 获取继续运动模式 + * + * @return 0:继续运动起始点为暂停点 1:继续运动起始点为指定点 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getResumeMode(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua函数原型 + * getResumeMode() -> int + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getResumeMode","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endchinese + * \english + * Get resume motion mode + * + * @return 0: Resume start point is the pause point; 1: Resume start point is the specified point + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getResumeMode(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua function prototype + * getResumeMode() -> int + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getResumeMode","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endenglish + */ + int getResumeMode(); + + /** + * \chinese + * 设置伺服模式 + * 使用 setServoModeSelect 替代 + * + * @param enable 是否使能 + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setServoMode(self: pyaubo_sdk.MotionControl, arg0: bool) -> int + * + * @par Lua函数原型 + * setServoMode(enable: boolean) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setServoMode","params":[true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set servo mode + * Use setServoModeSelect instead + * + * @param enable Whether to enable + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setServoMode(self: pyaubo_sdk.MotionControl, arg0: bool) -> int + * + * @par Lua function prototype + * setServoMode(enable: boolean) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setServoMode","params":[true],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + ARCS_DEPRECATED int setServoMode(bool enable); + + /** + * \chinese + * 判断伺服模式是否使能 + * 使用 getServoModeSelect 替代 + * + * @return 已使能返回true,反之则返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * isServoModeEnabled(self: pyaubo_sdk.MotionControl) -> bool + * + * @par Lua函数原型 + * isServoModeEnabled() -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.isServoModeEnabled","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endchinese + * \english + * Determine whether the servo mode is enabled. + * Use getServoModeSelect instead. + * + * @return Returns true if enabled, otherwise returns false. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * isServoModeEnabled(self: pyaubo_sdk.MotionControl) -> bool + * + * @par Lua function prototype + * isServoModeEnabled() -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.isServoModeEnabled","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endenglish + */ + ARCS_DEPRECATED bool isServoModeEnabled(); + + /** + * \chinese + * 设置伺服运动模式 + * + * @param mode + * 0-退出伺服模式 + * 1-(截断式)规划伺服模式 + * 2-透传模式(直接下发) + * 3-透传模式(缓存) + * 4-1ms透传模式(缓存) + * 5-规划伺服模式 + * 伺服模式1添加路点后,会实时调整目标点和规划路线(当前的目标点被更新后,不能保证达到之前设定的目标点) + * 伺服模式5添加路点后,能保证经过所有目标点 + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setServoModeSelect","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set servo motion mode + * + * @param mode + * 0 - Exit servo mode + * 1 - Planning servo mode + * 2 - Transparent mode (direct send) + * 3 - Transparent mode (buffered) + * @return + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setServoModeSelect","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setServoModeSelect(int mode); + + /** + * \chinese + * 获取伺服运动模式 + * + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getServoModeSelect","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Get the servo motion mode + * + * @return + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getServoModeSelect","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int getServoModeSelect(); + + /** + * \chinese + * 关节空间伺服 + * + * 目前可用参数只有 q 和 t; + * @param q 关节角, 单位 rad, + * @param a 加速度, 单位 rad/s^2, + * @param v 速度,单位 rad/s, + * @param t 运行时间,单位 s \n + * t 值越大,机器臂运动越慢,反之,运动越快; + * 该参数最优值为连续调用 servoJoint 接口的间隔时间。 + * @param lookahead_time 前瞻时间,单位 s \n + * 指定机器臂开始减速前要运动的时长,用前瞻时间来平滑轨迹[0.03, 0.2], + * 当 lookahead_time 小于一个控制周期时,越小则超调量越大, + * 该参数最优值为一个控制周期。 + * @param gain 比例增益 + * 跟踪目标位置的比例增益[100, 200], + * 用于控制运动的顺滑性和精度, + * 比例增益越大,到达目标位置的时间越长,超调量越小。 + * + * @retval 0 成功 + * @retval AUBO_BAD_STATE(1) 当前安全模式处于非 + * Normal、ReducedMode、Recovery 状态 + * @retval AUBO_QUEUE_FULL(2) 规划队列已满 + * @retval AUBO_BUSY(3) 上一条指令正在执行中 + * @retval -AUBO_BAD_STATE(-1) + * 可能的原因包括但不限于:线程已分离、线程被终止、task_id + * 未找到,或者当前机器人模式非 Running + * @retval -AUBO_TIMEOUT(-4) 调用接口超时 + * @retval -AUBO_INVL_ARGUMENT(-5) 轨迹位置超限或速度超限 + * @retval -AUBO_REQUEST_IGNORE(-13) 当前处于非 servo 模式 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * servoJoint(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float, arg3: float, arg4: float, arg5: float) -> int + * + * @par Lua函数原型 + * servoJoint(q: table, a: number, v: number, t: number, lookahead_time: + * number, gain: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.servoJoint","params":[[0,0,0,0,0,0],0,0,10,0,0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":-13} + * + * \endchinese + * \english + * Joint space servo + * + * Currently only q and t parameters are available; + * @param q Joint angles, unit: rad + * @param a Acceleration, unit: rad/s^2 + * @param v Velocity, unit: rad/s + * @param t Execution time, unit: s \n + * The larger the t value, the slower the robot moves, and vice versa; + * The optimal value for this parameter is the interval time for continuous calls to the servoJoint interface. + * @param lookahead_time Lookahead time, unit: s \n + * Specifies the duration to move before the robot starts to decelerate, used to smooth the trajectory [0.03, 0.2]. + * When lookahead_time is less than one control cycle, the smaller it is, the greater the overshoot. + * The optimal value for this parameter is one control cycle. + * @param gain Proportional gain + * Proportional gain for tracking the target position [100, 200], + * used to control the smoothness and accuracy of the motion. + * The larger the proportional gain, the longer it takes to reach the target position, and the smaller the overshoot. + * + * @retval 0 Success + * @retval AUBO_BAD_STATE(1) The current safety mode is not Normal, ReducedMode, or Recovery + * @retval AUBO_QUEUE_FULL(2) Planning queue is full + * @retval AUBO_BUSY(3) The previous instruction is being executed + * @retval -AUBO_BAD_STATE(-1) + * Possible reasons include but are not limited to: thread has been detached, thread terminated, task_id not found, or the current robot mode is not Running + * @retval -AUBO_TIMEOUT(-4) Interface call timeout + * @retval -AUBO_INVL_ARGUMENT(-5) Trajectory position or velocity out of range + * @retval -AUBO_REQUEST_IGNORE(-13) Not in servo mode + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * servoJoint(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float, arg3: float, arg4: float, arg5: float) -> int + * + * @par Lua function prototype + * servoJoint(q: table, a: number, v: number, t: number, lookahead_time: + * number, gain: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.servoJoint","params":[[0,0,0,0,0,0],0,0,10,0,0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":-13} + * + * \endenglish + */ + int servoJoint(const std::vector &q, double a, double v, double t, + double lookahead_time, double gain); + + /** + * \chinese + * 笛卡尔空间伺服 + * + * 目前可用参数只有 pose 和 t; + * @param pose 位姿, 单位 m, + * @param a 加速度, 单位 m/s^2, + * @param v 速度,单位 m/s, + * @param t 运行时间,单位 s \n + * t 值越大,机器臂运动越慢,反之,运动越快; + * 该参数最优值为连续调用 servoCartesian 接口的间隔时间。 + * @param lookahead_time 前瞻时间,单位 s \n + * 指定机器臂开始减速前要运动的时长,用前瞻时间来平滑轨迹[0.03, 0.2], + * 当 lookahead_time 小于一个控制周期时,越小则超调量越大, + * 该参数最优值为一个控制周期。 + * @param gain 比例增益 + * 跟踪目标位置的比例增益[100, 200], + * 用于控制运动的顺滑性和精度, + * 比例增益越大,到达目标位置的时间越长,超调量越小。 + * + * @retval 0 成功 + * @retval AUBO_BAD_STATE(1) 当前安全模式处于非 + * Normal、ReducedMode、Recovery 状态 + * @retval AUBO_QUEUE_FULL(2) 规划队列已满 + * @retval AUBO_BUSY(3) 上一条指令正在执行中 + * @retval -AUBO_BAD_STATE(-1) + * 可能的原因包括但不限于:线程已分离、线程被终止、task_id + * 未找到,或者当前机器人模式非 Running + * @retval -AUBO_TIMEOUT(-4) 调用接口超时 + * @retval -AUBO_INVL_ARGUMENT(-5) 轨迹位置超限或速度超限 + * @retval -AUBO_REQUEST_IGNORE(-13) 当前处于非 servo 模式 + * @retval -AUBO_IK_NO_CONVERGE(-23) 逆解计算不收敛,计算出错; + * @retval -AUBO_IK_OUT_OF_RANGE(-24) 逆解计算超出机器人最大限制; + * @retval AUBO_IK_CONFIG_DISMATCH(-25) 逆解输入配置存在错误; + * @retval -AUBO_IK_JACOBIAN_FAILED(-26) 逆解雅可比矩阵计算失败; + * @retval -AUBO_IK_NO_SOLU(-27) 目标点存在解析解,但均不满足选解条件; + * @retval -AUBO_IK_UNKOWN_ERROR(-28) 逆解返回未知类型错误; + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * servoCartesian(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float, arg3: float, arg4: float, arg5: float) -> int + * + * @par Lua函数原型 + * servoCartesian(pose: table, a: number, v: number, t: number, + * lookahead_time: number, gain: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.servoCartesian","params":[[0.58712,-0.15775,0.48703,2.76,0.344,1.432],0,0,10,0,0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":-13} + * \endchinese + * \english + * Cartesian space servo + * + * Currently, only pose and t parameters are available; + * @param pose Pose, unit: m + * @param a Acceleration, unit: m/s^2 + * @param v Velocity, unit: m/s + * @param t Execution time, unit: s \n + * The larger the t value, the slower the robot moves, and vice versa; + * The optimal value for this parameter is the interval time for continuous calls to the servoCartesian interface. + * @param lookahead_time Lookahead time, unit: s \n + * Specifies the duration to move before the robot starts to decelerate, used to smooth the trajectory [0.03, 0.2]. + * When lookahead_time is less than one control cycle, the smaller it is, the greater the overshoot. + * The optimal value for this parameter is one control cycle. + * @param gain Proportional gain + * Proportional gain for tracking the target position [100, 200], + * used to control the smoothness and accuracy of the motion, + * The larger the proportional gain, the longer it takes to reach the target position, and the smaller the overshoot. + * + * @retval 0 Success + * @retval AUBO_BAD_STATE(1) The current safety mode is not Normal, ReducedMode, or Recovery + * @retval AUBO_QUEUE_FULL(2) Planning queue is full + * @retval AUBO_BUSY(3) The previous instruction is being executed + * @retval -AUBO_BAD_STATE(-1) + * Possible reasons include but are not limited to: thread has been detached, thread terminated, task_id not found, or the current robot mode is not Running + * @retval -AUBO_TIMEOUT(-4) Interface call timeout + * @retval -AUBO_INVL_ARGUMENT(-5) Trajectory position or velocity out of range + * @retval -AUBO_REQUEST_IGNORE(-13) Not in servo mode + * @retval -AUBO_IK_NO_CONVERGE(-23) Inverse kinematics calculation does not converge, calculation error; + * @retval -AUBO_IK_OUT_OF_RANGE(-24) Inverse kinematics calculation exceeds robot maximum limits; + * @retval AUBO_IK_CONFIG_DISMATCH(-25) Inverse kinematics input configuration error; + * @retval -AUBO_IK_JACOBIAN_FAILED(-26) Inverse kinematics Jacobian calculation failed; + * @retval -AUBO_IK_NO_SOLU(-27) Analytical solution exists for the target point, but none meet the selection criteria; + * @retval -AUBO_IK_UNKOWN_ERROR(-28) Inverse kinematics returned an unknown error type; + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * servoCartesian(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float, arg3: float, arg4: float, arg5: float) -> int + * + * @par Lua function prototype + * servoCartesian(pose: table, a: number, v: number, t: number, + * lookahead_time: number, gain: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.servoCartesian","params":[[0.58712,-0.15775,0.48703,2.76,0.344,1.432],0,0,10,0,0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":-13} + * \endenglish + */ + int servoCartesian(const std::vector &pose, double a, double v, + double t, double lookahead_time, double gain); + + /** + * \chinese + * 伺服运动(带外部轴),用于执行离线轨迹、透传用户规划轨迹等 + * + * @param q + * @param extq + * @param t + * @param smooth_scale + * @param delay_sacle + * @return + * \endchinese + * \english + * Servo motion (with external axes), used for executing offline trajectories, pass-through user planned trajectories, etc. + * + * @param q + * @param extq + * @param t + * @param smooth_scale + * @param delay_sacle + * @return + * \endenglish + */ + int servoJointWithAxes(const std::vector &q, + const std::vector &extq, double a, double v, + double t, double lookahead_time, double gain); + + int servoJointWithAxisGroup(const std::vector &q, double a, + double v, double t, double lookahead_time, + double gain, const std::string &group_name, + const std::vector &extq); + + /** + * \chinese + * 伺服运动(带外部轴),用于执行离线轨迹、透传用户规划轨迹等 + * 与 servoJointWithAxes 区别在于接收笛卡尔空间位姿而不是关节角度 + * (由软件内部直接做逆解) + * + * @param pose + * @param extq + * @param t + * @param smooth_scale + * @param delay_sacle + * @return + * \endchinese + * \english + * Servo motion (with external axes), used for executing offline trajectories, pass-through user planned trajectories, etc. + * The difference from servoJointWithAxes is that it receives Cartesian poses instead of joint angles + * (inverse kinematics is performed internally by the software). + * + * @param pose + * @param extq + * @param t + * @param smooth_scale + * @param delay_sacle + * @return + * \endenglish + */ + int servoCartesianWithAxes(const std::vector &pose, + const std::vector &extq, double a, + double v, double t, double lookahead_time, + double gain); + + int servoCartesianWithAxisGroup(const std::vector &pose, double a, + double v, double t, double lookahead_time, + double gain, const std::string &group_name, + const std::vector &extq); + + /** + * \chinese + * 跟踪运动,用于执行离线轨迹、透传用户规划轨迹等 + * + * @param q + * @param smooth_scale + * @param delay_sacle + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.trackJoint","params":[[0,0,0,0,0,0],0.01,0.5,1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Tracking motion, used for executing offline trajectories or passing through user-planned trajectories, etc. + * + * @param q + * @param smooth_scale + * @param delay_sacle + * @return + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.trackJoint","params":[[0,0,0,0,0,0],0.01,0.5,1],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int trackJoint(const std::vector &q, double t, double smooth_scale, + double delay_sacle); + + /** + * \chinese + * 跟踪运动,用于执行离线轨迹、透传用户规划轨迹等 + * 与 trackJoint 区别在于接收笛卡尔空间位姿而不是关节角度 + * (由软件内部直接做逆解) + * + * @param pose + * @param t + * @param smooth_scale + * @param delay_sacle + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.trackCartesian","params":[[0.58712,-0.15775,0.48703,2.76,0.344,1.432],0.01,0.5,1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Tracking motion, used for executing offline trajectories or passing through user-planned trajectories, etc. + * The difference from trackJoint is that it receives Cartesian poses instead of joint angles + * (inverse kinematics is performed internally by the software). + * + * @param pose + * @param t + * @param smooth_scale + * @param delay_sacle + * @return + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.trackCartesian","params":[[0.58712,-0.15775,0.48703,2.76,0.344,1.432],0.01,0.5,1],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int trackCartesian(const std::vector &pose, double t, + double smooth_scale, double delay_sacle); + + /** + * \chinese + * 关节空间跟随 + * + * @note 暂未实现 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * followJoint(self: pyaubo_sdk.MotionControl, arg0: List[float]) -> int + * + * @par Lua函数原型 + * followJoint(q: table) -> nil + * \endchinese + * \english + * Joint space following + * + * @note Not implemented yet + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * followJoint(self: pyaubo_sdk.MotionControl, arg0: List[float]) -> int + * + * @par Lua function prototype + * followJoint(q: table) -> nil + * \endenglish + */ + int followJoint(const std::vector &q); + + /** + * \chinese + * 笛卡尔空间跟随 + * + * @note 暂未实现 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * followLine(self: pyaubo_sdk.MotionControl, arg0: List[float]) -> int + * + * @par Lua函数原型 + * followLine(pose: table) -> nil + * \endchinese + * \english + * Cartesian space following + * + * @note Not implemented yet + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * followLine(self: pyaubo_sdk.MotionControl, arg0: List[float]) -> int + * + * @par Lua function prototype + * followLine(pose: table) -> nil + * \endenglish + */ + int followLine(const std::vector &pose); + + /** + * \chinese + * 关节空间速度跟随 + * + * 当机械臂还没达到目标速度的时候,给一个新的目标速度,机械臂会立刻达到新的目标速度 + * + * @param qd 目标关节速度, 单位 rad/s + * @param a 主轴的加速度, 单位 rad/s^2 + * @param t 函数返回所需要的时间, 单位 s \n + * 如果 t = 0,当达到目标速度的时候,函数将返回; + * 反之,则经过 t 时间后,函数返回,不管是否达到目标速度。\n + * 如果没有达到目标速度,会减速到零。 + * 如果达到了目标速度就是按照目标速度匀速运动。 + * @retval 0 成功 + * @retval AUBO_BAD_STATE(1) 当前安全模式处于非 + * Normal、ReducedMode、Recovery 状态 + * @retval AUBO_BUSY(3) 上一条指令正在执行中 + * @retval -AUBO_BAD_STATE(-1) + * 可能的原因包括但不限于:线程已分离、线程被终止、task_id + * 未找到,或者当前机器人模式非 Running + * @retval -AUBO_TIMEOUT(-4) 调用接口超时 + * @retval -AUBO_INVL_ARGUMENT(-5) 参数数组qd的长度小于当前机器臂的自由度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * speedJoint(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float) -> int + * + * @par Lua函数原型 + * speedJoint(qd: table, a: number, t: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.speedJoint","params":[[0.2,0,0,0,0,0],1.5,100],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Joint space velocity following + * + * When the robot arm has not yet reached the target velocity, giving a new target velocity will cause the robot arm to immediately reach the new target velocity. + * + * @param qd Target joint velocity, unit: rad/s + * @param a Main axis acceleration, unit: rad/s^2 + * @param t Time required for the function to return, unit: s \n + * If t = 0, the function returns when the target velocity is reached; + * otherwise, the function returns after t seconds, regardless of whether the target velocity is reached.\n + * If the target velocity is not reached, it will decelerate to zero. + * If the target velocity is reached, it will move at a constant speed. + * @retval 0 Success + * @retval AUBO_BAD_STATE(1) The current safety mode is not Normal, ReducedMode, or Recovery + * @retval AUBO_BUSY(3) The previous instruction is being executed + * @retval -AUBO_BAD_STATE(-1) + * Possible reasons include but are not limited to: thread has been detached, thread terminated, task_id not found, or the current robot mode is not Running + * @retval -AUBO_TIMEOUT(-4) Interface call timeout + * @retval -AUBO_INVL_ARGUMENT(-5) The length of the qd array is less than the degrees of freedom of the current robot arm + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * speedJoint(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float) -> int + * + * @par Lua function prototype + * speedJoint(qd: table, a: number, t: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.speedJoint","params":[[0.2,0,0,0,0,0],1.5,100],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int speedJoint(const std::vector &qd, double a, double t); + + /** + * \chinese + * 关节空间速度跟随(机械臂运行工程时发生碰撞,通过此接口移动到安全位置) + * + * 当机械臂还没达到目标速度的时候,给一个新的目标速度,机械臂会立刻达到新的目标速度 + * + * @param qd 目标关节速度, 单位 rad/s + * @param a 主轴的加速度, 单位 rad/s^2 + * @param t 函数返回所需要的时间, 单位 s + * 如果 t = 0,当达到目标速度的时候,函数将返回; + * 反之,则经过 t 时间后,函数返回,不管是否达到目标速度。 + * 如果没有达到目标速度,会减速到零。 + * 如果达到了目标速度就是按照目标速度匀速运动。 + * @return 成功返回0; 失败返回错误码 + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * resumeSpeedJoint(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float) -> int + * + * @par Lua函数原型 + * resumeSpeedJoint(q: table, a: number, t: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.resumeSpeedJoint","params":[[0.2,0,0,0,0,0],1.5,100],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":-1} + * \endchinese + * \english + * Joint space velocity following (used to move to a safe position after a collision during process execution) + * + * When the robot arm has not yet reached the target velocity, giving a new target velocity will cause the robot arm to immediately reach the new target velocity. + * + * @param qd Target joint velocity, unit: rad/s + * @param a Main axis acceleration, unit: rad/s^2 + * @param t Time required for the function to return, unit: s + * If t = 0, the function returns when the target velocity is reached; + * otherwise, the function returns after t seconds, regardless of whether the target velocity is reached. + * If the target velocity is not reached, it will decelerate to zero. + * If the target velocity is reached, it will move at a constant speed. + * @return Returns 0 on success; otherwise returns error code + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * resumeSpeedJoint(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float) -> int + * + * @par Lua function prototype + * resumeSpeedJoint(q: table, a: number, t: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.resumeSpeedJoint","params":[[0.2,0,0,0,0,0],1.5,100],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":-1} + * \endenglish + */ + int resumeSpeedJoint(const std::vector &qd, double a, double t); + + /** + * \chinese + * 笛卡尔空间速度跟随 + * + * 当机械臂还没达到目标速度的时候,给一个新的目标速度,机械臂会立刻达到新的目标速度 + * + * @param xd 工具速度, 单位 m/s + * @param a 工具位置加速度, 单位 m/s^2 + * @param t 函数返回所需要的时间, 单位 s \n + * 如果 t = 0,当达到目标速度的时候,函数将返回; + * 反之,则经过 t 时间后,函数返回,不管是否达到目标速度。 + * 如果没有达到目标速度,会减速到零。 + * 如果达到了目标速度就是按照目标速度匀速运动。 + * @retval 0 成功 + * @retval AUBO_BAD_STATE(1) 当前安全模式处于非 + * Normal、ReducedMode、Recovery 状态 + * @retval AUBO_BUSY(3) 上一条指令正在执行中 + * @retval -AUBO_BAD_STATE(-1) + * 可能的原因包括但不限于:线程已分离、线程被终止、task_id + * 未找到,或者当前机器人模式非 Running + * @retval -AUBO_TIMEOUT(-4) 调用接口超时 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * speedLine(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: float, + * arg2: float) -> int + * + * @par Lua函数原型 + * speedLine(pose: table, a: number, t: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.speedLine","params":[[0.25,0,0,0,0,0],1.2,100],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Cartesian space velocity following + * + * When the robot arm has not yet reached the target velocity, giving a new target velocity will cause the robot arm to immediately reach the new target velocity. + * + * @param xd Tool velocity, unit: m/s + * @param a Tool position acceleration, unit: m/s^2 + * @param t Time required for the function to return, unit: s \n + * If t = 0, the function returns when the target velocity is reached; + * otherwise, the function returns after t seconds, regardless of whether the target velocity is reached. + * If the target velocity is not reached, it will decelerate to zero. + * If the target velocity is reached, it will move at a constant speed. + * @retval 0 Success + * @retval AUBO_BAD_STATE(1) The current safety mode is not Normal, ReducedMode, or Recovery + * @retval AUBO_BUSY(3) The previous instruction is being executed + * @retval -AUBO_BAD_STATE(-1) + * Possible reasons include but are not limited to: thread has been detached, thread terminated, task_id not found, or the current robot mode is not Running + * @retval -AUBO_TIMEOUT(-4) Interface call timeout + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * speedLine(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: float, + * arg2: float) -> int + * + * @par Lua function prototype + * speedLine(pose: table, a: number, t: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.speedLine","params":[[0.25,0,0,0,0,0],1.2,100],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int speedLine(const std::vector &xd, double a, double t); + + /** + * \chinese + * 笛卡尔空间速度跟随(机械臂运行工程时发生碰撞,通过此接口移动到安全位置) + * + * 当机械臂还没达到目标速度的时候,给一个新的目标速度,机械臂会立刻达到新的目标速度 + * + * @param xd 工具速度, 单位 m/s + * @param a 工具位置加速度, 单位 m/s^2 + * @param t 函数返回所需要的时间, 单位 s \n + * 如果 t = 0,当达到目标速度的时候,函数将返回; + * 反之,则经过 t 时间后,函数返回,不管是否达到目标速度。 + * 如果没有达到目标速度,会减速到零。 + * 如果达到了目标速度就是按照目标速度匀速运动。 + * @return 成功返回0; 失败返回错误码 + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * resumeSpeedLine(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float) -> int + * + * @par Lua函数原型 + * resumeSpeedLine(pose: table, a: number, t: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.resumeSpeedLine","params":[[0.25,0,0,0,0,0],1.2,100],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":-1} + * \endchinese + * \english + * Cartesian space velocity following (used to move to a safe position after a collision during process execution) + * + * When the robot arm has not yet reached the target velocity, giving a new target velocity will cause the robot arm to immediately reach the new target velocity. + * + * @param xd Tool velocity, unit: m/s + * @param a Tool position acceleration, unit: m/s^2 + * @param t Time required for the function to return, unit: s \n + * If t = 0, the function returns when the target velocity is reached; + * otherwise, the function returns after t seconds, regardless of whether the target velocity is reached. + * If the target velocity is not reached, it will decelerate to zero. + * If the target velocity is reached, it will move at a constant speed. + * @return Returns 0 on success; otherwise returns error code + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * resumeSpeedLine(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float) -> int + * + * @par Lua function prototype + * resumeSpeedLine(pose: table, a: number, t: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.resumeSpeedLine","params":[[0.25,0,0,0,0,0],1.2,100],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":-1} + * \endenglish + */ + int resumeSpeedLine(const std::vector &xd, double a, double t); + + /** + * \chinese + * 在关节空间做样条插值 + * + * @param q 关节角度,如果传入参数维度为0,表示样条运动结束 + * @param a 加速度, 单位 rad/s^2, + * 最大值可通过RobotConfig类中的接口getJointMaxAccelerations()来获取 + * @param v 速度, 单位 rad/s, + * 最大值可通过RobotConfig类中的接口getJointMaxSpeeds()来获取 + * @param duration + * @return 成功返回0; 失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * moveSpline(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float, arg3: float) -> int + * + * @par Lua函数原型 + * moveSpline(q: table, a: number, v: number, duration: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.moveSpline","params":[[0,0,0,0,0,0],1,1,0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Perform spline interpolation in joint space + * + * @param q Joint angles. If the input vector is of size 0, it indicates the end of the spline motion. + * @param a Acceleration, unit: rad/s^2. The maximum value can be obtained via RobotConfig::getJointMaxAccelerations(). + * @param v Velocity, unit: rad/s. The maximum value can be obtained via RobotConfig::getJointMaxSpeeds(). + * @param duration + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * moveSpline(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float, arg3: float) -> int + * + * @par Lua function prototype + * moveSpline(q: table, a: number, v: number, duration: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.moveSpline","params":[[0,0,0,0,0,0],1,1,0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int moveSpline(const std::vector &q, double a, double v, + double duration); + + /** + * \chinese + * 添加关节运动 + * + * @param q 关节角, 单位 rad + * @param a 加速度, 单位 rad/s^2, + * 最大值可通过RobotConfig类中的接口getJointMaxAccelerations()来获取 + * @param v 速度, 单位 rad/s, + * 最大值可通过RobotConfig类中的接口getJointMaxSpeeds()来获取 + * @param blend_radius 交融半径, 单位 m + * @param duration 运行时间,单位 s \n + * 通常当给定了速度和加速度,便能够确定轨迹的运行时间。 + * 如果想延长轨迹的运行时间,便要设置 duration 这个参数。 + * duration 可以延长轨迹运动的时间,但是不能缩短轨迹时间。\n + * 当 duration = 0的时候, + * 表示不指定运行时间,即没有明确完成运动的时间,将根据速度与加速度计算运行时间。 + * 如果duration不等于0,a 和 v 的值将被忽略。 + * @retval 0 成功 + * @retval AUBO_BAD_STATE(1) 当前安全模式处于非 + * Normal、ReducedMode、Recovery 状态 + * @retval AUBO_QUEUE_FULL(2) 规划队列已满 + * @retval AUBO_BUSY(3) 上一条指令正在执行中 + * @retval -AUBO_BAD_STATE(-1) + * 可能的原因包括但不限于:线程已分离、线程被终止、task_id + * 未找到,或者当前机器人模式非 Running + * @retval -AUBO_TIMEOUT(-4) 调用接口超时 + * @retval -AUBO_INVL_ARGUMENT(-5) 参数数组q的长度小于当前机器臂的自由度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * moveJoint(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: float, + * arg2: float, arg3: float, arg4: float) -> int + * + * @par Lua函数原型 + * moveJoint(q: table, a: number, v: number, blend_radius: number, duration: + * number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.moveJoint","params":[[-2.05177, + * -0.400292, 1.19625, 0.0285152, 1.57033, -2.28774],0.3,0.3,0,0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Add joint motion + * + * @param q Joint angles, unit: rad + * @param a Acceleration, unit: rad/s^2, + * The maximum value can be obtained via RobotConfig::getJointMaxAccelerations() + * @param v Velocity, unit: rad/s, + * The maximum value can be obtained via RobotConfig::getJointMaxSpeeds() + * @param blend_radius Blend radius, unit: m + * @param duration Execution time, unit: s \n + * Normally, when speed and acceleration are given, the trajectory duration can be determined. + * If you want to extend the trajectory duration, set the duration parameter. + * Duration can extend the trajectory time, but cannot shorten it.\n + * When duration = 0, + * it means the execution time is not specified, and the time will be calculated based on speed and acceleration. + * If duration is not 0, a and v values will be ignored. + * @retval 0 Success + * @retval AUBO_BAD_STATE(1) The current safety mode is not Normal, ReducedMode, or Recovery + * @retval AUBO_QUEUE_FULL(2) Planning queue is full + * @retval AUBO_BUSY(3) The previous instruction is being executed + * @retval -AUBO_BAD_STATE(-1) + * Possible reasons include but are not limited to: thread has been detached, thread terminated, task_id not found, or the current robot mode is not Running + * @retval -AUBO_TIMEOUT(-4) Interface call timeout + * @retval -AUBO_INVL_ARGUMENT(-5) The length of q is less than the degrees of freedom of the current robot arm + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * moveJoint(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: float, + * arg2: float, arg3: float, arg4: float) -> int + * + * @par Lua function prototype + * moveJoint(q: table, a: number, v: number, blend_radius: number, duration: + * number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.moveJoint","params":[[-2.05177, + * -0.400292, 1.19625, 0.0285152, 1.57033, -2.28774],0.3,0.3,0,0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int moveJoint(const std::vector &q, double a, double v, + double blend_radius, double duration); + + /** + * \chinese + * 机器人与外部轴同步运动 + * + * @param group_name + * @param q + * @param a + * @param v + * @param blend_radius + * @param duration + * @return + * \endchinese + * \english + * Synchronous motion of robot and external axes + * + * @param group_name + * @param q + * @param a + * @param v + * @param blend_radius + * @param duration + * @return + * \endenglish + */ + int moveJointWithAxisGroup(const std::vector &q, double a, double v, + double blend_radius, double duration, + const std::string &group_name, + const std::vector &extq); + + /** + * \chinese + * 通过关节运动移动到暂停点的位置 + * + * @param q 关节角, 单位 rad + * @param a 加速度, 单位 rad/s^2 + * @param v 速度, 单位 rad/s + * @param duration 运行时间,单位 s \n + * 通常当给定了速度和加速度,便能够确定轨迹的运行时间。 + * 如果想延长轨迹的运行时间,便要设置 duration 这个参数。 + * duration 可以延长轨迹运动的时间,但是不能缩短轨迹时间。\n + * 当 duration = 0的时候, + * 表示不指定运行时间,即没有明确完成运动的时间,将根据速度与加速度计算运行时间。 + * 如果duration不等于0,a 和 v 的值将被忽略。 + * @return 成功返回0;失败返回错误码 + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * resumeMoveJoint(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float, arg3: float) -> int + * + * @par Lua函数原型 + * resumeMoveJoint(q: table, a: number, v: number, duration: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.resumeMoveJoint","params":[[-2.05177, + * -0.400292, 1.19625, 0.0285152, 1.57033, -2.28774],0.3,0.3,0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":-1} + * \endchinese + * \english + * Move to the pause point using joint motion. + * + * @param q Joint angles, unit: rad + * @param a Acceleration, unit: rad/s^2 + * @param v Velocity, unit: rad/s + * @param duration Execution time, unit: s \n + * Normally, when speed and acceleration are given, the trajectory duration can be determined. + * If you want to extend the trajectory duration, set the duration parameter. + * Duration can extend the trajectory time, but cannot shorten it.\n + * When duration = 0, + * it means the execution time is not specified, and the time will be calculated based on speed and acceleration. + * If duration is not 0, a and v values will be ignored. + * @return Returns 0 on success; otherwise returns error code + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * resumeMoveJoint(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float, arg3: float) -> int + * + * @par Lua function prototype + * resumeMoveJoint(q: table, a: number, v: number, duration: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.resumeMoveJoint","params":[[-2.05177, + * -0.400292, 1.19625, 0.0285152, 1.57033, -2.28774],0.3,0.3,0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":-1} + * \endenglish + */ + int resumeMoveJoint(const std::vector &q, double a, double v, + double duration); + + /** + * \chinese + * 添加直线运动 + * + * @param pose 目标位姿 + * @param a 加速度(如果位置变化小于1mm,姿态变化大于 1e-4 + * rad,此加速度会被作为角加速度,单位 rad/s^2.否则为线加速度,单位 m/s^2) + * 最大值可通过RobotConfig类中的接口getTcpMaxAccelerations()来获取 + * @param v 速度(如果位置变化小于1mm,姿态变化大于 1e-4 + * rad,此速度会被作为角速度,单位 rad/s.否则为线速度,单位 m/s) + * 最大值可通过RobotConfig类中的接口getTcpMaxSpeeds()来获取 + * @param blend_radius 交融半径,单位 m,值介于0.001和1之间 + * @param duration 运行时间,单位 s \n + * 通常当给定了速度和加速度,便能够确定轨迹的运行时间。 + * 如果想延长轨迹的运行时间,便要设置 duration 这个参数。 + * duration 可以延长轨迹运动的时间,但是不能缩短轨迹时间。\n + * 当 duration = 0的时候, + * 表示不指定运行时间,即没有明确完成运动的时间,将根据速度与加速度计算运行时间。 + * 如果duration不等于0,a 和 v 的值将被忽略。 + * @retval 0 成功 + * @retval AUBO_BAD_STATE(1) 当前安全模式处于非 + * Normal、ReducedMode、Recovery 状态 + * @retval AUBO_QUEUE_FULL(2) 轨迹队列已满 + * @retval AUBO_BUSY(3) 上一条指令正在执行中 + * @retval -AUBO_BAD_STATE(-1) + * 可能的原因包括但不限于:线程已分离、线程被终止、task_id + * 未找到,或者当前机器人模式非 Running + * @retval -AUBO_TIMEOUT(-4) 调用接口超时 + * @retval -AUBO_INVL_ARGUMENT(-5) 参数数组 pose + * 的长度小于当前机器臂的自由度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * moveLine(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: float, + * arg2: float, arg3: float, arg4: float) -> int + * + * @par Lua函数原型 + * moveLine(pose: table, a: number, v: number, blend_radius: number, + * duration: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.moveLine","params":[[0.58815,0.0532,0.62391,2.46,0.479,1.619],1.2,0.25,0,0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Add linear motion + * + * @param pose Target pose + * @param a Acceleration (if the position change is less than 1mm and the posture change is greater than 1e-4 rad, this acceleration is treated as angular acceleration in rad/s^2; otherwise, as linear acceleration in m/s^2). The maximum value can be obtained via RobotConfig::getTcpMaxAccelerations(). + * @param v Velocity (if the position change is less than 1mm and the posture change is greater than 1e-4 rad, this velocity is treated as angular velocity in rad/s; otherwise, as linear velocity in m/s). The maximum value can be obtained via RobotConfig::getTcpMaxSpeeds(). + * @param blend_radius Blend radius, unit: m, value between 0.001 and 1 + * @param duration Execution time, unit: s \n + * Normally, when speed and acceleration are given, the trajectory duration can be determined. + * If you want to extend the trajectory duration, set the duration parameter. + * Duration can extend the trajectory time, but cannot shorten it.\n + * When duration = 0, it means the execution time is not specified, and the time will be calculated based on speed and acceleration. + * If duration is not 0, a and v values will be ignored. + * @retval 0 Success + * @retval AUBO_BAD_STATE(1) The current safety mode is not Normal, ReducedMode, or Recovery + * @retval AUBO_QUEUE_FULL(2) Trajectory queue is full + * @retval AUBO_BUSY(3) The previous instruction is being executed + * @retval -AUBO_BAD_STATE(-1) Possible reasons include but are not limited to: thread has been detached, thread terminated, task_id not found, or the current robot mode is not Running + * @retval -AUBO_TIMEOUT(-4) Interface call timeout + * @retval -AUBO_INVL_ARGUMENT(-5) The length of the pose array is less than the degrees of freedom of the current robot arm + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * moveLine(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: float, + * arg2: float, arg3: float, arg4: float) -> int + * + * @par Lua function prototype + * moveLine(pose: table, a: number, v: number, blend_radius: number, + * duration: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.moveLine","params":[[0.58815,0.0532,0.62391,2.46,0.479,1.619],1.2,0.25,0,0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int moveLine(const std::vector &pose, double a, double v, + double blend_radius, double duration); + + /** + * \chinese + * 直线运动与外部轴同步运动 + * + * @param group_name 外部轴组名称 + * @param pose 目标位姿 + * @param a 加速度 + * @param v 速度 + * @param blend_radius 交融半径 + * @param duration 运行时间 + * @return + * \endchinese + * \english + * Linear motion synchronized with external axes + * + * @param group_name Name of the external axis group + * @param pose Target pose + * @param a Acceleration + * @param v Velocity + * @param blend_radius Blend radius + * @param duration Execution time + * @return + * \endenglish + */ + int moveLineWithAxisGroup(const std::vector &pose, double a, + double v, double blend_radius, double duration, + const std::string &group_name, + const std::vector &extq); + + /** + * \chinese + * 添加工艺运动 + * + * @param pose + * @param a + * @param v + * @param blend_radius + * @return 成功返回0;失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.moveProcess","params":[[0.58815,0.0532,0.62391,2.46,0.479,1.619],1.2,0.25,0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Add process motion + * + * @param pose + * @param a + * @param v + * @param blend_radius + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.moveProcess","params":[[0.58815,0.0532,0.62391,2.46,0.479,1.619],1.2,0.25,0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int moveProcess(const std::vector &pose, double a, double v, + double blend_radius); + + /** + * \chinese + * 通过直线运动移动到暂停点的位置 + * + * @param pose 目标位姿 + * @param a 加速度, 单位 m/s^2 + * @param v 速度, 单位 m/s + * @param duration 运行时间,单位 s \n + * 通常当给定了速度和加速度,便能够确定轨迹的运行时间。 + * 如果想延长轨迹的运行时间,便要设置 duration 这个参数。 + * duration 可以延长轨迹运动的时间,但是不能缩短轨迹时间。\n + * 当 duration = 0的时候, + * 表示不指定运行时间,即没有明确完成运动的时间,将根据速度与加速度计算运行时间。 + * 如果duration不等于0,a 和 v 的值将被忽略。 + * @return 成功返回0;失败返回错误码 + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * resumeMoveLine(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float, arg3: float) -> int + * + * @par Lua函数原型 + * resumeMoveLine(pose: table, a: number, v: number,duration: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.resumeMoveLine","params":[[0.58815,0.0532,0.62391,2.46,0.479,1.619],1.2,0.25,0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Move to the pause point using linear motion. + * + * @param pose Target pose + * @param a Acceleration, unit: m/s^2 + * @param v Velocity, unit: m/s + * @param duration Execution time, unit: s \n + * Normally, when speed and acceleration are given, the trajectory duration can be determined. + * If you want to extend the trajectory duration, set the duration parameter. + * Duration can extend the trajectory time, but cannot shorten it.\n + * When duration = 0, it means the execution time is not specified, and the time will be calculated based on speed and acceleration. + * If duration is not 0, a and v values will be ignored. + * @return Returns 0 on success; otherwise returns error code + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * resumeMoveLine(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float, arg3: float) -> int + * + * @par Lua function prototype + * resumeMoveLine(pose: table, a: number, v: number, duration: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.resumeMoveLine","params":[[0.58815,0.0532,0.62391,2.46,0.479,1.619],1.2,0.25,0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int resumeMoveLine(const std::vector &pose, double a, double v, + double duration); + + /** + * \chinese + * 添加圆弧运动 + * + * @todo 可以由多段圆弧组成圆周运动 + * + * @param via_pose 圆弧运动途中点的位姿 + * @param end_pose 圆弧运动结束点的位姿 + * @param a 加速度(如果via_pose与上一个路点位置变化小于1mm,姿态变化大于 1e-4 + * rad, 此加速度会被作为角加速度,单位 rad/s^2.否则为线加速度,单位 m/s^2) + * @param v 速度(如果via_pose与上一个路点位置变化小于1mm, 姿态变化大于 1e-4 + * rad, 此速度会被作为角速度, 单位 rad / s.否则为线速度, 单位 m / s) + * @param blend_radius 交融半径,单位: m + * @param duration 运行时间,单位: s \n + * 通常当给定了速度和加速度,便能够确定轨迹的运行时间。 + * 如果想延长轨迹的运行时间,便要设置 duration 这个参数。 + * duration 可以延长轨迹运动的时间,但是不能缩短轨迹时间。\n + * 当 duration = 0 的时候, + * 表示不指定运行时间,即没有明确完成运动的时间,将根据速度与加速度计算运行时间。 + * 如果duration不等于0,a 和 v 的值将被忽略。 + * @return 成功返回0;失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * moveCircle(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * List[float], arg2: float, arg3: float, arg4: float, arg5: float) -> int + * + * @par Lua函数原型 + * moveCircle(via_pose: table, end_pose: table, a: number, v: number, + * blend_radius: number, duration: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.moveCircle","params":[[0.440164,-0.00249391,0.398658,2.45651,0,1.5708],[0.440164,0.166256,0.297599,2.45651,0,1.5708],1.2,0.25,0,0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Add circular arc motion + * + * @todo Can be composed of multiple arcs to form a circular motion + * + * @param via_pose The pose of the via point during the arc motion + * @param end_pose The pose of the end point of the arc motion + * @param a Acceleration (if the position change between via_pose and the previous waypoint is less than 1mm and the posture change is greater than 1e-4 rad, this acceleration is treated as angular acceleration in rad/s^2; otherwise, as linear acceleration in m/s^2) + * @param v Velocity (if the position change between via_pose and the previous waypoint is less than 1mm and the posture change is greater than 1e-4 rad, this velocity is treated as angular velocity in rad/s; otherwise, as linear velocity in m/s) + * @param blend_radius Blend radius, unit: m + * @param duration Execution time, unit: s \n + * Normally, when speed and acceleration are given, the trajectory duration can be determined. + * If you want to extend the trajectory duration, set the duration parameter. + * Duration can extend the trajectory time, but cannot shorten it.\n + * When duration = 0, it means the execution time is not specified, and the time will be calculated based on speed and acceleration. + * If duration is not 0, a and v values will be ignored. + * @return Returns 0 on success; otherwise returns error code + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * moveCircle(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * List[float], arg2: float, arg3: float, arg4: float, arg5: float) -> int + * + * @par Lua function prototype + * moveCircle(via_pose: table, end_pose: table, a: number, v: number, + * blend_radius: number, duration: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.moveCircle","params":[[0.440164,-0.00249391,0.398658,2.45651,0,1.5708],[0.440164,0.166256,0.297599,2.45651,0,1.5708],1.2,0.25,0,0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int moveCircle(const std::vector &via_pose, + const std::vector &end_pose, double a, double v, + double blend_radius, double duration); + + /** + * \chinese + * moveCircle 与外部轴同步运动 + * + * @param group_name 外部轴组名称 + * @param via_pose 圆弧运动途中点的位姿 + * @param end_pose 圆弧运动结束点的位姿 + * @param a 加速度 + * @param v 速度 + * @param blend_radius 交融半径 + * @param duration 运行时间 + * @return + * \endchinese + * \english + * moveCircle with external axes synchronized motion + * + * @param group_name Name of the external axis group + * @param via_pose The pose of the via point during the arc motion + * @param end_pose The pose of the end point of the arc motion + * @param a Acceleration + * @param v Velocity + * @param blend_radius Blend radius + * @param duration Execution time + * @return + * \endenglish + */ + int moveCircleWithAxisGroup(const std::vector &via_pose, + const std::vector &end_pose, double a, + double v, double blend_radius, double duration, + const std::string &group_name, + const std::vector &extq); + + /** + * \chinese + * 设置圆弧路径模式 + * + * @param mode 模式 \n + * 0:工具姿态相对于圆弧路径点坐标系保持不变 \n + * 1:姿态线性变化,绕着空间定轴转动,从起始点姿态变化到目标点姿态 \n + * 2:从起点姿态开始经过中间点姿态,变化到目标点姿态 + * @return 成功返回0;失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setCirclePathMode(self: pyaubo_sdk.MotionControl, arg0: int) -> int + * + * @par Lua函数原型 + * setCirclePathMode(mode: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setCirclePathMode","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set circle path mode + * + * @param mode Mode \n + * 0: Tool orientation remains unchanged relative to the arc path point coordinate system \n + * 1: Orientation changes linearly, rotating around a fixed axis in space, from the start orientation to the target orientation \n + * 2: Orientation changes from the start orientation, through the via point orientation, to the target orientation + * @return Returns 0 on success; otherwise returns an error code + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setCirclePathMode(self: pyaubo_sdk.MotionControl, arg0: int) -> int + * + * @par Lua function prototype + * setCirclePathMode(mode: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setCirclePathMode","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setCirclePathMode(int mode); + + /** + * \chinese + * 高级圆弧或者圆周运动 + * + * @param param 圆周运动参数 + * @return 成功返回0;失败返回错误码 + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * moveCircle2(self: pyaubo_sdk.MotionControl, arg0: + * arcs::common_interface::CircleParameters) -> int + * + * @par Lua函数原型 + * moveCircle2(param: table) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.moveCircle2","params":[{"pose_via":[0.440164,-0.00249391,0.398658,2.45651,0,1.570], + * "pose_to":[0.440164,0.166256,0.297599,2.45651,0,1.5708],"a":1.2,"v":0.25,"blend_radius":0,"duration":0,"helix":0, + * "spiral":0,"direction":0,"loop_times":0}],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Advanced arc or circular motion + * + * @param param Circular motion parameters + * @return Returns 0 on success; otherwise returns an error code: + * AUBO_BAD_STATE + * AUBO_BUSY + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * moveCircle2(self: pyaubo_sdk.MotionControl, arg0: + * arcs::common_interface::CircleParameters) -> int + * + * @par Lua function prototype + * moveCircle2(param: table) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.moveCircle2","params":[{"pose_via":[0.440164,-0.00249391,0.398658,2.45651,0,1.570], + * "pose_to":[0.440164,0.166256,0.297599,2.45651,0,1.5708],"a":1.2,"v":0.25,"blend_radius":0,"duration":0,"helix":0, + * "spiral":0,"direction":0,"loop_times":0}],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int moveCircle2(const CircleParameters ¶m); + + /** + * \chinese + * 新建一个路径点缓存 + * + * @param name 指定路径的名字 + * @param type 路径的类型 \n + * 1: toppra 时间最优路径规划 \n + * 2: cubic_spline(录制的轨迹) \n + * 3: 关节B样条插值,最少三个点 + * @param size 缓存区大小 + * @return 新建成功返回 AUBO_OK(0) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathBufferAlloc(self: pyaubo_sdk.MotionControl, arg0: str, arg1: int, + * arg2: int) -> int + * + * @par Lua函数原型 + * pathBufferAlloc(name: string, type: number, size: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathBufferAlloc","params":["rec",2,3],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Create a new path point buffer + * + * @param name Name of the path + * @param type Type of the path \n + * 1: toppra time-optimal path planning \n + * 2: cubic_spline (recorded trajectory) \n + * 3: Joint B-spline interpolation, at least three points + * @param size Buffer size + * @return Returns AUBO_OK(0) on success + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathBufferAlloc(self: pyaubo_sdk.MotionControl, arg0: str, arg1: int, + * arg2: int) -> int + * + * @par Lua function prototype + * pathBufferAlloc(name: string, type: number, size: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathBufferAlloc","params":["rec",2,3],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int pathBufferAlloc(const std::string &name, int type, int size); + + /** + * \chinese + * 向路径缓存添加路点 + * + * @param name 路径缓存的名字 + * @param waypoints 路点 + * @return 成功返回0;失败返回错误码 + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathBufferAppend(self: pyaubo_sdk.MotionControl, arg0: str, arg1: + * List[List[float]]) -> int + * + * @par Lua函数原型 + * pathBufferAppend(name: string, waypoints: table) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathBufferAppend","params":["rec",[[-0.000000,0.000009,-0.000001,0.000002,0.000002,0.000000],[-0.000001,0.000010,-0.000002,0.000000,0.000003,0.000002]]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Add waypoints to the path buffer + * + * @param name Name of the path buffer + * @param waypoints Waypoints + * @return Returns 0 on success; otherwise returns an error code + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathBufferAppend(self: pyaubo_sdk.MotionControl, arg0: str, arg1: + * List[List[float]]) -> int + * + * @par Lua function prototype + * pathBufferAppend(name: string, waypoints: table) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathBufferAppend","params":["rec",[[-0.000000,0.000009,-0.000001,0.000002,0.000002,0.000000],[-0.000001,0.000010,-0.000002,0.000000,0.000003,0.000002]]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int pathBufferAppend(const std::string &name, + const std::vector> &waypoints); + + /** + * \chinese + * 计算、优化等耗时操作,传入的参数相同时不会重新计算 + * + * @param name 通过pathBufferAlloc新建的路径点缓存的名字 + * @param a 关节加速度限制,需要和机器人自由度大小相同,单位 rad/s^2 + * @param v 关节速度限制,需要和机器人自由度大小相同,单位 rad/s + * @param t 时间 \n + * pathBufferAlloc 这个接口分配内存的时候要指定类型, + * 根据pathBufferAlloc这个接口的类型:\n + * 类型为1时,表示运动持续时间\n + * 类型为2时,表示采样时间间隔\n + * 类型为3时:t表示运动持续时间\n + * 若 t=0, 则由使用软件内部默认的时间(推荐使用)\n + * 若 t!=0, t需要设置为 路径点数*相邻点时间间隔(points * + * interval,interval >= 0.01) + * @return 成功返回0;失败返回错误码 + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathBufferEval(self: pyaubo_sdk.MotionControl, arg0: str, arg1: + * List[float], arg2: List[float], arg3: float) -> int + * + * @par Lua函数原型 + * pathBufferEval(name: string, a: table, v: table, t: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathBufferEval","params":["rec",[1,1,1,1,1,1],[1,1,1,1,1,1],0.02],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Perform computation and optimization (time-consuming operations). If the input parameters are the same, the calculation will not be repeated. + * + * @param name Name of the path point buffer created by pathBufferAlloc + * @param a Joint acceleration limits, must match the robot DOF, unit: rad/s^2 + * @param v Joint velocity limits, must match the robot DOF, unit: rad/s + * @param t Time \n + * When allocating memory with pathBufferAlloc, the type must be specified. + * According to the type in pathBufferAlloc:\n + * Type 1: t means motion duration\n + * Type 2: t means sampling interval\n + * Type 3: t means motion duration\n + * If t=0, the internal default time is used (recommended)\n + * If t!=0, t should be set to number_of_points * interval_between_points (interval >= 0.01) + * @return Returns 0 on success; otherwise returns an error code + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathBufferEval(self: pyaubo_sdk.MotionControl, arg0: str, arg1: + * List[float], arg2: List[float], arg3: float) -> int + * + * @par Lua function prototype + * pathBufferEval(name: string, a: table, v: table, t: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathBufferEval","params":["rec",[1,1,1,1,1,1],[1,1,1,1,1,1],0.02],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int pathBufferEval(const std::string &name, const std::vector &a, + const std::vector &v, double t); + + /** + * \chinese + * 指定名字的buffer是否有效 + * + * buffer需要满足三个条件有效: \n + * 1、buffer存在,已经分配过内存 \n + * 2、传进buffer的点要大于等于buffer的大小 \n + * 3、要执行一次pathBufferEval + * + * @param name buffer的名字 + * @return 有效返回true; 无效返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathBufferValid(self: pyaubo_sdk.MotionControl, arg0: str) -> bool + * + * @par Lua函数原型 + * pathBufferValid(name: string) -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathBufferValid","params":["rec"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * \endchinese + * \english + * Whether the buffer with the specified name is valid + * + * The buffer must meet three conditions to be valid: \n + * 1. The buffer exists and memory has been allocated \n + * 2. The number of points passed into the buffer must be greater than or equal to the buffer size \n + * 3. pathBufferEval must be executed once + * + * @param name Name of the buffer + * @return Returns true if valid; false otherwise + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathBufferValid(self: pyaubo_sdk.MotionControl, arg0: str) -> bool + * + * @par Lua function prototype + * pathBufferValid(name: string) -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathBufferValid","params":["rec"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * \endenglish + */ + bool pathBufferValid(const std::string &name); + + /** + * \chinese + * 释放路径缓存 + * + * @param name 缓存路径的名字 + * @return 成功返回0;失败返回错误码 + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathBufferFree(self: pyaubo_sdk.MotionControl, arg0: str) -> int + * + * @par Lua函数原型 + * pathBufferFree(name: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathBufferFree","params":["rec"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":-5} + * + * \endchinese + * \english + * Release path buffer + * + * @param name Name of the path buffer + * @return Returns 0 on success; otherwise returns an error code + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathBufferFree(self: pyaubo_sdk.MotionControl, arg0: str) -> int + * + * @par Lua function prototype + * pathBufferFree(name: string) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathBufferFree","params":["rec"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":-5} + * + * \endenglish + */ + int pathBufferFree(const std::string &name); + + /** + * \chinese + * 关节空间路径滤波器 + * + * @brief pathBufferFilter + * + * @param name 缓存路径的名称 + * @param order 滤波器阶数(一般取2) + * @param fd 截止频率,越小越光滑,但是延迟会大(一般取3-20) + * @param fs 离散数据的采样频率(一般取20-500) + * + * @return 成功返回0 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathBufferFilter(self: pyaubo_sdk.MotionControl, arg0: str, arg1: int, + * arg2: float, arg3: float) -> int + * + * @par Lua函数原型 + * pathBufferFilter(name: string, order: number, fd: number, fs:number) -> nil + * \endchinese + * \english + * Joint space path filter + * + * @brief pathBufferFilter + * + * @param name Name of the path buffer + * @param order Filter order (usually 2) + * @param fd Cutoff frequency, the smaller the smoother but with more delay (usually 3-20) + * @param fs Sampling frequency of discrete data (usually 20-500) + * + * @return Returns 0 on success + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathBufferFilter(self: pyaubo_sdk.MotionControl, arg0: str, arg1: int, + * arg2: float, arg3: float) -> int + * + * @par Lua function prototype + * pathBufferFilter(name: string, order: number, fd: number, fs:number) -> nil + * \endenglish + */ + int pathBufferFilter(const std::string &name, int order, double fd, + double fs); + + /** + * \chinese + * 列出所有缓存路径的名字 + * + * @return 返回所有缓存路径的名字 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathBufferList(self: pyaubo_sdk.MotionControl) -> List[str] + * + * @par Lua函数原型 + * pathBufferList() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathBufferList","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[]} + * + * \endchinese + * \english + * List all cached path names + * + * @return Returns all cached path names + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathBufferList(self: pyaubo_sdk.MotionControl) -> List[str] + * + * @par Lua function prototype + * pathBufferList() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.pathBufferList","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[]} + * + * \endenglish + */ + std::vector pathBufferList(); + + /** + * \chinese + * 执行缓存的路径 + * + * @param name 缓存路径的名字 + * @return 成功返回0;失败返回错误码 + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * movePathBuffer(self: pyaubo_sdk.MotionControl, arg0: str) -> int + * + * @par Lua函数原型 + * movePathBuffer(name: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.movePathBuffer","params":["rec"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Execute the cached path + * + * @param name Name of the cached path + * @return Returns 0 on success; otherwise returns an error code + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * movePathBuffer(self: pyaubo_sdk.MotionControl, arg0: str) -> int + * + * @par Lua function prototype + * movePathBuffer(name: string) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.movePathBuffer","params":["rec"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int movePathBuffer(const std::string &name); + + /** + * \chinese + * 相贯线接口 + * + * @param pose 由三个示教位姿组成(首先需要运动到起始点,起始点的要求:过主圆柱 + * 柱体轴心且与子圆柱体轴线平行的平面与子圆柱体在底部的交点) + * p1:过子圆柱体轴线且与大圆柱体轴线平行的平面,与小圆柱体在左侧顶部的交点 + * p2:过子圆柱体轴线且与大圆柱体轴线平行的平面,与大圆柱体在左侧底部的交点 + * p3:过子圆柱体轴线且与大圆柱体轴线平行的平面,与大圆柱体在右侧底部的交点 + * @param v 速度 + * @param a 加速度 + * @param main_pipe_radius 主圆柱体半径 + * @param sub_pipe_radius 子圆柱体半径 + * @param normal_distance 两圆柱体轴线距离 + * @param normal_alpha 两圆柱体轴线的夹角 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * moveIntersection(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float, arg3: float, arg4: float, arg5: float, arg6: float) -> int + * + * @par Lua函数原型 + * moveIntersection(poses: table, a: number, v: number, + * main_pipe_radius: number, sub_pipe_radius: number, normal_distance: number, normal_alpha: number) -> nil + * \endchinese + * \english + * Intersection interface + * + * @param poses Consists of three taught poses (first, move to the starting point. The starting point requirement: the intersection of the plane passing through the main cylinder axis and parallel to the sub-cylinder axis with the sub-cylinder at the bottom) + * p1: Intersection of the plane passing through the sub-cylinder axis and parallel to the main cylinder axis with the sub-cylinder at the left top + * p2: Intersection of the plane passing through the sub-cylinder axis and parallel to the main cylinder axis with the main cylinder at the left bottom + * p3: Intersection of the plane passing through the sub-cylinder axis and parallel to the main cylinder axis with the main cylinder at the right bottom + * @param v Velocity + * @param a Acceleration + * @param main_pipe_radius Main cylinder radius + * @param sub_pipe_radius Sub cylinder radius + * @param normal_distance Distance between the two cylinder axes + * @param normal_alpha Angle between the two cylinder axes + * + * @return Returns 0 on success; otherwise returns an error code + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * moveIntersection(self: pyaubo_sdk.MotionControl, arg0: List[float], arg1: + * float, arg2: float, arg3: float, arg4: float, arg5: float, arg6: float) -> int + * + * @par Lua function prototype + * moveIntersection(poses: table, a: number, v: number, + * main_pipe_radius: number, sub_pipe_radius: number, normal_distance: number, normal_alpha: number) -> nil + * \endenglish + */ + int moveIntersection(const std::vector> &poses, + double a, double v, double main_pipe_radius, + double sub_pipe_radius, double normal_distance, + double normal_alpha); + /** + * \chinese + * 关节空间停止运动 + * + * @param acc 关节加速度,单位: rad/s^2 + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * stopJoint(self: pyaubo_sdk.MotionControl, arg0: float) -> int + * + * @par Lua函数原型 + * stopJoint(acc: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.stopJoint","params":[31],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Stop motion in joint space + * + * @param acc Joint acceleration, unit: rad/s^2 + * @return Returns 0 on success; otherwise returns an error code + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * stopJoint(self: pyaubo_sdk.MotionControl, arg0: float) -> int + * + * @par Lua function prototype + * stopJoint(acc: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.stopJoint","params":[31],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int stopJoint(double acc); + + /** + * \chinese + * 关节空间停止运动(机械臂运行工程时发生碰撞,通过resumeSpeedJoint接口移动到安全位置后需要停止时调用此接口) + * + * @param acc 关节加速度,单位: rad/s^2 + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * resumeStopJoint(self: pyaubo_sdk.MotionControl, arg0: float) -> int + * + * @par Lua函数原型 + * resumeStopJoint(acc: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.resumeStopJoint","params":[31],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":-1} + * + * \endchinese + * \english + * Stop motion in joint space (used after moving to a safe position via resumeSpeedJoint following a collision during process execution) + * + * @param acc Joint acceleration, unit: rad/s^2 + * @return Returns 0 on success; otherwise returns an error code + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * resumeStopJoint(self: pyaubo_sdk.MotionControl, arg0: float) -> int + * + * @par Lua function prototype + * resumeStopJoint(acc: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.resumeStopJoint","params":[31],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":-1} + * + * \endenglish + */ + int resumeStopJoint(double acc); + + /** + * \chinese + * 停止 moveLine/moveCircle 等在笛卡尔空间的运动 + * + * @param acc 工具加速度, 单位: m/s^2 + * @param acc_rot + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * stopLine(self: pyaubo_sdk.MotionControl, arg0: float, arg1: float) -> int + * + * @par Lua函数原型 + * stopLine(acc: number, acc_rot: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.stopLine","params":[10,10],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Stop motions in Cartesian space such as moveLine/moveCircle. + * + * @param acc Tool acceleration, unit: m/s^2 + * @param acc_rot + * @return Returns 0 on success; otherwise returns an error code + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * stopLine(self: pyaubo_sdk.MotionControl, arg0: float, arg1: float) -> int + * + * @par Lua function prototype + * stopLine(acc: number, acc_rot: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.stopLine","params":[10,10],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int stopLine(double acc, double acc_rot); + + /** + * \chinese + * 笛卡尔空间停止运动(机械臂运行工程时发生碰撞,通过resumeSpeedLine接口移动到安全位置后需要停止时调用此接口) + * + * @param acc 位置加速度, 单位: m/s^2 + * @param acc_rot 姿态加速度,单位: rad/s^2 + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * resumeStopLine(self: pyaubo_sdk.MotionControl, arg0: float, arg1: float) + * -> int + * + * @par Lua函数原型 + * resumeStopLine(acc: number, acc_rot: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.resumeStopLine","params":[10,10],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":-1} + * + * \endchinese + * \english + * Stop motion in Cartesian space (used after moving to a safe position via resumeSpeedLine following a collision during process execution) + * + * @param acc Position acceleration, unit: m/s^2 + * @param acc_rot Orientation acceleration, unit: rad/s^2 + * @return Returns 0 on success; otherwise returns an error code + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * resumeStopLine(self: pyaubo_sdk.MotionControl, arg0: float, arg1: float) -> int + * + * @par Lua function prototype + * resumeStopLine(acc: number, acc_rot: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.resumeStopLine","params":[10,10],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":-1} + * + * \endenglish + */ + int resumeStopLine(double acc, double acc_rot); + + /** + * \chinese + * 开始摆动: weaveStart 和 weaveEnd 的 moveLine/moveCircle 将根据 params + * 进行摆动 + * + * @param params Json字符串用于定义摆动参数 + * { + * "type": , // "SINE" "SPIRAL" "TRIANGLE" "TRAPEZOIDAL" + * "step": , + * "amplitude": {,}, + * "hold_distance": {,}, + * "angle": + * "direction": + * } + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Start weaving: moveLine/moveCircle between weaveStart and weaveEnd will perform weaving according to params + * + * @param params Json string to define weaving parameters + * { + * "type": , // "SINE" "SPIRAL" "TRIANGLE" "TRAPEZOIDAL" + * "step": , + * "amplitude": {,}, + * "hold_distance": {,}, + * "angle": + * "direction": + * } + * @return Returns 0 on success; otherwise returns an error code + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int weaveStart(const std::string ¶ms); + + /** + * \chinese + * 结束摆动 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.weaveEnd","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * End weaving + * + * @return Returns 0 on success; otherwise returns an error code + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.weaveEnd","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int weaveEnd(); + + /** + * \chinese + * 设置未来路径上点的采样时间间隔 + * + * @param sample_time 采样时间间隔 单位: m/s^2 + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Set the sampling interval for points on the future path + * + * @param sample_time Sampling interval, unit: m/s^2 + * @return Returns 0 on success; otherwise returns an error code + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int setFuturePointSamplePeriod(double sample_time); + + /** + * \chinese + * 获取未来路径上的轨迹点 + * + * @return 路点(100ms * 10) + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getFuturePathPointsJoint","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[]} + * + * \endchinese + * \english + * Get trajectory points on the future path + * + * @return Waypoints (100ms * 10) + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getFuturePathPointsJoint","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[]} + * + * \endenglish + */ + std::vector> getFuturePathPointsJoint(); + + /** + * \chinese + * 设置传送带编码器参数 + * + * @param encoder_id 预留 + * @param tick_per_meter + * 线性传送带===>一米的脉冲值 + * 环形传送带===>一圈的脉冲值 + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setConveyorTrackEncoder(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua函数原型 + * setConveyorTrackEncoder -> int + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setConveyorTrackEncoder","params":[1,40000],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set conveyor encoder parameters + * + * @param encoder_id Reserved + * @param tick_per_meter + * Linear conveyor: pulses per meter + * Circular conveyor: pulses per revolution + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setConveyorTrackEncoder(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua function prototype + * setConveyorTrackEncoder -> int + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setConveyorTrackEncoder","params":[1,40000],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setConveyorTrackEncoder(int encoder_id, int tick_per_meter); + /** + * \chinese + * 圆形传送带跟随 + * + * @note 暂未实现 + * + * @param encoder_id + * 0-集成传感器 + * @param rotate_tool + * @return + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Circular conveyor tracking + * + * @note Not implemented yet + * + * @param encoder_id + * 0 - integrated sensor + * @param rotate_tool + * @return + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int conveyorTrackCircle(int encoder_id, const std::vector ¢er, + bool rotate_tool); + + /** + * \chinese + * 线性传送带跟随 + * + * @param encoder_id 预留 + * @param direction 传送带相对机器人基坐标系的移动方向 + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * conveyorTrackLine(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua函数原型 + * conveyorTrackLine -> int + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.conveyorTrackLine","params":[1,[1.0,0.0,0.0,0.0,0.0,0.0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Linear conveyor tracking + * + * @param encoder_id Reserved + * @param direction The movement direction of the conveyor relative to the robot base coordinate system + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * conveyorTrackLine(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua function prototype + * conveyorTrackLine -> int + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.conveyorTrackLine","params":[1,[1.0,0.0,0.0,0.0,0.0,0.0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int conveyorTrackLine(int encoder_id, const std::vector &direction); + + /** + * \chinese + * 终止传送带跟随 + * + * @param encoder_id 预留 + * @param a 预留 + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * conveyorTrackStop(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua函数原型 + * conveyorTrackStop -> int + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.conveyorTrackStop","params":[0,1.0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Stop conveyor tracking + * + * @param encoder_id Reserved + * @param a Reserved + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * conveyorTrackStop(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua function prototype + * conveyorTrackStop -> int + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.conveyorTrackStop","params":[0,1.0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int conveyorTrackStop(int encoder_id, double a); + + /** + * \chinese + * 切换传送带追踪物品 + * 如果当前物品正在处于跟踪状态,则将该物品出队,不再跟踪,返回true + * 如果没有物品正在处于跟踪状态,返回false + * + * @return + * + * @throws arcs::common_interface::AuboException + * + * @param encoder_id 预留 + * + * @par Python函数原型 + * conveyorTrackSwitch(self: pyaubo_sdk.MotionControl) -> bool + * + * @par Lua函数原型 + * conveyorTrackSwitch() -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.conveyorTrackSwitch","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endchinese + * \english + * Switch conveyor tracking item. + * If the current item is being tracked, it will be dequeued and no longer tracked, returning true. + * If no item is currently being tracked, returns false. + * + * @return + * + * @throws arcs::common_interface::AuboException + * + * @param encoder_id Reserved + * + * @par Python function prototype + * conveyorTrackSwitch(self: pyaubo_sdk.MotionControl) -> bool + * + * @par Lua function prototype + * conveyorTrackSwitch() -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.conveyorTrackSwitch","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endenglish + */ + bool conveyorTrackSwitch(int encoder_id); + + /** + * \chinese + * 传送带上是否有物品可以跟踪 + * @param encoder_id 预留 + * @return + * 如果队列第一个物品为跟踪状态,返回true + * 如果队列第一个物品不为跟踪状态,则对队列中其余物品进行是否在启动窗口内的判断 + * 超出启动窗口则出队,直到有物品处于启动窗口内,使其变为跟踪状态返回true, + * 队列中没有一个物品在启动窗口内返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * hasItemOnConveyorToTrack(self: pyaubo_sdk.MotionControl) -> bool + * + * @par Lua函数原型 + * hasItemOnConveyorToTrack() -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.hasItemOnConveyorToTrack","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":{true}} + * \endchinese + * \english + * Whether there is an item on the conveyor that can be tracked + * @param encoder_id Reserved + * @return + * If the first item in the queue is in tracking state, returns true. + * If the first item is not in tracking state, checks the rest of the queue for items within the start window. + * Items outside the start window are dequeued until an item is found within the window, which is then set to tracking state and returns true. + * If no item in the queue is within the start window, returns false. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * hasItemOnConveyorToTrack(self: pyaubo_sdk.MotionControl) -> bool + * + * @par Lua function prototype + * hasItemOnConveyorToTrack() -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.hasItemOnConveyorToTrack","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":{true}} + * \endenglish + */ + bool hasItemOnConveyorToTrack(int encoder_id); + + /** + * \chinese + * 增加传送带队列 + * + * @param encoder_id 预留 + * @param offset 当前物品点位相对于模板物品点位的偏移值 + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * conveyorTrackCreatItem(self: pyaubo_sdk.MotionControl, arg0: int, arg1:int, arg2: + * List[float]) -> int + * + * @par Lua函数原型 + * conveyorTrackCreatItem(encoder_id: number, item_id: number, offset: table) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.conveyorTrackCreatItem","params":[0,2, {0.0,0.0,0.0,0.0,0.0,0.0}],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * \endchinese + * \english + * Add an item to the conveyor queue + * + * @param encoder_id Reserved + * @param offset Offset of the current item position relative to the template item position + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * conveyorTrackCreatItem(self: pyaubo_sdk.MotionControl, arg0: int, arg1:int, arg2: + * List[float]) -> int + * + * @par Lua function prototype + * conveyorTrackCreatItem(encoder_id: number, item_id: number, offset: table) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.conveyorTrackCreatItem","params":[0,2, {0.0,0.0,0.0,0.0,0.0,0.0}],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * \endenglish + */ + int conveyorTrackCreatItem(int encoder_id, int item_id, + const std::vector &offset); + /** + * \chinese + * 设置传送带跟踪的补偿值 + * + * @param encoder_id 预留 + * @param comp 传送带补偿值 + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setConveyorTrackCompensate(self: pyaubo_sdk.MotionControl, arg0: int, + * arg1: float) -> int + * + * @par Lua函数原型 + * setConveyorTrackCompensate(comp: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setConveyorTrackCompensate","params":[0, + * 0.1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set the compensation value for conveyor tracking + * + * @param encoder_id Reserved + * @param comp Conveyor compensation value + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setConveyorTrackCompensate(self: pyaubo_sdk.MotionControl, arg0: int, + * arg1: float) -> int + * + * @par Lua function prototype + * setConveyorTrackCompensate(comp: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setConveyorTrackCompensate","params":[0, + * 0.1],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setConveyorTrackCompensate(int encoder_id, double comp); + + /** + * \chinese + * 判断传送带与机械臂之间是否达到相对静止 + * + * @param encoder_id 预留 + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * isConveyorTrackSync(self: pyaubo_sdk.MotionControl, arg0: int) -> bool + * + * @par Lua函数原型 + * isConveyorTrackSync(encoder_id: number) -> bool + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.isConveyorTrackSync","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endchinese + * \english + * Determine whether the conveyor and the robot arm have reached relative rest + * + * @param encoder_id Reserved + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * isConveyorTrackSync(self: pyaubo_sdk.MotionControl, arg0: int) -> bool + * + * @par Lua function prototype + * isConveyorTrackSync(encoder_id: number) -> bool + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.isConveyorTrackSync","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endenglish + */ + bool isConveyorTrackSync(int encoder_id); + + /** + * \chinese + * 设置传送带跟踪的最大距离限制 + * + * @param encoder_id 预留 + * @param limit + * 传送带跟踪的最大距离限制,单位:米 + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setConveyorTrackLimit(self: pyaubo_sdk.MotionControl, arg0: int, arg1: + * double) -> int + * + * @par Lua函数原型 + * setConveyorTrackLimit(encoder_id: number, limit: number) -> int + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setConveyorTrackLimit","params":[0, + * 1.5],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set the maximum distance limit for conveyor tracking + * + * @param encoder_id Reserved + * @param limit + * Maximum distance limit for conveyor tracking, unit: meter + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setConveyorTrackLimit(self: pyaubo_sdk.MotionControl, arg0: int, arg1: + * double) -> int + * + * @par Lua function prototype + * setConveyorTrackLimit(encoder_id: number, limit: number) -> int + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setConveyorTrackLimit","params":[0, + * 1.5],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setConveyorTrackLimit(int encoder_id, double limit); + + /** + * \chinese + * 设置传送带跟踪的启动窗口 + * + * @param encoder_id 预留 + * @param min_window + * 启动窗口的起始位置,单位:米 + * @param max_window + * 启动窗口的结束位置,单位:米 + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setConveyorTrackStartWindow(self: pyaubo_sdk.MotionControl, arg0: int, + * arg1: double, arg2: double) -> int + * + * @par Lua函数原型 + * setConveyorTrackStartWindow(encoder_id: number, min_window: number, + * max_window: number) -> int + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setConveyorTrackStartWindow","params":[0, + * 0.2, 1.0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the start window for conveyor tracking + * + * @param encoder_id Reserved + * @param min_window + * Start position of the window, unit: meter + * @param max_window + * End position of the window, unit: meter + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setConveyorTrackStartWindow(self: pyaubo_sdk.MotionControl, arg0: int, + * arg1: double, arg2: double) -> int + * + * @par Lua function prototype + * setConveyorTrackStartWindow(encoder_id: number, min_window: number, + * max_window: number) -> int + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setConveyorTrackStartWindow","params":[0, + * 0.2, 1.0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setConveyorTrackStartWindow(int encoder_id, double window_min, + double window_max); + + /** + * \chinese + * 设置传送带示教位置到同步开关之间的距离 + * + * @param encoder_id 预留 + * @param offset + * 传送带示教位置到同步开关之间的距离,单位:米 + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setConveyorTrackSensorOffset(self: pyaubo_sdk.MotionControl, arg0: int, + * arg1: double) -> int + * + * @par Lua函数原型 + * setConveyorTrackSensorOffset(encoder_id: number, offset: number) -> int + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setConveyorTrackSensorOffset","params":[0, + * 0.2],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set the distance from the conveyor teaching position to the sync switch + * + * @param encoder_id Reserved + * @param offset + * Distance from the conveyor teaching position to the sync switch, unit: meter + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setConveyorTrackSensorOffset(self: pyaubo_sdk.MotionControl, arg0: int, + * arg1: double) -> int + * + * @par Lua function prototype + * setConveyorTrackSensorOffset(encoder_id: number, offset: number) -> int + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setConveyorTrackSensorOffset","params":[0, + * 0.2],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setConveyorTrackSensorOffset(int encoder_id, double offset); + + /** + * \chinese + * 设置传送带同步分离,用于过滤掉同步开关中不需要的信号 + * + * @param encoder_id 预留 + * @param distance + * 从出现一个同步信号后到把一个新的同步信号接受为一个有效对象前走的最短距离,单位:米 + * @param time + * 从出现一个同步信号后到把一个新的同步信号接受为一个有效对象前走的最短时间,单位:秒 + * + * distance和time设置数值大于0即为生效 + * 当distance与time同时设置时,优先生效distance + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setConveyorTrackSyncSeparation(self: pyaubo_sdk.MotionControl, arg0: int, + * arg1: double, arg2: double) -> int + * + * @par Lua函数原型 + * setConveyorTrackSyncSeparation(encoder_id: number, distance: number, + * time: number) -> int + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setConveyorTrackSyncSeparation","params":[0, + * 0.05, 0.2],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set conveyor sync separation, used to filter out unwanted signals from the sync switch. + * + * @param encoder_id Reserved + * @param distance + * The minimum distance to travel after a sync signal appears before accepting a new sync signal as a valid object, unit: meter + * @param time + * The minimum time to elapse after a sync signal appears before accepting a new sync signal as a valid object, unit: second + * + * If distance and time are both set greater than 0, the setting takes effect. + * If both distance and time are set, distance takes precedence. + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setConveyorTrackSyncSeparation(self: pyaubo_sdk.MotionControl, arg0: int, + * arg1: double, arg2: double) -> int + * + * @par Lua function prototype + * setConveyorTrackSyncSeparation(encoder_id: number, distance: number, + * time: number) -> int + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setConveyorTrackSyncSeparation","params":[0, + * 0.05, 0.2],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setConveyorTrackSyncSeparation(int encoder_id, double distance, + double time); + + /** + * \chinese + * 传送带上工件的移动距离是否超过最大限值 + * + * @param encoder_id 预留 + * @return + * true : 移动距离超过了最大限值 + * false : 移动距离没有超过了最大限值 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * isConveyorTrackExceed(self: pyaubo_sdk.MotionControl, arg0: int) -> bool + * + * @par Lua函数原型 + * isConveyorTrackExceed(encoder_id: number) -> bool + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.isConveyorTrackExceed","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * \endchinese + * \english + * Whether the workpiece on the conveyor has moved beyond the maximum limit + * + * @param encoder_id Reserved + * @return + * true : The movement distance exceeds the maximum limit + * false : The movement distance does not exceed the maximum limit + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * isConveyorTrackExceed(self: pyaubo_sdk.MotionControl, arg0: int) -> bool + * + * @par Lua function prototype + * isConveyorTrackExceed(encoder_id: number) -> bool + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.isConveyorTrackExceed","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * \endenglish + */ + bool isConveyorTrackExceed(int encoder_id); + + /** + * \chinese + * 清空传动带队列中的所有对象 + * + * @param encoder_id 预留 + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * conveyorTrackClearItems(self: pyaubo_sdk.MotionControl, arg0: int) -> int + * + * @par Lua函数原型 + * conveyorTrackClearItems(encoder_id: number) -> int + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.conveyorTrackClearItems","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Clear all items in the conveyor queue + * + * @param encoder_id Reserved + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * conveyorTrackClearItems(self: pyaubo_sdk.MotionControl, arg0: int) -> int + * + * @par Lua function prototype + * conveyorTrackClearItems(encoder_id: number) -> int + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.conveyorTrackClearItems","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int conveyorTrackClearItems(int encoder_id); + + /** + * \chinese + * 获取传送带队列的编码器值 + * + * @param encoder_id 预留 + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getConveyorTrackQueue(self: pyaubo_sdk.MotionControl, arg0: int) -> List[int] + * @par Lua函数原型 + * getConveyorTrackQueue(encoder_id: number) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getConveyorTrackQueue","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":{[-500,-200,150,-50]}} + * \endchinese + * \english + * Get encoder values of the conveyor queue + * + * @param encoder_id Reserved + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getConveyorTrackQueue(self: pyaubo_sdk.MotionControl, arg0: int) -> List[int] + * @par Lua function prototype + * getConveyorTrackQueue(encoder_id: number) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getConveyorTrackQueue","params":[0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":{[-500,-200,150,-50]}} + * \endenglish + */ + std::vector getConveyorTrackQueue(int encoder_id); + /** + * \chinese + * 获取下一个跟踪的传送带物品的id + * + * @param encoder_id 预留 + * @return + * 返回物品id,没有next item返回 -1 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getConveyorTrackNextItem(self: pyaubo_sdk.MotionControl, arg0: int) -> int + * @par Lua函数原型 + * getConveyorTrackNextItem(encoder_id: number) -> int + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getConveyorTrackNextItem","params":[0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":{10}} + * \endchinese + * \english + * Get the ID of the next item on the conveyor to be tracked + * + * @param encoder_id Reserved + * @return + * Returns the item ID; returns -1 if there is no next item + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getConveyorTrackNextItem(self: pyaubo_sdk.MotionControl, arg0: int) -> int + * @par Lua function prototype + * getConveyorTrackNextItem(encoder_id: number) -> int + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getConveyorTrackNextItem","params":[0],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":{10}} + * \endenglish + */ + + int getConveyorTrackNextItem(int encoder_id); + + /** + * \chinese + * 螺旋线运动 + * + * @param param 封装的参数 + * @param blend_radius + * @param v + * @param a + * @param t + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.moveSpiral", + * "params":[{"spiral":0.005,"helix":0.005,"angle":18.84,"plane":0,"frame":[0,0,0,0,0,0]},0,0.25,1.2,0],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Spiral motion + * + * @param param Encapsulated parameters + * @param blend_radius + * @param v + * @param a + * @param t + * @return Returns 0 on success; otherwise returns an error code + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.moveSpiral", + * "params":[{"spiral":0.005,"helix":0.005,"angle":18.84,"plane":0,"frame":[0,0,0,0,0,0]},0,0.25,1.2,0],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int moveSpiral(const SpiralParameters ¶m, double blend_radius, double v, + double a, double t); + + /** + * \chinese + * 获取前瞻段数 + * + * @return 返回前瞻段数 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getLookAheadSize(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua函数原型 + * getLookAheadSize() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getLookAheadSize","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1} + * + * \endchinese + * \english + * Get look-ahead segment size + * + * @return Returns the look-ahead segment size + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getLookAheadSize(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua function prototype + * getLookAheadSize() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.getLookAheadSize","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1} + * + * \endenglish + */ + int getLookAheadSize(); + + /** + * \chinese + * 设置前瞻段数 + * 1.对于有较高速度平稳性要求的任务,如数控加工,涂胶,焊接等匀速需求,较长的前瞻段数可以提供更优的速度规划,产生的运动会更加平滑; + * 2.对于快速响应的抓取类任务,更倾向于较短的前瞻段数,以提高反应速度,但可能因为进给的路径不够及时导致速度波动很大. + * + * @return 成功返回0 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setLookAheadSize(self: pyaubo_sdk.MotionControl, arg0: int) -> int + * + * @par Lua函数原型 + * setLookAheadSize(eqradius: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setLookAheadSize","params":[1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set look-ahead segment size + * 1. For tasks requiring high speed smoothness, such as CNC machining, gluing, welding, etc., a longer look-ahead segment size can provide better speed planning and smoother motion. + * 2. For fast-response tasks such as picking, a shorter look-ahead segment size is preferred to improve response speed, but may cause large speed fluctuations due to insufficiently timely path feeding. + * + * @return Returns 0 on success + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setLookAheadSize(self: pyaubo_sdk.MotionControl, arg0: int) -> int + * + * @par Lua function prototype + * setLookAheadSize(eqradius: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.setLookAheadSize","params":[1],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setLookAheadSize(int size); + + /** + * \chinese + * 更新摆动过程中的频率和振幅 + * + * @param params Json字符串用于定义摆动参数 + * { + * "frequency": , + * "amplitude": {,} + * } + * + * @return 成功返回0 + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Update frequency and amplitude during weaving process + * + * @param params Json string used to define weaving parameters + * { + * "frequency": , + * "amplitude": {,} + * } + * + * @return Returns 0 on success + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int weaveUpdateParameters(const std::string ¶ms); + + /** + * \chinese + * 设置关节电流环刚度系数 + * + * @param stiffness 各个关节刚度系数,百分比。[0 -> 1],值越大,表现为越硬。 + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * enableJointSoftServo(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int + * + * @par Lua函数原型 + * enableJointSoftServo(stiffness: table) -> int + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.enableJointSoftServo","params":[[0.0,0.0,0.0,0.0,0.0,0.0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set joint current loop stiffness coefficient + * + * @param stiffness Stiffness coefficient for each joint, as a percentage [0 -> 1]. The larger the value, the stiffer the joint. + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * enableJointSoftServo(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int + * + * @par Lua function prototype + * enableJointSoftServo(stiffness: table) -> int + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.enableJointSoftServo","params":[[0.0,0.0,0.0,0.0,0.0,0.0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int enableJointSoftServo(const std::vector &stiffness); + + /** + * \chinese + * 关闭关节电流环刚度系数 + * + * @return 返回0表示成功,其他为错误码 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * disableJointSoftServo(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua函数原型 + * disableJointSoftServo() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.disableJointSoftServo","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1} + * \endchinese + * \english + * Disable joint current loop stiffness coefficient + * + * @return Returns 0 on success, otherwise error code + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * disableJointSoftServo(self: pyaubo_sdk.MotionControl) -> int + * + * @par Lua function prototype + * disableJointSoftServo() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.disableJointSoftServo","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1} + * \endenglish + */ + int disableJointSoftServo(); + + /** + * \chinese + * 判断关节电流环刚度系数是否使能 + * + * @return 已使能返回true,反之则返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * isJointSoftServoEnabled(self: pyaubo_sdk.MotionControl) -> bool + * + * @par Lua函数原型 + * isJointSoftServoEnabled() -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.MotionControl.isJointSoftServoEnabled","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1} + * \endchinese + * \english + * Determine whether the joint current loop stiffness coefficient is enabled. + * + * @return Returns true if enabled, otherwise returns false. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * isJointSoftServoEnabled(self: pyaubo_sdk.MotionControl) -> bool + * + * @par Lua function prototype + * isJointSoftServoEnabled() -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.MotionControl.isJointSoftServoEnabled","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1} + * \endenglish + */ + bool isJointSoftServoEnabled(); + +protected: + void *d_; +}; +using MotionControlPtr = std::shared_ptr; +} // namespace common_interface +} // namespace arcs + +#endif // AUBO_SDK_MOTION_CONTROL_INTERFACE_H diff --git a/third_party/AuboSdk/win/include/aubo/robot/robot_algorithm.h b/third_party/AuboSdk/win/include/aubo/robot/robot_algorithm.h new file mode 100644 index 00000000..f69ee306 --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo/robot/robot_algorithm.h @@ -0,0 +1,1118 @@ +/** @file robot_algorithm.h + * @brief 机器人算法相关的对外接口 + */ +#ifndef AUBO_SDK_ROBOT_ALGORITHM_INTERFACE_H +#define AUBO_SDK_ROBOT_ALGORITHM_INTERFACE_H + +#include +#include +#include +#include + +#include +#include + +namespace arcs { +namespace common_interface { + + +/** + * \chinese + * 机器人算法相关的对外接口 + * \endchinese + * \english + * Interfaces related to robot algorithms + * \endenglish + */ + +class ARCS_ABI_EXPORT RobotAlgorithm +{ +public: + RobotAlgorithm(); + virtual ~RobotAlgorithm(); + + /** + * \chinese + * 力传感器标定算法(三点标定法) + * + * @param force 力数据 + * @param q 关节角度 + * @return 标定结果 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * calibrateTcpForceSensor(self: pyaubo_sdk.RobotAlgorithm, arg0: + * List[List[float]], arg1: List[List[float]]) -> Tuple[List[float], + * List[float], float, List[float]] + * + * @par Lua函数原型 + * calibrateTcpForceSensor(force: table, q: table) -> table + * + * \endchinese + * \english + * Force sensor calibration algorithm (three-point calibration method) + * + * @param force Force data + * @param q Joint angles + * @return Calibration result + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * calibrateTcpForceSensor(self: pyaubo_sdk.RobotAlgorithm, arg0: + * List[List[float]], arg1: List[List[float]]) -> Tuple[List[float], + * List[float], float, List[float]] + * + * @par Lua function prototype + * calibrateTcpForceSensor(force: table, q: table) -> table + * + * \endenglish + */ + + ForceSensorCalibResult calibrateTcpForceSensor( + const std::vector> &forces, + const std::vector> &poses); + + /** + * \chinese + * 力传感器标定算法(三点标定法) + * @param forces + * @param poses + * @return force_offset, com, mass, angle error + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Force sensor calibration algorithm (three-point calibration method) + * @param forces + * @param poses + * @return force_offset, com, mass, angle error + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + ForceSensorCalibResultWithError calibrateTcpForceSensor2( + const std::vector> &forces, + const std::vector> &poses); + + /** + * \chinese + * 基于电流的负载辨识算法接口 + * + * 需要采集空载时运行激励轨迹的位置、速度、电流以及带负载时运行激励轨迹的位置、速度、电流 + * + * @param data_file_no_payload + * 空载时运行激励轨迹各关节数据的文件路径(.csv格式),共18列,依次为6个关节位置、6个关节速度、6个关节电流 + * @param data_file_with_payload + * 带负载运行激励轨迹各关节数据的文件路径(.csv格式),共18列,依次为6个关节位置、6个关节速度、6个关节电流 + * @return 辨识的结果 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * payloadIdentify(self: pyaubo_sdk.RobotAlgorithm, arg0: List[List[float]], + * arg1: List[List[float]]) -> Tuple[List[float], List[float], float, + * List[float]] + * + * @par Lua函数原型 + * payloadIdentify(data_with_payload: table, data_with_payload: table) -> + * table + * \endchinese + * \english + * Payload identification algorithm interface based on current + * + * Requires collecting position, velocity, and current data when running the excitation trajectory without load, as well as with load. + * + * @param data_file_no_payload + * File path of joint data when running the excitation trajectory without load (.csv format), 18 columns in total: 6 joint positions, 6 joint velocities, 6 joint currents + * @param data_file_with_payload + * File path of joint data when running the excitation trajectory with load (.csv format), 18 columns in total: 6 joint positions, 6 joint velocities, 6 joint currents + * @return Identification result + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * payloadIdentify(self: pyaubo_sdk.RobotAlgorithm, arg0: List[List[float]], + * arg1: List[List[float]]) -> Tuple[List[float], List[float], float, + * List[float]] + * + * @par Lua function prototype + * payloadIdentify(data_with_payload: table, data_with_payload: table) -> + * table + * \endenglish + */ + int payloadIdentify(const std::string &data_file_no_payload, + const std::string &data_file_with_payload); + + /** + * \chinese + * 新版基于电流的负载辨识算法接口 + * + * 需要采集带载时运行最少三个点的位置、速度、加速度、电流、温度、末端传感器数据、底座数据 + * + * @param data + * 带负载的各关节数据的文件路径(.csv格式),共42列,末端传感器数据、底座数据默认为0 + * @return 辨识的结果 + * \endchinese + * \english + * New version of payload identification algorithm interface based on current + * + * Requires collecting at least three points of position, velocity, acceleration, current, temperature, end sensor data, and base data when running with load + * + * @param data + * File path of joint data with load (.csv format), 42 columns in total, end sensor data and base data default to 0 + * @return Identification result + * \endenglish + */ + int payloadIdentify1(const std::string &file_name); + + /** + * \chinese + * 负载辨识是否计算完成 + * @return 完成返回0; 正在进行中返回1; 计算失败返回<0; + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.payloadCalculateFinished","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Whether payload identification calculation is finished + * @return 0 if finished; 1 if in progress; <0 if failed; + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.payloadCalculateFinished","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int payloadCalculateFinished(); + + /** + * \chinese + * 获取负载辨识结果 + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.getPayloadIdentifyResult","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,[],[],[]]} + * + * \endchinese + * \english + * Get the result of payload identification + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.getPayloadIdentifyResult","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,[],[],[]]} + * + * \endenglish + */ + Payload getPayloadIdentifyResult(); + + /** + * \chinese + * 关节摩擦力模型辨识算法接口 + * + * @param q 关节角度 + * @param qd 关节速度 + * @param qdd 关节加速度 + * @param temp 关节温度 + * @return 是否辨识成功 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * frictionModelIdentify(self: pyaubo_sdk.RobotAlgorithm, arg0: + * List[List[float]], arg1: List[List[float]], arg2: List[List[float]], + * arg3: List[List[float]]) -> bool + * + * @par Lua函数原型 + * frictionModelIdentify(q: table, qd: table, qdd: table, temp: table) -> + * boolean + * \endchinese + * \english + * Joint friction model identification algorithm interface + * + * @param q Joint positions + * @param qd Joint velocities + * @param qdd Joint accelerations + * @param temp Joint temperatures + * @return Whether identification succeeded + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * frictionModelIdentify(self: pyaubo_sdk.RobotAlgorithm, arg0: + * List[List[float]], arg1: List[List[float]], arg2: List[List[float]], + * arg3: List[List[float]]) -> bool + * + * @par Lua function prototype + * frictionModelIdentify(q: table, qd: table, qdd: table, temp: table) -> + * boolean + * \endenglish + */ + bool frictionModelIdentify(const std::vector> &q, + const std::vector> &qd, + const std::vector> &qdd, + const std::vector> &temp); + + /** + * \chinese + * 工件坐标系标定算法接口(需要在调用之前正确的设置机器人的TCP偏移) + * 输入多组关节角度和标定类型,输出工件坐标系位姿(相对于机器人基坐标系) + * + * @param q 关节角度 + * @param type 标定类型 + * @return 计算结果(工件坐标系位姿)以及错误代码 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * calibWorkpieceCoordinatePara(self: pyaubo_sdk.RobotAlgorithm, arg0: + * List[List[float]], arg1: int) -> Tuple[List[float], int] + * + * @par Lua函数原型 + * calibWorkpieceCoordinatePara(q: table, type: number) -> table, number + * \endchinese + * \english + * Workpiece coordinate calibration algorithm interface (requires correct TCP offset set before calling) + * Input multiple sets of joint angles and calibration type, output workpiece coordinate pose (relative to robot base) + * + * @param q Joint angles + * @param type Calibration type + * @return Calculation result (workpiece coordinate pose) and error code + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * calibWorkpieceCoordinatePara(self: pyaubo_sdk.RobotAlgorithm, arg0: + * List[List[float]], arg1: int) -> Tuple[List[float], int] + * + * @par Lua function prototype + * calibWorkpieceCoordinatePara(q: table, type: number) -> table, number + * \endenglish + */ + ResultWithErrno calibWorkpieceCoordinatePara( + const std::vector> &q, int type); + + /** + * \chinese + * 动力学正解 + * + * @param q 关节角 + * @param torqs + * @return 计算结果以及错误代码 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * forwardDynamics(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float], arg1: + * List[float]) -> Tuple[List[float], int] + * + * @par Lua函数原型 + * forwardDynamics(q: table, torqs: table) -> table, number + * \endchinese + * \english + * Forward dynamics + * + * @param q Joint angles + * @param torqs + * @return Calculation result and error code + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * forwardDynamics(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float], arg1: + * List[float]) -> Tuple[List[float], int] + * + * @par Lua function prototype + * forwardDynamics(q: table, torqs: table) -> table, number + * \endenglish + */ + ResultWithErrno forwardDynamics(const std::vector &q, + const std::vector &torqs); + + /** + * \chinese + * 动力学正解,基于给定的TCP偏移 + * + * @param q 关节角 + * @param torqs + * @param tcp_offset TCP偏移 + * @return 计算结果以及错误代码,同forwardDynamics + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * forwardDynamics(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float], arg1: + * List[float], arg2: List[float]) -> Tuple[List[float], int] + * + * @par Lua函数原型 + * forwardDynamics1(q: table, torqs: table, tcp_offset: table) -> table, number + * \endchinese + * \english + * Forward dynamics based on the given TCP offset + * + * @param q Joint angles + * @param torqs + * @param tcp_offset TCP offset + * @return Calculation result and error code, same as forwardDynamics + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * forwardDynamics(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float], arg1: + * List[float], arg2: List[float]) -> Tuple[List[float], int] + * + * @par Lua function prototype + * forwardDynamics1(q: table, torqs: table, tcp_offset: table) -> table, number + * \endenglish + */ + ResultWithErrno forwardDynamics1(const std::vector &q, + const std::vector &torqs, + const std::vector &tcp_offset); + + /** + * \chinese + * 运动学正解, 基于激活的TCP偏移(最近的通过 setTcpOffset 设置的参数) + * 输入关节角度,输出TCP位姿 + * + * @param q 关节角 + * @return TCP位姿和正解结果是否有效 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * forwardKinematics(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float]) -> + * Tuple[List[float], int] + * + * @par Lua函数原型 + * forwardKinematics(q: table) -> table, number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.forwardKinematics","params":[[3.083688522170976,1.2273215976885394,1.098072739631141,0.6705738810610149,-1.870715392248607,-0.39708546603119627]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[[0.7137448715395925,0.08416057568819092,0.6707994191515292,2.4599818776908724,0.4789772388601265,1.6189630435878408],0]} + * \endchinese + * \english + * Forward kinematics, based on the activated TCP offset (the most recently set via setTcpOffset) + * Input joint angles, output TCP pose + * + * @param q Joint angles + * @return TCP pose and whether the result is valid + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * forwardKinematics(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float]) -> + * Tuple[List[float], int] + * + * @par Lua function prototype + * forwardKinematics(q: table) -> table, number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.forwardKinematics","params":[[3.083688522170976,1.2273215976885394,1.098072739631141,0.6705738810610149,-1.870715392248607,-0.39708546603119627]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[[0.7137448715395925,0.08416057568819092,0.6707994191515292,2.4599818776908724,0.4789772388601265,1.6189630435878408],0]} + * \endenglish + */ + ResultWithErrno forwardKinematics(const std::vector &q); + + /** + * \chinese + * 运动学正解 + * 输入关节角度,输出TCP位姿 + * + * @param q 关节角 + * @param tcp_offset tcp偏移 + * @return TCP位姿和正解结果是否有效 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * forwardKinematics(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float], + * arg1: List[float]) -> Tuple[List[float], int] + * + * @par Lua函数原型 + * forwardKinematics1(q: table, tcp_offset: table) -> table, number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.forwardKinematics1","params":[[3.083688522170976,1.2273215976885394,1.098072739631141,0.6705738810610149,-1.870715392248607,-0.39708546603119627],[0.0, + * 0.13201,0.03879,0,0,0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[[0.7137636726659518,0.0837705432006433,0.6710022027216355,2.459981877690872,0.4789772388601267,1.6189630435878408],0]} + * + * @since 0.24.1 + * \endchinese + * \english + * Forward kinematics + * Input joint angles, output TCP pose + * + * @param q Joint angles + * @param tcp_offset TCP offset + * @return TCP pose and whether the result is valid + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * forwardKinematics(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float], + * arg1: List[float]) -> Tuple[List[float], int] + * + * @par Lua function prototype + * forwardKinematics1(q: table, tcp_offset: table) -> table, number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.forwardKinematics1","params":[[3.083688522170976,1.2273215976885394,1.098072739631141,0.6705738810610149,-1.870715392248607,-0.39708546603119627],[0.0, + * 0.13201,0.03879,0,0,0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[[0.7137636726659518,0.0837705432006433,0.6710022027216355,2.459981877690872,0.4789772388601267,1.6189630435878408],0]} + * + * @since 0.24.1 + * \endenglish + */ + ResultWithErrno forwardKinematics1(const std::vector &q, + const std::vector &tcp_offset); + + /** + * \chinese + * 运动学正解(忽略 TCP 偏移值) + * + * @param q 关节角 + * @return 法兰盘中心位姿和正解结果是否有效 + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.forwardToolKinematics","params":[[3.083688522170976,1.2273215976885394,1.098072739631141,0.6705738810610149,-1.870715392248607,-0.39708546603119627]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[[0.5881351149440136,0.05323734739426938,0.623922550656701,2.4599818776908724,0.4789772388601265,1.6189630435878408],0]} + * \endchinese + * \english + * Forward kinematics (ignoring TCP offset) + * + * @param q Joint angles + * @return Flange center pose and whether the result is valid + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.forwardToolKinematics","params":[[3.083688522170976,1.2273215976885394,1.098072739631141,0.6705738810610149,-1.870715392248607,-0.39708546603119627]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[[0.5881351149440136,0.05323734739426938,0.623922550656701,2.4599818776908724,0.4789772388601265,1.6189630435878408],0]} + * \endenglish + */ + ResultWithErrno forwardToolKinematics(const std::vector &q); + + /** + * \chinese + * 运动学逆解 + * 输入TCP位姿和参考关节角度,输出关节角度 + * + * @param qnear 参考关节角 + * @param pose TCP位姿 + * @return 关节角和逆解结果是否有效 + * 返回值的第一个参数为逆解结果,第二个为逆解错误码,错误码返回列表如下 + * 0 - 成功 + * -23 - 逆解计算不收敛,计算出错 + * -24 - 逆解计算超出机器人最大限制 + * -25 - 逆解输入配置存在错误 + * -26 - 逆解雅可比矩阵计算失败 + * -27 - 目标点存在解析解,但均不满足选解条件 + * -28 - 逆解返回未知类型错误 + * 若错误码非0,则返回值的第一个参数为输入参考关节角qnear + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * inverseKinematics(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float], + * arg1: List[float]) -> Tuple[List[float], int] + * + * @par Lua函数原型 + * inverseKinematics(qnear: table, pose: table) -> table, int + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.inverseKinematics","params":[[0,0,0,0,0,0],[0.71374,0.08417,0.6708,2.46,0.479,1.619]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[[3.083688522170976,1.2273215976885394,1.098072739631141,0.6705738810610149,-1.870715392248607,-0.39708546603119627],0]} + * \endchinese + * \english + * Inverse kinematics + * Input TCP pose and reference joint angles, output joint angles + * + * @param qnear Reference joint angles + * @param pose TCP pose + * @return Joint angles and whether the inverse kinematics result is valid + * The first parameter of the return value is the inverse kinematics result, the second is the error code. Error codes are as follows: + * 0 - Success + * -23 - Inverse kinematics calculation does not converge, calculation error + * -24 - Inverse kinematics calculation exceeds robot limits + * -25 - Inverse kinematics input configuration error + * -26 - Inverse kinematics Jacobian calculation failed + * -27 - Analytical solution exists but none satisfy the selection criteria + * -28 - Unknown error in inverse kinematics + * If the error code is not 0, the first parameter of the return value is the input reference joint angles qnear + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * inverseKinematics(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float], + * arg1: List[float]) -> Tuple[List[float], int] + * + * @par Lua function prototype + * inverseKinematics(qnear: table, pose: table) -> table, int + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.inverseKinematics","params":[[0,0,0,0,0,0],[0.71374,0.08417,0.6708,2.46,0.479,1.619]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[[3.083688522170976,1.2273215976885394,1.098072739631141,0.6705738810610149,-1.870715392248607,-0.39708546603119627],0]} + * \endenglish + */ + ResultWithErrno inverseKinematics(const std::vector &qnear, + const std::vector &pose); + + /** + * \chinese + * 运动学逆解 + * 输入TCP位姿和参考关节角度,输出关节角度 + * + * @param qnear 参考关节角 + * @param pose TCP位姿 + * @param tcp_offset TCP偏移 + * @return 关节角和逆解结果是否有效,同 inverseKinematics + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * inverseKinematics(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float], + * arg1: List[float]) -> Tuple[List[float], int] + * + * @par Lua函数原型 + * inverseKinematics(qnear: table, pose: table) -> table, int + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.inverseKinematics1","params":[[0,0,0,0,0,0],[0.71374,0.08417,0.6708,2.46,0.479,1.619],[0.0, + * 0.13201,0.03879,0,0,0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[[3.084454549595208,1.2278265883747776,1.0986586440159576,0.6708221281915528,-1.8712459848518375,-0.3965111476861782],0]} + * \endchinese + * \english + * Inverse kinematics + * Input TCP pose and reference joint angles, output joint angles + * + * @param qnear Reference joint angles + * @param pose TCP pose + * @param tcp_offset TCP offset + * @return Joint angles and whether the result is valid, same as inverseKinematics + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * inverseKinematics(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float], + * arg1: List[float]) -> Tuple[List[float], int] + * + * @par Lua function prototype + * inverseKinematics(qnear: table, pose: table) -> table, int + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.inverseKinematics1","params":[[0,0,0,0,0,0],[0.71374,0.08417,0.6708,2.46,0.479,1.619],[0.0, + * 0.13201,0.03879,0,0,0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[[3.084454549595208,1.2278265883747776,1.0986586440159576,0.6708221281915528,-1.8712459848518375,-0.3965111476861782],0]} + * \endenglish + */ + ResultWithErrno inverseKinematics1(const std::vector &qnear, + const std::vector &pose, + const std::vector &tcp_offset); + + /** + * \chinese + * 求出所有的逆解, 基于激活的 TCP 偏移 + * + * @param pose TCP位姿 + * @return 关节角和逆解结果是否有效 + * 返回的错误码同inverseKinematics + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.inverseKinematicsAll","params":[[0.71374,0.08417,0.6708,2.46,0.479,1.619]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[[[3.083688522170976,1.2273215976885394,1.098072739631141,0.6705738810610149,-1.870715392248607,-0.39708546603119627], + * [3.081056801097411,0.17985038037652645,-1.0991717292664145,-0.4806460200109001,-1.869182975312333,-0.402066016835411], + * [0.4090095277807992,-0.1623365054641728,1.081775890307679,0.26993250263224805,0.9738255833642309,0.000572556627720845], + * [0.4116449425067969,-1.1931664523907126,-1.0822709833775688,-0.8665964106161371,0.9732141569888207,0.006484919654891586]],0]} + * \endchinese + * \english + * Solve all inverse kinematics solutions based on the activated TCP offset + * + * @param pose TCP pose + * @return Joint angles and whether the result is valid + * The returned error code is the same as inverseKinematics + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.inverseKinematicsAll","params":[[0.71374,0.08417,0.6708,2.46,0.479,1.619]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[[[3.083688522170976,1.2273215976885394,1.098072739631141,0.6705738810610149,-1.870715392248607,-0.39708546603119627], + * [3.081056801097411,0.17985038037652645,-1.0991717292664145,-0.4806460200109001,-1.869182975312333,-0.402066016835411], + * [0.4090095277807992,-0.1623365054641728,1.081775890307679,0.26993250263224805,0.9738255833642309,0.000572556627720845], + * [0.4116449425067969,-1.1931664523907126,-1.0822709833775688,-0.8665964106161371,0.9732141569888207,0.006484919654891586]],0]} + * \endenglish + */ + ResultWithErrno1 inverseKinematicsAll(const std::vector &pose); + + /** + * \chinese + * 求出所有的逆解, 基于提供的 TCP 偏移 + * + * @param pose TCP位姿 + * @param tcp_offset TCP偏移 + * @return 关节角和逆解结果是否有效,同 inverseKinematicsAll + * 返回的错误码同inverseKinematics + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.inverseKinematicsAll1","params":[[0.71374,0.08417,0.6708,2.46,0.479,1.619],[0.0, + * 0.13201,0.03879,0,0,0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[[[3.084454549595208,1.2278265883747776,1.0986586440159576,0.6708221281915528,-1.8712459848518375,-0.3965111476861782], + * [3.0818224058231602,0.17980369843203092,-1.0997576631122077,-0.48102131527371267,-1.8697135490338517,-0.40149459722060593], + * [0.40972960018231047,-0.16226026285489026,1.0823403816496,0.2700204411869427,0.9734251963887868,0.0012903686498106507], + * [0.41236549588802296,-1.193621392918341,-1.0828346680836718,-0.8671097369314354,0.972815367289568,0.007206851371073478]],0]} + * \endchinese + * \english + * Solve all inverse kinematics solutions based on the provided TCP offset + * + * @param pose TCP pose + * @param tcp_offset TCP offset + * @return Joint angles and whether the result is valid, same as inverseKinematicsAll + * The returned error code is the same as inverseKinematics + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.inverseKinematicsAll1","params":[[0.71374,0.08417,0.6708,2.46,0.479,1.619],[0.0, + * 0.13201,0.03879,0,0,0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[[[3.084454549595208,1.2278265883747776,1.0986586440159576,0.6708221281915528,-1.8712459848518375,-0.3965111476861782], + * [3.0818224058231602,0.17980369843203092,-1.0997576631122077,-0.48102131527371267,-1.8697135490338517,-0.40149459722060593], + * [0.40972960018231047,-0.16226026285489026,1.0823403816496,0.2700204411869427,0.9734251963887868,0.0012903686498106507], + * [0.41236549588802296,-1.193621392918341,-1.0828346680836718,-0.8671097369314354,0.972815367289568,0.007206851371073478]],0]} + * \endenglish + */ + ResultWithErrno1 inverseKinematicsAll1( + const std::vector &pose, const std::vector &tcp_offset); + + /** + * \chinese + * 运动学逆解(忽略 TCP 偏移值) + * + * @param qnear 参考关节角 + * @param pose 法兰盘中心的位姿 + * @return 关节角和逆解结果是否有效 + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.inverseToolKinematics","params":[[0,0,0,0,0,0],[0.58815,0.0532,0.62391,2.46,0.479,1.619]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[[3.083609363838651,1.22736129158332,1.098095443698268,0.6705395395487186,-1.8706605026855632,-0.39714507002376465],0]} + * \endchinese + * \english + * Inverse kinematics (ignoring TCP offset) + * + * @param qnear Reference joint angles + * @param pose Flange center pose + * @return Joint angles and whether the result is valid + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.inverseToolKinematics","params":[[0,0,0,0,0,0],[0.58815,0.0532,0.62391,2.46,0.479,1.619]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[[3.083609363838651,1.22736129158332,1.098095443698268,0.6705395395487186,-1.8706605026855632,-0.39714507002376465],0]} + * \endenglish + */ + ResultWithErrno inverseToolKinematics(const std::vector &qnear, + const std::vector &pose); + + /** + * \chinese + * 运动学逆解(忽略 TCP 偏移值) + * + * @param qnear 参考关节角 + * @param pose 法兰盘中心的位姿 + * @return 关节角和逆解结果是否有效 + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.inverseToolKinematicsAll","params":[[0.58815,0.0532,0.62391,2.46,0.479,1.619]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[[[3.083609363838651,1.22736129158332,1.098095443698268,0.6705395395487186,-1.8706605026855632,-0.39714507002376465], + * [3.0809781797426523,0.17987122696706134,-1.0991932793263717,-0.4807053707530958,-1.8691282890274434,-0.40212516672751814], + * [0.40892195618737215,-0.16235398607358653,1.081812753177426,0.27003586475871766,0.9738744130114284,0.00048462518316674287], + * [0.41155633414333076,-1.1932173012004512,-1.082306542045813,-0.8665312056504818,0.9732632365861417,0.0063958311601771175]],0]} + * \endchinese + * \english + * Inverse kinematics (ignoring TCP offset) + * + * @param qnear Reference joint angles + * @param pose Flange center pose + * @return Joint angles and whether the result is valid + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.inverseToolKinematicsAll","params":[[0.58815,0.0532,0.62391,2.46,0.479,1.619]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[[[3.083609363838651,1.22736129158332,1.098095443698268,0.6705395395487186,-1.8706605026855632,-0.39714507002376465], + * [3.0809781797426523,0.17987122696706134,-1.0991932793263717,-0.4807053707530958,-1.8691282890274434,-0.40212516672751814], + * [0.40892195618737215,-0.16235398607358653,1.081812753177426,0.27003586475871766,0.9738744130114284,0.00048462518316674287], + * [0.41155633414333076,-1.1932173012004512,-1.082306542045813,-0.8665312056504818,0.9732632365861417,0.0063958311601771175]],0]} + * \endenglish + */ + ResultWithErrno1 inverseToolKinematicsAll(const std::vector &pose); + + /** + * \chinese + * 求解movej之间的轨迹点 + * + * @param q1 movej的起点 + * @param r1 在q1处的交融半径 + * @param q2 movej的终点 + * @param r2 在q2处的交融半径 + * @param d 采样距离 + * @return q1~q2 之间笛卡尔空间离散轨迹点(x,y,z,rx,ry,rz)集合 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathMovej(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float], arg1: + * float, arg2: List[float], arg3: float, arg4: float) -> List[List[float]] + * + * @par Lua函数原型 + * pathMovej(q1: table, r1: number, q2: table, r2: number, d: number) -> + * table, number + * \endchinese + * \english + * Solve the trajectory points between movej + * + * @param q1 Start point of movej + * @param r1 Blend radius at q1 + * @param q2 End point of movej + * @param r2 Blend radius at q2 + * @param d Sampling distance + * @return Discrete trajectory points (x, y, z, rx, ry, rz) between q1 and q2 in Cartesian space + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathMovej(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float], arg1: + * float, arg2: List[float], arg3: float, arg4: float) -> List[List[float]] + * + * @par Lua function prototype + * pathMovej(q1: table, r1: number, q2: table, r2: number, d: number) -> + * table, number + * \endenglish + */ + std::vector> pathMovej(const std::vector &q1, + double r1, + const std::vector &q2, + double r2, double d); + /** + * \chinese + * 计算机械臂末端的雅克比矩阵 + * + * @param q 关节角 + * @param base_or_end 参考坐标系为基坐标系(或者末端坐标系) + * true: 在 base 下描述 + * false: 在 末端坐标系 下描述 + * @return 雅克比矩阵是否有效 + * 返回值的第一个参数为该构型下对应的雅克比矩阵,第二个为逆解错误码 + * 此接口的错误码返回值在0.28.1-rc.21 0.29.0-alpha.25版本之后做了修改。 + * 此前逆解错误时返回 30082 ,修改后错误码返回列表如下 + * 0 - 成功 + * -23 - 逆解计算不收敛,计算出错 + * -24 - 逆解计算超出机器人最大限制 + * -25 - 逆解输入配置存在错误 + * -26 - 逆解雅可比矩阵计算失败 + * -27 - 目标点存在解析解,但均不满足选解条件 + * -28 - 逆解返回未知类型错误 + * 若错误码非0,则返回值的第一个参数为输入参考关节角qnear + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * calJacobian(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float], + * arg1: bool) -> Tuple[List[float], int] + * + * @par Lua函数原型 + * calJacobian(q: table, base_or_end: boolean) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.calcJacobian","params":[[0.58815,0.0532,0.62391,2.46,0.479,1.619],true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[[0.20822779551242535,-0.5409416184208162,0.2019786999613013,0.061264982268770196,-0.026269884327316487, + * 0.10131708699859962,0.26388933410019777,-0.36074292664199115,0.1346954733416397,0.04085636647597124,-0.07244204452918337,0.0708466286633346, + * 0.0,0.10401808481666497,-0.12571344758923886,-0.07741290545882097,0.18818543519232858,0.04628646442706299,0.0,0.5548228314607867, + * -0.5548228314607868,0.5548228314607868,-0.7901273140338193,0.37230961532208007,0.0,-0.8319685244586092,0.8319685244586091,-0.8319685244586091, + * -0.5269197820578843,-0.8184088260676008,1.0,3.749399456654644e-33,-6.512048180336603e-18,1.0956823467534067e-16,-0.31313634553301894, + * 0.43771285536682175],0]} + * \endchinese + * \english + * Calculate the Jacobian matrix at the robot end-effector + * + * @param q Joint angles + * @param base_or_end Reference frame: base (or end-effector) + * true: described in base frame + * false: described in end-effector frame + * @return Whether the Jacobian matrix is valid + * The first parameter of the return value is the Jacobian matrix for this configuration, the second is the error code. + * The error code list was updated after versions 0.28.1-rc.21 and 0.29.0-alpha.25. + * Previously, inverse kinematics errors returned 30082. The updated error codes are: + * 0 - Success + * -23 - Inverse kinematics calculation does not converge, calculation error + * -24 - Inverse kinematics calculation exceeds robot limits + * -25 - Inverse kinematics input configuration error + * -26 - Inverse kinematics Jacobian calculation failed + * -27 - Analytical solution exists but none satisfy the selection criteria + * -28 - Unknown error in inverse kinematics + * If the error code is not 0, the first parameter of the return value is the input reference joint angles qnear + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * calJacobian(self: pyaubo_sdk.RobotAlgorithm, arg0: List[float], + * arg1: bool) -> Tuple[List[float], int] + * + * @par Lua function prototype + * calJacobian(q: table, base_or_end: boolean) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.calcJacobian","params":[[0.58815,0.0532,0.62391,2.46,0.479,1.619],true],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[[0.20822779551242535,-0.5409416184208162,0.2019786999613013,0.061264982268770196,-0.026269884327316487, + * 0.10131708699859962,0.26388933410019777,-0.36074292664199115,0.1346954733416397,0.04085636647597124,-0.07244204452918337,0.0708466286633346, + * 0.0,0.10401808481666497,-0.12571344758923886,-0.07741290545882097,0.18818543519232858,0.04628646442706299,0.0,0.5548228314607867, + * -0.5548228314607868,0.5548228314607868,-0.7901273140338193,0.37230961532208007,0.0,-0.8319685244586092,0.8319685244586091,-0.8319685244586091, + * -0.5269197820578843,-0.8184088260676008,1.0,3.749399456654644e-33,-6.512048180336603e-18,1.0956823467534067e-16,-0.31313634553301894, + * 0.43771285536682175],0]} + * \endenglish + */ + ResultWithErrno calcJacobian(const std::vector &q, + bool base_or_end); + + /** + * \chinese + * 求解交融的轨迹点 + * + * @param type + * 0-movej 和 movej + * 1-movej 和 movel + * 2-movel 和 movej + * 3-movel 和 movel + * @param q_start 交融前路径的起点 + * @param q_via 交融点 + * @param q_to 交融后路径的终点 + * @param r 在q_via处的交融半径 + * @param d 采样距离 + * @return q_via处的交融段笛卡尔空间离散轨迹点(x,y,z)集合 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * pathBlend3Points(self: pyaubo_sdk.RobotAlgorithm, arg0: int, arg1: + * List[float], arg2: List[float], arg3: List[float], arg4: float, arg5: + * float) -> List[List[float]] + * + * @par Lua函数原型 + * pathBlend3Points(type: number, q_start: table, q_via: table, q_to: table, + * r: number, d: number) -> table, number + * \endchinese + * \english + * Solve the blended trajectory points + * + * @param type + * 0-movej and movej + * 1-movej and movel + * 2-movel and movej + * 3-movel and movel + * @param q_start Start point before blending + * @param q_via Blending point + * @param q_to End point after blending + * @param r Blend radius at q_via + * @param d Sampling distance + * @return Discrete trajectory points (x, y, z) of the blend segment at q_via in Cartesian space + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * pathBlend3Points(self: pyaubo_sdk.RobotAlgorithm, arg0: int, arg1: + * List[float], arg2: List[float], arg3: List[float], arg4: float, arg5: + * float) -> List[List[float]] + * + * @par Lua function prototype + * pathBlend3Points(type: number, q_start: table, q_via: table, q_to: table, + * r: number, d: number) -> table, number + * \endenglish + */ + std::vector> pathBlend3Points( + int type, const std::vector &q_start, + const std::vector &q_via, const std::vector &q_to, + double r, double d); + + /** + * \chinese + * 生成用于负载辨识的激励轨迹 + * 此接口内部调用pathBufferAppend + * 将离线轨迹存入buffer中,后续可通过movePathBuffer运行离线轨迹 + * @param name 轨迹名字 + * @param traj_conf 各关节轨迹的限制条件 + * traj_conf.move_axis: 运动的轴 + * 由于实际用户现场可能不希望在负载辨识时控制机械臂多关节大幅度运动,故最好选用traj_conf.move_axis=LoadIdentifyMoveAxis::Joint_4_6; + * traj_conf.init_joint: + * 运动初始关节角,为了避免关节5接近零位时的奇异问题,应设置traj_conf.init_joint[4]的绝对值不小于0.3(rad),接近1.57(rad)为宜。其余关节的关节角可任意设置 + * traj_conf.lower_joint_bound, traj_conf.upper_joint_bound: + * 关节角上下限,维度应与config.move_axis维度保持一致,推荐设置upper_joint_bound为2,lower_joint_bound为-2 + * config.max_velocity, config.max_acceleration: + * 关节角速度角加速度限制,维度应与config.move_axis维度保持一致,出于安全和驱动器跟随性能的考虑,推荐设置max_velocity=3,max_acceleration=5 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Generate excitation trajectory for payload identification + * This interface internally calls pathBufferAppend + * The offline trajectory is stored in the buffer, and can be executed later via movePathBuffer + * @param name Trajectory name + * @param traj_conf Joint trajectory constraints + * traj_conf.move_axis: Moving axes + * Since users may not want large multi-joint movements during payload identification, it is recommended to use traj_conf.move_axis=LoadIdentifyMoveAxis::Joint_4_6; + * traj_conf.init_joint: + * Initial joint angles. To avoid singularity issues near joint 5 zero position, set abs(traj_conf.init_joint[4]) >= 0.3(rad), preferably close to 1.57(rad). Other joints can be set arbitrarily. + * traj_conf.lower_joint_bound, traj_conf.upper_joint_bound: + * Joint angle limits, dimensions should match config.move_axis. Recommended: upper_joint_bound=2, lower_joint_bound=-2 + * config.max_velocity, config.max_acceleration: + * Joint velocity and acceleration limits, dimensions should match config.move_axis. For safety and driver performance, recommended: max_velocity=3, max_acceleration=5 + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int generatePayloadIdentifyTraj(const std::string &name, + const TrajConfig &traj_conf); + /** + * \chinese + * 负载辨识轨迹是否生成完成 + * + * @return 完成返回0; 正在进行中返回1; 计算失败返回<0; + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.payloadIdentifyTrajGenFinished","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Whether payload identification trajectory generation is finished + * + * @return 0 if finished; 1 if in progress; <0 if failed; + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotAlgorithm.payloadIdentifyTrajGenFinished","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int payloadIdentifyTrajGenFinished(); + + /** + * \chinese + * 求解 moveS 的轨迹点 + * + * @brief pathMoveS + * @param qs 样条轨迹生成点集合 + * @param d 采样距离 + * @return + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Solve the trajectory points for moveS + * + * @brief pathMoveS + * @param qs Spline trajectory generation point set + * @param d Sampling distance + * @return + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + std::vector> pathMoveS( + const std::vector> &qs, double d); + +protected: + void *d_; +}; +using RobotAlgorithmPtr = std::shared_ptr; + +} // namespace common_interface +} // namespace arcs + +#endif // AUBO_SDK_ROBOT_ALGORITHM_INTERFACE_H diff --git a/third_party/AuboSdk/win/include/aubo/robot/robot_config.h b/third_party/AuboSdk/win/include/aubo/robot/robot_config.h new file mode 100644 index 00000000..3bd5d52d --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo/robot/robot_config.h @@ -0,0 +1,3142 @@ +/** @file robot_config.h + * @brief 获取机器人配置接口,如获取DH参数、碰撞等级、安装位姿等等 + */ +#ifndef AUBO_SDK_ROBOT_CONFIG_H +#define AUBO_SDK_ROBOT_CONFIG_H + +#include +#include + +#include +#include + +namespace arcs { +namespace common_interface { + +class ARCS_ABI_EXPORT RobotConfig +{ +public: + RobotConfig(); + virtual ~RobotConfig(); + + /** + * \chinese + * 获取机器人的名字 + * + * @return 返回机器人的名字 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getName(self: pyaubo_sdk.RobotConfig) -> str + * + * @par Lua函数原型 + * getName() -> string + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getName","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"rob1"} + * \endchinese + * \english + * Get the robot's name. + * + * @return The robot's name. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getName(self: pyaubo_sdk.RobotConfig) -> str + * + * @par Lua function prototype + * getName() -> string + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getName","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"rob1"} + * \endenglish + */ + std::string getName(); + + /** + * \chinese + * 获取机器人的自由度(从硬件抽象层读取) + * + * @return 返回机器人的自由度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getDof(self: pyaubo_sdk.RobotConfig) -> int + * + * @par Lua函数原型 + * getDof() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getDof","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":6} + * \endchinese + * \english + * Get the robot's degrees of freedom (from the hardware abstraction layer). + * + * @return The robot's degrees of freedom. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getDof(self: pyaubo_sdk.RobotConfig) -> int + * + * @par Lua function prototype + * getDof() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getDof","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":6} + * \endenglish + */ + int getDof(); + + /** + * \chinese + * 获取机器人的伺服控制周期(从硬件抽象层读取) + * + * @return 机器人的伺服控制周期 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getCycletime(self: pyaubo_sdk.RobotConfig) -> float + * + * @par Lua函数原型 + * getCycletime() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getCycletime","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.005} + * \endchinese + * \english + * Get the robot's servo control cycle time (from the hardware abstraction + * layer). + * + * @return The robot's servo control cycle time. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getCycletime(self: pyaubo_sdk.RobotConfig) -> float + * + * @par Lua function prototype + * getCycletime() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getCycletime","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.005} + * \endenglish + */ + double getCycletime(); + + /** + * \chinese + * 预设缓速模式下的速度缩减比例 + * + * @param level 缓速等级 1, 2 + * @param fraction + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setSlowDownFraction","params":[1,0.8],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set the speed reduction ratio for the preset slow-down mode. + * + * @param level Slow-down level 1, 2 + * @param fraction + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setSlowDownFraction","params":[1,0.8],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setSlowDownFraction(int level, double fraction); + + /** + * \chinese + * 获取预设的缓速模式下的速度缩减比例 + * + * @param level 缓速等级 1, 2 + * @return 返回预设的缓速模式下的速度缩减比例 + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getSlowDownFraction","params":[1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.5} + * \endchinese + * \english + * Get the speed reduction ratio for the preset slow-down mode. + * + * @param level Slow-down level 1, 2 + * @return The speed reduction ratio for the preset slow-down mode. + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getSlowDownFraction","params":[1],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.5} + * \endenglish + */ + double getSlowDownFraction(int level); + + /** + * \chinese + * 获取默认的工具端加速度,单位m/s^2 + * + * @return 默认的工具端加速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getDefaultToolAcc(self: pyaubo_sdk.RobotConfig) -> float + * + * @par Lua函数原型 + * getDefaultToolAcc() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getDefaultToolAcc","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * \endchinese + * \english + * Get the default tool acceleration, in m/s^2. + * + * @return The default tool acceleration. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getDefaultToolAcc(self: pyaubo_sdk.RobotConfig) -> float + * + * @par Lua function prototype + * getDefaultToolAcc() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getDefaultToolAcc","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * \endenglish + */ + double getDefaultToolAcc(); + + /** + * \chinese + * 获取默认的工具端速度,单位m/s + * + * @return 默认的工具端速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getDefaultToolSpeed(self: pyaubo_sdk.RobotConfig) -> float + * + * @par Lua函数原型 + * getDefaultToolSpeed() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getDefaultToolSpeed","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * \endchinese + * \english + * Get the default tool speed, in m/s. + * + * @return The default tool speed. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getDefaultToolSpeed(self: pyaubo_sdk.RobotConfig) -> float + * + * @par Lua function prototype + * getDefaultToolSpeed() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getDefaultToolSpeed","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * \endenglish + */ + double getDefaultToolSpeed(); + + /** + * \chinese + * 获取默认的关节加速度,单位rad/s^2 + * + * @return 默认的关节加速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getDefaultJointAcc(self: pyaubo_sdk.RobotConfig) -> float + * + * @par Lua函数原型 + * getDefaultJointAcc() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getDefaultJointAcc","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * \endchinese + * \english + * Get the default joint acceleration, in rad/s^2. + * + * @return The default joint acceleration. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getDefaultJointAcc(self: pyaubo_sdk.RobotConfig) -> float + * + * @par Lua function prototype + * getDefaultJointAcc() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getDefaultJointAcc","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * \endenglish + */ + double getDefaultJointAcc(); + + /** + * \chinese + * 获取默认的关节速度,单位rad/s + * + * @return 默认的关节速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getDefaultJointSpeed(self: pyaubo_sdk.RobotConfig) -> float + * + * @par Lua函数原型 + * getDefaultJointSpeed() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getDefaultJointSpeed","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.0} + * \endchinese + * \english + * Get the default joint speed, in rad/s. + * + * @return The default joint speed. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getDefaultJointSpeed(self: pyaubo_sdk.RobotConfig) -> float + * + * @par Lua function prototype + * getDefaultJointSpeed() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getDefaultJointSpeed","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.0} + * \endenglish + */ + double getDefaultJointSpeed(); + + /** + * \chinese + * 获取机器人类型代码 + * + * @return 机器人类型代码 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getRobotType(self: pyaubo_sdk.RobotConfig) -> str + * + * @par Lua函数原型 + * getRobotType() -> string + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getRobotType","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"aubo_i5H"} + * \endchinese + * \english + * Get the robot type code. + * + * @return The robot type code. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getRobotType(self: pyaubo_sdk.RobotConfig) -> str + * + * @par Lua function prototype + * getRobotType() -> string + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getRobotType","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"aubo_i5H"} + * \endenglish + */ + std::string getRobotType(); + + /** + * \chinese + * 获取机器人子类型代码 + * + * @return 机器人子类型代码 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getRobotSubType(self: pyaubo_sdk.RobotConfig) -> str + * + * @par Lua函数原型 + * getRobotSubType() -> string + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getRobotSubType","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"B0"} + * \endchinese + * \english + * Get the robot sub-type code. + * + * @return The robot sub-type code. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getRobotSubType(self: pyaubo_sdk.RobotConfig) -> str + * + * @par Lua function prototype + * getRobotSubType() -> string + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getRobotSubType","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"B0"} + * \endenglish + */ + std::string getRobotSubType(); + + /** + * \chinese + * 获取控制柜类型代码 + * + * @return 控制柜类型代码 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getControlBoxType(self: pyaubo_sdk.RobotConfig) -> str + * + * @par Lua函数原型 + * getControlBoxType() -> string + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getControlBoxType","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"cb_ISStation"} + * \endchinese + * \english + * Get the control box type code. + * + * @return The control box type code. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getControlBoxType(self: pyaubo_sdk.RobotConfig) -> str + * + * @par Lua function prototype + * getControlBoxType() -> string + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getControlBoxType","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"cb_ISStation"} + * \endenglish + */ + std::string getControlBoxType(); + + /** + * \chinese + * 设置安装位姿(机器人的基坐标系相对于世界坐标系) world->base + * + * 一般在多机器人系统中使用,默认为 [0,0,0,0,0,0] + * + * @param pose 安装位姿 + * @return 成功返回0; 失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setMountingPose(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int + * + * @par Lua函数原型 + * setMountingPose(pose: table) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setMountingPose","params":[[0.0,0.0,0.0,0.0,0.0,0.0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set the mounting pose (robot base coordinate system relative to world + * coordinate system) world->base + * + * Typically used in multi-robot systems, default is [0,0,0,0,0,0] + * + * @param pose Mounting pose + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setMountingPose(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int + * + * @par Lua function prototype + * setMountingPose(pose: table) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setMountingPose","params":[[0.0,0.0,0.0,0.0,0.0,0.0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setMountingPose(const std::vector &pose); + + /** + * \chinese + * 获取安装位姿(机器人的基坐标系相对于世界坐标系) + * + * @return 安装位姿 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getMountingPose(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getMountingPose() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getMountingPose","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the mounting pose (robot base coordinate system relative to world + * coordinate system) + * + * @return Mounting pose + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getMountingPose(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getMountingPose() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getMountingPose","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getMountingPose(); + + /** + * \chinese + * 将机器人绑定到一个坐标系,如果这个坐标系是运动的,那机器人也会跟着运动 + * 应用于地轨或者龙门 + * 这个函数调用的时候 frame 和 ROBOTBASE 的相对关系就固定了 + * \endchinese + * \english + * Attach the robot base to a coordinate frame. If this frame moves, the + * robot will move accordingly. Used for applications like ground rails or + * gantries. When this function is called, the relationship between the + * frame and ROBOTBASE is fixed. \endenglish + */ + int attachRobotBaseTo(const std::string &frame); + std::string getRobotBaseParent(); + + /** + * \chinese + * 设置工件数据,编程点位都是基于工件坐标系 + * \endchinese + * \english + * Set work object data. All programmed points are based on the work object + * coordinate system. \endenglish + */ + + int setWorkObjectData(const WObjectData &wobj); + + /** + * \chinese + * 设置碰撞灵敏度等级 + * 数值越大越灵敏 + * + * @param level 碰撞灵敏度等级 + * 0: 关闭碰撞检测功能 + * 1~9: 碰撞灵敏等级 + * @return 成功返回0; 失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setCollisionLevel(self: pyaubo_sdk.RobotConfig, arg0: int) -> int + * + * @par Lua函数原型 + * setCollisionLevel(level: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setCollisionLevel","params":[6],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set the collision sensitivity level. + * The higher the value, the more sensitive. + * + * @param level Collision sensitivity level + * 0: Disable collision detection + * 1~9: Collision sensitivity levels + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setCollisionLevel(self: pyaubo_sdk.RobotConfig, arg0: int) -> int + * + * @par Lua function prototype + * setCollisionLevel(level: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setCollisionLevel","params":[6],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setCollisionLevel(int level); + + /** + * \chinese + * 获取碰撞灵敏度等级 + * + * @return 碰撞灵敏度等级 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getCollisionLevel(self: pyaubo_sdk.RobotConfig) -> int + * + * @par Lua函数原型 + * getCollisionLevel() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getCollisionLevel","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":6} + * \endchinese + * \english + * Get the collision sensitivity level. + * + * @return Collision sensitivity level. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getCollisionLevel(self: pyaubo_sdk.RobotConfig) -> int + * + * @par Lua function prototype + * getCollisionLevel() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getCollisionLevel","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":6} + * \endenglish + */ + int getCollisionLevel(); + + /** + * \chinese + * 设置碰撞停止类型 + * + * @param type 类型 \n + * 0: 碰撞后浮动,即碰撞之后进入拖动示教模式 \n + * 1: 碰撞后静止 \n + * 2: 碰撞后抱闸 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setCollisionStopType(self: pyaubo_sdk.RobotConfig, arg0: int) -> int + * + * @par Lua函数原型 + * setCollisionStopType(type: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setCollisionStopType","params":[1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set the collision stop type. + * + * @param type Type \n + * 0: Floating after collision, i.e., enters freedrive mode after collision + * \n 1: Stop after collision \n 2: Brake after collision + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setCollisionStopType(self: pyaubo_sdk.RobotConfig, arg0: int) -> int + * + * @par Lua function prototype + * setCollisionStopType(type: number) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setCollisionStopType","params":[1],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setCollisionStopType(int type); + + /** + * \chinese + * 获取碰撞停止类型 + * + * @return 返回碰撞停止类型 \n + * 0: 碰撞后浮动,即碰撞之后进入拖动示教模式 \n + * 1: 碰撞后静止 \n + * 2: 碰撞后抱闸 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getCollisionStopType(self: pyaubo_sdk.RobotConfig) -> int + * + * @par Lua函数原型 + * getCollisionStopType() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getCollisionStopType","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1} + * + * \endchinese + * \english + * Get the collision stop type. + * + * @return The collision stop type. \n + * 0: Floating after collision, i.e., enters freedrive mode after collision + * \n 1: Stop after collision \n 2: Brake after collision + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getCollisionStopType(self: pyaubo_sdk.RobotConfig) -> int + * + * @par Lua function prototype + * getCollisionStopType() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getCollisionStopType","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1} + * + * \endenglish + */ + int getCollisionStopType(); + + /** + * \chinese + * 设置机器人的原点位置 + * + * @param positions 关节角度 + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setHomePosition","params":[[0.0,-0.2617993877991494,1.74532925199433,0.4363323129985824,1.570796326794897,0.0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set the robot's home position. + * + * @param positions Joint angles + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setHomePosition","params":[[0.0,-0.2617993877991494,1.74532925199433,0.4363323129985824,1.570796326794897,0.0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setHomePosition(const std::vector &positions); + + /** + * \chinese + * 获取机器人的原点位置 + * + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getHomePosition","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,-0.2617993877991494,1.74532925199433,0.4363323129985824,1.570796326794897,0.0]} + * \endchinese + * \english + * Get the robot's home position. + * + * @return + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getHomePosition","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,-0.2617993877991494,1.74532925199433,0.4363323129985824,1.570796326794897,0.0]} + * \endenglish + */ + std::vector getHomePosition(); + + /** + * \chinese + * 设置拖动阻尼 + * + * @param damp 阻尼 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setFreedriveDamp(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int + * + * @par Lua函数原型 + * setFreedriveDamp(damp: table) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setFreedriveDamp","params":[[0.5,0.5,0.5,0.5,0.5,0.5]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set freedrive damping. + * + * @param damp Damping values. + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setFreedriveDamp(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int + * + * @par Lua function prototype + * setFreedriveDamp(damp: table) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setFreedriveDamp","params":[[0.5,0.5,0.5,0.5,0.5,0.5]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setFreedriveDamp(const std::vector &damp); + + /** + * \chinese + * 获取拖动阻尼 + * + * @return 拖动阻尼 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getFreedriveDamp(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getFreedriveDamp() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getFreedriveDamp","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.5,0.5,0.5,0.5,0.5,0.5]} + * \endchinese + * \english + * Get freedrive damping. + * + * @return Freedrive damping values. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getFreedriveDamp(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getFreedriveDamp() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getFreedriveDamp","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.5,0.5,0.5,0.5,0.5,0.5]} + * \endenglish + */ + std::vector getFreedriveDamp(); + + /** + * 设置混合拖动阻尼 + * + * @param damp 阻尼 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setHandguidDamp(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int + * + * @par Lua函数原型 + * setHandguidDamp(damp: table) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setHandguidDamp","params":[[0.5,0.5,0.5,0.5,0.5,0.5]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + */ + int setHandguidDamp(const std::vector &damp); + + /** + * 获取混合拖动阻尼 + * + * @return 拖动阻尼 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getHandguidDamp(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getHandguidDamp() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getHandguidDamp","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.5,0.5,0.5,0.5,0.5,0.5]} + * + */ + std::vector getHandguidDamp(); + + /** + * \chinese + * 获取机器人DH参数 + * alpha a d theta beta + * + * @param real 读取真实参数(理论值+补偿值)或者理论参数 + * @return 返回机器人DH参数 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getKinematicsParam(self: pyaubo_sdk.RobotConfig, arg0: bool) -> Dict[str, + * List[float]] + * + * @par Lua函数原型 + * getKinematicsParam(real: boolean) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getKinematicsParam","params":[true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":{"a":[0.0,-0.0001255999959539622,0.4086348000024445,0.3757601999930339,-0.00018950000230688602,3.7000001611886546e-05], + * "alpha":[0.0,-1.5701173967707458,3.1440308735524347,3.14650750358636,-1.5703093767832055,1.5751177669179182],"beta":[0.0,0.0,0.0,0.0,0.0,0.0], + * "d":[0.122,0.12154769999941345,-4.769999941345304e-05,4.769999941345304e-05,0.10287890000385232,0.116], + * "theta":[3.141592653589793,-1.5707963267948966,0.0,-1.5707963267948966,0.0,0.0]}} + * \endchinese + * \english + * Get the robot's DH parameters: alpha, a, d, theta, beta. + * + * @param real Read real parameters (theoretical + compensation) or + * theoretical parameters. + * @return Returns the robot's DH parameters. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getKinematicsParam(self: pyaubo_sdk.RobotConfig, arg0: bool) -> Dict[str, + * List[float]] + * + * @par Lua function prototype + * getKinematicsParam(real: boolean) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getKinematicsParam","params":[true],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":{"a":[0.0,-0.0001255999959539622,0.4086348000024445,0.3757601999930339,-0.00018950000230688602,3.7000001611886546e-05], + * "alpha":[0.0,-1.5701173967707458,3.1440308735524347,3.14650750358636,-1.5703093767832055,1.5751177669179182],"beta":[0.0,0.0,0.0,0.0,0.0,0.0], + * "d":[0.122,0.12154769999941345,-4.769999941345304e-05,4.769999941345304e-05,0.10287890000385232,0.116], + * "theta":[3.141592653589793,-1.5707963267948966,0.0,-1.5707963267948966,0.0,0.0]}} + * \endenglish + */ + std::unordered_map> getKinematicsParam( + bool real); + + /** + * \chinese + * 获取指定温度下的DH参数补偿值:alpha a d theta beta + * + * @param ref_temperature 参考温度 ℃,默认20℃ + * @return 返回DH参数补偿值 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getKinematicsCompensate(self: pyaubo_sdk.RobotConfig, arg0: float) -> + * Dict[str, List[float]] + * + * @par Lua函数原型 + * getKinematicsCompensate(ref_temperature: number) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getKinematicsCompensate","params":[20],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":{"a":[0.0,-0.0001255999959539622,0.0006348000024445355,-0.0002398000069661066,-0.00018950000230688602,3.7000001611886546e-05], + * "alpha":[0.0,0.000678930024150759,0.002438219962641597,0.0049148499965667725,0.00048695001169107854,0.004321440123021603], + * "beta":[0.0,0.0,0.0,0.0,0.0,0.0],"d":[0.0,4.769999941345304e-05,-4.769999941345304e-05,4.769999941345304e-05,0.0003789000038523227,0.0], + * "theta":[0.0,0.0,0.0,0.0,0.0,0.0]}} + * \endchinese + * \english + * Get DH parameter compensation values (alpha, a, d, theta, beta) at the + * specified temperature. + * + * @param ref_temperature Reference temperature in ℃, default is 20℃ + * @return Returns DH parameter compensation values. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getKinematicsCompensate(self: pyaubo_sdk.RobotConfig, arg0: float) -> + * Dict[str, List[float]] + * + * @par Lua function prototype + * getKinematicsCompensate(ref_temperature: number) -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getKinematicsCompensate","params":[20],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":{"a":[0.0,-0.0001255999959539622,0.0006348000024445355,-0.0002398000069661066,-0.00018950000230688602,3.7000001611886546e-05], + * "alpha":[0.0,0.000678930024150759,0.002438219962641597,0.0049148499965667725,0.00048695001169107854,0.004321440123021603], + * "beta":[0.0,0.0,0.0,0.0,0.0,0.0],"d":[0.0,4.769999941345304e-05,-4.769999941345304e-05,4.769999941345304e-05,0.0003789000038523227,0.0], + * "theta":[0.0,0.0,0.0,0.0,0.0,0.0]}} + * \endenglish + */ + std::unordered_map> + getKinematicsCompensate(double ref_temperature); + + /** + * \chinese + * 设置标准 DH 补偿到机器人 + * + * @param param + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Set standard DH compensation to the robot. + * + * @param param + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int setKinematicsCompensate( + const std::unordered_map> ¶m); + + /** + * \chinese + * 设置需要保存到接口板底座的参数 + * + * @param param 补偿数据 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setPersistentParameters(self: pyaubo_sdk.RobotConfig, arg0: str) -> int + * + * @par Lua函数原型 + * setPersistentParameters(param: string) -> nil + * + * \endchinese + * \english + * Set parameters to be saved to the interface board base. + * + * @param param Compensation data. + * + * @return Returns 0 on success; error code on failure. + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setPersistentParameters(self: pyaubo_sdk.RobotConfig, arg0: str) -> int + * + * @par Lua function prototype + * setPersistentParameters(param: string) -> nil + * + * \endenglish + */ + int setPersistentParameters(const std::string ¶m); + + /** + * \chinese + * 设置硬件抽象层自定义参数 + * 目的是为了做不同硬件之间的兼容 + * + * @param param 自定义参数 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Set custom parameters for the hardware abstraction layer. + * The purpose is to ensure compatibility between different hardware. + * + * @param param Custom parameters. + * + * @return Returns 0 on success; error code on failure. + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int setHardwareCustomParameters(const std::string ¶m); + + /** + * \chinese + * 获取硬件抽象层自定义参数 + * + * @param + * @return 返回硬件抽象层自定义的参数 + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Get custom parameters from the hardware abstraction layer. + * + * @param + * @return Returns custom parameters from the hardware abstraction layer. + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + std::string getHardwareCustomParameters(const std::string ¶m); + + /** + * \chinese + * 设置机器人关节零位 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setRobotZero(self: pyaubo_sdk.RobotConfig) -> int + * + * @par Lua函数原型 + * setRobotZero() -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setRobotZero","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set the robot joint zero position. + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setRobotZero(self: pyaubo_sdk.RobotConfig) -> int + * + * @par Lua function prototype + * setRobotZero() -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setRobotZero","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setRobotZero(); + + /** + * \chinese + * 获取可用的末端力矩传感器的名字 + * + * @return 返回可用的末端力矩传感器的名字 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getTcpForceSensorNames(self: pyaubo_sdk.RobotConfig) -> List[str] + * + * @par Lua函数原型 + * getTcpForceSensorNames() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getTcpForceSensorNames","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[]} + * + * \endchinese + * \english + * Get the names of available TCP force sensors. + * + * @return Returns the names of available TCP force sensors. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getTcpForceSensorNames(self: pyaubo_sdk.RobotConfig) -> List[str] + * + * @par Lua function prototype + * getTcpForceSensorNames() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getTcpForceSensorNames","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[]} + * + * \endenglish + */ + std::vector getTcpForceSensorNames(); + + /** + * \chinese + * 设置末端力矩传感器 + * 如果存在内置的末端力矩传感器,默认将使用内置的力矩传感器 + * + * @param name 末端力矩传感器的名字 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * selectTcpForceSensor(self: pyaubo_sdk.RobotConfig, arg0: str) -> int + * + * @par Lua函数原型 + * selectTcpForceSensor(name: string) -> nil + * \endchinese + * \english + * Set the TCP force sensor. + * If there is a built-in TCP force sensor, the built-in sensor will be used + * by default. + * + * @param name Name of the TCP force sensor. + * + * @return Returns 0 on success; error code on failure. + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * selectTcpForceSensor(self: pyaubo_sdk.RobotConfig, arg0: str) -> int + * + * @par Lua function prototype + * selectTcpForceSensor(name: string) -> nil + * \endenglish + */ + int selectTcpForceSensor(const std::string &name); + + /** + * \chinese + * 设置传感器安装位姿 + * + * @param sensor_pose 传感器安装位姿 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Set the sensor mounting pose. + * + * @param sensor_pose Sensor mounting pose + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int setTcpForceSensorPose(const std::vector &sensor_pose); + + /** + * \chinese + * 获取传感器安装位姿 + * + * @return 传感器安装位姿 + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getTcpForceSensorPose","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the sensor mounting pose. + * + * @return Sensor mounting pose. + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getTcpForceSensorPose","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getTcpForceSensorPose(); + + /** + * \chinese + * 是否安装了末端力矩传感器 + * + * @return 安装返回true; 没有安装返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * hasTcpForceSensor(self: pyaubo_sdk.RobotConfig) -> bool + * + * @par Lua函数原型 + * hasTcpForceSensor() -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.hasTcpForceSensor","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endchinese + * \english + * Whether a TCP force sensor is installed. + * + * @return Returns true if installed; false otherwise. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * hasTcpForceSensor(self: pyaubo_sdk.RobotConfig) -> bool + * + * @par Lua function prototype + * hasTcpForceSensor() -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.hasTcpForceSensor","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endenglish + */ + bool hasTcpForceSensor(); + + /** + * \chinese + * 设置末端力矩偏移 + * + * @param force_offset 末端力矩偏移 + * @return 成功返回0; 失败返回错误码 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setTcpForceOffset(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int + * + * @par Lua函数原型 + * setTcpForceOffset(force_offset: table) -> nil + * + * \endchinese + * \english + * Set the TCP force/torque offset. + * + * @param force_offset TCP force/torque offset + * @return Returns 0 on success; error code on failure + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setTcpForceOffset(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int + * + * @par Lua function prototype + * setTcpForceOffset(force_offset: table) -> nil + * + * \endenglish + */ + int setTcpForceOffset(const std::vector &force_offset); + + /** + * \chinese + * 获取末端力矩偏移 + * + * @return 返回末端力矩偏移 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getTcpForceOffset(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getTcpForceOffset() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getTcpForceOffset","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the TCP force/torque offset. + * + * @return Returns the TCP force/torque offset. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getTcpForceOffset(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getTcpForceOffset() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getTcpForceOffset","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getTcpForceOffset(); + + /** + * \chinese + * 获取可用的底座力矩传感器的名字 + * + * @return 返回可用的底座力矩传感器的名字 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getBaseForceSensorNames(self: pyaubo_sdk.RobotConfig) -> List[str] + * + * @par Lua函数原型 + * getBaseForceSensorNames() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getBaseForceSensorNames","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[]} + * + * \endchinese + * \english + * Get the names of available base force sensors. + * + * @return Returns the names of available base force sensors. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getBaseForceSensorNames(self: pyaubo_sdk.RobotConfig) -> List[str] + * + * @par Lua function prototype + * getBaseForceSensorNames() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getBaseForceSensorNames","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[]} + * + * \endenglish + */ + std::vector getBaseForceSensorNames(); + + /** + * \chinese + * 设置底座力矩传感器 + * 如果存在内置的底座力矩传感器,默认将使用内置的力矩传感器 + * + * @param name 底座力矩传感器的名字 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * selectBaseForceSensor(self: pyaubo_sdk.RobotConfig, arg0: str) -> int + * + * @par Lua函数原型 + * selectBaseForceSensor(name: string) -> nil + * \endchinese + * \english + * Set the base force sensor. + * If there is a built-in base force sensor, the built-in sensor will be + * used by default. + * + * @param name Name of the base force sensor. + * + * @return Returns 0 on success; error code on failure. + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * selectBaseForceSensor(self: pyaubo_sdk.RobotConfig, arg0: str) -> int + * + * @par Lua function prototype + * selectBaseForceSensor(name: string) -> nil + * \endenglish + */ + int selectBaseForceSensor(const std::string &name); + + /** + * \chinese + * 是否安装了底座力矩传感器 + * + * @return 安装返回true;没有安装返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * hasBaseForceSensor(self: pyaubo_sdk.RobotConfig) -> bool + * + * @par Lua函数原型 + * hasBaseForceSensor() -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.hasBaseForceSensor","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endchinese + * \english + * Whether a base force sensor is installed. + * + * @return Returns true if installed; false otherwise. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * hasBaseForceSensor(self: pyaubo_sdk.RobotConfig) -> bool + * + * @par Lua function prototype + * hasBaseForceSensor() -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.hasBaseForceSensor","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endenglish + */ + bool hasBaseForceSensor(); + + /** + * \chinese + * 设置底座力矩偏移 + * + * @param force_offset 底座力矩偏移 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setBaseForceOffset(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> + * int + * + * @par Lua函数原型 + * setBaseForceOffset(force_offset: table) -> nil + * \endchinese + * \english + * Set the base force/torque offset. + * + * @param force_offset Base force/torque offset + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setBaseForceOffset(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> + * int + * + * @par Lua function prototype + * setBaseForceOffset(force_offset: table) -> nil + * \endenglish + */ + int setBaseForceOffset(const std::vector &force_offset); + + /** + * \chinese + * 获取底座力矩偏移 + * + * @return 返回底座力矩偏移 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getBaseForceOffset(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getBaseForceOffset() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getBaseForceOffset","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[]} + * + * \endchinese + * \english + * Get the base force/torque offset. + * + * @return Returns the base force/torque offset. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getBaseForceOffset(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getBaseForceOffset() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getBaseForceOffset","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[]} + * + * \endenglish + */ + std::vector getBaseForceOffset(); + + /** + * \chinese + * 获取安全参数校验码 CRC32 + * + * @return 返回安全参数校验码 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getSafetyParametersCheckSum(self: pyaubo_sdk.RobotConfig) -> int + * + * @par Lua函数原型 + * getSafetyParametersCheckSum() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getSafetyParametersCheckSum","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":2033397241} + * + * \endchinese + * \english + * Get the safety parameter checksum CRC32. + * + * @return Returns the safety parameter checksum. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getSafetyParametersCheckSum(self: pyaubo_sdk.RobotConfig) -> int + * + * @par Lua function prototype + * getSafetyParametersCheckSum() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getSafetyParametersCheckSum","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":2033397241} + * + * \endenglish + */ + uint32_t getSafetyParametersCheckSum(); + + /** + * \chinese + * 发起确认安全配置参数请求: + * 将安全配置参数写入到安全接口板flash或文件 + * + * @param parameters 安全配置参数 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * confirmSafetyParameters(self: pyaubo_sdk.RobotConfig, arg0: + * arcs::common_interface::RobotSafetyParameterRange) -> int + * + * @par Lua函数原型 + * + * \endchinese + * \english + * Initiate a request to confirm safety configuration parameters: + * Write safety configuration parameters to the safety interface board flash + * or file. + * + * @param parameters Safety configuration parameters. + * + * @return Returns 0 on success; error code on failure. + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * confirmSafetyParameters(self: pyaubo_sdk.RobotConfig, arg0: + * arcs::common_interface::RobotSafetyParameterRange) -> int + * + * @par Lua function prototype + * + * \endenglish + */ + int confirmSafetyParameters(const RobotSafetyParameterRange ¶meters); + + /** + * \chinese + * 计算安全参数的 CRC32 校验值 + * + * @return crc32 + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Calculate the CRC32 checksum of safety parameters. + * + * @return crc32 + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + uint32_t calcSafetyParametersCheckSum( + const RobotSafetyParameterRange ¶meters); + + /** + * \chinese + * 获取关节最大位置(物理极限) + * + * @return 返回关节最大位置 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointMaxPositions(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getJointMaxPositions() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getJointMaxPositions","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[6.283185307179586,6.283185307179586,6.283185307179586,6.283185307179586,6.283185307179586,6.283185307179586]} + * \endchinese + * \english + * Get the joint maximum positions (physical limits). + * + * @return Returns the joint maximum positions. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointMaxPositions(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getJointMaxPositions() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getJointMaxPositions","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[6.283185307179586,6.283185307179586,6.283185307179586,6.283185307179586,6.283185307179586,6.283185307179586]} + * \endenglish + */ + std::vector getJointMaxPositions(); + + /** + * \chinese + * 获取关节最小位置(物理极限) + * + * @return 返回关节最小位置 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointMinPositions(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getJointMinPositions() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getJointMinPositions","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[-6.283185307179586,-6.283185307179586,-6.283185307179586,-6.283185307179586,-6.283185307179586,-6.283185307179586]} + * \endchinese + * \english + * Get the joint minimum positions (physical limits). + * + * @return Returns the joint minimum positions. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointMinPositions(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getJointMinPositions() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getJointMinPositions","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[-6.283185307179586,-6.283185307179586,-6.283185307179586,-6.283185307179586,-6.283185307179586,-6.283185307179586]} + * \endenglish + */ + std::vector getJointMinPositions(); + + /** + * \chinese + * 获取关节最大速度(物理极限) + * + * @return 返回关节最大速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointMaxSpeeds(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getJointMaxSpeeds() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getJointMaxSpeeds","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[3.892084231947355,3.892084231947355,3.892084231947355,3.1066860685499065,3.1066860685499065,3.1066860685499065]} + * \endchinese + * \english + * Get the joint maximum speeds (physical limits). + * + * @return Returns the joint maximum speeds. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointMaxSpeeds(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getJointMaxSpeeds() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getJointMaxSpeeds","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[3.892084231947355,3.892084231947355,3.892084231947355,3.1066860685499065,3.1066860685499065,3.1066860685499065]} + * \endenglish + */ + std::vector getJointMaxSpeeds(); + + /** + * \chinese + * 获取关节最大加速度(物理极限) + * + * @return 返回关节最大加速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointMaxAccelerations(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getJointMaxAccelerations() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getJointMaxAccelerations","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[31.104877758314785,31.104877758314785,31.104877758314785,20.73625684294463,20.73625684294463,20.73625684294463]} + * \endchinese + * \english + * Get the joint maximum accelerations (physical limits). + * + * @return Returns the joint maximum accelerations. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointMaxAccelerations(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getJointMaxAccelerations() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getJointMaxAccelerations","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[31.104877758314785,31.104877758314785,31.104877758314785,20.73625684294463,20.73625684294463,20.73625684294463]} + * \endenglish + */ + std::vector getJointMaxAccelerations(); + + /** + * \chinese + * 获取TCP最大速度(物理极限) + * + * @return 返回TCP最大速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getTcpMaxSpeeds(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getTcpMaxSpeeds() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getTcpMaxSpeeds","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[2.0,5.0]} + * \endchinese + * \english + * Get the TCP maximum speed (physical limits). + * + * @return Returns the TCP maximum speed. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getTcpMaxSpeeds(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getTcpMaxSpeeds() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getTcpMaxSpeeds","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[2.0,5.0]} + * \endenglish + */ + std::vector getTcpMaxSpeeds(); + + /** + * \chinese + * 获取TCP最大加速度(物理极限) + * + * @return 返回TCP最大加速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getTcpMaxAccelerations(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getTcpMaxAccelerations() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getTcpMaxAccelerations","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[10.0,10.0]} + * + * \endchinese + * \english + * Get the TCP maximum acceleration (physical limits). + * + * @return Returns the TCP maximum acceleration. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getTcpMaxAccelerations(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getTcpMaxAccelerations() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getTcpMaxAccelerations","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[10.0,10.0]} + * \endenglish + */ + std::vector getTcpMaxAccelerations(); + + /** + * \chinese + * 设置机器人安装姿态 + * + * @param gravity 安装姿态 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setGravity(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int + * + * @par Lua函数原型 + * setGravity(gravity: table) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setGravity","params":[[0.0,0.0,-9.87654321]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set the robot installation attitude (gravity vector). + * + * @param gravity Installation attitude (gravity vector) + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setGravity(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int + * + * @par Lua function prototype + * setGravity(gravity: table) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setGravity","params":[[0.0,0.0,-9.87654321]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setGravity(const std::vector &gravity); + + /** + * \chinese + * 获取机器人的安装姿态 + * + * 如果机器人底座安装了姿态传感器,则从传感器读取数据,否则按照用户设置 + * + * @return 返回安装姿态 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getGravity(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getGravity() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getGravity","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,-9.87654321]} + * + * \endchinese + * \english + * Get the robot's installation attitude (gravity vector). + * + * If the robot base is equipped with an attitude sensor, data is read from + * the sensor; otherwise, the user setting is used. + * + * @return Returns the installation attitude. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getGravity(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getGravity() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getGravity","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,-9.87654321]} + * + * \endenglish + */ + std::vector getGravity(); + + /** + * \chinese + * 设置当前的TCP偏移 + * + * TCP偏移表示形式为(x,y,z,rx,ry,rz)。 + * 其中x、y、z是工具中心点(TCP)在基坐标系下相对于法兰盘中心的位置偏移,单位是m。 + * rx、ry、rz是工具中心点(TCP)在基坐标系下相对于法兰盘中心的的姿态偏移,是ZYX欧拉角,单位是rad。 + * + * @param offset 当前的TCP偏移,形式为(x,y,z,rx,ry,rz) + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setTcpOffset(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int + * + * @par Lua函数原型 + * setTcpOffset(offset: table) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setTcpOffset","params":[[0.0,0.0,0.0,0.0,0.0,0.0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set the current TCP offset. + * + * The TCP offset is represented as (x, y, z, rx, ry, rz). + * x, y, z are the position offsets of the Tool Center Point (TCP) relative + * to the flange center in the base coordinate system, in meters. rx, ry, rz + * are the orientation offsets of the TCP relative to the flange center in + * the base coordinate system, as ZYX Euler angles in radians. + * + * @param offset The current TCP offset, in the form (x, y, z, rx, ry, rz) + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setTcpOffset(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> int + * + * @par Lua function prototype + * setTcpOffset(offset: table) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setTcpOffset","params":[[0.0,0.0,0.0,0.0,0.0,0.0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setTcpOffset(const std::vector &offset); + + /** + * \chinese + * 获取当前的TCP偏移 + * + * TCP偏移表示形式为(x,y,z,rx,ry,rz)。 + * 其中x、y、z是工具中心点(TCP)在基坐标系下相对于法兰盘中心的位置偏移,单位是m。 + * rx、ry、rz是工具中心点(TCP)在基坐标系下相对于法兰盘中心的的姿态偏移,是ZYX欧拉角,单位是rad。 + * + * @return 当前的TCP偏移,形式为(x,y,z,rx,ry,rz) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getTcpOffset(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getTcpOffset() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getTcpOffset","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the current TCP offset. + * + * The TCP offset is represented as (x, y, z, rx, ry, rz). + * x, y, z are the position offsets of the Tool Center Point (TCP) relative + * to the flange center in the base coordinate system, in meters. rx, ry, rz + * are the orientation offsets of the TCP relative to the flange center in + * the base coordinate system, as ZYX Euler angles in radians. + * + * @return The current TCP offset, in the form (x, y, z, rx, ry, rz) + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getTcpOffset(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getTcpOffset() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getTcpOffset","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getTcpOffset(); + + /** + * \chinese + * 设置工具端质量、质心及惯量 + * + * @param m 工具端质量 + * @param com 质心 + * @param inertial 惯量 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setToolInertial(self: pyaubo_sdk.RobotConfig, arg0: float, arg1: + * List[float], arg2: List[float]) -> int + * + * @par Lua函数原型 + * setToolInertial(m: number, com: table, inertial: table) -> nil + * \endchinese + * \english + * Set tool mass, center of mass, and inertia. + * + * @param m Tool mass + * @param com Center of mass + * @param inertial Inertia + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setToolInertial(self: pyaubo_sdk.RobotConfig, arg0: float, arg1: + * List[float], arg2: List[float]) -> int + * + * @par Lua function prototype + * setToolInertial(m: number, com: table, inertial: table) -> nil + * \endenglish + */ + int setToolInertial(double m, const std::vector &com, + const std::vector &inertial); + + /** + * \chinese + * 设置有效负载 + * + * @param m 质量, 单位: kg + * @param cog 重心, 单位: m, 形式为(CoGx, CoGy, CoGz) + * @param aom 力矩轴的方向, 单位: rad, 形式为(rx, ry, rz) + * @param inertia 惯量, 单位: kg*m^2, 形式为(Ixx, Iyy, Izz, Ixy, Ixz, + * Iyz)或(Ixx, Ixy, Ixz, Iyx, Iyy, Iyz, Izx, Izy, Izz) + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setPayload(self: pyaubo_sdk.RobotConfig, arg0: float, arg1: List[float], + * arg2: List[float], arg3: List[float]) -> int + * + * @par Lua函数原型 + * setPayload(m: number, cog: table, aom: table, inertia: table) -> nil + * + * @par Lua示例 + * setPayload(3, {0,0,0}, {0,0,0}, {0,0,0,0,0,0,0,0,0}) + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setPayload","params":[3,[0,0,0],[0,0,0],[0,0,0,0,0,0,0,0,0]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Set the payload. + * + * @param m Mass, unit: kg + * @param cog Center of gravity, unit: m, format (CoGx, CoGy, CoGz) + * @param aom Axis of moment, unit: rad, format (rx, ry, rz) + * @param inertia Inertia, unit: kg*m^2, format (Ixx, Iyy, Izz, Ixy, Ixz, + * Iyz) or (Ixx, Ixy, Ixz, Iyx, Iyy, Iyz, Izx, Izy, Izz) + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setPayload(self: pyaubo_sdk.RobotConfig, arg0: float, arg1: List[float], + * arg2: List[float], arg3: List[float]) -> int + * + * @par Lua function prototype + * setPayload(m: number, cog: table, aom: table, inertia: table) -> nil + * + * @par Lua example + * setPayload(3, {0,0,0}, {0,0,0}, {0,0,0,0,0,0,0,0,0}) + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.setPayload","params":[3,[0,0,0],[0,0,0],[0,0,0,0,0,0,0,0,0]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int setPayload(double m, const std::vector &cog, + const std::vector &aom, + const std::vector &inertia); + + /** + * \chinese + * 获取有效负载 + * + * @return 有效负载. + * 第一个元素表示质量, 单位: kg; + * 第二个元素表示重心, 单位: m, 形式为(CoGx, CoGy, CoGz); + * 第三个元素表示力矩轴的方向, 单位: rad, 形式为(rx, ry, rz); + * 第四个元素表示惯量, 单位: kg*m^2, 形式为(Ixx, Iyy, Izz, Ixy, Ixz, Iyz) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getPayload(self: pyaubo_sdk.RobotConfig) -> Tuple[float, List[float], + * List[float], List[float]] + * + * @par Lua函数原型 + * getPayload() -> number, table, table, table + * + * @par Lua示例 + * m, cog, aom, inertia = getPayload() + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getPayload","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[3.0,[0.0,0.0,0.0],[0.0,0.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0]]} + * \endchinese + * \english + * Get the payload. + * + * @return The payload. + * The first element is the mass in kg; + * The second element is the center of gravity in meters, format (CoGx, + * CoGy, CoGz); The third element is the axis of moment in radians, format + * (rx, ry, rz); The fourth element is the inertia in kg*m^2, format (Ixx, + * Iyy, Izz, Ixy, Ixz, Iyz) + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getPayload(self: pyaubo_sdk.RobotConfig) -> Tuple[float, List[float], + * List[float], List[float]] + * + * @par Lua function prototype + * getPayload() -> number, table, table, table + * + * @par Lua example + * m, cog, aom, inertia = getPayload() + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getPayload","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[3.0,[0.0,0.0,0.0],[0.0,0.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0]]} + * \endenglish + */ + Payload getPayload(); + + /** + * \chinese + * 末端位姿是否在安全范围之内 + * + * @param pose 末端位姿 + * @return 在安全范围内返回true; 反之返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * toolSpaceInRange(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> bool + * + * @par Lua函数原型 + * toolSpaceInRange(pose: table) -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.toolSpaceInRange","params":[[0.58712, + * -0.15775, 0.48703, 2.76, 0.344, 1.432]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":true} + * \endchinese + * \english + * Whether the end-effector pose is within the safety range. + * + * @param pose End-effector pose + * @return Returns true if within the safety range; otherwise returns false + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * toolSpaceInRange(self: pyaubo_sdk.RobotConfig, arg0: List[float]) -> bool + * + * @par Lua function prototype + * toolSpaceInRange(pose: table) -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.toolSpaceInRange","params":[[0.58712, + * -0.15775, 0.48703, 2.76, 0.344, 1.432]],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":true} + * \endenglish + */ + bool toolSpaceInRange(const std::vector &pose); + + /** + * \chinese + * 发起固件升级请求,控制器软件将进入固件升级模式 + * + * @param fw 固件升级路径。该路径的格式为: 固件安装包路径\#升级节点列表。 + * 其中固件安装包路径和升级节点列表以井号(#)分隔,升级节点以逗号(,)分隔。 + * 如果节点名称后带有!,则表示强制(不带版本校验)升级该节点; + * 反之,则表示带校验版本地升级节点, + * 即在升级该节点前,会先判断当前版本和目标版本是否相同,如果相同就不升级该节点。\n + * 可以根据实际需求灵活设置需要升级的节点。\n + * 例如, + * /tmp/firmware_update-1.0.42-rc.5+2347b0d.firm\#master_mcu!,slace_mcu!, + * base!,tool!,joint1!,joint2!,joint3!,joint4!,joint5!,joint6! + * 表示强制升级接口板主板、接口板从板、基座、工具和6个关节(joint1至joint6)。\n + * all表示所有的节点,例如 + * /tmp/firm_XXX.firm\#all 表示带校验版本地升级全部节点, + * /tmp/firm_XXX.firm\#all!表示强制升级全部节点 + * + * @return 指令下发成功返回0; 失败返回错误码。 \n + * -AUBO_BAD_STATE: 运行时(RuntimeMachine)的当前状态不是Stopped, + * 固件升级请求被拒绝。AUBO_BAD_STATE的值是1。 \n + * -AUBO_TIMEOUT: 超时。AUBO_TIMEOUT的值是4。 \n + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * firmwareUpdate(self: pyaubo_sdk.RobotConfig, arg0: str) -> int + * + * @par Lua函数原型 + * firmwareUpdate(fw: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.firmwareUpdate","params":["/tmp/firmware_update-1.0.42-rc.12+3e33eac.firm#master_mcu"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Initiate a firmware upgrade request. The controller software will enter + * firmware upgrade mode. + * + * @param fw Firmware upgrade path. The format is: firmware package + * path\#upgrade node list. The firmware package path and node list are + * separated by a hash (#), and nodes are separated by commas (,). If a node + * name ends with !, it means to force upgrade (without version check) that + * node; otherwise, the node will be upgraded only if the current version + * differs from the target version. You can flexibly specify which nodes to + * upgrade as needed. For example, + * /tmp/firmware_update-1.0.42-rc.5+2347b0d.firm#master_mcu!,slace_mcu!,base!,tool!,joint1!,joint2!,joint3!,joint4!,joint5!,joint6! + * means to force upgrade the interface board main, interface board slave, + * base, tool, and joints 1-6. "all" means all nodes, e.g. + * /tmp/firm_XXX.firm#all means upgrade all nodes with version check, + * /tmp/firm_XXX.firm#all! means force upgrade all nodes. + * + * @return Returns 0 if the command is sent successfully; otherwise, returns + * an error code. -AUBO_BAD_STATE: The current state of the RuntimeMachine + * is not Stopped, so the firmware upgrade request is rejected. + * AUBO_BAD_STATE = 1. -AUBO_TIMEOUT: Timeout. AUBO_TIMEOUT = 4. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * firmwareUpdate(self: pyaubo_sdk.RobotConfig, arg0: str) -> int + * + * @par Lua function prototype + * firmwareUpdate(fw: string) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.firmwareUpdate","params":["/tmp/firmware_update-1.0.42-rc.12+3e33eac.firm#master_mcu"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int firmwareUpdate(const std::string &fw); + + /** + * \chinese + * 获取当前的固件升级的进程 + * + * @return 当前的固件升级进程。 \n + * 第一个元素表示步骤名称。如果是failed,则表示固件升级失败 \n + * 第二个元素表示升级的进度(0~1),完成之后,返回("", 1) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getFirmwareUpdateProcess(self: pyaubo_sdk.RobotConfig) -> Tuple[str, + * float] + * + * @par Lua函数原型 + * getFirmwareUpdateProcess() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getFirmwareUpdateProcess","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[" ",0.0]} + * + * \endchinese + * \english + * Get the current firmware upgrade process. + * + * @return The current firmware upgrade process. \n + * The first element is the step name. If it is "failed", the firmware + * upgrade failed. \n The second element is the upgrade progress (0~1). When + * finished, returns ("", 1) + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getFirmwareUpdateProcess(self: pyaubo_sdk.RobotConfig) -> Tuple[str, + * float] + * + * @par Lua function prototype + * getFirmwareUpdateProcess() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getFirmwareUpdateProcess","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[" ",0.0]} + * + * \endenglish + */ + std::tuple getFirmwareUpdateProcess(); + + /** + * \chinese + * 获取关节最大位置(当前正在使用的限制值) + * + * @return 返回关节最大位置(当前正在使用的限制值) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getLimitJointMaxPositions(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getLimitJointMaxPositions() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getLimitJointMaxPositions","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[6.2831854820251465,6.2831854820251465,6.2831854820251465,6.2831854820251465,6.2831854820251465,6.2831854820251465]} + * \endchinese + * \english + * Get the joint maximum positions (currently used limit values). + * + * @return Returns the joint maximum positions (currently used limit + * values). + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getLimitJointMaxPositions(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getLimitJointMaxPositions() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getLimitJointMaxPositions","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[6.2831854820251465,6.2831854820251465,6.2831854820251465,6.2831854820251465,6.2831854820251465,6.2831854820251465]} + * \endenglish + */ + std::vector getLimitJointMaxPositions(); + + /** + * \chinese + * 获取关节最小位置(当前正在使用的限制值) + * + * @return 返回关节最小位置(当前正在使用的限制值) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getLimitJointMinPositions(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getLimitJointMinPositions() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getLimitJointMinPositions","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[-6.2831854820251465,-6.2831854820251465,-6.2831854820251465,-6.2831854820251465,-6.2831854820251465,-6.2831854820251465]} + * \endchinese + * \english + * Get the joint minimum positions (currently used limit values). + * + * @return Returns the joint minimum positions (currently used limit + * values). + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getLimitJointMinPositions(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getLimitJointMinPositions() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getLimitJointMinPositions","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[-6.2831854820251465,-6.2831854820251465,-6.2831854820251465,-6.2831854820251465,-6.2831854820251465,-6.2831854820251465]} + * \endenglish + */ + std::vector getLimitJointMinPositions(); + + /** + * \chinese + * 获取关节最大速度(当前正在使用的限制值) + * + * @return 返回关节最大速度(当前正在使用的限制值) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getLimitJointMaxSpeeds(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getLimitJointMaxSpeeds() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getLimitJointMaxSpeeds","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[3.8920841217041016,3.8920841217041016,3.8920841217041016,3.1066861152648926,3.1066861152648926,3.1066861152648926]} + * \endchinese + * \english + * Get the joint maximum speeds (currently used limit values). + * + * @return Returns the joint maximum speeds (currently used limit values). + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getLimitJointMaxSpeeds(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getLimitJointMaxSpeeds() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getLimitJointMaxSpeeds","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[3.8920841217041016,3.8920841217041016,3.8920841217041016,3.1066861152648926,3.1066861152648926,3.1066861152648926]} + * \endenglish + */ + std::vector getLimitJointMaxSpeeds(); + + /** + * \chinese + * 获取关节最大加速度(当前正在使用的限制值) + * + * @return 返回关节最大加速度(当前正在使用的限制值) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getLimitJointMaxAccelerations(self: pyaubo_sdk.RobotConfig) -> + * List[float] + * + * @par Lua函数原型 + * getLimitJointMaxAccelerations() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getLimitJointMaxAccelerations","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[31.104877758314785,31.104877758314785,31.104877758314785,20.73625684294463,20.73625684294463,20.73625684294463]} + * \endchinese + * \english + * Get the joint maximum accelerations (currently used limit values). + * + * @return Returns the joint maximum accelerations (currently used limit + * values). + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getLimitJointMaxAccelerations(self: pyaubo_sdk.RobotConfig) -> + * List[float] + * + * @par Lua function prototype + * getLimitJointMaxAccelerations() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getLimitJointMaxAccelerations","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[31.104877758314785,31.104877758314785,31.104877758314785,20.73625684294463,20.73625684294463,20.73625684294463]} + * \endenglish + */ + std::vector getLimitJointMaxAccelerations(); + + /** + * \chinese + * 获取TCP最大速度(当前正在使用的限制值) + * + * @return 返回TCP最大速度(当前正在使用的限制值) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getLimitTcpMaxSpeed(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua函数原型 + * getLimitTcpMaxSpeed() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getLimitTcpMaxSpeed","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":2.0} + * \endchinese + * \english + * Get the TCP maximum speed (currently used limit value). + * + * @return Returns the TCP maximum speed (currently used limit value). + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getLimitTcpMaxSpeed(self: pyaubo_sdk.RobotConfig) -> List[float] + * + * @par Lua function prototype + * getLimitTcpMaxSpeed() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getLimitTcpMaxSpeed","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":2.0} + * \endenglish + */ + double getLimitTcpMaxSpeed(); + + /** + * \chinese + * 获取当前安全停止的类型 + * + * @return 返回当前安全停止的类型 + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getSafeguardStopType","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"None"} + * \endchinese + * \english + * Get the current safeguard stop type. + * + * @return Returns the current safeguard stop type. + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getSafeguardStopType","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"None"} + * \endenglish + */ + SafeguedStopType getSafeguardStopType(); + + /** + * \chinese + * 按位获取完整的安全停止触发源 + * + * @return 返回所有安全停止触发源 + * + * 安全停止的原因: + * 手动模式下可配置安全IO触发的安全停止 - 1<<0 + * 自动模式下可配置安全IO触发的安全停止 - 1<<1 + * 控制柜SI输入触发的安全停止 - 1<<2 + * 示教器三态开关触发的安全停止 - 1<<3 + * 自动切手动触发的安全停止 - 1<<4 + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getSafeguardStopSource","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Get the complete safeguard stop source as a bitmask. + * + * @return Returns all safeguard stop sources. + * + * Reasons for safeguard stop: + * Safeguard stop triggered by configurable safety IO in manual mode - 1<<0 + * Safeguard stop triggered by configurable safety IO in automatic mode - + * 1<<1 Safeguard stop triggered by control box SI input - 1<<2 Safeguard + * stop triggered by teach pendant three-position switch - 1<<3 Safeguard + * stop triggered by switching from auto to manual - 1<<4 + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getSafeguardStopSource","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int getSafeguardStopSource(); + + /** + * \chinese + * 按位获取完整的机器人紧急停止触发源 + * + * @return 返回所有机器人紧急停止触发源 + * + * 紧急停止的原因: + * 控制柜紧急停止按钮触发 - 1<<0 + * 示教器紧急停止按钮触发 - 1<<1 + * 手柄紧急停止按钮触发 - 1<<2 + * 固定IO紧急停止触发 - 1<<3 + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getRobotEmergencyStopSource","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Get the complete robot emergency stop source as a bitmask. + * + * @return Returns all robot emergency stop sources. + * + * Reasons for emergency stop: + * Emergency stop triggered by control box button - 1<<0 + * Emergency stop triggered by teach pendant button - 1<<1 + * Emergency stop triggered by handle button - 1<<2 + * Emergency stop triggered by fixed IO - 1<<3 + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getRobotEmergencyStopSource","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int getRobotEmergencyStopSource(); + + /** + * \chinese + * 获取工具端力矩传感器的名字 + * + * @return 当前工具端力矩传感器名字 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getSelectedTcpForceSensorName(self: pyaubo_sdk.RobotConfig) -> str + * + * @par Lua函数原型 + * getSelectedTcpForceSensorName() -> str + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getSelectedTcpForceSensorName","params":[],"id":1} + * \endchinese + * \english + * Get the name of the selected TCP force sensor. + * + * @return The name of the currently selected TCP force sensor. + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getSelectedTcpForceSensorName(self: pyaubo_sdk.RobotConfig) -> str + * + * @par Lua function prototype + * getSelectedTcpForceSensorName() -> str + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotConfig.getSelectedTcpForceSensorName","params":[],"id":1} + * \endenglish + */ + std::string getSelectedTcpForceSensorName(); + +protected: + void *d_; +}; +using RobotConfigPtr = std::shared_ptr; + +} // namespace common_interface +} // namespace arcs +#endif // AUBO_SDK_ROBOT_CONFIG_H diff --git a/third_party/AuboSdk/win/include/aubo/robot/robot_manage.h b/third_party/AuboSdk/win/include/aubo/robot/robot_manage.h new file mode 100644 index 00000000..cb6ded5f --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo/robot/robot_manage.h @@ -0,0 +1,1461 @@ +/** @file robot_manage.h + * @brief 机器人管理接口,如上电、启动、拖动示教模式等 + */ +#ifndef AUBO_SDK_ROBOT_CONTROL_INTERFACE_H +#define AUBO_SDK_ROBOT_CONTROL_INTERFACE_H + +#include +#include + +#include +#include + +namespace arcs { +namespace common_interface { + +class ARCS_ABI_EXPORT RobotManage +{ +public: + RobotManage(); + virtual ~RobotManage(); + + /** + * \chinese + * 发起机器人上电请求 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * poweron(self: pyaubo_sdk.RobotManage) -> int + * + * @par Lua函数原型 + * poweron() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.poweron","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++ 实例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->poweron(); + * @endcode + * + * \endchinese + * + * \english + * Initiate robot power-on request + * + * @return Returns 0 on success; error code on failure + * AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * poweron(self: pyaubo_sdk.RobotManage) -> int + * + * @par Lua function prototype + * poweron() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.poweron","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->poweron(); + * @endcode + * \endenglish + */ + int poweron(); + + /** + * \chinese + * 发起机器人启动请求 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * startup(self: pyaubo_sdk.RobotManage) -> int + * + * @par Lua函数原型 + * startup() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.startup","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->startup(); + * @endcode + * \endchinese + * + * \english + * Initiate robot startup request + * + * @return Returns 0 on success; error code on failure + * AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * startup(self: pyaubo_sdk.RobotManage) -> int + * + * @par Lua function prototype + * startup() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.startup","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->startup(); + * @endcode + * \endenglish + */ + int startup(); + + /** + * \chinese + * 发起机器人松开刹车请求 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * releaseRobotBrake(self: pyaubo_sdk.RobotManage) -> int + * + * @par Lua函数原型 + * releaseRobotBrake() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.releaseRobotBrake","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->releaseRobotBrake(); + * @endcode + * \endchinese + * + * \english + * Initiate robot brake release request + * + * @return Returns 0 on success; error code on failure + * AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * releaseRobotBrake(self: pyaubo_sdk.RobotManage) -> int + * + * @par Lua function prototype + * releaseRobotBrake() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.releaseRobotBrake","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->releaseRobotBrake(); + * @endcode + * \endenglish + */ + int releaseRobotBrake(); + + /** + * \chinese + * 发起机器人刹车请求 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * lockRobotBrake(self: pyaubo_sdk.RobotManage) -> int + * + * @par Lua函数原型 + * lockRobotBrake() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.lockRobotBrake","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->lockRobotBrake(); + * @endcode + * \endchinese + * + * \english + * Initiate robot brake lock request + * + * @return Returns 0 on success; error code on failure + * AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * lockRobotBrake(self: pyaubo_sdk.RobotManage) -> int + * + * @par Lua function prototype + * lockRobotBrake() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.lockRobotBrake","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->lockRobotBrake(); + * @endcode + * \endenglish + */ + int lockRobotBrake(); + + /** + * \chinese + * 发起机器人断电请求 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * poweroff(self: pyaubo_sdk.RobotManage) -> int + * + * @par Lua函数原型 + * poweroff() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.poweroff","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->poweroff(); + * @endcode + * \endchinese + * + * \english + * Initiate robot power-off request + * + * @return Returns 0 on success; error code on failure + * AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * poweroff(self: pyaubo_sdk.RobotManage) -> int + * + * @par Lua function prototype + * poweroff() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.poweroff","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->poweroff(); + * @endcode + * \endenglish + */ + int poweroff(); + + /** + * \chinese + * 发起机器人反向驱动请求 + * + * @param enable + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * backdrive(self: pyaubo_sdk.RobotManage, arg0: bool) -> int + * + * @par Lua函数原型 + * backdrive(enable: boolean) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.backdrive","params":[false],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->backdrive(true); + * @endcode + * \endchinese + * + * \english + * Initiate robot backdrive request + * + * @param enable + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * backdrive(self: pyaubo_sdk.RobotManage, arg0: bool) -> int + * + * @par Lua function prototype + * backdrive(enable: boolean) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.backdrive","params":[false],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->backdrive(true); + * @endcode + * \endenglish + */ + int backdrive(bool enable); + + /** + * \chinese + * 发起机器人自由驱动请求 + * 接口在软件版本 0.31.x 后已废弃,使用 handguideMode 接口替换 + * handguideMode({1,1,1,1,1}, {0,0,0,0,0,0}) + * + * @param enable + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * freedrive(self: pyaubo_sdk.RobotManage, arg0: bool) -> int + * + * @par Lua函数原型 + * freedrive(enable: boolean) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.freedrive","params":[true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->freedrive(true); + * @endcode + * \endchinese + * + * \english + * Initiate robot freedrive request + * This interface is deprecated after software version 0.31.x, use handguideMode instead: + * handguideMode({1,1,1,1,1}, {0,0,0,0,0,0}) + * + * @param enable + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * freedrive(self: pyaubo_sdk.RobotManage, arg0: bool) -> int + * + * @par Lua function prototype + * freedrive(enable: boolean) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.freedrive","params":[true],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->freedrive(true); + * @endcode + * \endenglish + */ + int freedrive(bool enable); + + /** + * \chinese + * 高阶拖动示教 + * + * @param freeAxes 可以拖动的轴 0-不能拖动 1-可以拖动 + * @param feature 如果维度为0,代表基于 TCP 坐标系拖动 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endchinese + * + * \english + * Advanced hand-guiding mode + * + * @param freeAxes Axes that can be moved: 0-cannot move, 1-can move + * @param feature If the dimension is 0, it means hand-guiding based on the TCP coordinate system + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int handguideMode(const std::vector &freeAxes, + const std::vector &feature); + + /** + * \chinese + * 退出拖动示教 + * + * @note 暂未实现 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endchinese + * + * \english + * Exit hand-guiding mode + * + * @note Not implemented yet + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int exitHandguideMode(); + + /** + * \chinese + * 获取拖动示教器的状态(是否处于奇异空间) + * + * @note 暂未实现 + * + * @return + * • 0 - 正常操作. + * • 1 - 接近奇异空间. + * • 2 - 极其接近奇异点,将产生较大的拖动阻尼. + * + * @throws arcs::common_interface::AuboException + * \endchinese + * + * \english + * Get the status of the hand-guiding device (whether it is in a singular space) + * + * @note Not implemented yet + * + * @return + * • 0 - Normal operation. + * • 1 - Approaching singular space. + * • 2 - Extremely close to a singularity, large hand-guiding damping will occur. + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int getHandguideStatus(); + + /** + * \chinese + * 获取拖动示教器触发源 + * + * @note 暂未实现 + * + * @return + * + * @throws arcs::common_interface::AuboException + * \endchinese + * + * \english + * Get the trigger source of the hand-guiding device + * + * @note Not implemented yet + * + * @return + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int getHandguideTrigger(); + + /** + * \chinese + * 获取拖动示教使能状态 + * + * @return 使能返回true; 失能返回false + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.isHandguideEnabled","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endchinese + * \english + * Get the hand-guiding enable status + * + * @return Returns true if enabled; false if disabled + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.isHandguideEnabled","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * \endenglish + */ + bool isHandguideEnabled(); + + /** + * \chinese + * 发起机器人进入/退出仿真模式请求 + * + * @param enable + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setSim(self: pyaubo_sdk.RobotManage, arg0: bool) -> int + * + * @par Lua函数原型 + * setSim(enable: boolean) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.setSim","params":[true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->setSim(true); + * @endcode + * \endchinese + * + * \english + * Initiate robot enter/exit simulation mode request + * + * @param enable + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setSim(self: pyaubo_sdk.RobotManage, arg0: bool) -> int + * + * @par Lua function prototype + * setSim(enable: boolean) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.setSim","params":[true],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->setSim(true); + * @endcode + * \endenglish + */ + int setSim(bool enable); + + /** + * \chinese + * 设置机器人操作模式 + * + * @param mode 操作模式 + * + * @return 成功返回0; 失败返回错误码 + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setOperationalMode(self: pyaubo_sdk.RobotManage, arg0: + * arcs::common_interface::OperationalModeType) -> int + * + * @par Lua函数原型 + * setOperationalMode(mode: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.setOperationalMode","params":["Manual"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->setOperationalMode(OperationalModeType::Automatic); + * @endcode + * \endchinese + * \english + * Set the robot operational mode + * + * @param mode Operational mode + * + * @return Returns 0 on success; error code on failure + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setOperationalMode(self: pyaubo_sdk.RobotManage, arg0: + * arcs::common_interface::OperationalModeType) -> int + * + * @par Lua function prototype + * setOperationalMode(mode: number) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.setOperationalMode","params":["Manual"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->setOperationalMode(OperationalModeType::Automatic); + * @endcode + * \endenglish + */ + int setOperationalMode(OperationalModeType mode); + + /** + * \chinese + * 获取机器人操作模式 + * + * @return 机器人操作模式 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getOperationalMode(self: pyaubo_sdk.RobotManage) -> arcs::common_interface::OperationalModeType + * + * @par Lua函数原型 + * getOperationalMode() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.getOperationalMode","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"Manual"} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * OperationalModeType mode = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->getOperationalMode(); + * @endcode + * \endchinese + * \english + * Get the robot operational mode + * + * @return Robot operational mode + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getOperationalMode(self: pyaubo_sdk.RobotManage) -> arcs::common_interface::OperationalModeType + * + * @par Lua function prototype + * getOperationalMode() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.getOperationalMode","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"Manual"} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * OperationalModeType mode = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->getOperationalMode(); + * @endcode + * \endenglish + */ + OperationalModeType getOperationalMode(); + + /** + * \chinese + * 获取控制模式 + * + * @return 控制模式 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getRobotControlMode(self: pyaubo_sdk.RobotManage) -> arcs::common_interface::RobotControlModeType + * + * @par Lua函数原型 + * getRobotControlMode() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.getRobotControlMode","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"Position"} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * RobotControlModeType mode = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->getRobotControlMode(); + * @endcode + * \endchinese + * \english + * Get the control mode + * + * @return Control mode + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getRobotControlMode(self: pyaubo_sdk.RobotManage) -> arcs::common_interface::RobotControlModeType + * + * @par Lua function prototype + * getRobotControlMode() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.getRobotControlMode","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"Position"} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * RobotControlModeType mode = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->getRobotControlMode(); + * @endcode + * \endenglish + */ + RobotControlModeType getRobotControlMode(); + + /** + * \chinese + * 是否使能了拖动示教模式 + * + * @return 使能返回true; 反之返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * isFreedriveEnabled(self: pyaubo_sdk.RobotManage) -> bool + * + * @par Lua函数原型 + * isFreedriveEnabled() -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.isFreedriveEnabled","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * bool isEnabled = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->isFreedriveEnabled(); + * @endcode + * \endchinese + * \english + * Whether the freedrive mode is enabled + * + * @return Returns true if enabled; otherwise returns false + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * isFreedriveEnabled(self: pyaubo_sdk.RobotManage) -> bool + * + * @par Lua function prototype + * isFreedriveEnabled() -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.isFreedriveEnabled","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * bool isEnabled = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->isFreedriveEnabled(); + * @endcode + * \endenglish + */ + bool isFreedriveEnabled(); + + /** + * \chinese + * 是否使能了反向驱动模式 + * + * @return 使能返回true; 反之返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * isBackdriveEnabled(self: pyaubo_sdk.RobotManage) -> bool + * + * @par Lua函数原型 + * isBackdriveEnabled() -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.isBackdriveEnabled","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * bool isEnabled = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->isBackdriveEnabled(); + * @endcode + * \endchinese + * \english + * Whether the backdrive mode is enabled + * + * @return Returns true if enabled; otherwise returns false + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * isBackdriveEnabled(self: pyaubo_sdk.RobotManage) -> bool + * + * @par Lua function prototype + * isBackdriveEnabled() -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.isBackdriveEnabled","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * bool isEnabled = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->isBackdriveEnabled(); + * @endcode + * \endenglish + */ + bool isBackdriveEnabled(); + + /** + * \chinese + * 是否使能了仿真模式 + * + * @return 使能返回true; 反之返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * isSimulationEnabled(self: pyaubo_sdk.RobotManage) -> bool + * + * @par Lua函数原型 + * isSimulationEnabled() -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.isSimulationEnabled","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":true} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * bool isEnabled = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->isSimulationEnabled(); + * @endcode + * \endchinese + * \english + * Whether the simulation mode is enabled + * + * @return Returns true if enabled; otherwise returns false + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * isSimulationEnabled(self: pyaubo_sdk.RobotManage) -> bool + * + * @par Lua function prototype + * isSimulationEnabled() -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.isSimulationEnabled","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":true} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * bool isEnabled = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->isSimulationEnabled(); + * @endcode + * \endenglish + */ + bool isSimulationEnabled(); + + /** + * \chinese + * 清除防护停机,包括碰撞停机 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setUnlockProtectiveStop(self: pyaubo_sdk.RobotManage) -> int + * + * @par Lua函数原型 + * setUnlockProtectiveStop() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.setUnlockProtectiveStop","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->setUnlockProtectiveStop(); + * @endcode + * \endchinese + * \english + * Clear protective stop, including collision stop + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setUnlockProtectiveStop(self: pyaubo_sdk.RobotManage) -> int + * + * @par Lua function prototype + * setUnlockProtectiveStop() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.setUnlockProtectiveStop","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->setUnlockProtectiveStop(); + * @endcode + * \endenglish + */ + int setUnlockProtectiveStop(); + + /** + * \chinese + * 重置安全接口板,一般在机器人断电之后需要重置时调用,比如机器人急停、故障等之后 + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * restartInterfaceBoard(self: pyaubo_sdk.RobotManage) -> int + * + * @par Lua函数原型 + * restartInterfaceBoard() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.restartInterfaceBoard","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->restartInterfaceBoard(); + * @endcode + * \endchinese + * \english + * Reset the safety interface board, usually called after the robot is powered off and needs to be reset, such as after emergency stop or fault. + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * restartInterfaceBoard(self: pyaubo_sdk.RobotManage) -> int + * + * @par Lua function prototype + * restartInterfaceBoard() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.restartInterfaceBoard","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->restartInterfaceBoard(); + * @endcode + * \endenglish + */ + int restartInterfaceBoard(); + + /** + * \chinese + * 开始实时轨迹的记录 + * + * @param file_name + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endchinese + * \english + * Start real-time trajectory recording + * + * @param file_name + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_INVL_ARGUMENT + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * \endenglish + */ + int startRecord(const std::string &file_name); + + /** + * \chinese + * 停止实时记录 + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.stopRecord","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Stop real-time recording + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.stopRecord","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int stopRecord(); + + /** + * \chinese + * 暂停实时记录 + * + * @param pause + * + * @return 成功返回0;失败返回错误码 + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.pauseRecord","params":[true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Pause real-time recording + * + * @param pause + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_BAD_STATE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.pauseRecord","params":[true],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int pauseRecord(bool pause); + + /** + * \chinese + * 发起机器人进入/退出联动模式请求, + * 只有操作模式为自动或者无时,才能使能联动模式 + * + * @param enable + * + * @return 成功返回0; 失败返回错误码 + * AUBO_BUSY + * AUBO_REQUEST_IGNORE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * setLinkModeEnable(self: pyaubo_sdk.RobotManage, arg0: bool) -> int + * + * @par Lua函数原型 + * setLinkModeEnable(enable: boolean) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.setLinkModeEnable","params":[true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->setLinkModeEnable(true); + * @endcode + * \endchinese + * \english + * Initiate robot enter/exit link mode request. + * Link mode can only be enabled when the operation mode is Automatic or None. + * + * @param enable + * + * @return Returns 0 on success; error code on failure + * AUBO_BUSY + * AUBO_REQUEST_IGNORE + * -AUBO_BAD_STATE + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * setLinkModeEnable(self: pyaubo_sdk.RobotManage, arg0: bool) -> int + * + * @par Lua function prototype + * setLinkModeEnable(enable: boolean) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.setLinkModeEnable","params":[true],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->setLinkModeEnable(true); + * @endcode + * \endenglish + */ + int setLinkModeEnable(bool enable); + + /** + * \chinese + * 是否使能了联动模式,联动模式下用户可以通过外部IO控制机器人(用户可以对IO的功能进行配置) + * + * @return 使能返回true; 反之返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * isLinkModeEnabled(self: pyaubo_sdk.RobotManage) -> bool + * + * @par Lua函数原型 + * isLinkModeEnabled() -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.isLinkModeEnabled","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * bool isEnabled = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->isLinkModeEnabled(); + * @endcode + * \endchinese + * \english + * Whether the link mode is enabled. In link mode, users can control the robot via external IO (users can configure the IO functions). + * + * @return Returns true if enabled; otherwise returns false + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * isLinkModeEnabled(self: pyaubo_sdk.RobotManage) -> bool + * + * @par Lua function prototype + * isLinkModeEnabled() -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.isLinkModeEnabled","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * bool isEnabled = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->isLinkModeEnabled(); + * @endcode + * \endenglish + */ + bool isLinkModeEnabled(); + + /** + * \chinese + * 手动触发生成诊断文件 + * + * @return 指令下发成功返回0; 失败返回错误码。 \n + * -AUBO_BAD_STATE: 运行时(RuntimeMachine)的当前状态不是Stopped, + * 固件升级请求被拒绝。AUBO_BAD_STATE的值是1。 \n + * -AUBO_TIMEOUT: 超时。AUBO_TIMEOUT的值是4。 \n + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * generateDiagnoseFile(self: pyaubo_sdk.RobotManage, arg0: str) -> int + * + * @par Lua函数原型 + * generateDiagnoseFile(reason: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotManage.generateDiagnoseFile","params":["reason"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * bool isEnabled = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->generateDiagnoseFile("reason"); + * @endcode + * \endchinese + * \english + * Manually trigger the generation of a diagnostic file + * + * @return Returns 0 if the command is successfully issued; error code on failure. \n + * -AUBO_BAD_STATE: The current state of the RuntimeMachine is not Stopped, + * the firmware upgrade request is rejected. The value of AUBO_BAD_STATE is 1. \n + * -AUBO_TIMEOUT: Timeout. The value of AUBO_TIMEOUT is 4. \n + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * generateDiagnoseFile(self: pyaubo_sdk.RobotManage, arg0: str) -> int + * + * @par Lua function prototype + * generateDiagnoseFile(reason: string) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotManage.generateDiagnoseFile","params":["reason"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * bool isEnabled = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage()->generateDiagnoseFile("reason"); + * @endcode + * \endenglish + */ + int generateDiagnoseFile(const std::string &reason); + +protected: + void *d_; +}; +using RobotManagePtr = std::shared_ptr; +} // namespace common_interface +} // namespace arcs + +#endif // AUBO_SDK_ROBOT_CONTROL_INTERFACE_H diff --git a/third_party/AuboSdk/win/include/aubo/robot/robot_state.h b/third_party/AuboSdk/win/include/aubo/robot/robot_state.h new file mode 100644 index 00000000..71be2e8e --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo/robot/robot_state.h @@ -0,0 +1,2485 @@ +/** @file robot_state.h + * @brief 获取机器人状态接口,如关节速度、关节角度、固件/硬件版本 + */ +#ifndef AUBO_SDK_ROBOT_STATE_INTERFACE_H +#define AUBO_SDK_ROBOT_STATE_INTERFACE_H + +#include + +#include +#include + +namespace arcs { +namespace common_interface { + +class ARCS_ABI_EXPORT RobotState +{ +public: + RobotState(); + virtual ~RobotState(); + + /** + * \chinese + * 获取机器人的模式状态 + * + * @return 机器人的模式状态 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getRobotModeType(self: pyaubo_sdk.RobotState) -> + * arcs::common_interface::RobotModeType + * + * @par Lua函数原型 + * getRobotModeType() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getRobotModeType","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"Running"} + * + *\endchinese + *\english + * Get the robot mode state + * + * @return The robot's mode state + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getRobotModeType(self: pyaubo_sdk.RobotState) -> + * arcs::common_interface::RobotModeType + * + * @par Lua function prototype + * getRobotModeType() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getRobotModeType","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"Running"} + *\endenglish + */ + + RobotModeType getRobotModeType(); + + /** + * \chinese + * 获取安全模式 + * + * @return 安全模式 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getSafetyModeType(self: pyaubo_sdk.RobotState) -> + * arcs::common_interface::SafetyModeType + * + * @par Lua函数原型 + * getSafetyModeType() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getSafetyModeType","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"Normal"} + * \endchinese + * \english + * Get the safety mode + * + * @return The safety mode + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getSafetyModeType(self: pyaubo_sdk.RobotState) -> + * arcs::common_interface::SafetyModeType + * + * @par Lua function prototype + * getSafetyModeType() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getSafetyModeType","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"Normal"} + * \endenglish + */ + SafetyModeType getSafetyModeType(); + + /** + * \chinese + * 获取机器人通电状态 + * + * @return 机器人通电返回 true; 反之返回 false + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.isPowerOn","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":true} + * \endchinese + * \english + * Get the robot power-on state + * + * @return Returns true if the robot is powered on; otherwise returns false + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.isPowerOn","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":true} + * \endenglish + */ + bool isPowerOn(); + + /** + * \chinese + * 机器人是否已经停止下来 + * + * @return 停止返回true; 反之返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * isSteady(self: pyaubo_sdk.RobotState) -> bool + * + * @par Lua函数原型 + * isSteady() -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.isSteady","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":true} + * \endchinese + * \english + * Whether the robot has stopped + * + * @return Returns true if stopped; otherwise returns false + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * isSteady(self: pyaubo_sdk.RobotState) -> bool + * + * @par Lua function prototype + * isSteady() -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.isSteady","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":true} + * \endenglish + */ + bool isSteady(); + + /** + * \chinese + * 机器人是否发生了碰撞 + * + * @return 发生碰撞返回 true; 反之返回 false + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.isCollisionOccurred","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":false} + * \endchinese + * \english + * Whether a collision has occurred + * + * @return Returns true if a collision occurred; otherwise returns false + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.isCollisionOccurred","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":false} + * \endenglish + */ + bool isCollisionOccurred(); + + /** + * \chinese + * 机器人是否已经在安全限制之内 + * + * @return 在安全限制之内返回true; 反之返回false + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * isWithinSafetyLimits(self: pyaubo_sdk.RobotState) -> bool + * + * @par Lua函数原型 + * isWithinSafetyLimits() -> boolean + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.isWithinSafetyLimits","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":true} + * \endchinese + * \english + * Whether the robot is within safety limits + * + * @return Returns true if within safety limits; otherwise returns false + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * isWithinSafetyLimits(self: pyaubo_sdk.RobotState) -> bool + * + * @par Lua function prototype + * isWithinSafetyLimits() -> boolean + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.isWithinSafetyLimits","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":true} + * \endenglish + */ + bool isWithinSafetyLimits(); + + /** + * \chinese + * 获取当前的TCP位姿,其 TCP 偏移可以通过 getActualTcpOffset 获取 + * + * 位姿表示形式为(x,y,z,rx,ry,rz)。 + * 其中x、y、z是工具中心点(TCP)在基坐标系下的位置,单位是m。 + * rx、ry、rz是工具中心点(TCP)在基坐标系下的姿态,是ZYX欧拉角,单位是rad。 + * + * @return TCP的位姿,形式为(x,y,z,rx,ry,rz) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getTcpPose(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getTcpPose() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpPose","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.41777839846910425,-0.13250000000000012,0.20928451364415995,3.1415792312578987,0.0,1.5707963267948963]} + * \endchinese + * \english + * Get the current TCP pose. The TCP offset can be obtained by getActualTcpOffset. + * + * The pose is represented as (x, y, z, rx, ry, rz). + * x, y, z are the position of the Tool Center Point (TCP) in the base coordinate system, in meters. + * rx, ry, rz are the orientation of the TCP in the base coordinate system, as ZYX Euler angles in radians. + * + * @return The TCP pose, in the form (x, y, z, rx, ry, rz) + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getTcpPose(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getTcpPose() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpPose","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.41777839846910425,-0.13250000000000012,0.20928451364415995,3.1415792312578987,0.0,1.5707963267948963]} + * \endenglish + */ + std::vector getTcpPose(); + + /** + * \chinese + * 获取当前的 TCP 偏移,也就是 getTcpPose 返回的 pose 用到的 TCP 偏移 + * + * @return 当前的 TCP 偏移 + * \endchinese + * \english + * Get the current TCP offset, which is the TCP offset used by the pose returned from getTcpPose + * + * @return The current TCP offset + * \endenglish + */ + std::vector getActualTcpOffset(); + + /** + * \chinese + * 获取下一个目标路点 + * 注意与 getTcpTargetPose 的区别,此处定义存在歧义,命名需要优化 + * + * 位姿表示形式为(x,y,z,rx,ry,rz)。 + * 其中x、y、z是工具中心点(TCP)在基坐标系下的目标位置,单位是m。 + * rx、ry、rz是工具中心点(TCP)在基坐标系下的目标姿态,是ZYX欧拉角,单位是rad。 + * + * @return 当前目标位姿,形式为(x,y,z,rx,ry,rz) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getTargetTcpPose(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getTargetTcpPose() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTargetTcpPose","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.4173932217619493,-0.13250000000000012,0.43296496133045825,3.141577313781914,0.0,1.5707963267948963]} + * \endchinese + * \english + * Get the next target waypoint. + * Note the difference from getTcpTargetPose; the definition here is ambiguous and the naming needs improvement. + * + * The pose is represented as (x, y, z, rx, ry, rz). + * x, y, z are the target position of the Tool Center Point (TCP) in the base coordinate system, in meters. + * rx, ry, rz are the target orientation of the TCP in the base coordinate system, as ZYX Euler angles in radians. + * + * @return The current target pose, in the form (x, y, z, rx, ry, rz) + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getTargetTcpPose(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getTargetTcpPose() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTargetTcpPose","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.4173932217619493,-0.13250000000000012,0.43296496133045825,3.141577313781914,0.0,1.5707963267948963]} + * \endenglish + */ + std::vector getTargetTcpPose(); + + /** + * \chinese + * 获取工具端的位姿(不带TCP偏移) + * + * 位姿表示形式为(x,y,z,rx,ry,rz)。 + * 其中x、y、z是法兰盘中心在基坐标系下的目标位置,单位是m。 + * rx、ry、rz是法兰盘中心在基坐标系下的目标姿态,是ZYX欧拉角,单位是rad。 + * + * @return 工具端的位姿,形式为(x,y,z,rx,ry,rz) + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolPose(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getToolPose() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getToolPose","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.41777820858878617,-0.13250000000000012,0.20928410288421018,3.141579231257899,0.0,1.5707963267948963]} + * \endchinese + * \english + * Get the tool pose (without TCP offset) + * + * The pose is represented as (x, y, z, rx, ry, rz). + * x, y, z are the target position of the flange center in the base coordinate system, in meters. + * rx, ry, rz are the target orientation of the flange center in the base coordinate system, as ZYX Euler angles in radians. + * + * @return The tool pose, in the form (x, y, z, rx, ry, rz) + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolPose(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getToolPose() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getToolPose","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.41777820858878617,-0.13250000000000012,0.20928410288421018,3.141579231257899,0.0,1.5707963267948963]} + * \endenglish + */ + std::vector getToolPose(); + + /** + * \chinese + * 获取TCP速度 + * + * @return TCP速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getTcpSpeed(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getTcpSpeed() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpSpeed","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the TCP speed + * + * @return TCP speed + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getTcpSpeed(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getTcpSpeed() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpSpeed","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getTcpSpeed(); + + /** + * \chinese + * 获取TCP的力/力矩 + * + * @return TCP的力/力矩 + * + * @par Python函数原型 + * getTcpForce(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getTcpForce() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpForce","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the TCP force/torque + * + * @return TCP force/torque + * + * @par Python function prototype + * getTcpForce(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getTcpForce() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpForce","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getTcpForce(); + + /** + * \chinese + * 获取肘部的位置 + * + * @return 肘部的位置 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getElbowPosistion(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getElbowPosistion() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getElbowPosistion","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.07355755887512408,-0.1325,0.43200874126125227,-1.5707963267948968,0.433006344376404,0.0]} + * \endchinese + * \english + * Get the position of the elbow + * + * @return The position of the elbow + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getElbowPosistion(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getElbowPosistion() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getElbowPosistion","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.07355755887512408,-0.1325,0.43200874126125227,-1.5707963267948968,0.433006344376404,0.0]} + * \endenglish + */ + std::vector getElbowPosistion(); + + /** + * \chinese + * 获取肘部速度 + * + * @return 肘部速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getElbowVelocity(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getElbowVelocity() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getElbowVelocity","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the elbow velocity + * + * @return Elbow velocity + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getElbowVelocity(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getElbowVelocity() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getElbowVelocity","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getElbowVelocity(); + + /** + * \chinese + * 获取基座力/力矩 + * + * @return 基座力/力矩 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getBaseForce(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getBaseForce() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getBaseForce","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the base force/torque + * + * @return Base force/torque + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getBaseForce(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getBaseForce() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getBaseForce","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getBaseForce(); + + /** + * \chinese + * 获取上一次发送的TCP目标位姿 + * + * @return TCP目标位姿 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getTcpTargetPose(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getTcpTargetPose() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpTargetPose","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.41777829240862013,-0.13250000000000012,0.2092832117232601,3.1415812372223217,0.0,1.5707963267948963]} + * \endchinese + * \english + * Get the last sent TCP target pose + * + * @return TCP target pose + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getTcpTargetPose(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getTcpTargetPose() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpTargetPose","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.41777829240862013,-0.13250000000000012,0.2092832117232601,3.1415812372223217,0.0,1.5707963267948963]} + * \endenglish + */ + std::vector getTcpTargetPose(); + + /** + * \chinese + * 获取TCP目标速度 + * + * @return TCP目标速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getTcpTargetSpeed(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getTcpTargetSpeed() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpTargetSpeed","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the TCP target speed + * + * @return TCP target speed + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getTcpTargetSpeed(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getTcpTargetSpeed() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpTargetSpeed","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getTcpTargetSpeed(); + + /** + * \chinese + * 获取TCP目标力/力矩 + * + * @return TCP目标力/力矩 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getTcpTargetForce(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getTcpTargetForce() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpTargetForce","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the TCP target force/torque + * + * @return TCP target force/torque + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getTcpTargetForce(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getTcpTargetForce() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpTargetForce","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getTcpTargetForce(); + + /** + * \chinese + * 获取机械臂关节标志 + * + * @return 机械臂关节标志 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointState(self: pyaubo_sdk.RobotState) -> + * List[arcs::common_interface::JointStateType] + * + * @par Lua函数原型 + * getJointState() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointState","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":["Running","Running","Running","Running","Running","Running"]} + * \endchinese + * \english + * Get the joint state of the manipulator + * + * @return Joint state of the manipulator + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointState(self: pyaubo_sdk.RobotState) -> + * List[arcs::common_interface::JointStateType] + * + * @par Lua function prototype + * getJointState() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointState","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":["Running","Running","Running","Running","Running","Running"]} + * \endenglish + */ + std::vector getJointState(); + + /** + * \chinese + * 获取关节的伺服状态 + * + * @return 关节的伺服状态 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointServoMode(self: pyaubo_sdk.RobotState) -> + * List[arcs::common_interface::JointServoModeType] + * + * @par Lua函数原型 + * getJointServoMode() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointServoMode","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":["Position","Position","Position","Position","Position","Position"]} + * \endchinese + * \english + * Get the servo state of the joints + * + * @return The servo state of the joints + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointServoMode(self: pyaubo_sdk.RobotState) -> + * List[arcs::common_interface::JointServoModeType] + * + * @par Lua function prototype + * getJointServoMode() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointServoMode","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":["Position","Position","Position","Position","Position","Position"]} + * \endenglish + */ + std::vector getJointServoMode(); + + /** + * \chinese + * 获取机械臂关节角度 + * + * @return 机械臂关节角度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointPositions(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getJointPositions() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointPositions","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,-0.26199241371495835,1.7418102574563423,0.4330197667082982,1.5707963267948966,0.0]} + * \endchinese + * \english + * Get the joint positions of the manipulator + * + * @return Joint positions of the manipulator + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointPositions(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getJointPositions() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointPositions","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,-0.26199241371495835,1.7418102574563423,0.4330197667082982,1.5707963267948966,0.0]} + * \endenglish + */ + std::vector getJointPositions(); + + /** + * \chinese + * 获取机械臂历史关节角度 + * + * @param steps 步数 + * @return 机械臂历史关节角度 + * \endchinese + * \english + * Get the historical joint positions of the manipulator + * + * @param steps Number of steps + * @return Historical joint positions of the manipulator + * \endenglish + */ + std::vector getJointPositionsHistory(int steps); + + /** + * \chinese + * 获取机械臂关节速度 + * + * @return 机械臂关节速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointSpeeds(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getJointSpeeds() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointSpeeds","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the joint speeds of the manipulator + * + * @return Joint speeds of the manipulator + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointSpeeds(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getJointSpeeds() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointSpeeds","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getJointSpeeds(); + + /** + * \chinese + * 获取机械臂关节加速度 + * + * @return 机械臂关节加速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointAccelerations(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getJointAccelerations() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointAccelerations","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the joint accelerations of the manipulator + * + * @return Joint accelerations of the manipulator + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointAccelerations(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getJointAccelerations() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointAccelerations","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getJointAccelerations(); + + /** + * \chinese + * 获取机械臂关节力矩 + * + * @return 机械臂关节力矩 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointTorqueSensors(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getJointTorqueSensors() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointTorqueSensors","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,6275.367736816406,-7704.2816162109375,3586.9766235351563,503.0364990234375,1506.0882568359375]} + * \endchinese + * \english + * Get the joint torques of the manipulator + * + * @return Joint torques of the manipulator + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointTorqueSensors(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getJointTorqueSensors() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointTorqueSensors","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,6275.367736816406,-7704.2816162109375,3586.9766235351563,503.0364990234375,1506.0882568359375]} + * \endenglish + */ + std::vector getJointTorqueSensors(); + + /** + * \chinese + * 获取机械臂关节接触力矩(外力距) + * + * @return 机械臂关节接触力矩 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointContactTorques(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getJointContactTorques() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointContactTorques","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the joint contact torques (external torques) of the manipulator + * + * @return Joint contact torques of the manipulator + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointContactTorques(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getJointContactTorques() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointContactTorques","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getJointContactTorques(); + + /** + * \chinese + * 获取底座力传感器读数 + * + * @return 底座力传感器读数 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getBaseForceSensor(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getBaseForceSensor() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getBaseForceSensor","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the base force sensor readings + * + * @return Base force sensor readings + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getBaseForceSensor(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getBaseForceSensor() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getBaseForceSensor","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getBaseForceSensor(); + + /** + * \chinese + * 获取TCP力传感器读数 + * + * @return TCP力传感器读数 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getTcpForceSensors(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getTcpForceSensors() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpForceSensors","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the TCP force sensor readings + * + * @return TCP force sensor readings + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getTcpForceSensors(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getTcpForceSensors() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpForceSensors","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getTcpForceSensors(); + + /** + * \chinese + * 获取机械臂关节电流 + * + * @return 机械臂关节电流 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointCurrents(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getJointCurrents() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointCurrents","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,1.25885009765625,-1.5289306640625,0.71868896484375,0.1007080078125,0.3021240234375]} + * \endchinese + * \english + * Get the joint currents of the manipulator + * + * @return Joint currents of the manipulator + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointCurrents(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getJointCurrents() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointCurrents","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,1.25885009765625,-1.5289306640625,0.71868896484375,0.1007080078125,0.3021240234375]} + * \endenglish + */ + std::vector getJointCurrents(); + + /** + * \chinese + * 获取机械臂关节电压 + * + * @return 机械臂关节电压 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointVoltages(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getJointVoltages() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointVoltages","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[2.0,2.5,3.0,2.0,2.5,2.0]} + * \endchinese + * \english + * Get the joint voltages of the manipulator + * + * @return Joint voltages of the manipulator + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointVoltages(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getJointVoltages() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointVoltages","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[2.0,2.5,3.0,2.0,2.5,2.0]} + * \endenglish + */ + std::vector getJointVoltages(); + + /** + * \chinese + * 获取机械臂关节温度 + * + * @return 机械臂关节温度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointTemperatures(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getJointTemperatures() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointTemperatures","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[38.0,38.0,38.0,39.0,38.0,39.0]} + * \endchinese + * \english + * Get the joint temperatures of the manipulator + * + * @return Joint temperatures of the manipulator + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointTemperatures(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getJointTemperatures() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointTemperatures","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[38.0,38.0,38.0,39.0,38.0,39.0]} + * \endenglish + */ + std::vector getJointTemperatures(); + + /** + * \chinese + * 获取关节全球唯一ID + * + * @return 关节全球唯一ID + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointUniqueIds(self: pyaubo_sdk.RobotState) -> List[str] + * + * @par Lua函数原型 + * getJointUniqueIds() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointUniqueIds","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":["00800020ffffffff31405153","00800020ffffffff3e3f5153","00800020ffffffff414b5153","00800020ffffffff31065153","00800020ffffffff41535153","00800020ffffffff41545153"]} + * \endchinese + * \english + * Get the globally unique IDs of the joints + * + * @return Globally unique IDs of the joints + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointUniqueIds(self: pyaubo_sdk.RobotState) -> List[str] + * + * @par Lua function prototype + * getJointUniqueIds() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointUniqueIds","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":["00800020ffffffff31405153","00800020ffffffff3e3f5153","00800020ffffffff414b5153","00800020ffffffff31065153","00800020ffffffff41535153","00800020ffffffff41545153"]} + * \endenglish + */ + std::vector getJointUniqueIds(); + + /** + * \chinese + * 获取关节固件版本 + * + * @return 关节固件版本 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointFirmwareVersions(self: pyaubo_sdk.RobotState) -> List[int] + * + * @par Lua函数原型 + * getJointFirmwareVersions() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointFirmwareVersions","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[1000010,1000010,1000010,1000010,1000010,1000010]} + * \endchinese + * \english + * Get the joint firmware versions + * + * @return Joint firmware versions + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointFirmwareVersions(self: pyaubo_sdk.RobotState) -> List[int] + * + * @par Lua function prototype + * getJointFirmwareVersions() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointFirmwareVersions","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[1000010,1000010,1000010,1000010,1000010,1000010]} + * \endenglish + */ + std::vector getJointFirmwareVersions(); + + /** + * \chinese + * 获取关节硬件版本 + * + * @return 关节硬件版本 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointHardwareVersions(self: pyaubo_sdk.RobotState) -> List[int] + * + * @par Lua函数原型 + * getJointHardwareVersions() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointHardwareVersions","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[1000000,1000000,1004000,1004000,1004000,1004000]} + * \endchinese + * \english + * Get the joint hardware versions + * + * @return Joint hardware versions + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointHardwareVersions(self: pyaubo_sdk.RobotState) -> List[int] + * + * @par Lua function prototype + * getJointHardwareVersions() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointHardwareVersions","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[1000000,1000000,1004000,1004000,1004000,1004000]} + * \endenglish + */ + std::vector getJointHardwareVersions(); + + /** + * \chinese + * 获取MasterBoard全球唯一ID + * + * @return MasterBoard全球唯一ID + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getMasterBoardUniqueId(self: pyaubo_sdk.RobotState) -> str + * + * @par Lua函数原型 + * getMasterBoardUniqueId() -> string + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getMasterBoardUniqueId","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"001e0044510f343037323637"} + * \endchinese + * \english + * Get the globally unique ID of the MasterBoard + * + * @return Globally unique ID of the MasterBoard + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getMasterBoardUniqueId(self: pyaubo_sdk.RobotState) -> str + * + * @par Lua function prototype + * getMasterBoardUniqueId() -> string + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getMasterBoardUniqueId","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"001e0044510f343037323637"} + * \endenglish + */ + std::string getMasterBoardUniqueId(); + + /** + * \chinese + * 获取MasterBoard固件版本 + * + * @return MasterBoard固件版本 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getMasterBoardFirmwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua函数原型 + * getMasterBoardFirmwareVersion() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getMasterBoardFirmwareVersion","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1000004} + * \endchinese + * \english + * Get the MasterBoard firmware version + * + * @return MasterBoard firmware version + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getMasterBoardFirmwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua function prototype + * getMasterBoardFirmwareVersion() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getMasterBoardFirmwareVersion","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1000004} + * \endenglish + */ + int getMasterBoardFirmwareVersion(); + /** + * \chinese + * 获取MasterBoard硬件版本 + * + * @return MasterBoard硬件版本 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getMasterBoardHardwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua函数原型 + * getMasterBoardHardwareVersion() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getMasterBoardHardwareVersion","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1000000} + * \endchinese + * \english + * Get the MasterBoard hardware version + * + * @return MasterBoard hardware version + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getMasterBoardHardwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua function prototype + * getMasterBoardHardwareVersion() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getMasterBoardHardwareVersion","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1000000} + * \endenglish + */ + int getMasterBoardHardwareVersion(); + + /** + * \chinese + * 获取SlaveBoard全球唯一ID + * + * @return SlaveBoard全球唯一ID + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getSlaveBoardUniqueId(self: pyaubo_sdk.RobotState) -> str + * + * @par Lua函数原型 + * getSlaveBoardUniqueId() -> string + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getSlaveBoardUniqueId","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"736572630080000000000000"} + * \endchinese + * \english + * Get the globally unique ID of the SlaveBoard + * + * @return Globally unique ID of the SlaveBoard + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getSlaveBoardUniqueId(self: pyaubo_sdk.RobotState) -> str + * + * @par Lua function prototype + * getSlaveBoardUniqueId() -> string + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getSlaveBoardUniqueId","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"736572630080000000000000"} + * \endenglish + */ + std::string getSlaveBoardUniqueId(); + + /** + * \chinese + * 获取SlaveBoard固件版本 + * + * @return SlaveBoard固件版本 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getSlaveBoardFirmwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua函数原型 + * getSlaveBoardFirmwareVersion() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getSlaveBoardFirmwareVersion","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Get the SlaveBoard firmware version + * + * @return SlaveBoard firmware version + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getSlaveBoardFirmwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua function prototype + * getSlaveBoardFirmwareVersion() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getSlaveBoardFirmwareVersion","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int getSlaveBoardFirmwareVersion(); + + /** + * \chinese + * 获取SlaveBoard硬件版本 + * + * @return SlaveBoard硬件版本 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getSlaveBoardHardwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua函数原型 + * getSlaveBoardHardwareVersion() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getSlaveBoardHardwareVersion","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":6030098} + * \endchinese + * \english + * Get the SlaveBoard hardware version + * + * @return SlaveBoard hardware version + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getSlaveBoardHardwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua function prototype + * getSlaveBoardHardwareVersion() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getSlaveBoardHardwareVersion","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":6030098} + * \endenglish + */ + int getSlaveBoardHardwareVersion(); + + /** + * \chinese + * 获取工具端全球唯一ID + * + * @return 工具端全球唯一ID + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolUniqueId(self: pyaubo_sdk.RobotState) -> str + * + * @par Lua函数原型 + * getToolUniqueId() -> string + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getToolUniqueId","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"397d4e5331541252314d3042"} + * \endchinese + * \english + * Get the globally unique ID of the tool + * + * @return Globally unique ID of the tool + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolUniqueId(self: pyaubo_sdk.RobotState) -> str + * + * @par Lua function prototype + * getToolUniqueId() -> string + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getToolUniqueId","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"397d4e5331541252314d3042"} + * \endenglish + */ + std::string getToolUniqueId(); + + /** + * \chinese + * 获取工具端固件版本 + * + * @return 工具端固件版本 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolFirmwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua函数原型 + * getToolFirmwareVersion() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getToolFirmwareVersion","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1001003} + * \endchinese + * \english + * Get the tool firmware version + * + * @return Tool firmware version + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolFirmwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua function prototype + * getToolFirmwareVersion() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getToolFirmwareVersion","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1001003} + * \endenglish + */ + int getToolFirmwareVersion(); + + /** + * \chinese + * 获取工具端硬件版本 + * + * @return 工具端硬件版本 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolHardwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua函数原型 + * getToolHardwareVersion() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getToolHardwareVersion","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1000000} + * \endchinese + * \english + * Get the tool hardware version + * + * @return Tool hardware version + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolHardwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua function prototype + * getToolHardwareVersion() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getToolHardwareVersion","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1000000} + * \endenglish + */ + int getToolHardwareVersion(); + + /** + * \chinese + * 获取末端通信模式 + * + * @return 末端通信模式 + * 0: 表示无串口 + * 1: 表示只有串口 + * 2: 表示带力传感器和串口 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getToolCommMode(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua函数原型 + * getToolCommMode() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getToolCommMode","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1} + * \endchinese + * \english + * Get the tool communication mode + * + * @return Tool communication mode + * 0: No serial port + * 1: Serial port only + * 2: With force sensor and serial port + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getToolCommMode(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua function prototype + * getToolCommMode() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getToolCommMode","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1} + * \endenglish + */ + int getToolCommMode(); + + /** + * \chinese + * 获取底座全球唯一ID + * + * @return 底座全球唯一ID + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getPedestalUniqueId(self: pyaubo_sdk.RobotState) -> str + * + * @par Lua函数原型 + * getPedestalUniqueId() -> string + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getPedestalUniqueId","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"205257533543065248544339"} + * \endchinese + * \english + * Get the globally unique ID of the pedestal + * + * @return Globally unique ID of the pedestal + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getPedestalUniqueId(self: pyaubo_sdk.RobotState) -> str + * + * @par Lua function prototype + * getPedestalUniqueId() -> string + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getPedestalUniqueId","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"205257533543065248544339"} + * \endenglish + */ + std::string getPedestalUniqueId(); + + /** + * \chinese + * 获取底座固件版本 + * + * @return 底座固件版本 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getPedestalFirmwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua函数原型 + * getPedestalFirmwareVersion() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getPedestalFirmwareVersion","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1000004} + * \endchinese + * \english + * Get the pedestal firmware version + * + * @return Pedestal firmware version + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getPedestalFirmwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua function prototype + * getPedestalFirmwareVersion() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getPedestalFirmwareVersion","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1000004} + * \endenglish + */ + int getPedestalFirmwareVersion(); + + /** + * \chinese + * 获取底座硬件版本 + * + * @return 底座硬件版本 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getPedestalHardwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua函数原型 + * getPedestalHardwareVersion() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getPedestalHardwareVersion","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":1007000} + * \endchinese + * \english + * Get the pedestal hardware version + * + * @return Pedestal hardware version + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getPedestalHardwareVersion(self: pyaubo_sdk.RobotState) -> int + * + * @par Lua function prototype + * getPedestalHardwareVersion() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getPedestalHardwareVersion","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":1007000} + * \endenglish + */ + int getPedestalHardwareVersion(); + + /** + * \chinese + * 获取机械臂关节目标位置角度 + * + * @return 机械臂关节目标位置角度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointTargetPositions(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getJointTargetPositions() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointTargetPositions","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,-0.2619944355631239,1.7418124015308052,0.4330219266665035,1.5707963267948966,0.0]} + * \endchinese + * \english + * Get the target joint positions (angles) of the manipulator + * + * @return Target joint positions (angles) of the manipulator + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointTargetPositions(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getJointTargetPositions() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointTargetPositions","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,-0.2619944355631239,1.7418124015308052,0.4330219266665035,1.5707963267948966,0.0]} + * \endenglish + */ + std::vector getJointTargetPositions(); + + /** + * \chinese + * 获取机械臂关节目标速度 + * + * @return 机械臂关节目标速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointTargetSpeeds(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getJointTargetSpeeds() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointTargetSpeeds","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.00024227101509399773,0.0016521760307419697,0.0026521060731088397,0.0,0.0]} + * \endchinese + * \english + * Get the target joint speeds of the manipulator + * + * @return Target joint speeds of the manipulator + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointTargetSpeeds(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getJointTargetSpeeds() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointTargetSpeeds","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.00024227101509399773,0.0016521760307419697,0.0026521060731088397,0.0,0.0]} + * \endenglish + */ + std::vector getJointTargetSpeeds(); + + /** + * \chinese + * 获取机械臂关节目标加速度 + * + * @return 机械臂关节目标加速度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointTargetAccelerations(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getJointTargetAccelerations() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointTargetAccelerations","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,-0.6737932929246071,-12.610253240108449,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the target joint accelerations of the manipulator + * + * @return Target joint accelerations of the manipulator + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointTargetAccelerations(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getJointTargetAccelerations() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointTargetAccelerations","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,-0.6737932929246071,-12.610253240108449,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getJointTargetAccelerations(); + + /** + * \chinese + * 获取机械臂关节目标力矩 + * + * @return 机械臂关节目标力矩 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointTargetTorques(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getJointTargetTorques() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointTargetTorques","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the target joint torques of the manipulator + * + * @return Target joint torques of the manipulator + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointTargetTorques(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getJointTargetTorques() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointTargetTorques","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getJointTargetTorques(); + + /** + * \chinese + * 获取机械臂关节目标电流 + * + * @return 机械臂关节目标电流 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getJointTargetCurrents(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua函数原型 + * getJointTargetCurrents() -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointTargetCurrents","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endchinese + * \english + * Get the target joint currents of the manipulator + * + * @return Target joint currents of the manipulator + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getJointTargetCurrents(self: pyaubo_sdk.RobotState) -> List[float] + * + * @par Lua function prototype + * getJointTargetCurrents() -> table + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getJointTargetCurrents","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":[0.0,0.0,0.0,0.0,0.0,0.0]} + * \endenglish + */ + std::vector getJointTargetCurrents(); + + /** + * \chinese + * 获取控制柜温度 + * + * @return 控制柜温度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getControlBoxTemperature(self: pyaubo_sdk.RobotState) -> float + * + * @par Lua函数原型 + * getControlBoxTemperature() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getControlBoxTemperature","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":25.0} + * \endchinese + * \english + * Get the control box temperature + * + * @return Control box temperature + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getControlBoxTemperature(self: pyaubo_sdk.RobotState) -> float + * + * @par Lua function prototype + * getControlBoxTemperature() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getControlBoxTemperature","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":25.0} + * \endenglish + */ + double getControlBoxTemperature(); + + /** + * \chinese + * 获取控制柜湿度 + * + * @return 控制柜湿度 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getControlBoxHumidity(self: pyaubo_sdk.RobotState) -> float + * + * @par Lua函数原型 + * getControlBoxHumidity() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getControlBoxHumidity","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":20.0} + * \endchinese + * \english + * Get the control box humidity + * + * @return Control box humidity + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getControlBoxHumidity(self: pyaubo_sdk.RobotState) -> float + * + * @par Lua function prototype + * getControlBoxHumidity() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getControlBoxHumidity","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":20.0} + * \endenglish + */ + double getControlBoxHumidity(); + + /** + * \chinese + * 获取母线电压 + * + * @return 母线电压 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getMainVoltage(self: pyaubo_sdk.RobotState) -> float + * + * @par Lua函数原型 + * getMainVoltage() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getMainVoltage","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":52.75} + * \endchinese + * \english + * Get the main bus voltage + * + * @return Main bus voltage + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getMainVoltage(self: pyaubo_sdk.RobotState) -> float + * + * @par Lua function prototype + * getMainVoltage() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getMainVoltage","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":52.75} + * \endenglish + */ + double getMainVoltage(); + + /** + * \chinese + * 获取母线电流 + * + * @return 母线电流 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getMainCurrent(self: pyaubo_sdk.RobotState) -> float + * + * @par Lua函数原型 + * getMainCurrent() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getMainCurrent","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.3204345703125} + * \endchinese + * \english + * Get the main bus current + * + * @return Main bus current + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getMainCurrent(self: pyaubo_sdk.RobotState) -> float + * + * @par Lua function prototype + * getMainCurrent() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getMainCurrent","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.3204345703125} + * \endenglish + */ + double getMainCurrent(); + + /** + * \chinese + * 获取机器人电压 + * + * @return 机器人电压 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getRobotVoltage(self: pyaubo_sdk.RobotState) -> float + * + * @par Lua函数原型 + * getRobotVoltage() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getRobotVoltage","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":52.75} + * \endchinese + * \english + * Get the robot voltage + * + * @return Robot voltage + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getRobotVoltage(self: pyaubo_sdk.RobotState) -> float + * + * @par Lua function prototype + * getRobotVoltage() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getRobotVoltage","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":52.75} + * \endenglish + */ + double getRobotVoltage(); + + /** + * \chinese + * 获取机器人电流 + * + * @return 机器人电流 + * + * @throws arcs::common_interface::AuboException + * + * @par Python函数原型 + * getRobotCurrent(self: pyaubo_sdk.RobotState) -> float + * + * @par Lua函数原型 + * getRobotCurrent() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getRobotCurrent","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0.3204345703125} + * \endchinese + * \english + * Get the robot current + * + * @return Robot current + * + * @throws arcs::common_interface::AuboException + * + * @par Python function prototype + * getRobotCurrent(self: pyaubo_sdk.RobotState) -> float + * + * @par Lua function prototype + * getRobotCurrent() -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getRobotCurrent","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0.3204345703125} + * \endenglish + */ + double getRobotCurrent(); + + /** + * \chinese + * 获取机器人缓速等级 + * + * @return 机器人缓速等级 + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getSlowDownLevel","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Get the robot slow down level + * + * @return Robot slow down level + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getSlowDownLevel","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + int getSlowDownLevel(); + + /** + * \chinese + * 获取末端力传感器通信状态 + * + * @param name 力传感器名称,与 selectTcpForceSensor 的参数一致 + * @return 通信正常返回 true; 反之返回 false + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.RobotState.getTcpForceSensorStatus","params":["tool.KWR75A"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + * \english + * Get the communication status of the tool force sensor + * + * @param name force sensor name, it is consistent with the parameters of + * 'selectTcpForceSensor' + * @return Returns true if communication is normal; otherwise returns false + * + * @throws arcs::common_interface::AuboException + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"rob1.RobotState.getSlowDownLevel","params":["tool.KWR75A"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + */ + bool getTcpForceSensorStatus(const std::string &name); + +protected: + void *d_; +}; +using RobotStatePtr = std::shared_ptr; +} // namespace common_interface +} // namespace arcs +#endif // AUBO_SDK_ROBOT_STATE_INTERFACE_H diff --git a/third_party/AuboSdk/win/include/aubo/robot_interface.h b/third_party/AuboSdk/win/include/aubo/robot_interface.h new file mode 100644 index 00000000..445d7132 --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo/robot_interface.h @@ -0,0 +1,373 @@ +/** @file robot_interface.h + * @brief 机器人API 接口 + */ +#ifndef AUBO_SDK_ROBOT_INTERFACE_H +#define AUBO_SDK_ROBOT_INTERFACE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace arcs { +namespace common_interface { + +class ARCS_ABI_EXPORT RobotInterface +{ +public: + RobotInterface(); + virtual ~RobotInterface(); + /** + * \chinese + * 获取RobotConfig接口 + * + * @return RobotConfigPtr对象的指针 + * + * @par Python函数原型 + * getRobotConfig(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::RobotConfig + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * RobotConfigPtr ptr = + * rpc_cli->getRobotInterface(robot_name)->getRobotConfig(); + * @endcode + * \endchinese + * \english + * Get RobotConfig interface + * + * @return Pointer to RobotConfig object + * + * @par Python function prototype + * getRobotConfig(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::RobotConfig + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * RobotConfigPtr ptr = + * rpc_cli->getRobotInterface(robot_name)->getRobotConfig(); + * @endcode + * \endenglish + */ + + RobotConfigPtr getRobotConfig(); + + /** + * \chinese + * 获取运动规划接口 + * + * @return MotionControlPtr对象的指针 + * + * @par Python函数原型 + * getMotionControl(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::MotionControl + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * MotionControlPtr ptr = + * rpc_cli->getRobotInterface(robot_name)->getMotionControl(); + * @endcode + * \endchinese + * \english + * Get motion planning interface + * + * @return Pointer to MotionControl object + * + * @par Python function prototype + * getMotionControl(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::MotionControl + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * MotionControlPtr ptr = + * rpc_cli->getRobotInterface(robot_name)->getMotionControl(); + * @endcode + * \endenglish + */ + MotionControlPtr getMotionControl(); + + /** + * \chinese + * 获取力控接口 + * + * @return ForceControlPtr对象的指针 + * + * @par Python函数原型 + * getForceControl(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::ForceControl + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * ForceControlPtr ptr = + * rpc_cli->getRobotInterface(robot_name)->getForceControl(); + * @endcode + * \endchinese + * \english + * Get force control interface + * + * @return Pointer to ForceControl object + * + * @par Python function prototype + * getForceControl(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::ForceControl + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * ForceControlPtr ptr = + * rpc_cli->getRobotInterface(robot_name)->getForceControl(); + * @endcode + * \endenglish + */ + ForceControlPtr getForceControl(); + + /** + * \chinese + * 获取IO控制的接口 + * + * @return IoControlPtr对象的指针 + * + * @par Python函数原型 + * getIoControl(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::IoControl + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * IoControlPtr ptr = + * rpc_cli->getRobotInterface(robot_name)->getIoControl(); + * @endcode + * \endchinese + * \english + * Get IO control interface + * + * @return Pointer to IoControl object + * + * @par Python function prototype + * getIoControl(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::IoControl + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * IoControlPtr ptr = + * rpc_cli->getRobotInterface(robot_name)->getIoControl(); + * @endcode + * \endenglish + */ + IoControlPtr getIoControl(); + + /** + * \chinese + * 获取同步运动接口 + * + * @return SyncMovePtr对象的指针 + * + * @par Python函数原型 + * getSyncMove(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::SyncMove + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * SyncMovePtr ptr = rpc_cli->getRobotInterface(robot_name)->getSyncMove(); + * @endcode + * \endchinese + * \english + * Get synchronized motion interface + * + * @return Pointer to SyncMove object + * + * @par Python function prototype + * getSyncMove(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::SyncMove + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * SyncMovePtr ptr = rpc_cli->getRobotInterface(robot_name)->getSyncMove(); + * @endcode + * \endenglish + */ + SyncMovePtr getSyncMove(); + + /** + * \chinese + * 获取机器人实用算法接口 + * + * @return RobotAlgorithmPtr对象的指针 + * + * @par Python函数原型 + * getRobotAlgorithm(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::RobotAlgorithm + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * RobotAlgorithmPtr ptr = + * rpc_cli->getRobotInterface(robot_name)->getRobotAlgorithm(); + * @endcode + * \endchinese + * \english + * Get robot utility algorithm interface + * + * @return Pointer to RobotAlgorithm object + * + * @par Python function prototype + * getRobotAlgorithm(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::RobotAlgorithm + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * RobotAlgorithmPtr ptr = + * rpc_cli->getRobotInterface(robot_name)->getRobotAlgorithm(); + * @endcode + * \endenglish + */ + RobotAlgorithmPtr getRobotAlgorithm(); + + /** + * \chinese + * 获取机器人管理接口(上电、启动、停止等) + * + * @return RobotManagePtr对象的指针 + * + * @par Python函数原型 + * getRobotManage(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::RobotManage + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * RobotManagePtr ptr = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage(); + * @endcode + * \endchinese + * \english + * Get robot management interface (power on, start, stop, etc.) + * + * @return Pointer to RobotManage object + * + * @par Python function prototype + * getRobotManage(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::RobotManage + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * RobotManagePtr ptr = + * rpc_cli->getRobotInterface(robot_name)->getRobotManage(); + * @endcode + * \endenglish + */ + RobotManagePtr getRobotManage(); + + /** + * \chinese + * 获取机器人状态接口 + * + * @return RobotStatePtr对象的指针 + * + * @par Python函数原型 + * getRobotState(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::RobotState + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * RobotStatePtr ptr = + * rpc_cli->getRobotInterface(robot_name)->getRobotState(); + * @endcode + * \endchinese + * \english + * Get robot state interface + * + * @return Pointer to RobotState object + * + * @par Python function prototype + * getRobotState(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::RobotState + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * RobotStatePtr ptr = + * rpc_cli->getRobotInterface(robot_name)->getRobotState(); + * @endcode + * \endenglish + */ + RobotStatePtr getRobotState(); + + /** + * \chinese + * 获取告警信息接口 + * + * @return TracePtr对象的指针 + * + * @par Python函数原型 + * getTrace(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::Trace + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * TracePtr ptr = rpc_cli->getRobotInterface(robot_name)->getTrace(); + * @endcode + * \endchinese + * \english + * Get alarm information interface + * + * @return Pointer to Trace object + * + * @par Python function prototype + * getTrace(self: pyaubo_sdk.RobotInterface) -> + * arcs::common_interface::Trace + * + * @par C++ example + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * TracePtr ptr = rpc_cli->getRobotInterface(robot_name)->getTrace(); + * @endcode + * \endenglish + */ + TracePtr getTrace(); + +protected: + void *d_; +}; +using RobotInterfacePtr = std::shared_ptr; + +} // namespace common_interface +} // namespace arcs + +#endif // AUBO_SDK_ROBOT_INTERFACE_H diff --git a/third_party/AuboSdk/win/include/aubo/runtime_machine.h b/third_party/AuboSdk/win/include/aubo/runtime_machine.h new file mode 100644 index 00000000..d0795d9e --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo/runtime_machine.h @@ -0,0 +1,1417 @@ +/** @file runtime_machine.h + * @brief Script interpreter runtime interface, + * allows pausing the script interpreter and setting/removing breakpoints. + */ +#ifndef AUBO_SDK_RUNTIME_MACHINE_INTERFACE_H +#define AUBO_SDK_RUNTIME_MACHINE_INTERFACE_H + +#include +#include +#include + +namespace arcs { +namespace common_interface { + +/** + * The RuntimeMachine class + */ +class ARCS_ABI_EXPORT RuntimeMachine +{ +public: + RuntimeMachine(); + virtual ~RuntimeMachine(); + + + /** + * \chinese + * 返回 task_id + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.newTask","params":[false],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":26} + * \endchinese + * \english + * Returns the task_id + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.newTask","params":[false],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":26} + * \endenglish + */ + int newTask(bool daemon = false); + + /** + * \chinese + * 删除 task,会终止正在执行的运动 + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.deleteTask","params":[26],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Delete a task, which will terminate any ongoing motion. + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.deleteTask","params":[26],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int deleteTask(int tid); + + /** + * \chinese + * 等待 task 自然结束 + * + * @param tid + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.detachTask","params":[26],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Wait for the task to finish naturally + * + * @param tid + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.detachTask","params":[26],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int detachTask(int tid); + + /** + * \chinese + * 判断任务是否存活 + * + * @param tid + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.isTaskAlive","params":[26],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endchinese + * \english + * Check if the task is alive + * + * @param tid + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.isTaskAlive","params":[26],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":true} + * + * \endenglish + */ + bool isTaskAlive(int tid); + + /** + * \chinese + * 获取任务中缓存的指令的数量 + * + * @param tid + * @return + * \endchinese + * \english + * Get the number of cached instructions in the task + * + * @param tid + * @return + * \endenglish + */ + int getTaskQueueSize(int tid); + + /** + * \chinese + * 切换当前线程,切换之后接下来的指令将被插入切换后的线程中 + * + * @param tid + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.switchTask","params":[26],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Switch the current thread. After switching, subsequent instructions will be inserted into the switched thread. + * + * @param tid + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.switchTask","params":[26],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int switchTask(int tid); + + /** + * \chinese + * 标记记下来的指令的行号和注释 + * + * @param lineno + * @param comment + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.setLabel","params":[5,"moveJoint"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Mark the line number and comment of the recorded instruction + * + * @param lineno + * @param comment + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.setLabel","params":[5,"moveJoint"],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setLabel(int lineno, const std::string &comment); + + /** + * \chinese + * 向aubo_control日志中添加注释 + * 使用 setLabel 替换 + * + * @param tid 指令的线程ID + * @param lineno 行号 + * @param comment 注释 + * @return + * + * @par Python函数原型 + * setPlanContext(self: pyaubo_sdk.RuntimeMachine, arg0: int, arg1: int, + * arg2: str) -> int + * + * @par Lua函数原型 + * setPlanContext(tid: number, lineno: number, comment: string) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.setPlanContext","params":[26,3,"moveJoint"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Add a comment to the aubo_control log + * Use setLabel instead + * + * @param tid Thread ID of the instruction + * @param lineno Line number + * @param comment Comment + * @return + * + * @par Python function prototype + * setPlanContext(self: pyaubo_sdk.RuntimeMachine, arg0: int, arg1: int, + * arg2: str) -> int + * + * @par Lua function prototype + * setPlanContext(tid: number, lineno: number, comment: string) -> number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.setPlanContext","params":[26,3,"moveJoint"],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + ARCS_DEPRECATED int setPlanContext(int tid, int lineno, + const std::string &comment); + + /** + * \chinese + * 空操作 + * + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.nop","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * No operation + * + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.nop","params":[],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int nop(); + + /** + * \chinese + * 获取耗时的接口(INST)执行状态, 如 setPersistentParameters + * + * @return 指令名字, 执行状态 + * 执行状态: EXECUTING/FINISHED + * + * @par Python函数原型 + * getExecutionStatus(self: pyaubo_sdk.RuntimeMachine) -> Tuple[str, str, + * int] + * + * @par Lua函数原型 + * getExecutionStatus() -> string, string, number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.getExecutionStatus","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":["confirmSafetyParameters","FINISHED"]} + * + * \endchinese + * \english + * Get the execution status of time-consuming interfaces (INST), such as setPersistentParameters + * + * @return Instruction name, execution status + * Execution status: EXECUTING/FINISHED + * + * @par Python function prototype + * getExecutionStatus(self: pyaubo_sdk.RuntimeMachine) -> Tuple[str, str, int] + * + * @par Lua function prototype + * getExecutionStatus() -> string, string, number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.getExecutionStatus","params":[],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":["confirmSafetyParameters","FINISHED"]} + * + * \endenglish + */ + std::tuple getExecutionStatus(); + std::tuple getExecutionStatus1(); + + /** + * \chinese + * 跳转到指定行号 + * + * @param lineno + * @return + * + * @par Python函数原型 + * gotoLine(self: pyaubo_sdk.RuntimeMachine, arg0: int) -> int + * + * @par Lua函数原型 + * gotoLine(lineno: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.gotoLine","params":[10],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Jump to the specified line number + * + * @param lineno + * @return + * + * @par Python function prototype + * gotoLine(self: pyaubo_sdk.RuntimeMachine, arg0: int) -> int + * + * @par Lua function prototype + * gotoLine(lineno: number) -> number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.gotoLine","params":[10],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int gotoLine(int lineno); + + /** + * \chinese + * 获取当前运行上下文 + * + * @param tid 任务编号 + * 如果指定(不是-1),返回对应任务的运行上下文;如果不指定(是-1),返回正在运行的线程的运行上下文 + * + * @return + * + * @par Python函数原型 + * getPlanContext(self: pyaubo_sdk.RuntimeMachine) -> Tuple[int, int, str] + * + * @par Lua函数原型 + * getPlanContext() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.getPlanContext","params":[-1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[-1,0,""]} + * + * \endchinese + * \english + * Get the current runtime context + * + * @param tid Task ID + * If specified (not -1), returns the runtime context of the corresponding task; if not specified (is -1), returns the runtime context of the currently running thread + * + * @return + * + * @par Python function prototype + * getPlanContext(self: pyaubo_sdk.RuntimeMachine) -> Tuple[int, int, str] + * + * @par Lua function prototype + * getPlanContext() -> number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.getPlanContext","params":[-1],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":[-1,0,""]} + * + * \endenglish + */ + std::tuple getPlanContext(int tid = -1); + + /** + * \chinese + * 获取提前运行规划器的上下文信息 + * + * @param tid 任务编号 + * 如果指定(不是-1),返回对应任务运行规划器的上下文信息;如果不指定(是-1),返回正在运行的线程运行规划器的上下文信息 + * + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.getAdvancePlanContext","params":[-1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[-1,-1,""]} + * + * \endchinese + * \english + * Get the context information of the advance planner + * + * @param tid Task ID + * If specified (not -1), returns the context information of the advance planner for the corresponding task; if not specified (is -1), returns the context information of the advance planner for the currently running thread + * + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.getAdvancePlanContext","params":[-1],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":[-1,-1,""]} + * + * \endenglish + */ + std::tuple getAdvancePlanContext(int tid = -1); + + /** + * \chinese + * 获取AdvanceRun的程序指针 + * + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.getAdvancePtr","params":[-1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":-1} + * + * \endchinese + * \english + * Get the program pointer of AdvanceRun + * + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.getAdvancePtr","params":[-1],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":-1} + * + * \endenglish + */ + int getAdvancePtr(int tid = -1); + + /** + * \chinese + * 获取机器人运动的程序指针 + * + * @param tid 任务编号 + * 如果指定(不是-1),返回对应任务的程序指针;如果不指定(是-1),返回正在运行线程的程序指针 + * + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.getMainPtr","params":[-1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":-1} + * + * \endchinese + * \english + * Get the program pointer of robot motion + * + * @param tid Task ID + * If specified (not -1), returns the program pointer of the corresponding task; if not specified (is -1), returns the program pointer of the currently running thread + * + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.getMainPtr","params":[-1],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":-1} + * + * \endenglish + */ + int getMainPtr(int tid = -1); + + /** + * \chinese + * 获取最近解释过的指令指针 + * + * @param tid + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.getInterpPtr","params":[26],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":-1} + * + * \endchinese + * \english + * Get the pointer of the most recently interpreted instruction + * + * @param tid + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.getInterpPtr","params":[26],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":-1} + * + * \endenglish + */ + int getInterpPtr(int tid); + + /** + * \chinese + * 加载本地工程文件 + * Lua 脚本,只需要给出文件名字,不需要后缀,需要从 ${ARCS_WS}/program + * 目录中查找 + * + * @param program + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.loadProgram","params":["demo"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Load a local project file. + * For Lua scripts, only the file name is required (no extension), and it will be searched in the ${ARCS_WS}/program directory. + * + * @param program + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.loadProgram","params":["demo"],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int loadProgram(const std::string &program); + + /** + * \chinese + * 预加载工程文件 + * + * @param index 0~99 工程索引号 + * @param program 工程名字 + * @return + * \endchinese + * \english + * Preload project file + * + * @param index Project index number (0~99) + * @param program Project name + * @return + * \endenglish + */ + int preloadProgram(int index, const std::string &program); + + /** + * \chinese + * 获取预加载工程文件名字,如果没有加载或者超出索引范围则返回空字符串 + * + * @param index 0~99 工程索引号 + * @return 工程文件名字 + * \endchinese + * \english + * Get the name of the preloaded project file. Returns an empty string if not loaded or index is out of range. + * + * @param index Project index number (0~99) + * @return Project file name + * \endenglish + */ + std::string getPreloadProgram(int index); + + /** + * \chinese + * 运行已经加载的工程文件 + * + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.runProgram","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Run the already loaded project file + * + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.runProgram","params":[],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int runProgram(); + + /** + * \chinese + * 开始运行时 + * + * @return + * + * @par Python函数原型 + * start(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua函数原型 + * start() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.start","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Start the runtime + * + * @return + * + * @par Python function prototype + * start(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua function prototype + * start() -> number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.start","params":[],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int start(); + + /** + * \chinese + * 停止运行时即脚本运行,无法停止运行时状态为 Stopped 时的机器人运动 + * + * 如果考虑停止机器人所有运动,可以调用 RuntimeMachine::abort 接口 + * + * @return + * + * @par Python函数原型 + * stop(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua函数原型 + * stop() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.stop","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Stop the runtime, i.e., stop script execution. Cannot stop robot motion when the runtime state is Stopped. + * + * If you want to stop all robot motion, use the RuntimeMachine::abort interface. + * + * @return + * + * @par Python function prototype + * stop(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua function prototype + * stop() -> number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.stop","params":[],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int stop(); + + /** + * \chinese + * 终止机器人运行. + * + * 如果只是考虑停止运行时,可以调用 RuntimeMachine::stop 接口 + * + * 如果脚本运行时处于 Running 状态,则终止运行时;如果运行时处于 Stopped + * 且机器人正在移动,则停止机器人移动;如果此时力控开启了,则机器人停止力控 + * + * @return + * + * @par Python函数原型 + * abort(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua函数原型 + * abort() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.abort","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Abort robot operation. + * + * If you only want to stop the runtime, you can call the RuntimeMachine::stop interface. + * + * If the script runtime is in the Running state, aborts the runtime; if the runtime is Stopped and the robot is moving, stops the robot motion; if force control is enabled, stops force control. + * + * @return + * + * @par Python function prototype + * abort(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua function prototype + * abort() -> number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.abort","params":[],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int abort(); + + /** + * \chinese + * 暂停解释器 + * + * @return + * + * @par Python函数原型 + * pause(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua函数原型 + * pause() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.pause","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Pause the interpreter + * + * @return + * + * @par Python function prototype + * pause(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua function prototype + * pause() -> number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.pause","params":[],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int pause(); + + /** + * \chinese + * 单步运行 + * + * @return + * + * @par Python函数原型 + * step(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua函数原型 + * step() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.step","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Execute a single step + * + * @return + * + * @par Python function prototype + * step(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua function prototype + * step() -> number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.step","params":[],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int step(); + + /** + * \chinese + * 恢复解释器 + * + * @return + * + * @par Python函数原型 + * resume(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua函数原型 + * resume() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.resume","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Resume the interpreter + * + * @return + * + * @par Python function prototype + * resume(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua function prototype + * resume() -> number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.resume","params":[],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int resume(); + + /** + * \chinese + * 恢复解释器之前等待恢复前之前的序列完成 + * + * @param wait + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.setResumeWait","params":[true],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Wait for the previous sequence to complete before resuming the interpreter + * + * @param wait + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.setResumeWait","params":[true],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setResumeWait(bool wait); + + /** + * \chinese + * 获取规划器的状态 + * + * @return + * + * @par Python函数原型 + * getStatus(self: pyaubo_sdk.RuntimeMachine) -> + * arcs::common_interface::RuntimeState + * + * @par Lua函数原型 + * getStatus() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.getStatus","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"Running"} + * + * \endchinese + * \english + * Get the status of the planner + * + * @return + * + * @par Python function prototype + * getStatus(self: pyaubo_sdk.RuntimeMachine) -> + * arcs::common_interface::RuntimeState + * + * @par Lua function prototype + * getStatus() -> number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.getStatus","params":[],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":"Running"} + * + * \endenglish + */ + ARCS_DEPRECATED RuntimeState getStatus(); + RuntimeState getRuntimeState(); + + /** + * \chinese + * 设置断点 + * + * @param lineno + * @return + * + * @par Python函数原型 + * setBreakPoint(self: pyaubo_sdk.RuntimeMachine, arg0: int) -> int + * + * @par Lua函数原型 + * setBreakPoint(lineno: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.setBreakPoint","params":[15],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Set a breakpoint + * + * @param lineno + * @return + * + * @par Python function prototype + * setBreakPoint(self: pyaubo_sdk.RuntimeMachine, arg0: int) -> int + * + * @par Lua function prototype + * setBreakPoint(lineno: number) -> number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.setBreakPoint","params":[15],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int setBreakPoint(int lineno); + + /** + * \chinese + * 移除断点 + * + * @param lineno + * @return + * + * @par Python函数原型 + * removeBreakPoint(self: pyaubo_sdk.RuntimeMachine, arg0: int) -> int + * + * @par Lua函数原型 + * removeBreakPoint(lineno: number) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.removeBreakPoint","params":[15],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Remove a breakpoint + * + * @param lineno + * @return + * + * @par Python function prototype + * removeBreakPoint(self: pyaubo_sdk.RuntimeMachine, arg0: int) -> int + * + * @par Lua function prototype + * removeBreakPoint(lineno: number) -> number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.removeBreakPoint","params":[15],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int removeBreakPoint(int lineno); + + /** + * \chinese + * 清除所有断点 + * + * @return + * + * @par Python函数原型 + * clearBreakPoints(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua函数原型 + * clearBreakPoints() -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.clearBreakPoints","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Clear all breakpoints + * + * @return + * + * @par Python function prototype + * clearBreakPoints(self: pyaubo_sdk.RuntimeMachine) -> int + * + * @par Lua function prototype + * clearBreakPoints() -> number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.clearBreakPoints","params":[],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int clearBreakPoints(); + + /** + * \chinese + * 定时器开始 + * + * @param name + * @return + * + * @par Python函数原型 + * timerStart(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int + * + * @par Lua函数原型 + * timerStart(name: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.timerStart","params":["timer"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Start the timer + * + * @param name + * @return + * + * @par Python function prototype + * timerStart(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int + * + * @par Lua function prototype + * timerStart(name: string) -> nil + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.timerStart","params":["timer"],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int timerStart(const std::string &name); + + /** + * \chinese + * 定时器结束 + * + * @param name + * @return + * + * @par Python函数原型 + * timerStop(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int + * + * @par Lua函数原型 + * timerStop(name: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.timerStop","params":["timer"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Stop the timer + * + * @param name + * @return + * + * @par Python function prototype + * timerStop(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int + * + * @par Lua function prototype + * timerStop(name: string) -> nil + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.timerStop","params":["timer"],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int timerStop(const std::string &name); + + /** + * \chinese + * 定时器重置 + * + * @param name + * @return + * + * @par Python函数原型 + * timerReset(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int + * + * @par Lua函数原型 + * timerReset(name: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.timerReset","params":["timer"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Reset the timer + * + * @param name + * @return + * + * @par Python function prototype + * timerReset(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int + * + * @par Lua function prototype + * timerReset(name: string) -> nil + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.timerReset","params":["timer"],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int timerReset(const std::string &name); + + /** + * \chinese + * 定时器删除 + * + * @param name + * @return + * + * @par Python函数原型 + * timerDelete(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int + * + * @par Lua函数原型 + * timerDelete(name: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.timerDelete","params":["timer"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Delete the timer + * + * @param name + * @return + * + * @par Python function prototype + * timerDelete(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> int + * + * @par Lua function prototype + * timerDelete(name: string) -> nil + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.timerDelete","params":["timer"],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int timerDelete(const std::string &name); + + /** + * \chinese + * 获取定时器数值 + * + * @param name + * @return + * + * @par Python函数原型 + * getTimer(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> float + * + * @par Lua函数原型 + * getTimer(name: string) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.getTimer","params":["timer"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":25.409769612} + * + * \endchinese + * \english + * Get the timer value + * + * @param name + * @return + * + * @par Python function prototype + * getTimer(self: pyaubo_sdk.RuntimeMachine, arg0: str) -> float + * + * @par Lua function prototype + * getTimer(name: string) -> number + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.getTimer","params":["timer"],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":25.409769612} + * + * \endenglish + */ + double getTimer(const std::string &name); + + /** + * \chinese + * 开始配置触发 + * + * @param distance + * @param delay + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.triggBegin","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * Start configuring trigger + * + * @param distance + * @param delay + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.triggBegin","params":[],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int triggBegin(double distance, double delay); + + /** + * \chinese + * 终止配置触发 + * + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.triggEnd","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endchinese + * \english + * End configuring trigger + * + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.triggEnd","params":[],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":0} + * + * \endenglish + */ + int triggEnd(); + + /** + * \chinese + * 返回自动分配的中断号 + * + * @param distance + * @param delay + * @param intnum + * @return + * \endchinese + * \english + * Returns the automatically assigned interrupt number + * + * @param distance + * @param delay + * @param intnum + * @return + * \endenglish + */ + int triggInterrupt(double distance, double delay); + + /** + * \chinese + * 获取所有的中断号列表 + * + * @return + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"RuntimeMachine.getTriggInterrupts","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":[]} + * + * \endchinese + * \english + * Get the list of all interrupt numbers + * + * @return + * + * @par JSON-RPC Request Example + * {"jsonrpc":"2.0","method":"RuntimeMachine.getTriggInterrupts","params":[],"id":1} + * + * @par JSON-RPC Response Example + * {"id":1,"jsonrpc":"2.0","result":[]} + * + * \endenglish + */ + std::vector getTriggInterrupts(); + +protected: + void *d_; +}; + +using RuntimeMachinePtr = std::shared_ptr; + +} // namespace common_interface +} // namespace arcs +#endif // AUBO_SDK_RUNTIME_MACHINE_H diff --git a/third_party/AuboSdk/win/include/aubo/serial.h b/third_party/AuboSdk/win/include/aubo/serial.h new file mode 100644 index 00000000..679a21fc --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo/serial.h @@ -0,0 +1,396 @@ +/** @file serial.h + * @brief 串口通信 + */ +#ifndef AUBO_SDK_SERIAL_INTERFACE_H +#define AUBO_SDK_SERIAL_INTERFACE_H + +#include +#include + +#include +#include + +namespace arcs { +namespace common_interface { + +class ARCS_ABI_EXPORT Serial +{ +public: + Serial(); + virtual ~Serial(); + + /** + * \chinese + * 打开TCP/IP以太网通信串口 + * + * @param device 设备名 + * @param baud 波特率 + * @param stop_bits 停止位 + * @param even 校验位 + * @param serial_name 串口名称 + * @return 返回值 + * + * @par Python函数原型 + * serialOpen(self: pyaubo_sdk.Serial, arg0: str, arg1: int, arg2: float, + * arg3: int, arg4: str) -> int + * + * @par Lua函数原型 + * serialOpen(device: string, baud: number, stop_bits: number, even: number, + * serial_name: string) -> nil + * \endchinese + * \english + * Open TCP/IP ethernet communication serial + * + * @param device + * @param baud + * @param stop_bits + * @param even + * @param serial_name + * @return + * + * @par Python function prototype + * serialOpen(self: pyaubo_sdk.Serial, arg0: str, arg1: int, arg2: float, + * arg3: int, arg4: str) -> int + * + * @par Lua function prototype + * serialOpen(device: string, baud: number, stop_bits: number, even: number, + * serial_name: string) -> nil + * \endenglish + */ + + int serialOpen(const std::string &device, int baud, float stop_bits, + int even, const std::string &serial_name = "serial_0"); + + /** + * \chinese + * 关闭TCP/IP串口通信 + * 关闭与服务器的串口连接。 + * + * @param serial_name 串口名称 + * @return 返回值 + * + * @par Python函数原型 + * serialClose(self: pyaubo_sdk.Serial, arg0: str) -> int + * + * @par Lua函数原型 + * serialClose(serial_name: string) -> nil + * \endchinese + * \english + * Close TCP/IP serial communication + * Close down the serial connection to the server. + * + * @param serial_name + * @return + * + * @par Python function prototype + * serialClose(self: pyaubo_sdk.Serial, arg0: str) -> int + * + * @par Lua function prototype + * serialClose(serial_name: string) -> nil + * \endenglish + */ + int serialClose(const std::string &serial_name = "serial_0"); + + /** + * \chinese + * 从串口读取指定数量的字节。字节为网络字节序。一次最多可读取30个值。 + * + * @param variable 变量 + * @param serial_name 串口名称 + * @return 返回值 + * + * @par Python函数原型 + * serialReadByte(self: pyaubo_sdk.Serial, arg0: str, arg1: str) -> int + * + * @par Lua函数原型 + * serialReadByte(variable: string, serial_name: string) -> number + * \endchinese + * \english + * Reads a number of bytes from the serial. Bytes are in network byte + * order. A maximum of 30 values can be read in one command. + * + * @param variable + * @param serial_name + * @return + * + * @par Python function prototype + * serialReadByte(self: pyaubo_sdk.Serial, arg0: str, arg1: str) -> int + * + * @par Lua function prototype + * serialReadByte(variable: string, serial_name: string) -> number + * \endenglish + */ + int serialReadByte(const std::string &variable, + const std::string &serial_name = "serial_0"); + + /** + * \chinese + * 从串口读取指定数量的字节。字节为网络字节序。一次最多可读取30个值。 + * 返回读取到的数字列表(int列表,长度=number+1)。 + * + * @param number 读取的字节数 + * @param variable 变量 + * @param serial_name 串口名称 + * @return 返回值 + * + * @par Python函数原型 + * serialReadByteList(self: pyaubo_sdk.Serial, arg0: int, arg1: str, arg2: str) -> int + * + * @par Lua函数原型 + * serialReadByteList(number: number, variable: string, serial_name: string) -> number + * \endchinese + * \english + * Reads a number of bytes from the serial. Bytes are in network byte + * order. A maximum of 30 values can be read in one command. + * A list of numbers read (list of ints, length=number+1) + * + * @param number Number of bytes to read + * @param variable + * @param serial_name Serial port name + * @return Return value + * + * @par Python function prototype + * serialReadByteList(self: pyaubo_sdk.Serial, arg0: int, arg1: str, arg2: str) -> int + * + * @par Lua function prototype + * serialReadByteList(number: number, variable: string, serial_name: string) -> number + * \endenglish + */ + int serialReadByteList(int number, const std::string &variable, + const std::string &serial_name = "serial_0"); + + /** + * \chinese + * 从串口读取所有数据,并将数据作为字符串返回。 + * 字节为网络字节序。 + * + * 可选参数 "prefix" 和 "suffix" 用于指定从串口提取的内容。 + * "prefix" 指定提取子串(消息)的起始位置。直到 "prefix" 结束的数据会被忽略并从串口移除。 + * "suffix" 指定提取子串(消息)的结束位置。串口中 "suffix" 之后的剩余数据会被保留。 + * 例如,如果串口服务器发送字符串 "noise>hello<",控制器可以通过设置 prefix=">" 和 suffix="<" 来接收 "hello"。 + * 通过使用 "prefix" 和 "suffix",还可以一次向控制器发送多条字符串,因为 "suffix" 定义了消息的结束位置。 + * 例如发送 ">hello<>world<" + * + * @param variable 变量 + * @param serial_name 串口名称 + * @param prefix 前缀 + * @param suffix 后缀 + * @param interpret_escape 是否解释转义字符 + * @return 返回值 + * + * @par Python函数原型 + * serialReadString(self: pyaubo_sdk.Serial, arg0: str, arg1: str, arg2: str, arg3: str, arg4: bool) -> int + * + * @par Lua函数原型 + * serialReadString(variable: string, serial_name: string, prefix: string, suffix: string, interpret_escape: boolean) -> number + * \endchinese + * \english + * Reads all data from the serial and returns the data as a string. + * Bytes are in network byte order. + * + * The optional parameters "prefix" and "suffix", can be used to express + * what is extracted from the serial. The "prefix" specifies the start + * of the substring (message) extracted from the serial. The data up to + * the end of the "prefix" will be ignored and removed from the serial. + * The "suffix" specifies the end of the substring (message) extracted + * from the serial. Any remaining data on the serial, after the "suffix", + * will be preserved. E.g. if the serial server sends a string + * "noise>hello<", the controller can receive the "hello" by calling this + * script function with the prefix=">" and suffix="<". By using the + * "prefix" and "suffix" it is also possible send multiple string to the + * controller at once, because the suffix defines where the message ends. + * E.g. sending ">hello<>world<" + * + * @param variable + * @param serial_name + * @param prefix + * @param suffix + * @param interpret_escape + * @return + * + * @par Python function prototype + * serialReadString(self: pyaubo_sdk.Serial, arg0: str, arg1: str, arg2: str, arg3: str, arg4: bool) -> int + * + * @par Lua function prototype + * serialReadString(variable: string, serial_name: string, prefix: string, suffix: string, interpret_escape: boolean) -> number + * \endenglish + */ + int serialReadString(const std::string &variable, + const std::string &serial_name = "serial_0", + const std::string &prefix = "", + const std::string &suffix = "", + bool interpret_escape = false); + + /** + * \chinese + * 发送一个字节到服务器 + * 通过串口发送字节 。不期望有响应。可用于发送特殊的ASCII字符;10为换行符,2为文本开始,3为文本结束。 + * + * @param value 字节值 + * @param serial_name 串口名称 + * @return 返回值 + * + * @par Python函数原型 + * serialSendByte(self: pyaubo_sdk.Serial, arg0: str, arg1: str) -> int + * + * @par Lua函数原型 + * serialSendByte(value: string, serial_name: string) -> nil + * \endchinese + * \english + * Sends a byte to the server + * Sends the byte through the serial. Expects no response. Can + * be used to send special ASCII characters; 10 is newline, 2 is start of + * text, 3 is end of text. + * + * @param value + * @param serial_name + * @return + * + * @par Python function prototype + * serialSendByte(self: pyaubo_sdk.Serial, arg0: str, arg1: str) -> int + * + * @par Lua function prototype + * serialSendByte(value: string, serial_name: string) -> nil + * \endenglish + */ + int serialSendByte(char value, const std::string &serial_name = "serial_0"); + + /** + * \chinese + * 发送一个整数(int32_t)到服务器 + * 通过串口发送整数 。以网络字节序发送。不期望有响应。 + * + * @param value 整数值 + * @param serial_name 串口名称 + * @return 返回值 + * + * @par Python函数原型 + * serialSendInt(self: pyaubo_sdk.Serial, arg0: int, arg1: str) -> int + * + * @par Lua函数原型 + * serialSendInt(value: number, serial_name: string) -> nil + * \endchinese + * \english + * Sends an int (int32_t) to the server + * Sends the int through the serial. Send in network byte order. + * Expects no response. + * + * @param value + * @param serial_name + * @return + * + * @par Python function prototype + * serialSendInt(self: pyaubo_sdk.Serial, arg0: int, arg1: str) -> int + * + * @par Lua function prototype + * serialSendInt(value: number, serial_name: string) -> nil + * \endenglish + */ + int serialSendInt(int value, const std::string &serial_name = "serial_0"); + + /** + * \chinese + * 发送带有换行符的字符串到服务器 + * 以ASCII编码通过串口发送字符串,并在末尾添加换行符。不期望有响应。 + * + * @param str 字符串 + * @param serial_name 串口名称 + * @return 返回值 + * + * @par Python函数原型 + * serialSendLine(self: pyaubo_sdk.Serial, arg0: str, arg1: str) -> int + * + * @par Lua函数原型 + * serialSendLine(str: string, serial_name: string) -> nil + * \endchinese + * \english + * Sends a string with a newline character to the server + * Sends the string through the serial in ASCII coding, appending a newline at the end. Expects no response. + * + * @param str + * @param serial_name + * @return + * + * @par Python function prototype + * serialSendLine(self: pyaubo_sdk.Serial, arg0: str, arg1: str) -> int + * + * @par Lua function prototype + * serialSendLine(str: string, serial_name: string) -> nil + * \endenglish + */ + int serialSendLine(const std::string &str, + const std::string &serial_name = "serial_0"); + + /** + * \chinese + * 发送字符串到服务器 + * 以ASCII编码通过串口发送字符串。不期望有响应。 + * + * @param str 字符串 + * @param serial_name 串口名称 + * @return 返回值 + * + * @par Python函数原型 + * serialSendString(self: pyaubo_sdk.Serial, arg0: str, arg1: str) -> int + * + * @par Lua函数原型 + * serialSendString(str: string, serial_name: string) -> nil + * \endchinese + * \english + * Sends a string to the server + * Sends the string through the serial in ASCII coding. Expects no + * response. + * + * @param str + * @param serial_name + * @return + * + * @par Python function prototype + * serialSendString(self: pyaubo_sdk.Serial, arg0: str, arg1: str) -> int + * + * @par Lua function prototype + * serialSendString(str: string, serial_name: string) -> nil + * \endenglish + */ + int serialSendString(const std::string &str, + const std::string &serial_name = "serial_0"); + + /** + * \chinese + * + * @param is_check 是否校验 + * @param str 字符串数组 + * @param serial_name 串口名称 + * @return 返回值 + * + * @par Python函数原型 + * serialSendAllString(self: pyaubo_sdk.Serial, arg0: bool, arg1: List[str], arg2: str) -> int + * + * @par Lua函数原型 + * serialSendAllString(is_check: boolean, str: table, serial_name: string) -> nil + * \endchinese + * \english + * + * @param is_check Whether to check + * @param str Array of strings + * @param serial_name Serial port name + * @return Return value + * + * @par Python function prototype + * serialSendAllString(self: pyaubo_sdk.Serial, arg0: bool, arg1: List[str], arg2: str) -> int + * + * @par Lua function prototype + * serialSendAllString(is_check: boolean, str: table, serial_name: string) -> nil + * \endenglish + */ + int serialSendAllString(bool is_check, const std::vector &str, + const std::string &serial_name = "serial_0"); + +protected: + void *d_; +}; +using SerialPtr = std::shared_ptr; + +} // namespace common_interface +} // namespace arcs +#endif diff --git a/third_party/AuboSdk/win/include/aubo/socket.h b/third_party/AuboSdk/win/include/aubo/socket.h new file mode 100644 index 00000000..c95f2a34 --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo/socket.h @@ -0,0 +1,627 @@ +/** @file socket.h + * @brief socket通信 + */ +#ifndef AUBO_SDK_SOCKET_INTERFACE_H +#define AUBO_SDK_SOCKET_INTERFACE_H + +#include +#include + +#include +#include + +namespace arcs { +namespace common_interface { + +class ARCS_ABI_EXPORT Socket +{ +public: + Socket(); + virtual ~Socket(); + + /** + * \english + * Open TCP/IP ethernet communication socket + * + * Instruction + * + * @param address + * @param port + * @param socket_name + * @return + * + * @par Python function prototype + * socketOpen(self: pyaubo_sdk.Socket, arg0: str, arg1: int, arg2: str) -> int + * + * @par Lua function prototype + * socketOpen(address: string, port: number, socket_name: string) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Socket.socketOpen","params":["172.16.26.248",8000,"socket_0"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + * \chinese + * 打开TCP/IP以太网通信socket + * + * 指令 + * + * @param address 地址 + * @param port 端口 + * @param socket_name 套接字名称 + * @return 返回值 + * + * @par Python函数原型 + * socketOpen(self: pyaubo_sdk.Socket, arg0: str, arg1: int, arg2: str) -> int + * + * @par Lua函数原型 + * socketOpen(address: string, port: number, socket_name: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Socket.socketOpen","params":["172.16.26.248",8000,"socket_0"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + */ + int socketOpen(const std::string &address, int port, + const std::string &socket_name = "socket_0"); + + /** + * \english + * Closes TCP/IP socket communication + * Closes down the socket connection to the server. + * + * Instruction + * + * @param socket_name + * @return + * + * @par Python function prototype + * socketClose(self: pyaubo_sdk.Socket, arg0: str) -> int + * + * @par Lua function prototype + * socketClose(socket_name: string) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Socket.socketClose","params":["socket_0"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + * \chinese + * 关闭TCP/IP socket 通信 + * 关闭与服务器的 socket 连接。 + * + * 指令 + * + * @param socket_name 套接字名称 + * @return 返回值 + * + * @par Python函数原型 + * socketClose(self: pyaubo_sdk.Socket, arg0: str) -> int + * + * @par Lua函数原型 + * socketClose(socket_name: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Socket.socketClose","params":["socket_0"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + */ + int socketClose(const std::string &socket_name = "socket_0"); + + /** + * \english + * Reads a number of ascii formatted floats from the socket. A maximum + * of 30 values can be read in one command. + * A list of numbers read (list of floats, length=number+1) + * + * Result will be stored in a register named reg_key. Use getFloatVec + * to retrieve data + * + * @param number + * @param variable + * @param socket_name + * @return + * + * @par Python function prototype + * socketReadAsciiFloat(self: pyaubo_sdk.Socket, arg0: int, arg1: str, arg2: + * str) -> int + * + * @par Lua function prototype + * socketReadAsciiFloat(number: number, variable: string, socket_name: + * string) -> number + * \endenglish + * \chinese + * 从socket读取指定数量的ASCII格式浮点数。一次最多可读取30个值。 + * 读取到的数字列表(浮点数列表,长度=number+1) + * + * 结果将存储在名为reg_key的寄存器中。使用getFloatVec获取数据 + * + * @param number 数量 + * @param variable 变量名 + * @param socket_name 套接字名称 + * @return 返回值 + * + * @par Python函数原型 + * socketReadAsciiFloat(self: pyaubo_sdk.Socket, arg0: int, arg1: str, arg2: + * str) -> int + * + * @par Lua函数原型 + * socketReadAsciiFloat(number: number, variable: string, socket_name: + * string) -> number + * \endchinese + */ + int socketReadAsciiFloat(int number, const std::string &variable, + const std::string &socket_name = "socket_0"); + + /** + * \english + * Reads a number of 32 bit integers from the socket. Bytes are in + * network byte order. A maximum of 30 values can be read in one + * command. + * A list of numbers read (list of ints, length=number+1) + * + * Instruction + * + * std::vector + * + * @param number + * @param variable + * @param socket_name + * @return + * + * @par Python function prototype + * socketReadBinaryInteger(self: pyaubo_sdk.Socket, arg0: int, arg1: str, + * arg2: str) -> int + * + * @par Lua function prototype + * socketReadBinaryInteger(number: number, variable: string, socket_name: + * string) -> number + * \endenglish + * \chinese + * 从socket读取指定数量的32位整数。字节为网络字节序。一次最多可读取30个值。 + * 读取到的数字列表(整数列表,长度=number+1) + * + * 指令 + * + * std::vector + * + * @param number 数量 + * @param variable 变量名 + * @param socket_name 套接字名称 + * @return 返回值 + * + * @par Python函数原型 + * socketReadBinaryInteger(self: pyaubo_sdk.Socket, arg0: int, arg1: str, + * arg2: str) -> int + * + * @par Lua函数原型 + * socketReadBinaryInteger(number: number, variable: string, socket_name: + * string) -> number + * \endchinese + */ + int socketReadBinaryInteger(int number, const std::string &variable, + const std::string &socket_name = "socket_0"); + + /** + * \english + * Reads a number of bytes from the socket. Bytes are in network byte + * order. A maximum of 30 values can be read in one command. + * A list of numbers read (list of ints, length=number+1) + * + * Instruction + * + * std::vector + * + * @param number + * @param variable + * @param socket_name + * @return + * + * @par Python function prototype + * socketReadByteList(self: pyaubo_sdk.Socket, arg0: int, arg1: str, arg2: + * str) -> int + * + * @par Lua function prototype + * socketReadByteList(number: number, variable: string, socket_name: string) + * -> number + * \endenglish + * \chinese + * 从socket读取指定数量的字节。字节为网络字节序。一次最多可读取30个值。 + * 读取到的数字列表(整数列表,长度=number+1) + * + * 指令 + * + * std::vector + * + * @param number 数量 + * @param variable 变量名 + * @param socket_name 套接字名称 + * @return 返回值 + * + * @par Python函数原型 + * socketReadByteList(self: pyaubo_sdk.Socket, arg0: int, arg1: str, arg2: + * str) -> int + * + * @par Lua函数原型 + * socketReadByteList(number: number, variable: string, socket_name: string) + * -> number + * \endchinese + */ + int socketReadByteList(int number, const std::string &variable, + const std::string &socket_name = "socket_0"); + + /** + * \english + * Reads all data from the socket and returns the data as a string. + * Bytes are in network byte order. + * + * The optional parameters "prefix" and "suffix", can be used to express + * what is extracted from the socket. The "prefix" specifies the start + * of the substring (message) extracted from the socket. The data up to + * the end of the "prefix" will be ignored and removed from the socket. + * The "suffix" specifies the end of the substring (message) extracted + * from the socket. Any remaining data on the socket, after the "suffix", + * will be preserved. E.g. if the socket server sends a string + * "noise>hello<", the controller can receive the "hello" by calling this + * script function with the prefix=">" and suffix="<". By using the + * "prefix" and "suffix" it is also possible send multiple string to the + * controller at once, because the suffix defines where the message ends. + * E.g. sending ">hello<>world<" + * + * Instruction + * + * std::string + * + * @param variable + * @param socket_name + * @param prefix + * @param suffix + * @param interpret_escape + * @return + * + * @par Python function prototype + * socketReadString(self: pyaubo_sdk.Socket, arg0: str, arg1: str, arg2: + * str, arg3: str, arg4: bool) -> int + * + * @par Lua function prototype + * socketReadString(variable: string, socket_name: string, prefix: string, + * suffix: string, interpret_escape: boolean) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Socket.socketReadString","params":["camera","socket_0","","",false],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + * \chinese + * 从socket读取所有数据并将其作为字符串返回。 + * 字节为网络字节序。 + * + * 可选参数"prefix"和"suffix"可用于指定从socket中提取的内容。 + * "prefix"指定提取子字符串(消息)的起始位置。直到"prefix"结尾的数据将被忽略并从socket中移除。 + * "suffix"指定提取子字符串(消息)的结束位置。"suffix"之后的任何剩余数据将保留在socket中。 + * 例如,如果socket服务器发送字符串"noise>hello<",控制器可以通过调用此脚本函数并设置prefix=">"和suffix="<"来接收"hello"。 + * 通过使用"prefix"和"suffix",还可以一次向控制器发送多条字符串,因为"suffix"定义了消息的结束位置。例如发送">hello<>world<" + * + * 指令 + * + * std::string + * + * @param variable 变量名 + * @param socket_name 套接字名称 + * @param prefix 前缀 + * @param suffix 后缀 + * @param interpret_escape 是否解释转义字符 + * @return 返回值 + * + * @par Python函数原型 + * socketReadString(self: pyaubo_sdk.Socket, arg0: str, arg1: str, arg2: + * str, arg3: str, arg4: bool) -> int + * + * @par Lua函数原型 + * socketReadString(variable: string, socket_name: string, prefix: string, + * suffix: string, interpret_escape: boolean) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Socket.socketReadString","params":["camera","socket_0","","",false],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + */ + int socketReadString(const std::string &variable, + const std::string &socket_name = "socket_0", + const std::string &prefix = "", + const std::string &suffix = "", + bool interpret_escape = false); + + /** + * \english + * Reads all data from the socket and returns the data as a vector of chars. + * + * Instruction + * std::vector + * + * @param variable + * @param socket_name + * @return + * + * @par Python function prototype + * socketReadAllString(self: pyaubo_sdk.Socket, arg0: str, arg1: str) -> int + * + * @par Lua function prototype + * socketReadAllString(variable: string, socket_name: string) -> number + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Socket.socketReadAllString","params":["camera","socket_0"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + * \chinese + * 从socket读取所有数据并将其作为char向量返回。 + * + * 指令 + * std::vector + * + * @param variable 变量名 + * @param socket_name 套接字名称 + * @return 返回值 + * + * @par Python函数原型 + * socketReadAllString(self: pyaubo_sdk.Socket, arg0: str, arg1: str) -> int + * + * @par Lua函数原型 + * socketReadAllString(variable: string, socket_name: string) -> number + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Socket.socketReadAllString","params":["camera","socket_0"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + */ + int socketReadAllString(const std::string &variable, + const std::string &socket_name = "socket_0"); + + /** + * \english + * Sends a byte to the server + * Sends the byte through the socket. Expects no response. Can + * be used to send special ASCII characters; 10 is newline, 2 is start of + * text, 3 is end of text. + * + * Instruction + * + * @param value + * @param socket_name + * @return + * + * @par Python function prototype + * socketSendByte(self: pyaubo_sdk.Socket, arg0: str, arg1: str) -> int + * + * @par Lua function prototype + * socketSendByte(value: string, socket_name: string) -> nil + * + * \endenglish + * \chinese + * 发送一个字节到服务器 + * 通过socket发送字节,不期望响应。可用于发送特殊ASCII字符;10为换行符,2为文本开始,3为文本结束。 + * + * 指令 + * + * @param value 字节值 + * @param socket_name 套接字名称 + * @return 返回值 + * + * @par Python函数原型 + * socketSendByte(self: pyaubo_sdk.Socket, arg0: str, arg1: str) -> int + * + * @par Lua函数原型 + * socketSendByte(value: string, socket_name: string) -> nil + * + * \endchinese + */ + int socketSendByte(char value, const std::string &socket_name = "socket_0"); + + /** + * \english + * Sends an int (int32_t) to the server + * Sends the int through the socket. Send in network byte order. + * Expects no response + * + * Instruction + * + * @param value + * @param socket_name + * @return + * + * @par Python function prototype + * socketSendInt(self: pyaubo_sdk.Socket, arg0: int, arg1: str) -> int + * + * @par Lua function prototype + * socketSendInt(value: number, socket_name: string) -> nil + * + * \endenglish + * \chinese + * 发送一个int(int32_t)到服务器 + * 通过socket发送int ,以网络字节序发送。不期望响应。 + * + * 指令 + * + * @param value 整数值 + * @param socket_name 套接字名称 + * @return 返回值 + * + * @par Python函数原型 + * socketSendInt(self: pyaubo_sdk.Socket, arg0: int, arg1: str) -> int + * + * @par Lua函数原型 + * socketSendInt(value: number, socket_name: string) -> nil + * + * \endchinese + */ + int socketSendInt(int value, const std::string &socket_name = "socket_0"); + + /** + * \english + * Sends a string with a newline character to the server + * Sends the string through the socket in ASCII coding. Expects no + * response. + * + * Instruction + * + * @param str + * @param socket_name + * @return + * + * @par Python function prototype + * socketSendLine(self: pyaubo_sdk.Socket, arg0: str, arg1: str) -> int + * + * @par Lua function prototype + * socketSendLine(str: string, socket_name: string) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Socket.socketSendLine","params":["abcd","socket_0"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + * \chinese + * 发送带有换行符的字符串到服务器. + * 通过socket以ASCII编码发送字符串,不期望响应。 + * + * 指令 + * + * @param str 字符串 + * @param socket_name 套接字名称 + * @return 返回值 + * + * @par Python函数原型 + * socketSendLine(self: pyaubo_sdk.Socket, arg0: str, arg1: str) -> int + * + * @par Lua函数原型 + * socketSendLine(str: string, socket_name: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Socket.socketSendLine","params":["abcd","socket_0"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + */ + int socketSendLine(const std::string &str, + const std::string &socket_name = "socket_0"); + + /** + * \english + * Sends a string to the server + * Sends the string through the socket in ASCII coding. Expects no + * response. + * + * Instruction + * + * @param str + * @param socket_name + * @return + * + * @par Python function prototype + * socketSendString(self: pyaubo_sdk.Socket, arg0: str, arg1: str) -> int + * + * @par Lua function prototype + * socketSendString(str: string, socket_name: string) -> nil + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"Socket.socketSendString","params":["abcd","socket_0"],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":0} + * \endenglish + * \chinese + * 发送字符串到服务器 + * 通过socket以ASCII编码发送字符串,不期望响应。 + * + * 指令 + * + * @param str 字符串 + * @param socket_name 套接字名称 + * @return 返回值 + * + * @par Python函数原型 + * socketSendString(self: pyaubo_sdk.Socket, arg0: str, arg1: str) -> int + * + * @par Lua函数原型 + * socketSendString(str: string, socket_name: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"Socket.socketSendString","params":["abcd","socket_0"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * \endchinese + */ + int socketSendString(const std::string &str, + const std::string &socket_name = "socket_0"); + + /** + * \english + * Sends all data in the given vector of chars to the server. + * + * @param is_check Whether to check the sending status + * @param str The data to send as a vector of chars + * @param socket_name The name of the socket + * @return Status code + * + * @par Python function prototype + * socketSendAllString(self: pyaubo_sdk.Socket, arg0: bool, arg1: List[str], arg2: str) -> int + * + * @par Lua function prototype + * socketSendAllString(is_check: boolean, str: table, socket_name: string) -> nil + * \endenglish + * \chinese + * 发送给定char向量中的所有数据到服务器。 + * + * @param is_check 是否检查发送状态 + * @param str 要发送的数据,char向量 + * @param socket_name 套接字名称 + * @return 状态码 + * + * @par Python函数原型 + * socketSendAllString(self: pyaubo_sdk.Socket, arg0: bool, arg1: List[str], arg2: str) -> int + * + * @par Lua函数原型 + * socketSendAllString(is_check: boolean, str: table, socket_name: string) -> nil + * \endchinese + */ + int socketSendAllString(bool is_check, const std::vector &str, + const std::string &socket_name = "socket_0"); + + /** + * 检测 socket 连接是否成功 + * @brief socketHasConnected + * @param socket_name + * + * @return + * + * @par Python函数原型 + * socketHasConnected(self: pyaubo_sdk.Socket, arg0: str) -> bool + * + * @par Lua函数原型 + * socketHasConnected(socket_name: string) -> boolean + */ + bool socketHasConnected(const std::string &socket_name = "socket_0"); + +protected: + void *d_; +}; +using SocketPtr = std::shared_ptr; + +} // namespace common_interface +} // namespace arcs +#endif diff --git a/third_party/AuboSdk/win/include/aubo/sync_move.h b/third_party/AuboSdk/win/include/aubo/sync_move.h new file mode 100644 index 00000000..fc59b011 --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo/sync_move.h @@ -0,0 +1,980 @@ +/** @file sync_move.h + * @brief 同步运行 + * + * 1. Independent movements + * If the different task programs, and their robots, work independently, no + * synchronization or coordination is needed. Each task program is then + * written as if it was the program for a single robot system. + * + * 2. Semi coordinated movements + * Several robots can work with the same work object, without synchronized + * movements, as long as the work object is not moving. + * A positioner can move the work object when the robots are not coordinated + * to it, and the robots can be coordinated to the work object when it is not + * moving. Switching between moving the object and coordinating the robots is + * called semi coordinated movements. + * + * 3. Coordinated synchronized movements + * Several robots can work with the same moving work object. + * The positioner or robot that holds the work object and the robots that work + * with the work object must have synchronized movements. This means that the + * RAPID task programs, that handle one mechanical unit each, execute their + * move instructions simultaneously. + */ +#ifndef AUBO_SDK_SYNC_MOVE_INTERFACE_H +#define AUBO_SDK_SYNC_MOVE_INTERFACE_H + +#include +#include +#include +#include +#include + +namespace arcs { +namespace common_interface { + +typedef std::unordered_set TaskSet; +class ARCS_ABI_EXPORT SyncMove +{ +public: + SyncMove(); + virtual ~SyncMove(); + + /** + *\chinese + * syncMoveOn 用于启动同步运动模式。 + * + * syncMoveOn 指令会等待其他任务程序。当所有任务程序都到达 syncMoveOn 时, + * 它们将继续以同步运动模式执行。不同任务程序中的移动指令将同时执行, + * 直到执行 syncMoveOff 指令为止。在 syncMoveOn 指令之前必须编程一个停止点。 + * + * @param syncident + * @param taskset + * @return + * + * @par Python函数原型 + * syncMoveOn(self: pyaubo_sdk.SyncMove, arg0: str, arg1: Set[str]) -> int + * + * @par Lua函数原型 + * syncMoveOn(syncident: string, taskset: table) -> nil + * @endcoe + * \endchinese + * \english + * syncMoveOn is used to start synchronized movement mode. + * + * A syncMoveOn instruction will wait for the other task programs. When + * all task programs have reached the syncMoveOn, they will continue + * their execution in synchronized movement mode. The move instructions + * in the different task programs are executed simultaneously, until the + * instruction syncMoveOff is executed. + * A stop point must be programmed before the syncMoveOn instruction. + * + * @param syncident + * @param taskset + * @return + * + * @par Python函数原型 + * syncMoveOn(self: pyaubo_sdk.SyncMove, arg0: str, arg1: Set[str]) -> int + * + * @par Lua函数原型 + * syncMoveOn(syncident: string, taskset: table) -> nil + * @endcoe + * \endenglish + */ + int syncMoveOn(const std::string &syncident, const TaskSet &taskset); + + /** + * \chinese + * 设置同步路径段的ID + * 在同步运动模式下,所有同时执行的移动指令必须全部编程为圆角区(corner zones)或全部为停止点(stop points)。 + * 这意味着具有相同ID的移动指令要么全部带有圆角区,要么全部带有停止点。 + * 如果在各自的任务程序中同步执行的移动指令中,一个带有圆角区而另一个带有停止点,则会发生错误。 + * 同步执行的移动指令可以有不同大小的圆角区(例如,一个使用z10,另一个使用z50)。 + * + * @param id + * @return + * + * @par Python函数原型 + * syncMoveSegment(self: pyaubo_sdk.SyncMove, arg0: int) -> bool + * + * @par Lua函数原型 + * syncMoveSegment(id: number) -> boolean + * @endcoe + * \endchinese + * \english + * Set the ID for the synchronized path segment. + * In synchronized movements mode, all or none of the simultaneous move instructions must be programmed with corner zones. + * This means that move instructions with the same ID must either all have corner zones, or all have stop points. + * If a move instruction with a corner zone and a move instruction with a stop point are synchronously executed in their respective task program, an error will occur. + * Synchronously executed move instructions can have corner zones of different sizes (e.g. one uses z10 and one uses z50). + * + * @param id + * @return + * + * @par Python prototype + * syncMoveSegment(self: pyaubo_sdk.SyncMove, arg0: int) -> bool + * + * @par Lua prototype + * syncMoveSegment(id: number) -> boolean + * @endcoe + * \endenglish + */ + bool syncMoveSegment(int id); + + /** + * \chinese + * syncMoveOff 用于结束同步运动模式。 + * + * syncMoveOff 指令会等待其他任务程序。当所有任务程序都到达 syncMoveOff 时, + * 它们将继续以非同步模式执行。在 syncMoveOff 指令之前必须编程一个停止点。 + * + * @param syncident + * @return + * + * @par Python函数原型 + * syncMoveOff(self: pyaubo_sdk.SyncMove, arg0: str) -> int + * + * @par Lua函数原型 + * syncMoveOff(syncident: string) -> nil + * @endcoe + * \endchinese + * \english + * syncMoveOff is used to end synchronized movement mode. + * + * A syncMoveOff instruction will wait for the other task programs. When + * all task programs have reached the syncMoveOff, they will continue + * their execution in unsynchronized mode. + * A stop point must be programmed before the syncMoveOff instruction. + * + * @param syncident + * @return + * + * @par Python prototype + * syncMoveOff(self: pyaubo_sdk.SyncMove, arg0: str) -> int + * + * @par Lua prototype + * syncMoveOff(syncident: string) -> nil + * @endcoe + * \endenglish + */ + int syncMoveOff(const std::string &syncident); + + /** + * \chinese + * syncMoveUndo 用于关闭同步运动,即使不是所有其他任务程序都执行了 syncMoveUndo 指令。 + * + * syncMoveUndo 主要用于 UNDO 处理程序。当程序指针从过程移动时,syncMoveUndo 用于关闭同步。 + * + * @return + * + * @par Python函数原型 + * syncMoveUndo(self: pyaubo_sdk.SyncMove) -> int + * + * @par Lua函数原型 + * syncMoveUndo() -> nil + * @endcoe + * \endchinese + * \english + * syncMoveUndo is used to turn off synchronized movements, even if not + * all the other task programs execute the syncMoveUndo instruction. + * + * syncMoveUndo is intended for UNDO handlers. When the program + * pointer is moved from the procedure, syncMoveUndo is used to turn off + * the synchronization. + * + * @return + * + * @par Python prototype + * syncMoveUndo(self: pyaubo_sdk.SyncMove) -> int + * + * @par Lua prototype + * syncMoveUndo() -> nil + * @endcoe + * \endenglish + */ + int syncMoveUndo(); + + /** + * \chinese + * waitSyncTasks 用于在程序中的特定点同步多个任务程序。 + * + * waitSyncTasks 指令会等待其他任务程序。当所有任务程序都到达 waitSyncTasks 指令时, + * 它们将继续执行。 + * + * @param syncident + * @param taskset + * @return + * + * @par Python函数原型 + * waitSyncTasks(self: pyaubo_sdk.SyncMove, arg0: str, arg1: Set[str]) -> int + * + * @par Lua函数原型 + * waitSyncTasks(syncident: string, taskset: table) -> nil + * @endcoe + * \endchinese + * \english + * waitSyncTasks is used to synchronize several task programs at a specific + * point in the program. + * + * A waitSyncTasks instruction will wait for the other task programs. When all + * task programs have reached the waitSyncTasks instruction, they will continue + * their execution. + * + * @param syncident + * @param taskset + * @return + * + * @par Python prototype + * waitSyncTasks(self: pyaubo_sdk.SyncMove, arg0: str, arg1: Set[str]) -> int + * + * @par Lua prototype + * waitSyncTasks(syncident: string, taskset: table) -> nil + * @endcoe + * \endenglish + */ + int waitSyncTasks(const std::string &syncident, const TaskSet &taskset); + + /** + * \chinese + * isSyncMoveOn 用于判断机械单元组是否处于同步运动模式。 + * + * 不控制任何机械单元的任务可以通过该函数判断参数“使用机械单元组”中定义的机械单元是否处于同步运动模式。 + * + * @return + * + * @par Python函数原型 + * isSyncMoveOn(self: pyaubo_sdk.SyncMove) -> bool + * + * @par Lua函数原型 + * isSyncMoveOn() -> boolean + * \endchinese + * \english + * isSyncMoveOn is used to tell if the mechanical unit group is in synchronized movement mode. + * + * A task that does not control any mechanical unit can find out if the mechanical units defined in the parameter Use Mechanical Unit Group are in synchronized movement mode. + * + * @return + * + * @par Python prototype + * isSyncMoveOn(self: pyaubo_sdk.SyncMove) -> bool + * + * @par Lua prototype + * isSyncMoveOn() -> boolean + * \endenglish + */ + bool isSyncMoveOn(); + + /** + * \chinese + * 暂停同步运动模式。 + * + * @return + * + * @par Python函数原型 + * syncMoveSuspend(self: pyaubo_sdk.SyncMove) -> int + * + * @par Lua函数原型 + * syncMoveSuspend() -> nil + * \endchinese + * \english + * Suspend synchronized movement mode. + * + * @return + * + * @par Python prototype + * syncMoveSuspend(self: pyaubo_sdk.SyncMove) -> int + * + * @par Lua prototype + * syncMoveSuspend() -> nil + * \endenglish + */ + int syncMoveSuspend(); + + /** + * \chinese + * 恢复同步运动模式。 + * + * @return + * + * @par Python函数原型 + * syncMoveResume(self: pyaubo_sdk.SyncMove) -> int + * + * @par Lua函数原型 + * syncMoveResume() -> nil + * \endchinese + * \english + * Resume synchronized movement mode. + * + * @return + * + * @par Python prototype + * syncMoveResume(self: pyaubo_sdk.SyncMove) -> int + * + * @par Lua prototype + * syncMoveResume() -> nil + * \endenglish + */ + int syncMoveResume(); + + /** + * \chinese + * 添加一个名为 name 的坐标系,其初始位姿为 pose,位姿以 ref_frame 坐标系表达。 + * 此命令仅向世界模型添加一个坐标系,并不会将其附加到 ref_frame 坐标系。 + * 如需将新添加的坐标系附加到 ref_frame,请使用 frameAttach()。 + * + * @param name: 要添加的坐标系名称。名称不能与任何已存在的世界模型对象(坐标系、轴或轴组)重复,否则会抛出异常。 + * @param pose: 新对象的初始位姿。 + * @param ref_frame: 位姿所表达的参考坐标系对象名称。若未指定,默认使用机器人“base”坐标系。 + * + * @return + * \endchinese + * \english + * Add a frame with the name "name" initialized at the specified pose + * expressed in the ref_frame coordinate frame. This command only adds a + * frame to the world, it does not attach it to the ref_frame coordinate + * frame. Use frameAttach() to attach the newly added frame to ref_frame if + * desired. + * + * @param name: name of the frame to be added. The name must not be the same + * as any existing world model object (frame, axis, or axis group), + * otherwise an exception is thrown + * @param pose: initial pose of the new object + * @param ref_frame: name of the world model object whose coordinate frame + * the pose is expressed in. If nothing is provided here, the default is the + * robot “base” frame. + * + * @return + * \endenglish + */ + int frameAdd(const std::string &name, const std::vector &pose, + const std::string &ref_name); + + /** + * \chinese + * 将子坐标系附加到父世界模型对象。附加时会设置父子之间的相对变换,使得子坐标系在世界中不会移动。 + * + * 子坐标系不能为“world”、“flange”、“tcp”,也不能与父坐标系同名。 + * + * 如果子或父不是已存在的坐标系,或导致形成闭环,则操作会失败。 + * + * 如果用于 MotionPlus,parent 参数可以是外部轴或轴组的名称。 + * + * @param child: 要附加的子坐标系名称,不能为“world”、“flange”或“tcp”。 + * @param parent: 子坐标系将要附加到的父对象名称。 + * + * @return + * \endchinese + * \english + * Attaches the child frame to the parent world model object. The relative + * transform between the parent and child will be set such that the child + * does not move in the world when the attachment occurs. + * + * The child cannot be “world”, “flange”, “tcp”, or the same as parent. + * + * This will fail if child or parent is not an existing frame, or this makes + * the attachments form a closed chain. + * + * If being used with the MotionPlus, the parent argument can be the name of + * an external axis or axis group. + * + * @param child: name of the frame to be attached. The name must not be + * “world”, “flange”, or “tcp”. + * @param parent: name of the object that the child frame will be attached + * to. + * + * @return + * \endenglish + */ + int frameAttach(const std::string &child, const std::string &parent); + + /** + * \chinese + * 删除所有已添加到世界模型的坐标系。 + * + * “world”、“base”、“flange”和“tcp”坐标系不能被删除。 + * + * 任何附加到被删除坐标系的坐标系将会被附加到“world”坐标系,并设置新的偏移,使得被分离的坐标系在世界中不会移动。 + * + * @return + * \endchinese + * \english + * Delete all frames that have been added to the world model. + * + * The “world”, “base”, “flange”, and “tcp” frames cannot be deleted. + * + * Any frames that are attached to the deleted frames will be attached to + * the “world” frame with new frame offsets set such that the detached + * frames do not move in the world. + * + * @return + * \endenglish + */ + int frameDeleteAll(); + + /** + * \chinese + * 删除指定名称的坐标系。 + * + * “world”、“base”、“flange”和“tcp”坐标系不能被删除。 + * + * 任何附加到被删除坐标系的坐标系将会被附加到“world”坐标系,并设置新的偏移,使得被分离的坐标系在世界中不会移动。 + * + * 如果指定的坐标系不存在,则操作会失败。 + * + * @param name: 要删除的坐标系名称 + * + * @return + * \endchinese + * \english + * Delete the frame with name from the world model. + * + * The “world”, “base”, “flange”, and “tcp” frames cannot be deleted. + * + * Any frames that are attached to the deleted frame will be attached to the + * “world” frame with new frame offsets set such that the detached frame + * does not move in the world. + * + * This command will fail if the frame does not exist. + * + * @param name: name of the frame to be deleted + * + * @return + * \endenglish + */ + int frameDelete(const std::string &name); + + /** + * \chinese + * 更改名为 name 的坐标系的位置,将其移动到由 pose 指定的新位置,pose 以 ref_name 坐标系表达。 + * + * 如果 name 为 “world”、“flange”、“tcp”,或该坐标系不存在,则操作会失败。注意:如需移动 “tcp” 坐标系,请使用 set_tcp() 命令。 + * + * 如果用于 MotionPlus,ref_name 参数可以是外部轴或轴组的名称。 + * + * @param name: 要移动的坐标系名称 + * @param pose: 新的位置 + * @param ref_name: pose 所表达的参考坐标系,默认值为机器人的 “base” 坐标系。 + * + * @return + * \endchinese + * \english + * Changes the placement of the coordinate frame named name to the new + * placement given by pose that is defined in the ref_name coordinate frame. + * + * This will fail if name is “world”, “flange”, “tcp”, or if the frame does + * not exist. Note: to move the “tcp” frame, use the set_tcp() command + * instead. + * + * If being used with the MotionPlus, the ref_name argument can be the name + * of an external axis or axis group. + * + * @param name: the name of the frame to move + * @param pose: the new placement + * @param ref_name: the coordinate frame that pose is expressed in. The + * default value is the robot’s “base” frame. + * + * @return + * \endenglish + */ + int frameMove(const std::string &name, const std::vector &pose, + const std::string &ref_name); + + /** + * \chinese + * 获取名为 name 的坐标系相对于 rel_frame 坐标系的位姿,并以 ref_frame 坐标系表达。 + * 如果未提供 ref_frame,则返回 name 坐标系相对于 rel_frame 坐标系的位姿,并以 rel_frame 坐标系表达。 + * + * 如果任一参数不是已存在的坐标系,则操作会失败。 + * + * 如果用于 MotionPlus,所有三个参数也可以是外部轴或轴组的名称。 + * + * @param name: 要查询的坐标系名称。 + * @param rel_frame: “相对坐标系”,用于计算相对位姿的坐标系。 + * @param ref_frame: “参考坐标系”,用于表达结果相对位姿的坐标系。如果未提供,则默认为 rel_frame。 + * + * @return 以 ref_frame 坐标系表达的 name 坐标系的位姿。 + * \endchinese + * \english + * Get the pose of the name frame relative to the rel_frame frame but + * expressed in the coordinates of the ref_frame frame. If ref_frame is not + * provided, then this returns the pose of the name frame relative to and + * expressed in the same frame as rel_frame. + * + * This will fail if any arguments are not an existing frame. + * + * If being used with MotionPlus, all three arguments can also be the names + * of external axes or axis groups. + * + * @param name: name of the frame to query. + * @param rel_frame: short for “relative frame” is the frame where the pose + * is computed relative to + * @param ref_frame: short for “reference frame” is the frame to express the + * coordinates of resulting relative pose in. If this is not provided, then + * it will default to match the value of rel_frame. + * + * @return The pose of the frame expressed in the ref_frame coordinates. + * \endenglish + */ + std::vector frameGetPose(const std::string &name, + const std::string &rel_frame, + const std::string &ref_frame); + + /** + * \chinese + * 将位姿从 from_frame 坐标系转换到 to_frame 坐标系。 + * + * 如果任一坐标系参数不是已存在的坐标系,则操作会失败。 + * + * 如果用于 MotionPlus,所有三个参数也可以是外部轴或轴组的名称。 + * + * @param pose: 要转换的位姿 + * @param from_frame: 原始坐标系的参考坐标系名称 + * @param to_frame: 新坐标系的参考坐标系名称 + * + * @return 以 to_frame 坐标系表达的 pose 值。 + * \endchinese + * \english + * Convert pose from from_frame to to_frame. + * + * This will fail if either coordinate system argument is not an existing + * frame. + * + * If being used with MotionPlus, all three arguments can also be the names + * of external axes or axis groups. + * + * @param pose: pose to be converted + * @param from_frame: name of reference frame at origin of old coordinate + * system + * @param to_frame: name of reference frame at origin of new coordinate + * system + * + * @return Value of pose expressed in the coordinates of to_frame. + * \endenglish + */ + std::vector frameConvertPose(const std::vector &pose, + const std::string &from_frame, + const std::string &to_frame); + + /** + * \chinese + * 查询指定名称的坐标系是否存在。 + * + * @param name: 要查询的坐标系名称。 + * + * @return 如果存在该名称的坐标系则返回 true,否则返回 false。 + * \endchinese + * \english + * Queries for the existence of a frame by the given name. + * + * @param name: name of the frame to be queried. + * + * @return Returns true if there is a frame by the given name, false if not. + * \endenglish + */ + bool frameExist(const std::string &name); + + /** + * \chinese + * 获取名为 name 的坐标系在世界模型中的父坐标系名称。 + * + * 如果该坐标系没有附加到其他坐标系,则其父坐标系为 "world"。 + * + * @param name: 要查询的坐标系名称 + * + * @return 父坐标系的名称,字符串类型 + * \endchinese + * \english + * Get the parent of the frame named name in the world model. + * + * If the frame is not attached to another frame, then “world” is the + * parent. + * + * @param name: the frame being queried + * + * @return name of the parent as a string + * \endenglish + */ + std::string frameGetParent(const std::string &name); + + /** + * \chinese + * 返回指定父对象的直接子对象坐标系名称列表。父子关系由世界模型的附加关系定义。 + * 如果用于 MotionPlus,子对象也可以是轴组或轴。 + * + * @param name: 父对象的名称。 + * + * @return 直接子对象坐标系名称列表 + * \endchinese + * \english + * Returns a list of immediate child object frame names. Parent-child + * relationships are defined by world model attachments. If being used with + * MotionPlus, the child objects may also be an axis group or an axis. + * + * @param name: the name of the parent object. + * + * @return a list of immediate child object frame names + * \endenglish + */ + std::vector frameGetChildren(const std::string &name); + + /** + * \chinese + * 向世界模型添加一个新的轴组,名称为 name。轴组基座放置在 ref_frame 坐标系下的 pose 位置。 + * + * 轴组只能附加到世界坐标系。 + * + * 每个轴组的基座都附加有一个坐标系,可以通过轴组名称作为参数传递给其他世界模型函数。 + * + * 世界模型最多可添加 6 个轴组。 + * + * @param name: 要添加的轴组名称,不能为空字符串。世界模型对象(如坐标系、轴组、轴等)的名称必须唯一。 + * @param pose: 轴组基座在参考坐标系下的位姿。 + * @param ref_frame (可选): pose 所在的参考坐标系名称,可以是任何带有坐标系的世界模型实体(如坐标系、轴组、轴等)。默认值 "base" 表示机器人基座坐标系。 + * + * @return + * \endchinese + * \english + * Adds a new axis group with the given name to the world model. It is + * placed at the given pose in the reference coordinate frame defined by + * ref_frame. + * + * An axis group can only be attached to the world coordinate frame. + * + * Each axis group has a coordinate frame attached to its base, which can be + * used as an argument to other world model functions by referring the name + * of the group. + * + * At most 6 axis groups can be added to the world model. + * + * @param name: (string) Name of the axis group to add. The name cannot be + * an empty string. Names used by world model objects (e.g., frame, axis + * group, axis, etc.) must be unique. + * + * @param pose: (pose) Pose of the axis group’s base, in the reference + * coordinate frame. + * + * @param ref_frame (optional): (string) Name of the reference coordinate + * frame that pose is defined in. This can be any world model entity with a + * coordinate system (e.g., frame, axis group, axis, etc.). The default + * value "base" refers to the robot’s base frame. + * + * @return + * \endenglish + */ + int axisGroupAdd(const std::string &name, const std::vector &pose, + const std::string &ref_frame); + + /** + * \chinese + * 删除具有给定名称的轴组。 + * + * 所有附加的轴也会被禁用(如果处于活动状态)并删除。 + * + * 如果该轴组正被其他函数控制,则操作会失败。 + * + * @param name: 要删除的轴组名称。该名称的轴组必须存在。 + * + * @return + * \endchinese + * \english + * Deletes the axis group with the given name from the world model. + * + * All attached axes are also disabled (if live) and deleted. + * + * This function will fail, if this axis group is under control by another function. + * + * @param name: (string) Name of the axis group to delete. Axis group with + * such name must exist. + * + * @return + * \endenglish + */ + int axisGroupDelete(const std::string &name); + + /** + * \chinese + * 向名为 group_name 的轴组添加一个名为 name 的外部轴。该轴在 parent 坐标系下的 pose 位置附加,pose 表示轴位置为 0 时的位姿。 + * 轴的类型、最大速度、最大加速度、位置限制和索引分别由 type、v_limit、a_limit、q_limits 和 axis_index 定义。 + * pose 参数通常通过外部轴调试标定流程获得。 + * 如果该轴组正被其他函数控制,或附加关系形成闭环,则操作会失败。 + * + * @param group_name: 要添加轴的轴组名称,需已通过 axis_group_add() 创建且存在。 + * @param name: 新轴的名称,不能为空且需唯一。 + * @param parent: 父轴名称,若为空或与 group_name 相同,则附加到轴组基座。父轴需已存在于该轴组。 + * @param pose: 轴在父坐标系下的零位姿。type 为 0(旋转轴)时,z 轴为旋转轴;type 为 1(直线轴)时,z 轴为移动方向。 + * @param type: 轴类型,0 表示旋转轴,1 表示直线轴。 + * @param v_limit: 最大速度。 + * @param a_limit: 最大加速度。 + * @param q_limits: 位置限制。 + * @param axis_index: 轴索引。 + * \endchinese + * \english + * Adds an external axis with the given name to the axis group named group_name. + * The axis is attached at the given pose in the reference coordinate frame defined by parent when its axis position is 0. + * The type, max velocity, max acceleration, position limits, and index of this axis are defined by type, v_limit, a_limit, q_limits, and axis_index, respectively. + * The pose parameter is typically obtained from a calibration process when the external axis is commissioned. + * This function will fail if this axis group is under control of another function, or if the kinematic chain created by the attachment forms a closed chain. + * + * @param group_name: Name of the axis group this new axis is added to. The axis group would have been created using axis_group_add(). Axis group with such name must exist. + * @param name: Name of the new axis. The name cannot be an empty string. Names used by world model objects (e.g., frame, axis group, axis, etc.) must be unique. + * @param parent: Name of the parent axis. If it’s empty or the same as group_name, the new axis will be attached to the base of the axis group. Axis with such name must exist in the axis group. + * @param pose: The zero-position pose, in the parent coordinate frame, this axis will be placed and attached to. This is the pose the axis will be (relative to its parent) when its axis position is 0. If type is 0 (rotary), then the z axis of the frame corresponds to the axis of rotation. If type is 1 (linear), then the z axis is the axis of translation. + * @param type: Axis type, 0 for rotary, 1 for linear. + * @param v_limit: Maximum velocity. + * @param a_limit: Maximum acceleration. + * @param q_limits: Position limits. + * @param axis_index: Axis index. + * \endenglish + */ + int axisGroupAddAxis(const std::string &group_name, const std::string &name, + const std::string &parent, + const std::vector &pose); + + /** + * \chinese + * 更新指定名称的轴的相关属性。pose 参数通常通过外部轴调试标定流程获得。 + * 如果该轴所属的轴组正被其他命令控制,则操作会失败。 + * 如果该轴组中任何已附加的轴处于激活和使能状态,则操作会失败。 + * + * @param name: 要更新的轴的名称,需已存在。 + * @param pose (可选): 轴在父轴(或轴组)坐标系下的零位姿。即轴位置为 0 时的位姿。 + * \endchinese + * \english + * Updates the corresponding properties of axis with name. The pose + * parameter is typically obtained from a calibration process when the + * external axis is commissioned. See here for a guide on a basic routine + * for calibrating a single rotary axis. + * + * This function will fail, if the axis group the axis attached to is + * already being controlled by another command. + * This function will fail, if any attached axis of the axis group is live + * and enabled. + * + * @param name: (string) Name of the axis to update. Axis with such name + * must exist. + * + * @param pose (optional): (pose) New zero-position pose, in the coordinate + * frame of the parent axis (or axis group), of the axis. This is the pose + * of the axis when its axis position is 0. + * \endenglish + */ + int axisGroupUpdateAxis(const std::string &name, + const std::vector &pose); + + /** + * \chinese + * 返回指定轴名称在 RTDE 目标位置和实际位置数组中的索引。 + * + * @param axis_name: (string) 要查询的轴名称。该名称的轴必须存在。 + * + * @return integer: 该轴在 RTDE 目标位置和实际位置数组中的索引。 + * \endchinese + * \english + * Returns the index of the axis with given axis_name in the RTDE target + * positions and actual positions arrays. + * + * @param axis_name: (string) Name of the axis in query. + * Axis with such name must exist. + * + * @return integer: Index of the axis in the RTDE target positions and + * actual positions arrays. + * \endenglish + */ + int axisGroupGetAxisIndex(const std::string &name); + + /** + * \chinese + * 返回指定轴索引对应的轴名称。 + * + * @param axis_index: (整数) 要查询的轴索引。该索引的轴必须存在。 + * + * @return 字符串: 轴的名称。 + * \endchinese + * \english + * Returns the name of the axis with the given axis_index. + * + * @param axis_index: (integer) Index of the axis in query. + * Axis with such index must exist. + * + * @return string: Name of the axis. + * \endenglish + */ + std::string axisGroupGetAxisName(int index); + + /** + * \chinese + * 返回指定轴组的当前目标位置。 + * 如果未指定 group_name,则返回所有外部轴的目标位置。 + * + * 如果外部轴总线被禁用,则该函数会失败。 + * + * @param group_name (可选): (string) 要查询的轴组名称。该名称的轴组必须真实存在。 + * + * @return Double[]: 涉及轴的目标位置,顺序为其外部轴索引顺序。 + * \endchinese + * \english + * Returns the current target positions of the axis group with group_name. + * If group_name is not provided, the target positions of all external axes + * will be returned. + * + * This function will fail, if the external axis bus is disabled. + * + * @param group_name (optional): (string) Name of the axis group in query. + * Axis group with such name must REALLY exist. + * + * @return Double[]: Target positions of the involved axes, in the order of + * their external axis indices. + * \endenglish + */ + std::vector axisGroupGetTargetPositions( + const std::string &group_name); + + /** + * \chinese + * 返回指定轴组的当前实际位置。 + * 如果未指定 group_name,则返回所有外部轴的实际位置。 + * + * 如果外部轴总线被禁用,则该函数会失败。 + * + * @param group_name (可选): (string) 要查询的轴组名称。该名称的轴组必须真实存在。 + * + * @return Double[]: 涉及轴的实际位置,顺序为其外部轴索引顺序。 + * \endchinese + * \english + * Returns the current actual positions of the axis group with group_name. + * If group_name is not provided, the actual positions of all external axes + * will be returned. + * + * This function will fail, if the external axis bus is disabled. + * + * @param group_name (optional): (string) Name of the axis group in query. + * Axis group with such name must exist. + * + * @return Double[]: Actual positions of the involved axes, in the order of + * their external axis indices. + * \endenglish + */ + std::vector axisGroupGetActualPositions( + const std::string &group_name); + + /** + * \chinese + * 通过给定的 offset,将轴组 group_name 的目标位置和实际位置整体偏移。 + * + * 这是一个仅在控制器内部进行的软件偏移,不会影响外部轴驱动器。该偏移也会应用于通过 RTDE 发布的任何目标和实际位置流。 + * + * @param group_name: (string) 要应用偏移的轴组名称。该名称的轴组必须存在。 + * + * @param offset: (float[]) 目标和实际位置需要整体偏移的量。offset 的大小必须与该轴组所包含的轴数量一致。 + * + * @return + * \endchinese + * \english + * Shifts the target and actual positions of the axis group group_name by + * the given offset. + * + * This is a software shift that happens in the controller only, it does not + * affect external axis drives. The shift is also applied to any streamed + * target and actual positions published on RTDE. + * + * @param group_name: (string) Name of the axis group to apply the offset + * positions to. Axis group with such name must exist. + * + * @param offset: (float[]) Offsets that the target and actual positions + * should be shifted by. The size of offset must match the number of axes + * attached to the given group. + * + * @return + * \endenglish + */ + int axisGroupOffsetPositions(const std::string &group_name, + const std::vector &offset); + + /** + * \chinese + * 以梯形速度曲线将名为 group_name 的轴组移动到新的位置 q。 + * 参数 a 指定本次运动的最大加速度占各轴加速度极限的百分比。 + * 参数 v 指定本次运动的最大速度占各轴速度极限的百分比。 + * + * 实际的加速度和速度由最受限制的轴决定,以确保所有轴在加速、匀速和减速阶段同时完成。 + * + * @param group_name: (string) 要移动的轴组名称。该名称的轴组必须存在。 + * @param q: (float[]) 目标位置,旋转轴为弧度,直线轴为米。如果目标超出位置极限,则会被限制在最近的极限值。涉及的轴按其索引递增排序。q 的大小必须与该轴组包含的轴数量一致。 + * @param a: (float) 本次运动的最大加速度因子,取值范围 (0,1],表示占加速度极限的百分比。 + * @param v: (float) 本次运动的最大速度因子,取值范围 (0,1],表示占速度极限的百分比。 + * + * 返回值: 无 + * \endchinese + * \english + * Moves the axes of axis group named group_name to new positions q, using a + * trapezoidal velocity profile. Factor a specifying the percentage of the + * max profile accelerations out of the acceleration limits of each axes. + * Factor v specifying the percentage of the max profile velocities out of + * the velocity limits of each axes. + * + * The actual accelerations and velocities are determined by the most + * constraining axis, so that all the axes complete the acceleration, + * cruise, and deceleration phases at the same time. + * + * @param group_name: (string) Name of the axis group to move. + * Axis group with such name must exist. + * + * @param q: (float[]) Target positions in rad (rotary) or in m (linear). If + * the target exceeds the position limits, then it is set to the nearest + * limit. The involved axes are ordered increasingly by their axis indices. + * The size of q must match the number of axes attached to the given group. + * + * @param a: (float) Factor specifying the max accelerations of this move + * out of the acceleration limits. a must be in range of (0,1]. + * + * @param v: (float) Factor specifying the max velocities of this move out + * of the velocity limits. v must be in range of (0,1]. + * + * Return: n/a + * \endenglish + */ + int axisGroupMoveJoint(const std::string &group_name, + const std::vector &q, double a, double v); + + /** + * \chinese + * 以指定的加速度因子 a,将名为 group_name 的轴组加速到目标速度 qd。该函数会运行 t 秒。 + * @param group_name: (string) 要控制的外部轴组名称,必须已存在。 + * @param qd: (float[]) 轴组各轴的目标速度。如果目标速度超过速度极限,则会被限制在极限值。涉及的轴按其索引递增排序。qd 的大小必须与该轴组包含的轴数量一致。 + * @param a: (float) 本次运动的最大加速度因子,取值范围 (0,1],表示占加速度极限的百分比。 + * @param t (可选): (float) 函数运行的持续时间(秒)。若 t < 0,则函数将在目标速度达到时返回;若 t ≥ 0,则函数将在该持续时间后返回,无论实际速度是否达到目标值。 + * \endchinese + * \english + * Accelerates the axes of axis group named group_name up to the target + * velocities qd. Factor a specifying the percentage of the max + * accelerations out of the acceleration limits of each axes. The function + * will run for a period of t seconds. + * + * @param group_name: (string) Name of the external axis group to control. + * Axis group with such name must exist. + * + * @param qd: (float[]) Target velocities for the axes in the axis group. If + * the target exceeds the velocity limits, then it is set to the limit. The + * involved axes are ordered increasingly by their axis indices. The size of + * qd must match the number of axes attached to the given group. + * + * @param a: (float) Factor specifying the max accelerations of this move + * out of the acceleration limits. a must be in range of (0,1]. + * + * @param t (optional): (float) Duration in seconds before the function + * returns. If t < 0, then the function will return when the target + * velocities are reached. if t ≥ 0, then the function will return after + * this duration, regardless of what the achieved axes velocities are. + * \endenglish + */ + int axisGroupSpeedJoint(const std::string &group_name, + const std::vector &qd, double a, double t); + +protected: + void *d_; +}; + +using SyncMovePtr = std::shared_ptr; +} // namespace common_interface +} // namespace arcs +#endif // AUBO_SDK_SYNC_MOVE_INTERFACE_H diff --git a/third_party/AuboSdk/win/include/aubo/system_info.h b/third_party/AuboSdk/win/include/aubo/system_info.h new file mode 100644 index 00000000..b6d836f7 --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo/system_info.h @@ -0,0 +1,342 @@ +/** @file system_info.h + * @brief 获取系统信息接口,如接口板的版本号、示教器软件的版本号 + */ +#ifndef AUBO_SDK_SYSTEM_INFO_INTERFACE_H +#define AUBO_SDK_SYSTEM_INFO_INTERFACE_H + +#include +#include +#include + +#include + +namespace arcs { +namespace common_interface { + +class ARCS_ABI_EXPORT SystemInfo +{ +public: + SystemInfo(); + virtual ~SystemInfo(); + + /** + * \chinese + * 获取控制器软件版本号 + * + * @return 返回控制器软件版本号 + * + * @par Python函数原型 + * getControlSoftwareVersionCode(self: pyaubo_sdk.SystemInfo) -> int + * + * @par Lua函数原型 + * getControlSoftwareVersionCode() -> number + * + * @par C++示例 + * @code + * int control_version = + * rpc_cli->getSystemInfo()->getControlSoftwareVersionCode(); + * @endcode + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"SystemInfo.getControlSoftwareVersionCode","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":28003} + * + * \endchinese + * \english + * Get the controller software version code + * + * @return Returns the controller software version code + * + * @par Python prototype + * getControlSoftwareVersionCode(self: pyaubo_sdk.SystemInfo) -> int + * + * @par Lua prototype + * getControlSoftwareVersionCode() -> number + * + * @par C++ example + * @code + * int control_version = + * rpc_cli->getSystemInfo()->getControlSoftwareVersionCode(); + * @endcode + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"SystemInfo.getControlSoftwareVersionCode","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":28003} + * + * \endenglish + */ + int getControlSoftwareVersionCode(); + + /** + * \chinese + * 获取完整控制器软件版本号 + * + * @return 返回完整控制器软件版本号 + * + * @par Python函数原型 + * getControlSoftwareFullVersion(self: pyaubo_sdk.SystemInfo) -> str + * + * @par Lua函数原型 + * getControlSoftwareFullVersion() -> string + * + * @par C++示例 + * @code + * std::string control_version = + * rpc_cli->getSystemInfo()->getControlSoftwareFullVersion(); + * @endcode + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"SystemInfo.getControlSoftwareFullVersion","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"0.31.0-alpha.16+20alc76"} + * + * \endchinese + * \english + * Get the full controller software version + * + * @return Returns the full controller software version + * + * @par Python prototype + * getControlSoftwareFullVersion(self: pyaubo_sdk.SystemInfo) -> str + * + * @par Lua prototype + * getControlSoftwareFullVersion() -> string + * + * @par C++ example + * @code + * std::string control_version = + * rpc_cli->getSystemInfo()->getControlSoftwareFullVersion(); + * @endcode + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"SystemInfo.getControlSoftwareFullVersion","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"0.31.0-alpha.16+20alc76"} + * + * \endenglish + */ + std::string getControlSoftwareFullVersion(); + + /** + * \chinese + * 获取接口版本号 + * + * @return 返回接口版本号 + * + * @par Python函数原型 + * getInterfaceVersionCode(self: pyaubo_sdk.SystemInfo) -> int + * + * @par Lua函数原型 + * getInterfaceVersionCode() -> number + * + * @par C++示例 + * @code + * int interface_version = + * rpc_cli->getSystemInfo()->getInterfaceVersionCode(); + * @endcode + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"SystemInfo.getInterfaceVersionCode","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":22003} + * + * \endchinese + * \english + * Get the interface version code + * + * @return Returns the interface version code + * + * @par Python prototype + * getInterfaceVersionCode(self: pyaubo_sdk.SystemInfo) -> int + * + * @par Lua prototype + * getInterfaceVersionCode() -> number + * + * @par C++ example + * @code + * int interface_version = + * rpc_cli->getSystemInfo()->getInterfaceVersionCode(); + * @endcode + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"SystemInfo.getInterfaceVersionCode","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":22003} + * + * \endenglish + */ + int getInterfaceVersionCode(); + + /** + * \chinese + * 获取控制器软件构建时间 + * + * @return 返回控制器软件构建时间 + * + * @par Python函数原型 + * getControlSoftwareBuildDate(self: pyaubo_sdk.SystemInfo) -> str + * + * @par Lua函数原型 + * getControlSoftwareBuildDate() -> string + * + * @par C++示例 + * @code + * std::string build_date = + * rpc_cli->getSystemInfo()->getControlSoftwareBuildDate(); + * @endcode + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"SystemInfo.getControlSoftwareBuildDate","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"2024-3-5 07:03:20"} + * + * \endchinese + * \english + * Get the controller software build date + * + * @return Returns the controller software build date + * + * @par Python prototype + * getControlSoftwareBuildDate(self: pyaubo_sdk.SystemInfo) -> str + * + * @par Lua prototype + * getControlSoftwareBuildDate() -> string + * + * @par C++ example + * @code + * std::string build_date = + * rpc_cli->getSystemInfo()->getControlSoftwareBuildDate(); + * @endcode + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"SystemInfo.getControlSoftwareBuildDate","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"2024-3-5 07:03:20"} + * + * \endenglish + */ + std::string getControlSoftwareBuildDate(); + + /** + * \chinese + * 获取控制器软件git版本 + * + * @return 返回控制器软件git版本 + * + * @par Python函数原型 + * getControlSoftwareVersionHash(self: pyaubo_sdk.SystemInfo) -> str + * + * @par Lua函数原型 + * getControlSoftwareVersionHash() -> string + * + * @par C++示例 + * @code + * std::string git_version = + * rpc_cli->getSystemInfo()->getControlSoftwareVersionHash(); + * @endcode + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"SystemInfo.getControlSoftwareVersionHash","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":"fa4f64a"} + * + * \endchinese + * \english + * Get the controller software git version + * + * @return Returns the controller software git version + * + * @par Python prototype + * getControlSoftwareVersionHash(self: pyaubo_sdk.SystemInfo) -> str + * + * @par Lua prototype + * getControlSoftwareVersionHash() -> string + * + * @par C++ example + * @code + * std::string git_version = + * rpc_cli->getSystemInfo()->getControlSoftwareVersionHash(); + * @endcode + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"SystemInfo.getControlSoftwareVersionHash","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":"fa4f64a"} + * + * \endenglish + */ + std::string getControlSoftwareVersionHash(); + + /** + * \chinese + * 获取系统时间(软件启动时间 ns 纳秒) + * + * @return 返回系统时间(软件启动时间 ns 纳秒) + * + * @par Python函数原型 + * getControlSystemTime(self: pyaubo_sdk.SystemInfo) -> int + * + * @par Lua函数原型 + * getControlSystemTime() -> number + * + * @par C++示例 + * @code + * std::string system_time = + * rpc_cli->getSystemInfo()->getControlSystemTime(); + * @endcode + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"SystemInfo.getControlSystemTime","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":9287799079682} + * + * \endchinese + * \english + * Get the system time (software start time in nanoseconds) + * + * @return Returns the system time (software start time in nanoseconds) + * + * @par Python prototype + * getControlSystemTime(self: pyaubo_sdk.SystemInfo) -> int + * + * @par Lua prototype + * getControlSystemTime() -> number + * + * @par C++ example + * @code + * std::string system_time = + * rpc_cli->getSystemInfo()->getControlSystemTime(); + * @endcode + * + * @par JSON-RPC request example + * {"jsonrpc":"2.0","method":"SystemInfo.getControlSystemTime","params":[],"id":1} + * + * @par JSON-RPC response example + * {"id":1,"jsonrpc":"2.0","result":9287799079682} + * + * \endenglish + */ + uint64_t getControlSystemTime(); + +protected: + void *d_; +}; + +using SystemInfoPtr = std::shared_ptr; + +} // namespace common_interface +} // namespace arcs +#endif diff --git a/third_party/AuboSdk/win/include/aubo/trace.h b/third_party/AuboSdk/win/include/aubo/trace.h new file mode 100644 index 00000000..ca6173bf --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo/trace.h @@ -0,0 +1,158 @@ +/** @file trace.h + * @brief 向控制器日志系统注入日志方面的接口 + */ +#ifndef AUBO_SDK_TRACE_INTERFACE_H +#define AUBO_SDK_TRACE_INTERFACE_H + +#include +#include +#include +#include + +#include +#include + +namespace arcs { +namespace common_interface { + +/** + * \~chinese 提供给控制器扩展程序的日志记录系统 \~english provides a logging system for controller extension programs + */ +class ARCS_ABI_EXPORT Trace +{ +public: + Trace(); + virtual ~Trace(); + + /** + * 向 aubo_control 日志注入告警信息 + * + * TraceLevel: \n + * 0 - FATAL \n + * 1 - ERROR \n + * 2 - WARNING \n + * 3 - INFO \n + * 4 - DEBUG \n + * + * code定义参考 error_stack + * + * @param level + * @param code + * @param args + * @return + * + * @par Python函数原型 + * alarm(self: pyaubo_sdk.Trace, arg0: arcs::common_interface::TraceLevel, + * arg1: int, arg2: List[str]) -> int + * + * @par Lua函数原型 + * alarm(level: number, code: number, args: table) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.Trace.alarm","params":["",1,["Error","Trajectory + * planning failed!","1"]],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + */ + int alarm(TraceLevel level, int code, + const std::vector &args = {}); + + /** + * 打印文本信息到日志中 + * + * @param msg 文本信息 + * @return + * + * @par Python函数原型 + * textmsg(self: pyaubo_sdk.Trace, arg0: str) -> int + * + * @par Lua函数原型 + * textmsg(msg: string) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.Trace.textmsg","params":["test"],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + */ + int textmsg(const std::string &msg); + + /** + * 通知上位机 + * + * @param msg + * @return + */ + int notify(const std::string &msg); + + /** + * 向连接的 RTDE 客户端发送弹窗请求 + * + * @param level + * @param title + * @param msg + * @param mode 模式 \n + * 0: 普通模式 \n + * 1: 阻塞模式 \n + * 2: 输入模式 bool \n + * 3: 输入模式 int \n + * 4: 输入模式 double \n + * 5: 输入模式 string \n + * @return + * + * @par Python函数原型 + * popup(self: pyaubo_sdk.Trace, arg0: arcs::common_interface::TraceLevel, + * arg1: str, arg2: str, arg3: int) -> int + * + * @par Lua函数原型 + * popup(level: number, title: string, msg: string, mode: number) -> nil + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.Trace.popup","params":["","Error","Trajectory + * planning failed!",1],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":0} + * + */ + int popup(TraceLevel level, const std::string &title, + const std::string &msg, int mode); + + /** + * peek最新的 AlarmInfo(上次一获取之后) + * + * last_time设置为0时,可以获取到所有的AlarmInfo + * + * @param num + * @param last_time + * @return + * + * @par Python函数原型 + * peek(self: pyaubo_sdk.Trace, arg0: int, arg1: int) -> + * List[arcs::common_interface::RobotMsg] + * + * @par Lua函数原型 + * peek(num: number, last_time: number) -> table + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"rob1.Trace.peek","params":[1,0],"id":1} + * + * @par JSON-RPC响应示例 + * {{"id":1,"jsonrpc":"2.0","result":[{"args":["RobotModeType.Running"], + * "code":30045,"level":"INFO","source":"rob1","timestamp":5102883064300}]} + * + */ + RobotMsgVector peek(size_t num, uint64_t last_time = 0); + +protected: + void *d_; +}; + +using TracePtr = std::shared_ptr; + +} // namespace common_interface +} // namespace arcs +#endif diff --git a/third_party/AuboSdk/win/include/aubo/type_def.h b/third_party/AuboSdk/win/include/aubo/type_def.h new file mode 100644 index 00000000..d5e5fa83 --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo/type_def.h @@ -0,0 +1,867 @@ +/** @file type_def.h + * @brief 数据类型的定义 + */ +#ifndef AUBO_SDK_TYPE_DEF_H +#define AUBO_SDK_TYPE_DEF_H + +#include +#include +#include +#include +#include +#include +#include + +#ifdef _MSC_VER +#pragma execution_character_set("utf-8") +#endif + +namespace arcs { +namespace common_interface { + +/// Cartesion degree of freedom, 6 for x,y,z,rx,ry,rz +#define CARTESIAN_DOF 6 +#define SAFETY_PARAM_SELECT_NUM 2 /// normal + reduced +#define SAFETY_PLANES_NUM 8 /// 安全平面的数量 +#define SAFETY_CUBIC_NUM 10 /// 安全立方体的数量 +#define TOOL_CONFIGURATION_NUM 3 /// 工具配置数量 + +using Vector3d = std::array; +using Vector4d = std::array; +using Vector3f = std::array; +using Vector4f = std::array; +using Vector6f = std::array; + +struct RobotSafetyParameterRange +{ + RobotSafetyParameterRange() + { + for (int i = 0; i < SAFETY_PARAM_SELECT_NUM; i++) { + params[i].power = 0.; + params[i].momentum = 0.; + params[i].stop_time = 0.; + params[i].stop_distance = 0.; + params[i].reduced_entry_time = 0.; + params[i].reduced_entry_distance = 0.; + params[i].tcp_speed = 0.; + params[i].elbow_speed = 0.; + params[i].tcp_force = 0.; + params[i].elbow_force = 0.; + std::fill(params[i].qmin.begin(), params[i].qmin.end(), 0.); + std::fill(params[i].qmax.begin(), params[i].qmax.end(), 0.); + std::fill(params[i].qdmax.begin(), params[i].qdmax.end(), 0.); + std::fill(params[i].joint_torque.begin(), + params[i].joint_torque.end(), 0.); + params[i].tool_orientation.fill(0.); + params[i].tool_deviation = 0.; + for (int j = 0; j < SAFETY_PLANES_NUM; j++) { + params[i].planes[j].fill(0.); + params[i].restrict_elbow[j] = 0; + } + } + for (int i = 0; i < SAFETY_PLANES_NUM; i++) { + trigger_planes[i].plane.fill(0.); + trigger_planes[i].restrict_elbow = 0; + } + for (int i = 0; i < SAFETY_CUBIC_NUM; i++) { + cubic[i].orig.fill(0.); + cubic[i].size.fill(0.); + cubic[i].restrict_elbow = 0; + } + for (int i = 0; i < TOOL_CONFIGURATION_NUM; i++) { + tools[i].fill(0.); + } + + tool_inclination = 0.; + tool_azimuth = 0.; + std::fill(safety_home.begin(), safety_home.end(), 0.); + + safety_input_emergency_stop = 0; + safety_input_safeguard_stop = 0; + safety_input_safeguard_reset = 0; + safety_input_auto_safeguard_stop = 0; + safety_input_auto_safeguard_reset = 0; + safety_input_three_position_switch = 0; + safety_input_operational_mode = 0; + safety_input_reduced_mode = 0; + safety_input_handguide = 0; + + safety_output_emergency_stop = 0; + safety_output_not_emergency_stop = 0; + safety_output_robot_moving = 0; + safety_output_robot_steady = 0; + safety_output_reduced_mode = 0; + safety_output_not_reduced_mode = 0; + safety_output_safe_home = 0; + safety_output_robot_not_stopping = 0; + safety_output_safetyguard_stop = 0; + + tp_3pe_for_handguide = 1; + allow_manual_high_speed = 0; + } + + uint32_t crc32{ 0 }; + + /// 最多可以保存2套参数, 默认使用第 0 套参数 + struct + { + float power; ///< sum of joint torques times joint angular speeds + float momentum; ///< 机器人动量限制 + float stop_time; ///< 停机时间 ms + float stop_distance; ///< 停机距离 m + float reduced_entry_time; ///< 进入缩减模式的最大时间 + float + reduced_entry_distance; ///< 进入缩减模式的最大距离(可由安全平面触发) + float tcp_speed; + float elbow_speed; + float tcp_force; + float elbow_force; + std::vector qmin; + std::vector qmax; + std::vector qdmax; + std::vector joint_torque; + Vector3f tool_orientation; ///< + float tool_deviation; + Vector4f planes[SAFETY_PLANES_NUM]; /// x,y,z,displacement + int restrict_elbow[SAFETY_PLANES_NUM]; + } params[SAFETY_PARAM_SELECT_NUM]; + + /// 8个触发平面 + struct + { + Vector4f plane; /// x,y,z,displacement + int restrict_elbow; + } trigger_planes[SAFETY_PLANES_NUM]; + + struct + { + Vector6f orig; ///< 立方块的原点 (x,y,z,rx,ry,rz) + Vector3f size; ///< 立方块的尺寸 (x,y,z) + int restrict_elbow; + } cubic[SAFETY_CUBIC_NUM]; ///< 10个安全空间 + + /// 3个工具 + Vector4f tools[TOOL_CONFIGURATION_NUM]; /// x,y,z,radius + + float tool_inclination{ 0. }; ///< 倾角 + float tool_azimuth{ 0. }; ///< 方位角 + std::vector safety_home; + + /// 可配置IO的输入输出安全功能配置 + uint32_t safety_input_emergency_stop; + uint32_t safety_input_safeguard_stop; + uint32_t safety_input_safeguard_reset; + uint32_t safety_input_auto_safeguard_stop; + uint32_t safety_input_auto_safeguard_reset; + uint32_t safety_input_three_position_switch; + uint32_t safety_input_operational_mode; + uint32_t safety_input_reduced_mode; + uint32_t safety_input_handguide; + + uint32_t safety_output_emergency_stop; + uint32_t safety_output_not_emergency_stop; + uint32_t safety_output_robot_moving; + uint32_t safety_output_robot_steady; + uint32_t safety_output_reduced_mode; + uint32_t safety_output_not_reduced_mode; + uint32_t safety_output_safe_home; + uint32_t safety_output_robot_not_stopping; + uint32_t safety_output_safetyguard_stop; + + int tp_3pe_for_handguide; ///< 是否将示教器三档位开关作为拖动功能开关 + int allow_manual_high_speed; ///< 手动模式下允许高速运行 +}; + +inline std::ostream &operator<<(std::ostream &os, + const RobotSafetyParameterRange &vd) +{ + // os << (int)vd; + return os; +} + +struct WObjectData +{ + /// 是否为外部工具 + bool remote_tool{ false }; + + /// 工件坐标系耦合的 + std::string attach_frame{ "" }; + + /// 用户坐标系 + /// 如果 robhold 为 false, 那 uframe 的数值是基于 world + /// 否则,uframe 的数值是基于 flange + std::vector user_coord{ std::vector(6, 0) }; + + /// 工件坐标系,基于 uframe + std::vector obj_coord{ std::vector(6, 0) }; +}; + +inline std::ostream &operator<<(std::ostream &os, WObjectData p) +{ + return os; +} + +/// 接口函数返回值定义 +/// +/// 整数为警告,负数为错误,0为没有错误也没有警告 +#define ENUM_AuboErrorCodes_DECLARES \ + ENUM_ITEM(AUBO_OK, 0, "Success") \ + ENUM_ITEM(AUBO_BAD_STATE, 1, "State error") \ + ENUM_ITEM(AUBO_QUEUE_FULL, 2, "Planning queue full") \ + ENUM_ITEM(AUBO_BUSY, 3, "The previous command is executing") \ + ENUM_ITEM(AUBO_TIMEOUT, 4, "Timeout") \ + ENUM_ITEM(AUBO_INVL_ARGUMENT, 5, "Invalid parameters") \ + ENUM_ITEM(AUBO_NOT_IMPLETEMENT, 6, "Interface not implemented") \ + ENUM_ITEM(AUBO_NO_ACCESS, 7, "Cannot access") \ + ENUM_ITEM(AUBO_CONN_REFUSED, 8, "Connection refused") \ + ENUM_ITEM(AUBO_CONN_RESET, 9, "Connection is reset") \ + ENUM_ITEM(AUBO_INPROGRESS, 10, "Execution in progress") \ + ENUM_ITEM(AUBO_EIO, 11, "Input/Output error") \ + ENUM_ITEM(AUBO_NOBUFFS, 12, "") \ + ENUM_ITEM(AUBO_REQUEST_IGNORE, 13, "Request was ignored") \ + ENUM_ITEM(AUBO_ALGORITHM_PLAN_FAILED, 14, \ + "Motion planning algorithm error") \ + ENUM_ITEM(AUBO_VERSION_INCOMPAT, 15, "Interface version unmatch") \ + ENUM_ITEM(AUBO_DIMENSION_ERR, 16, \ + "Input parameter dimension is incorrect") \ + ENUM_ITEM(AUBO_SINGULAR_ERR, 17, "Input configuration may be singular") \ + ENUM_ITEM(AUBO_POS_BOUND_ERR, 18, \ + "Input position boundary exceeds the limit range") \ + ENUM_ITEM(AUBO_INIT_POS_ERR, 19, "Initial position input is unreasonable") \ + ENUM_ITEM(AUBO_ELP_SETTING_ERR, 20, "Envelope body setting error") \ + ENUM_ITEM(AUBO_TRAJ_GEN_FAIL, 21, "Trajectory generation failed") \ + ENUM_ITEM(AUBO_TRAJ_SELF_COLLISION, 22, "Trajectory self collision") \ + ENUM_ITEM( \ + AUBO_IK_NO_CONVERGE, 23, \ + "Inverse kinematics computation did not converge; computation failed") \ + ENUM_ITEM(AUBO_IK_OUT_OF_RANGE, 24, \ + "Inverse kinematics result out of robot range") \ + ENUM_ITEM(AUBO_IK_CONFIG_DISMATCH, 25, \ + "Inverse kinematics input configuration contains errors") \ + ENUM_ITEM(AUBO_IK_JACOBIAN_FAILED, 26, \ + "The calculation of the inverse Jacobian matrix failed") \ + ENUM_ITEM(AUBO_IK_NO_SOLU, 27, \ + "The target point has solutions, but it has exceeded the joint " \ + "limit conditions") \ + ENUM_ITEM(AUBO_IK_UNKOWN_ERROR, 28, "Inverse kinematics unkown error") \ + ENUM_ITEM(AUBO_MOVE_IGNORED_SERVOMODE, 29, \ + "Robot is in servo mode where movement is disabled") \ + ENUM_ITEM(AUBO_INST_QUEUED, 100, "Instruction pused into queue succeed") \ + ENUM_ITEM(AUBO_INTERNAL_ERR, 101, "Internal error caused by alg .etc.") \ + ENUM_ITEM(AUBO_ERR_UNKOWN, 99999, "Unkown error occurred.") + +// clang-format off +/** + * The RuntimeState enum + * + */ +#define ENUM_RuntimeState_DECLARES \ + ENUM_ITEM(Running, 0, "正在运行中") \ + ENUM_ITEM(Retracting, 1, "倒退") \ + ENUM_ITEM(Pausing, 2, "暂停中") \ + ENUM_ITEM(Paused, 3, "暂停状态") \ + ENUM_ITEM(Stepping, 4, "单步执行中") \ + ENUM_ITEM(Stopping, 5, "受控停止中(保持原有轨迹)") \ + ENUM_ITEM(Stopped, 6, "已停止") \ + ENUM_ITEM(Aborting, 7, "停止(最大速度关节运动停机)") + +/** + * @brief The RobotModeType enum + * + * 硬件强相关 + */ +#define ENUM_RobotModeType_DECLARES \ + ENUM_ITEM(NoController, -1, "提供给示教器使用的, 如果aubo_control进程崩溃则会显示为NoController") \ + ENUM_ITEM(Disconnected, 0, "没有连接到机械臂本体(控制器与接口板断开连接或是 EtherCAT 等总线断开)") \ + ENUM_ITEM(ConfirmSafety, 1, "正在进行安全配置, 断电状态下进行") \ + ENUM_ITEM(Booting, 2, "机械臂本体正在上电初始化") \ + ENUM_ITEM(PowerOff, 3, "机械臂本体处于断电状态") \ + ENUM_ITEM(PowerOn, 4, "机械臂本体上电成功, 刹车暂未松开(抱死), 关节初始状态未获取") \ + ENUM_ITEM(Idle, 5, "机械臂上电成功, 刹车暂未松开(抱死), 电机不通电, 关节初始状态获取完成") \ + ENUM_ITEM(BrakeReleasing, 6, "机械臂上电成功, 刹车正在松开") \ + ENUM_ITEM(BackDrive, 7, "反向驱动:刹车松开, 电机不通电") \ + ENUM_ITEM(Running, 8, "机械臂刹车松开, 运行模式, 控制权由硬件移交给软件") \ + ENUM_ITEM(Maintaince, 9, "维护模式: 包括固件升级、参数写入等") \ + ENUM_ITEM(Error, 10, "") \ + ENUM_ITEM(PowerOffing, 11, "机械臂本体处于断电过程中") + +#define ENUM_SafetyModeType_DECLARES \ + ENUM_ITEM(Undefined, 0, "安全状态待定") \ + ENUM_ITEM(Normal, 1, "正常运行模式") \ + ENUM_ITEM(ReducedMode, 2, "缩减运行模式") \ + ENUM_ITEM(Recovery, 3, "启动时如果在安全限制之外, 机器人将进入recovery模式") \ + ENUM_ITEM(Violation, 4, "超出安全限制(根据安全配置, 例如速度超限等)") \ + ENUM_ITEM(ProtectiveStop, 5, "软件触发的停机(保持轨迹, 不抱闸, 不断电)") \ + ENUM_ITEM(SafeguardStop, 6, "IO触发的防护停机(不保持轨迹, 抱闸, 不断电)") \ + ENUM_ITEM(SystemEmergencyStop,7, "系统急停:急停信号由外部输入(可配置输入), 不对外输出急停信号") \ + ENUM_ITEM(RobotEmergencyStop, 8, "机器人急停:控制柜急停输入或者示教器急停按键触发, 对外输出急停信号") \ + ENUM_ITEM(Fault, 9, "机械臂硬件故障或者系统故障") + //ValidateJointId + +/** + * 根据ISO 10218-1:2011(E) 5.7节 + * Automatic: In automatic mode, the robot shall execute the task programme and + * the safeguarding measures shall be functioning. Automatic operation shall be + * prevented if any stop condition is detected. Switching from this mode shall + * result in a stop. + */ +#define ENUM_OperationalModeType_DECLARES \ + ENUM_ITEM(Disabled, 0, "禁用模式: 不使用Operational Mode") \ + ENUM_ITEM(Automatic, 1, "自动模式: 机器人正常工作模式, 运行速度不会被限制") \ + ENUM_ITEM(Manual, 2, "手动模式: 机器人编程示教模式(T1), 机器人运行速度将会被限制或者机器人程序校验模式(T2)") + +/** + * 机器人的控制模式, 最终的控制对象 + */ +#define ENUM_RobotControlModeType_DECLARES \ + ENUM_ITEM(Unknown, 0, "未知的控制模式") \ + ENUM_ITEM(Position, 1, "位置控制 movej") \ + ENUM_ITEM(Speed, 2, "速度控制 speedj/speedl") \ + ENUM_ITEM(Servo, 3, "位置控制 servoj") \ + ENUM_ITEM(Freedrive, 4, "拖动示教 freedrive_mode") \ + ENUM_ITEM(Force, 5, "末端力控 force_mode") \ + ENUM_ITEM(Torque, 6, "关节力矩控制") \ + ENUM_ITEM(Collision, 7, "碰撞模式") + +#define ENUM_JointServoModeType_DECLARES \ + ENUM_ITEM(Unknown, -1, "未知") \ + ENUM_ITEM(Open, 0, "开环模式") \ + ENUM_ITEM(Current, 1, "电流伺服模式") \ + ENUM_ITEM(Velocity, 2, "速度伺服模式") \ + ENUM_ITEM(Position, 3, "位置伺服模式") \ + ENUM_ITEM(Torque, 4, "力矩伺服模式") + +#define ENUM_JointStateType_DECLARES \ + ENUM_ITEM(Poweroff, 0, "节点未连接到接口板或者已经断电") \ + ENUM_ITEM(Idle, 2, "节点空闲") \ + ENUM_ITEM(Fault, 3, "节点错误, 节点停止伺服运动, 刹车抱死") \ + ENUM_ITEM(Running, 4, "节点伺服") \ + ENUM_ITEM(Bootload, 5, "节点bootloader状态, 暂停一切通讯") + +#define ENUM_StandardInputAction_DECLARES \ + ENUM_ITEM(Default, 0, "无触发") \ + ENUM_ITEM(Handguide, 1, "拖动示教,高电平触发") \ + ENUM_ITEM(GoHome, 2, "运动到工程初始位姿,高电平触发") \ + ENUM_ITEM(StartProgram, 3, "开始工程,上升沿触发") \ + ENUM_ITEM(StopProgram, 4, "停止工程,上升沿触发") \ + ENUM_ITEM(PauseProgram, 5, "暂停工程,上升沿触发") \ + ENUM_ITEM(PopupDismiss, 6, "消除弹窗,上升沿触发") \ + ENUM_ITEM(PowerOn, 7, "机器人上电/松刹车,上升沿触发") \ + ENUM_ITEM(PowerOff, 8, "机器人抱死刹车/断电,上升沿触发") \ + ENUM_ITEM(ResumeProgram, 9, "恢复工程,上升沿触发") \ + ENUM_ITEM(SlowDown1, 10, "机器人减速触发1,高电平触发") \ + ENUM_ITEM(SlowDown2, 11, "机器人减速触发2,高电平触发") \ + ENUM_ITEM(SafeStop, 12, "安全停止,高电平触发") \ + ENUM_ITEM(RunningGuard, 13, "信号,高电平有效") \ + ENUM_ITEM(MoveToFirstPoint, 14, "运动到工程初始位姿,高电平触发") \ + ENUM_ITEM(xSlowDown1, 15, "机器人减速触发1,低电平触发") \ + ENUM_ITEM(xSlowDown2, 16, "机器人减速触发2,低电平触发") \ + ENUM_ITEM(ConveyorTrack, 17, "传送带检测到物品触发,高电平触发") \ + ENUM_ITEM(xConveyorTrack, 18, "传送带检测到物品触发,低电平触发") \ + ENUM_ITEM(UnlockProtectiveStop, 19, "解除保护性停止,上升沿触发") + +#define ENUM_StandardOutputRunState_DECLARES \ + ENUM_ITEM(None, 0, "标准输出状态未定义") \ + ENUM_ITEM(StopLow, 1, "低电平指示工程停止") \ + ENUM_ITEM(StopHigh, 2, "高电平指示机器人停止") \ + ENUM_ITEM(RunningHigh, 3, "指示工程正在运行") \ + ENUM_ITEM(PausedHigh, 4, "指示工程已经暂停") \ + ENUM_ITEM(AtHome, 5, "高电平指示机器人正在拖动") \ + ENUM_ITEM(Handguiding, 6, "高电平指示机器人正在拖动") \ + ENUM_ITEM(PowerOn, 7, "高电平指示机器人已经上电") \ + ENUM_ITEM(RobotEmergencyStop, 8, "高电平指示机器人急停按下") \ + ENUM_ITEM(SystemEmergencyStop, 9, "高电平指示外部输入系统急停按下") \ + ENUM_ITEM(InternalEmergencyStop, 8, "高电平指示机器人急停按下") \ + ENUM_ITEM(ExternalEmergencyStop, 9, "高电平指示外部输入系统急停按下") \ + ENUM_ITEM(SystemError, 10, "系统错误,包括故障、超限、急停、安全停止、防护停止 ") \ + ENUM_ITEM(NotSystemError, 11, "无系统错误,包括普通模式、缩减模式和恢复模式 ") \ + ENUM_ITEM(RobotOperable, 12, "机器人可操作,机器人上电且松刹车了 ") \ + ENUM_ITEM(OperationalMode, 13, "高电平指示自动模式,低电平指示手动模式") + +#define ENUM_SafetyInputAction_DECLARES \ + ENUM_ITEM(Unassigned, 0, "安全输入未分配动作") \ + ENUM_ITEM(EmergencyStop, 1, "安全输入触发急停") \ + ENUM_ITEM(SafeguardStop, 2, "安全输入触发防护停止, 边沿触发") \ + ENUM_ITEM(SafeguardReset, 3, "安全输入触发防护重置, 边沿触发") \ + ENUM_ITEM(ThreePositionSwitch, 4, "3档位使能开关") \ + ENUM_ITEM(OperationalMode, 5, "切换自动模式和手动模式") \ + ENUM_ITEM(HandGuide, 6, "拖动示教") \ + ENUM_ITEM(ReducedMode, 7, "安全参数切换1(缩减模式),序号越低优先级越高,三路输出都无效时,选用第0组安全参数") \ + ENUM_ITEM(AutomaticModeSafeguardStop, 8, "自动模式下防护停机输入(需要配置三档位使能设备)") \ + ENUM_ITEM(AutomaticModeSafeguardReset, 9, "自动模式下上升沿触发防护重置(需要配置三档位使能设备)") + +#define ENUM_SafetyOutputRunState_DECLARES \ + ENUM_ITEM(Unassigned, 0, "安全输出未定义") \ + ENUM_ITEM(SystemEmergencyStop, 1, "输出高当有机器人急停输入或者急停按键被按下") \ + ENUM_ITEM(NotSystemEmergencyStop, 2, "输出低当有机器人急停输入或者急停按键被按下") \ + ENUM_ITEM(RobotMoving, 3, "输出高当有关节运动速度超过 0.1rad/s") \ + ENUM_ITEM(RobotNotMoving, 4, "输出高当所有的关节运动速度不超过 0.1rad/s") \ + ENUM_ITEM(ReducedMode, 5, "输出高当机器人处于缩减模式") \ + ENUM_ITEM(NotReducedMode, 6, "输出高当机器人不处于缩减模式") \ + ENUM_ITEM(SafeHome, 7, "输出高当机器人已经处于安全Home位姿") \ + ENUM_ITEM(RobotNotStopping, 8, "输出低当机器人正在急停或者安全停止中") + +#define ENUM_PayloadIdentifyMoveAxis_DECLARES \ + ENUM_ITEM(Joint_2_6, 0,"第2和6关节运动") \ + ENUM_ITEM(Joint_3_6, 1,"第3和6关节运动") \ + ENUM_ITEM(Joint_4_6, 2,"第4和6关节运动") \ + ENUM_ITEM(Joint_4_5_6, 3,"第4、5、6关节运动") \ + +#define ENUM_EnvelopingShape_DECLARES \ + ENUM_ITEM(Cube, 1,"立方体") \ + ENUM_ITEM(Column, 2,"柱状体") \ + ENUM_ITEM(Stl, 3,"以STL文件的形式描述负载碰撞集合体") + +#define ENUM_TaskFrameType_DECLARES \ + ENUM_ITEM(NONE, 0,"") \ + ENUM_ITEM(POINT_FORCE, 1, "力控坐标系发生变换, 使得力控参考坐标系的y轴沿着机器人TCP指向力控所选特征的原点, x和z轴取决于所选特征的原始方向" \ + "力控坐标系发生变换, 使得力控参考坐标系的y轴沿着机器人TCP指向力控所选特征的原点, x和z轴取决于所选特征的原始方向" \ + "机器人TCP与所选特征的起点之间的距离至少为10mm" \ + "优先选择X轴, 为所选特征的X轴在力控坐标系Y轴垂直平面上的投影, 如果所选特征的X轴与力控坐标系的Y轴平行, " \ + "通过类似方法确定力控坐标系Z轴, Y-X或者Y-Z轴确定之后, 通过右手法则确定剩下的轴") \ + ENUM_ITEM(FRAME_FORCE, 2,"力控坐标系不发生变换 SIMPLE_FORC") \ + ENUM_ITEM(MOTION_FORCE, 3,"力控坐标系发生变换, 使得力控参考坐标系的x轴为机器人TCP速度在所选特征x-y平面上的投影y轴将垂直于机械臂运动, 并在所选特征的x-y平面内")\ + ENUM_ITEM(TOOL_FORCE, 4,"以工具末端坐标系作为力控参考坐标系") + +#ifdef ERROR +#undef ERROR +#endif + +#define ENUM_TraceLevel_DECLARES \ + ENUM_ITEM(FATAL, 0, "") \ + ENUM_ITEM(ERROR, 1, "") \ + ENUM_ITEM(WARNING, 2, "") \ + ENUM_ITEM(INFO, 3, "") \ + ENUM_ITEM(DEBUG, 4, "") + +#define ENUM_AxisModeType_DECLARES \ + ENUM_ITEM(NoController, -1, "提供给示教器使用的, 如果aubo_control进程崩溃则会显示为NoController") \ + ENUM_ITEM(Disconnected, 0, "未连接") \ + ENUM_ITEM(PowerOff, 1, "断电") \ + ENUM_ITEM(BrakeReleasing, 2, "刹车松开中") \ + ENUM_ITEM(Idle, 3, "空闲") \ + ENUM_ITEM(Running, 4, "运行中") \ + ENUM_ITEM(Fault, 5, "错误状态") + +#define ENUM_SafeguedStopType_DECLARES \ + ENUM_ITEM(None, 0, "无安全停止") \ + ENUM_ITEM(SafeguedStopIOInput, 1, "安全停止(IO输入)") \ + ENUM_ITEM(SafeguedStop3PE, 2, "安全停止(三态开关)") \ + ENUM_ITEM(SafeguedStopOperational, 3, "安全停止(操作模式)") + +#define ENUM_RobotEmergencyStopType_DECLARES \ + ENUM_ITEM(RobotEmergencyStopNone, 0, "无紧急停止") \ + ENUM_ITEM(RobotEmergencyStopControlBox, 1, "紧急停止(控制柜急停)") \ + ENUM_ITEM(RobotEmergencyStopTeachPendant, 2, "紧急停止(示教器急停)") \ + ENUM_ITEM(RobotEmergencyStopHandle, 3, "紧急停止(手柄急停)") \ + ENUM_ITEM(RobotEmergencyStopEI, 4, "紧急停止(固定IO急停)") + +#define ENUM_ITEM(c, n, ...) c = n, +enum AuboErrorCodes : int +{ + ENUM_AuboErrorCodes_DECLARES +}; + +enum class RuntimeState : int +{ + ENUM_RuntimeState_DECLARES +}; + +enum class RobotModeType : int +{ + ENUM_RobotModeType_DECLARES +}; + +enum class AxisModeType : int +{ + ENUM_AxisModeType_DECLARES +}; + +/** + * 安全状态: + * + */ +enum class SafetyModeType : int +{ + ENUM_SafetyModeType_DECLARES +}; + +/** + * 操作模式 + */ +enum class OperationalModeType : int +{ + ENUM_OperationalModeType_DECLARES +}; + +/** + * 机器人控制模式 + */ +enum class RobotControlModeType : int +{ + ENUM_RobotControlModeType_DECLARES +}; + +/** + * 关节伺服模式 + */ +enum class JointServoModeType : int +{ + ENUM_JointServoModeType_DECLARES +}; + +/** + * 关节状态 + */ +enum class JointStateType : int +{ + ENUM_JointStateType_DECLARES +}; + +/** + * 标准输出运行状态 + */ +enum class StandardOutputRunState : int +{ + ENUM_StandardOutputRunState_DECLARES +}; + +/** + * @brief The StandardInputAction enum + */ +enum class StandardInputAction : int +{ + ENUM_StandardInputAction_DECLARES +}; + +enum class SafetyInputAction : int +{ + ENUM_SafetyInputAction_DECLARES +}; + +enum class SafetyOutputRunState : int +{ + ENUM_SafetyOutputRunState_DECLARES +}; + +enum TaskFrameType +{ + ENUM_TaskFrameType_DECLARES +}; + +enum EnvelopingShape : int +{ + ENUM_EnvelopingShape_DECLARES +}; + +enum PayloadIdentifyMoveAxis : int +{ + ENUM_PayloadIdentifyMoveAxis_DECLARES +}; + +enum TraceLevel +{ + ENUM_TraceLevel_DECLARES +}; + +enum SafeguedStopType : int +{ + ENUM_SafeguedStopType_DECLARES +}; + +enum RobotEmergencyStopType : int +{ + ENUM_RobotEmergencyStopType_DECLARES +}; +#undef ENUM_ITEM + +// clang-format on + +#define DECL_TO_STRING_FUNC(ENUM) \ + inline std::string toString(ENUM v) \ + { \ + using T = ENUM; \ + std::string name = #ENUM "."; \ + ENUM_##ENUM##_DECLARES \ + \ + return #ENUM ".Unkown"; \ + } \ + inline std::ostream &operator<<(std::ostream &os, ENUM v) \ + { \ + os << toString(v); \ + return os; \ + } + +#define ENUM_ITEM(c, n, ...) \ + if (v == T::c) { \ + return name + #c; \ + } + +DECL_TO_STRING_FUNC(RuntimeState) +DECL_TO_STRING_FUNC(RobotModeType) +DECL_TO_STRING_FUNC(AxisModeType) +DECL_TO_STRING_FUNC(SafetyModeType) +DECL_TO_STRING_FUNC(OperationalModeType) +DECL_TO_STRING_FUNC(RobotControlModeType) +DECL_TO_STRING_FUNC(JointServoModeType) +DECL_TO_STRING_FUNC(JointStateType) +DECL_TO_STRING_FUNC(StandardInputAction) +DECL_TO_STRING_FUNC(StandardOutputRunState) +DECL_TO_STRING_FUNC(SafetyInputAction) +DECL_TO_STRING_FUNC(SafetyOutputRunState) +DECL_TO_STRING_FUNC(TaskFrameType) +DECL_TO_STRING_FUNC(TraceLevel) + +#undef ENUM_ITEM + +enum class ForceControlState +{ + Stopped, + Starting, + Stropping, + Running +}; + +enum class RefFrameType +{ + None, /// + Tool, ///< 工具坐标系 + Path, ///< 轨迹坐标系 + Base ///< 基坐标系 +}; + +/// 圆周运动参数定义 +struct CircleParameters +{ + std::vector pose_via; ///< 圆周运动途中点的位姿 + std::vector pose_to; ///< 圆周运动结束点的位姿 + double a; ///< 加速度, 单位: m/s^2 + double v; ///< 速度,单位: m/s + double blend_radius; ///< 交融半径,单位: m + double duration; ///< 运行时间,单位: s + double helix; + double spiral; + double direction; + int loop_times; ///< 暂不支持 +}; + +inline std::ostream &operator<<(std::ostream &os, CircleParameters p) +{ + return os; +} + +struct SpiralParameters +{ + std::vector frame; ///< 参考点,螺旋线的中心点和参考坐标系 + int plane; ///< 参考平面选择 0-XY 1-YZ 2-ZX + double angle; ///< 转动的角度,如果为正数,机器人逆时针旋转 + double spiral; ///< 正数外扩 + double helix; ///< 正数上升 +}; + +inline std::ostream &operator<<(std::ostream &os, SpiralParameters p) +{ + return os; +} + +struct Enveloping +{ + EnvelopingShape shape; // 包络体形状 + std::vector + ep_args; // 包络体组合,shape为None或Stl时无需对ep_args赋值; + // shape为Cube时ep_args有9个元素,分别为xmin,xmax,ymin,ymax,zmin,zmax,rx,ry,rz; + // shape为Column时ep_args有5个元素,分别为radius,height,rx,ry,rz; + std::string stl_path; // stl的路径(绝对路径),stl文件需为二进制文件, + // shape设置为Stl时,此项生效 +}; + +inline std::ostream &operator<<(std::ostream &os, Enveloping p) +{ + return os; +} + +/// 用于负载辨识的轨迹配置 +struct TrajConfig +{ + std::vector envelopings; // 包络体组合 + PayloadIdentifyMoveAxis move_axis; // 运动的轴(ID), 下标从0开始 + std::vector init_joint; // 关节初始位置 + std::vector upper_joint_bound; // 运动轴上限 + std::vector lower_joint_bound; // 运动轴下限 + std::vector max_velocity; // 关节运动的最大速度,默认值为 3.0 + std::vector max_acceleration; // 关节运动的最大加速度,默认值为 5.0 +}; + +inline std::ostream &operator<<(std::ostream &os, TrajConfig p) +{ + return os; +} + +// result with error code +using ResultWithErrno = std::tuple, int>; +using ResultWithErrno1 = std::tuple>, int>; + +// mass, cog, aom, inertia +using Payload = std::tuple, std::vector, + std::vector>; + +// force_offset, com, mass, angle +using ForceSensorCalibResult = + std::tuple, std::vector, double, + std::vector>; + +// force_offset, com, mass, angle error +using ForceSensorCalibResultWithError = + std::tuple, std::vector, double, + std::vector, double>; + +// 动力学模型m,d,k +using DynamicsModel = + std::tuple, std::vector, std::vector>; + +// double xmin; +// double xmax; +// double ymin; +// double ymax; +// double zmin; +// double zmax; +using Box = std::vector; + +// double xcbottom; +// double ycbottom; +// double zcbottom; +// double height; +// double radius; +using Cylinder = std::vector; + +// double xc; +// double yc; +// double radius; +using Sphere = std::vector; + +struct RobotMsg +{ + uint64_t timestamp; ///< 时间戳,即系统时间 + TraceLevel level; ///< 日志等级 + int code; ///< 错误码 + std::string source; ///< 发送消息的机器人别名 alias + ///< 可在 /root/arcs_ws/config/aubo_control.conf + ///< 配置文件中查到机器人的alias + std::vector args; ///< 机器人参数 +}; +using RobotMsgVector = std::vector; + +/// RTDE菜单 +struct RtdeRecipe +{ + bool to_server; ///< 输入/输出 + int chanel; ///< 通道 + double frequency; ///< 更新频率 + int trigger; ///< 触发方式(该功能暂未实现): 0 - 周期; 1 - 变化 + std::vector segments; ///< 字段列表 +}; + +/// 异常类型 +enum error_type +{ + parse_error = -32700, ///< 解析错误 + invalid_request = -32600, ///< 无效请求 + method_not_found = -32601, ///< 方法未找到 + invalid_params = -32602, ///< 无效参数 + internal_error = -32603, ///< 内部错误 + server_error, ///< 服务器错误 + invalid ///< 无效 +}; + +/// 异常码 +enum ExceptionCode +{ + EC_DISCONNECTED = -1, ///< 断开连接 + EC_NOT_LOGINED = -2, ///< 未登录 + EC_INVAL_SOCKET = -3, ///< 无效套接字 + EC_REQUEST_BUSY = -4, ///< 请求繁忙 + EC_SEND_FAILED = -5, ///< 发送失败 + EC_RECV_TIMEOUT = -6, ///< 接收超时 + EC_RECV_ERROR = -7, ///< 接收错误 + EC_PARSE_ERROR = -8, ///< 解析错误 + EC_INVALID_REQUEST = -9, ///< 无效请求 + EC_METHOD_NOT_FOUND = -10, ///< 方法未找到 + EC_INVALID_PARAMS = -11, ///< 无效参数 + EC_INTERNAL_ERROR = -12, ///< 内部错误 + EC_SERVER_ERROR = -13, ///< 服务器错误 + EC_INVALID = -14 ///< 无效 +}; + +/// 自定义异常类 AuboException +class AuboException : public std::exception +{ +public: + AuboException(int code, const std::string &prefix, + const std::string &message) noexcept + : code_(code), message_(prefix + "-" + message) + { + } + + AuboException(int code, const std::string &message) noexcept + : code_(code), message_(message) + { + } + + error_type type() const + { + if (code_ >= -32603 && code_ <= -32600) { + return static_cast(code_); + } else if (code_ >= -32099 && code_ <= -32000) { + return server_error; + } else if (code_ == -32700) { + return parse_error; + } + return invalid; + } + + int code() const { return code_; } + const char *what() const noexcept override { return message_.c_str(); } + +private: + int code_; ///< 异常码 + std::string message_; ///< 异常消息 +}; + +inline const char *returnValue2Str(int retval) +{ + static const char *retval_str[] = { +#define ENUM_ITEM(n, v, s) s, + ENUM_AuboErrorCodes_DECLARES +#undef ENUM_ITEM + }; + + enum arcs_index + { +#define ENUM_ITEM(n, v, s) n##_INDEX, + ENUM_AuboErrorCodes_DECLARES +#undef ENUM_ITEM + }; + + int index = -1; + +#define ENUM_ITEM(n, v, s) \ + if (abs(retval) == v) \ + index = n##_INDEX; + ENUM_AuboErrorCodes_DECLARES +#undef ENUM_ITEM + + if (index == -1) + { + index = AUBO_ERR_UNKOWN_INDEX; + } + + return retval_str[(unsigned)index]; +} + +} // namespace common_interface +} // namespace arcs +#endif + +#if defined ENABLE_JSON_TYPES +#include "bindings/jsonrpc/json_types.h" +#endif diff --git a/third_party/AuboSdk/win/include/aubo_sdk/math_c.h b/third_party/AuboSdk/win/include/aubo_sdk/math_c.h new file mode 100644 index 00000000..8eca724a --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo_sdk/math_c.h @@ -0,0 +1,53 @@ +#ifndef AUBO_SDK_Math_C_H +#define AUBO_SDK_Math_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI int poseAdd(MATH_HANDLER h, const double *p1, const double *p2, + double *result); +ARCS_ABI int poseSub(MATH_HANDLER h, const double *p1, const double *p2, + double *result); +ARCS_ABI int interpolatePose(MATH_HANDLER h, const double *p1, const double *p2, + double alpha, double *result); +ARCS_ABI int poseTrans(MATH_HANDLER h, const double *pose_from, + const double *pose_from_to, double *result); +ARCS_ABI int poseTransInv(MATH_HANDLER h, const double *pose_from, + const double *pose_to_from, double *result); +ARCS_ABI int poseInverse(MATH_HANDLER h, const double *pose, double *result); +ARCS_ABI double poseDistance(MATH_HANDLER h, const double *p1, + const double *p2); +ARCS_ABI double poseAngleDistance(MATH_HANDLER h, const double *p1, + const double *p2); +ARCS_ABI BOOL poseEqual(MATH_HANDLER h, const double *p1, const double *p2, + double eps); +ARCS_ABI int transferRefFrame(MATH_HANDLER h, const double *F_b_a_old, + Vector3d_C V_in_a, int type, double *result); +ARCS_ABI int poseRotation(MATH_HANDLER h, const double *pose, + const double *rotv, double *result); +ARCS_ABI int rpyToQuaternion(MATH_HANDLER h, const double *rpy, double *result); +ARCS_ABI int quaternionToRpy(MATH_HANDLER h, const double *quant, + double *result); +ARCS_ABI int tcpOffsetIdentify(MATH_HANDLER h, const double *poses, int rows, + double *result); +ARCS_ABI int calibrateCoordinate(MATH_HANDLER h, const double *poses, int rows, + int type, double *result); +ARCS_ABI int calculateCircleFourthPoint(MATH_HANDLER h, const double *p1, + const double *p2, const double *p3, + int mode, double *result); +ARCS_ABI int forceTrans(MATH_HANDLER h, const double *pose_a_in_b, + const double *force_in_a, double *result); +ARCS_ABI int getDeltaPoseBySensorDistance(MATH_HANDLER h, + const double *distances, + double position, double radius, + double track_scale, double *result); +ARCS_ABI int deltaPoseTrans(MATH_HANDLER h, const double *pose_a_in_b, + const double *ft_in_a, double *result); +ARCS_ABI int deltaPoseAdd(MATH_HANDLER h, const double *pose_a_in_b, + const double *v_in_b, double *result); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/win/include/aubo_sdk/register_control_c.h b/third_party/AuboSdk/win/include/aubo_sdk/register_control_c.h new file mode 100644 index 00000000..c3e38858 --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo_sdk/register_control_c.h @@ -0,0 +1,120 @@ +#ifndef AUBO_SDK_RegisterControl_C_H +#define AUBO_SDK_RegisterControl_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI BOOL getBoolInput(REGISTER_CONTROL_HANDLER h, uint32_t address); +ARCS_ABI int setBoolInput(REGISTER_CONTROL_HANDLER h, uint32_t address, + BOOL value); +ARCS_ABI int getInt32Input(REGISTER_CONTROL_HANDLER h, uint32_t address); +ARCS_ABI int setInt32Input(REGISTER_CONTROL_HANDLER h, uint32_t address, + int value); +ARCS_ABI float getFloatInput(REGISTER_CONTROL_HANDLER h, uint32_t address); +ARCS_ABI int setFloatInput(REGISTER_CONTROL_HANDLER h, uint32_t address, + float value); +ARCS_ABI double getDoubleInput(REGISTER_CONTROL_HANDLER h, uint32_t address); +ARCS_ABI int setDoubleInput(REGISTER_CONTROL_HANDLER h, uint32_t address, + double value); +ARCS_ABI BOOL getBoolOutput(REGISTER_CONTROL_HANDLER h, uint32_t address); +ARCS_ABI int setBoolOutput(REGISTER_CONTROL_HANDLER h, uint32_t address, + BOOL value); +ARCS_ABI int getInt32Output(REGISTER_CONTROL_HANDLER h, uint32_t address); +ARCS_ABI int setInt32Output(REGISTER_CONTROL_HANDLER h, uint32_t address, + int value); +ARCS_ABI float getFloatOutput(REGISTER_CONTROL_HANDLER h, uint32_t address); +ARCS_ABI int setFloatOutput(REGISTER_CONTROL_HANDLER h, uint32_t address, + float value); +ARCS_ABI double getDoubleOutput(REGISTER_CONTROL_HANDLER h, uint32_t address); +ARCS_ABI int setDoubleOutput(REGISTER_CONTROL_HANDLER h, uint32_t address, + double value); +ARCS_ABI int16_t getInt16Register(REGISTER_CONTROL_HANDLER h, uint32_t address); +ARCS_ABI int setInt16Register(REGISTER_CONTROL_HANDLER h, uint32_t address, + int16_t value); +ARCS_ABI BOOL variableUpdated(REGISTER_CONTROL_HANDLER h, const char *key, + uint64_t since); +ARCS_ABI BOOL hasNamedVariable(REGISTER_CONTROL_HANDLER h, const char *key); +ARCS_ABI int getNamedVariableType(REGISTER_CONTROL_HANDLER h, const char *key, + char *result); +ARCS_ABI BOOL getBool(REGISTER_CONTROL_HANDLER h, const char *key, + BOOL default_value); +ARCS_ABI int setBool(REGISTER_CONTROL_HANDLER h, const char *key, BOOL value); +ARCS_ABI int getVecChar(REGISTER_CONTROL_HANDLER h, const char *key, + const char *default_value, char *result, int sz); +ARCS_ABI int setVecChar(REGISTER_CONTROL_HANDLER h, const char *key, + const char *value, int sz); +ARCS_ABI int getInt32(REGISTER_CONTROL_HANDLER h, const char *key, + int default_value); +ARCS_ABI int setInt32(REGISTER_CONTROL_HANDLER h, const char *key, int value); +ARCS_ABI int getVecInt32(REGISTER_CONTROL_HANDLER h, const char *key, + int32_t *default_value, int *result); +ARCS_ABI int setVecInt32(REGISTER_CONTROL_HANDLER h, const char *key, + int32_t *value); +ARCS_ABI float getFloat(REGISTER_CONTROL_HANDLER h, const char *key, + float default_value); +ARCS_ABI int setFloat(REGISTER_CONTROL_HANDLER h, const char *key, float value); +ARCS_ABI int getVecFloat(REGISTER_CONTROL_HANDLER h, const char *key, + const float *default_value, float *result); +ARCS_ABI int setVecFloat(REGISTER_CONTROL_HANDLER h, const char *key, + const float *value); +ARCS_ABI double getDouble(REGISTER_CONTROL_HANDLER h, const char *key, + double default_value); +ARCS_ABI int setDouble(REGISTER_CONTROL_HANDLER h, const char *key, + double value); +ARCS_ABI int getVecDouble(REGISTER_CONTROL_HANDLER h, const char *key, + const double *default_value, double *result); +ARCS_ABI int setVecDouble(REGISTER_CONTROL_HANDLER h, const char *key, + const double *value); +ARCS_ABI int getString(REGISTER_CONTROL_HANDLER h, const char *key, + const char *default_value, char *result); +ARCS_ABI int setString(REGISTER_CONTROL_HANDLER h, const char *key, + const char *value); +ARCS_ABI int clearNamedVariable(REGISTER_CONTROL_HANDLER h, const char *key); +ARCS_ABI int setWatchDog(REGISTER_CONTROL_HANDLER h, const char *key, + double timeout, int action); +ARCS_ABI int getWatchDogAction(REGISTER_CONTROL_HANDLER h, const char *key); +ARCS_ABI int getWatchDogTimeout(REGISTER_CONTROL_HANDLER h, const char *key); +ARCS_ABI int modbusAddSignal(REGISTER_CONTROL_HANDLER h, + const char *device_info, int slave_number, + int signal_address, int signal_type, + const char *signal_name, BOOL sequential_mode); +ARCS_ABI int modbusDeleteSignal(REGISTER_CONTROL_HANDLER h, + const char *signal_name); +ARCS_ABI int modbusDeleteAllSignals(REGISTER_CONTROL_HANDLER h); +ARCS_ABI int modbusGetSignalStatus(REGISTER_CONTROL_HANDLER h, + const char *signal_name); +ARCS_ABI int modbusGetSignalNames(REGISTER_CONTROL_HANDLER h, char **result); +ARCS_ABI int modbusGetSignalTypes(REGISTER_CONTROL_HANDLER h, int *result); +ARCS_ABI int modbusGetSignalValues(REGISTER_CONTROL_HANDLER h, int *result); +ARCS_ABI int modbusGetSignalErrors(REGISTER_CONTROL_HANDLER h, int *result); +ARCS_ABI int modbusSendCustomCommand(REGISTER_CONTROL_HANDLER h, const char *IP, + int slave_number, int function_code, + uint8_t *data, int sz); +ARCS_ABI int modbusSetDigitalInputAction(REGISTER_CONTROL_HANDLER h, + const char *robot_name, + const char *signal_name, + StandardInputAction_C action); +ARCS_ABI int modbusSetOutputRunstate(REGISTER_CONTROL_HANDLER h, + const char *robot_name, + const char *signal_name, + StandardOutputRunState_C runstate); +ARCS_ABI int modbusSetOutputSignal(REGISTER_CONTROL_HANDLER h, + const char *signal_name, uint16_t value); +ARCS_ABI int modbusSetOutputSignalPulse(REGISTER_CONTROL_HANDLER h, + const char *signal_name, uint16_t value, + double duration); +ARCS_ABI int modbusSetSignalUpdateFrequency(REGISTER_CONTROL_HANDLER h, + const char *signal_name, + int update_frequency); +ARCS_ABI int modbusGetSignalIndex(REGISTER_CONTROL_HANDLER h, + const char *signal_name); +ARCS_ABI int modbusGetSignalError(REGISTER_CONTROL_HANDLER h, + const char *signal_name); +ARCS_ABI int getModbusDeviceStatus(REGISTER_CONTROL_HANDLER h, + const char *device_name); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/win/include/aubo_sdk/robot/force_control_c.h b/third_party/AuboSdk/win/include/aubo_sdk/robot/force_control_c.h new file mode 100644 index 00000000..55ccc592 --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo_sdk/robot/force_control_c.h @@ -0,0 +1,78 @@ +#ifndef AUBO_SDK_ForceControl_C_H +#define AUBO_SDK_ForceControl_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI int fcEnable(FORCE_CONTROL_HANDLER h); +ARCS_ABI int fcDisable(FORCE_CONTROL_HANDLER h); +ARCS_ABI BOOL isFcEnabled(FORCE_CONTROL_HANDLER h); +ARCS_ABI int setTargetForce(FORCE_CONTROL_HANDLER h, const double *feature, + const uint8_t *compliance, const double *wrench, + const double *limits, TaskFrameType_C type); +ARCS_ABI int setDynamicModel(FORCE_CONTROL_HANDLER h, const double *m, + const double *d, const double *k); +ARCS_ABI DynamicsModel_C getDynamicModel(FORCE_CONTROL_HANDLER h); +ARCS_ABI int setDynamicModelContact(FORCE_CONTROL_HANDLER h, + const double *env_stiff, + const double *damp_scale, + const double *stiff_scale); +ARCS_ABI int setCondForce(FORCE_CONTROL_HANDLER h, const double *min, + const double *max, BOOL outside, double timeout); +ARCS_ABI int setCondOrient(FORCE_CONTROL_HANDLER h, const double *frame, + double max_angle, double max_rot, BOOL outside, + double timeout); +ARCS_ABI int setCondPlane(FORCE_CONTROL_HANDLER h, const double *plane, + double timeout); +ARCS_ABI int setCondCylinder(FORCE_CONTROL_HANDLER h, const double *axis, + double radius, BOOL outside, double timeout); +ARCS_ABI int setCondSphere(FORCE_CONTROL_HANDLER h, const double *center, + double radius, BOOL outside, double timeout); +ARCS_ABI int setCondTcpSpeed(FORCE_CONTROL_HANDLER h, const double *min, + const double *max, BOOL outside, double timeout); +ARCS_ABI int setCondActive(FORCE_CONTROL_HANDLER h); +ARCS_ABI int setCondDistance(FORCE_CONTROL_HANDLER h, double distance, + double timeout); +ARCS_ABI int setCondAdvanced(FORCE_CONTROL_HANDLER h, const char *type, + const double *args, double timeout); +ARCS_ABI BOOL isCondFullfiled(FORCE_CONTROL_HANDLER h); +ARCS_ABI int setSupvForce(FORCE_CONTROL_HANDLER h, const double *min, + const double *max); +ARCS_ABI int setSupvOrient(FORCE_CONTROL_HANDLER h, const double *frame, + double max_angle, double max_rot, BOOL outside); +ARCS_ABI int setSupvPosBox(FORCE_CONTROL_HANDLER h, const double *frame, + const double *box); +ARCS_ABI int setSupvPosCylinder(FORCE_CONTROL_HANDLER h, const double *frame, + const double *cylinder); +ARCS_ABI int setSupvPosSphere(FORCE_CONTROL_HANDLER h, const double *frame, + const double *sphere); +ARCS_ABI int setSupvReoriSpeed(FORCE_CONTROL_HANDLER h, + const double *speed_limit, BOOL outside, + double timeout); +ARCS_ABI int setSupvTcpSpeed(FORCE_CONTROL_HANDLER h, const double *speed_limit, + BOOL outside, double timeout); +ARCS_ABI int setLpFilter(FORCE_CONTROL_HANDLER h, const double *cutoff_freq); +ARCS_ABI int resetLpFilter(FORCE_CONTROL_HANDLER h); +ARCS_ABI int speedChangeTune(FORCE_CONTROL_HANDLER h, int speed_levels, + double speed_ratio_min); +ARCS_ABI int speedChangeEnable(FORCE_CONTROL_HANDLER h, double ref_force); +ARCS_ABI int speedChangeDisable(FORCE_CONTROL_HANDLER h); +ARCS_ABI int setDamping(FORCE_CONTROL_HANDLER h, const double *damping, + double ramp_time); +ARCS_ABI int resetDamping(FORCE_CONTROL_HANDLER h); +ARCS_ABI int softFloatEnable(FORCE_CONTROL_HANDLER h); +ARCS_ABI int softFloatDisable(FORCE_CONTROL_HANDLER h); +ARCS_ABI BOOL isSoftFloatEnabled(FORCE_CONTROL_HANDLER h); +ARCS_ABI int setSoftFloatParams(FORCE_CONTROL_HANDLER h, BOOL joint_space, + const uint8_t *select, + const double *stiff_percent, + const double *stiff_damp_ratio, + const double *force_threshold, + const double *force_limit); +ARCS_ABI int toolContact(FORCE_CONTROL_HANDLER h, const uint8_t *direction); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/win/include/aubo_sdk/robot/io_control_c.h b/third_party/AuboSdk/win/include/aubo_sdk/robot/io_control_c.h new file mode 100644 index 00000000..45565338 --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo_sdk/robot/io_control_c.h @@ -0,0 +1,113 @@ +#ifndef AUBO_SDK_IoControl_C_H +#define AUBO_SDK_IoControl_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI int getStandardDigitalInputNum(IO_CONTROL_HANDLER h); +ARCS_ABI int getToolDigitalInputNum(IO_CONTROL_HANDLER h); +ARCS_ABI int getConfigurableDigitalInputNum(IO_CONTROL_HANDLER h); +ARCS_ABI int getStandardDigitalOutputNum(IO_CONTROL_HANDLER h); +ARCS_ABI int getToolDigitalOutputNum(IO_CONTROL_HANDLER h); +ARCS_ABI int setToolIoInput(IO_CONTROL_HANDLER h, int index, BOOL input); +ARCS_ABI BOOL isToolIoInput(IO_CONTROL_HANDLER h, int index); +ARCS_ABI int getConfigurableDigitalOutputNum(IO_CONTROL_HANDLER h); +ARCS_ABI int getStandardAnalogInputNum(IO_CONTROL_HANDLER h); +ARCS_ABI int getToolAnalogInputNum(IO_CONTROL_HANDLER h); +ARCS_ABI int getStandardAnalogOutputNum(IO_CONTROL_HANDLER h); +ARCS_ABI int getToolAnalogOutputNum(IO_CONTROL_HANDLER h); +ARCS_ABI int setDigitalInputActionDefault(IO_CONTROL_HANDLER h); +ARCS_ABI int setStandardDigitalInputAction(IO_CONTROL_HANDLER h, int index, + StandardInputAction_C action); +ARCS_ABI int setToolDigitalInputAction(IO_CONTROL_HANDLER h, int index, + StandardInputAction_C action); +ARCS_ABI int setConfigurableDigitalInputAction(IO_CONTROL_HANDLER h, int index, + StandardInputAction_C action); +ARCS_ABI StandardInputAction_C +getStandardDigitalInputAction(IO_CONTROL_HANDLER h, int index); +ARCS_ABI StandardInputAction_C getToolDigitalInputAction(IO_CONTROL_HANDLER h, + int index); +ARCS_ABI StandardInputAction_C +getConfigurableDigitalInputAction(IO_CONTROL_HANDLER h, int index); +ARCS_ABI int setDigitalOutputRunstateDefault(IO_CONTROL_HANDLER h); +ARCS_ABI int setStandardDigitalOutputRunstate( + IO_CONTROL_HANDLER h, int index, StandardOutputRunState_C runstate); +ARCS_ABI int setToolDigitalOutputRunstate(IO_CONTROL_HANDLER h, int index, + StandardOutputRunState_C runstate); +ARCS_ABI int setConfigurableDigitalOutputRunstate( + IO_CONTROL_HANDLER h, int index, StandardOutputRunState_C runstate); +ARCS_ABI StandardOutputRunState_C +getStandardDigitalOutputRunstate(IO_CONTROL_HANDLER h, int index); +ARCS_ABI StandardOutputRunState_C +getToolDigitalOutputRunstate(IO_CONTROL_HANDLER h, int index); +ARCS_ABI StandardOutputRunState_C +getConfigurableDigitalOutputRunstate(IO_CONTROL_HANDLER h, int index); +ARCS_ABI int setStandardAnalogOutputRunstate(IO_CONTROL_HANDLER h, int index, + StandardOutputRunState_C runstate); +ARCS_ABI int setToolAnalogOutputRunstate(IO_CONTROL_HANDLER h, int index, + StandardOutputRunState_C runstate); +ARCS_ABI StandardOutputRunState_C +getStandardAnalogOutputRunstate(IO_CONTROL_HANDLER h, int index); +ARCS_ABI StandardOutputRunState_C +getToolAnalogOutputRunstate(IO_CONTROL_HANDLER h, int index); +ARCS_ABI int setStandardAnalogInputDomain(IO_CONTROL_HANDLER h, int index, + int domain); +ARCS_ABI int setToolAnalogInputDomain(IO_CONTROL_HANDLER h, int index, + int domain); +ARCS_ABI int getStandardAnalogInputDomain(IO_CONTROL_HANDLER h, int index); +ARCS_ABI int getToolAnalogInputDomain(IO_CONTROL_HANDLER h, int index); +ARCS_ABI int setStandardAnalogOutputDomain(IO_CONTROL_HANDLER h, int index, + int domain); +ARCS_ABI int setToolAnalogOutputDomain(IO_CONTROL_HANDLER h, int index, + int domain); +ARCS_ABI int setToolVoltageOutputDomain(IO_CONTROL_HANDLER h, int domain); +ARCS_ABI int getToolVoltageOutputDomain(IO_CONTROL_HANDLER h); +ARCS_ABI int getStandardAnalogOutputDomain(IO_CONTROL_HANDLER h, int index); +ARCS_ABI int getToolAnalogOutputDomain(IO_CONTROL_HANDLER h, int index); +ARCS_ABI int setStandardDigitalOutput(IO_CONTROL_HANDLER h, int index, + BOOL value); +ARCS_ABI int setStandardDigitalOutputPulse(IO_CONTROL_HANDLER h, int index, + BOOL value, double duration); +ARCS_ABI int setToolDigitalOutput(IO_CONTROL_HANDLER h, int index, BOOL value); +ARCS_ABI int setToolDigitalOutputPulse(IO_CONTROL_HANDLER h, int index, + BOOL value, double duration); +ARCS_ABI int setConfigurableDigitalOutput(IO_CONTROL_HANDLER h, int index, + BOOL value); +ARCS_ABI int setConfigurableDigitalOutputPulse(IO_CONTROL_HANDLER h, int index, + BOOL value, double duration); +ARCS_ABI int setStandardAnalogOutput(IO_CONTROL_HANDLER h, int index, + double value); +ARCS_ABI int setToolAnalogOutput(IO_CONTROL_HANDLER h, int index, double value); +ARCS_ABI BOOL getStandardDigitalInput(IO_CONTROL_HANDLER h, int index); +ARCS_ABI uint32_t getStandardDigitalInputs(IO_CONTROL_HANDLER h); +ARCS_ABI BOOL getToolDigitalInput(IO_CONTROL_HANDLER h, int index); +ARCS_ABI uint32_t getToolDigitalInputs(IO_CONTROL_HANDLER h); +ARCS_ABI BOOL getConfigurableDigitalInput(IO_CONTROL_HANDLER h, int index); +ARCS_ABI uint32_t getConfigurableDigitalInputs(IO_CONTROL_HANDLER h); +ARCS_ABI double getStandardAnalogInput(IO_CONTROL_HANDLER h, int index); +ARCS_ABI double getToolAnalogInput(IO_CONTROL_HANDLER h, int index); +ARCS_ABI BOOL getStandardDigitalOutput(IO_CONTROL_HANDLER h, int index); +ARCS_ABI uint32_t getStandardDigitalOutputs(IO_CONTROL_HANDLER h); +ARCS_ABI BOOL getToolDigitalOutput(IO_CONTROL_HANDLER h, int index); +ARCS_ABI uint32_t getToolDigitalOutputs(IO_CONTROL_HANDLER h); +ARCS_ABI BOOL getConfigurableDigitalOutput(IO_CONTROL_HANDLER h, int index); +ARCS_ABI uint32_t getConfigurableDigitalOutputs(IO_CONTROL_HANDLER h); +ARCS_ABI double getStandardAnalogOutput(IO_CONTROL_HANDLER h, int index); +ARCS_ABI double getToolAnalogOutput(IO_CONTROL_HANDLER h, int index); +ARCS_ABI int getStaticLinkInputNum(IO_CONTROL_HANDLER h); +ARCS_ABI int getStaticLinkOutputNum(IO_CONTROL_HANDLER h); +ARCS_ABI uint32_t getStaticLinkInputs(IO_CONTROL_HANDLER h); +ARCS_ABI uint32_t getStaticLinkOutputs(IO_CONTROL_HANDLER h); +ARCS_ABI BOOL hasEncoderSensor(IO_CONTROL_HANDLER h); +ARCS_ABI int setEncDecoderType(IO_CONTROL_HANDLER h, int type, int range_id); +ARCS_ABI int setEncTickCount(IO_CONTROL_HANDLER h, int tick); +ARCS_ABI int getEncDecoderType(IO_CONTROL_HANDLER h); +ARCS_ABI int getEncTickCount(IO_CONTROL_HANDLER h); +ARCS_ABI int unwindEncDeltaTickCount(IO_CONTROL_HANDLER h, int delta_count); +ARCS_ABI BOOL getToolButtonStatus(IO_CONTROL_HANDLER h); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/win/include/aubo_sdk/robot/motion_control_c.h b/third_party/AuboSdk/win/include/aubo_sdk/robot/motion_control_c.h new file mode 100644 index 00000000..dd2b4f7f --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo_sdk/robot/motion_control_c.h @@ -0,0 +1,154 @@ +#ifndef AUBO_SDK_MotionControl_C_H +#define AUBO_SDK_MotionControl_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI double getEqradius(MOTION_CONTROL_HANDLER h); +ARCS_ABI int setEqradius(MOTION_CONTROL_HANDLER h, double eqradius); +ARCS_ABI double getSpeedFraction(MOTION_CONTROL_HANDLER h); +ARCS_ABI int setSpeedFraction(MOTION_CONTROL_HANDLER h, double fraction); +ARCS_ABI int speedFractionCritical(MOTION_CONTROL_HANDLER h, BOOL enable); +ARCS_ABI BOOL isSpeedFractionCritical(MOTION_CONTROL_HANDLER h); +ARCS_ABI BOOL isBlending(MOTION_CONTROL_HANDLER h); +ARCS_ABI int pathOffsetEnable(MOTION_CONTROL_HANDLER h); +ARCS_ABI int pathOffsetSet(MOTION_CONTROL_HANDLER h, const double *offset, + int type); +ARCS_ABI int pathOffsetDisable(MOTION_CONTROL_HANDLER h); +ARCS_ABI int jointOffsetEnable(MOTION_CONTROL_HANDLER h); +ARCS_ABI int jointOffsetSet(MOTION_CONTROL_HANDLER h, const double *offset, + int type); +ARCS_ABI int jointOffsetDisable(MOTION_CONTROL_HANDLER h); +ARCS_ABI int getTrajectoryQueueSize(MOTION_CONTROL_HANDLER h); +ARCS_ABI int getQueueSize(MOTION_CONTROL_HANDLER h); +ARCS_ABI int getExecId(MOTION_CONTROL_HANDLER h); +ARCS_ABI double getDuration(MOTION_CONTROL_HANDLER h, int id); +ARCS_ABI double getMotionLeftTime(MOTION_CONTROL_HANDLER h, int id); +ARCS_ABI double getProgress(MOTION_CONTROL_HANDLER h); +ARCS_ABI int setWorkObjectHold(MOTION_CONTROL_HANDLER h, + const char *module_name, + const double *mounting_pose); +ARCS_ABI char *getWorkObjectHold(MOTION_CONTROL_HANDLER h); +ARCS_ABI int getPauseJointPositions(MOTION_CONTROL_HANDLER h, double *result); +ARCS_ABI int setServoMode(MOTION_CONTROL_HANDLER h, BOOL enable); +ARCS_ABI BOOL isServoModeEnabled(MOTION_CONTROL_HANDLER h); +ARCS_ABI int setServoModeSelect(MOTION_CONTROL_HANDLER h, int mode); +ARCS_ABI int getServoModeSelect(MOTION_CONTROL_HANDLER h); +ARCS_ABI int servoJoint(MOTION_CONTROL_HANDLER h, const double *q, double a, + double v, double t, double lookahead_time, double gain); +ARCS_ABI int servoCartesian(MOTION_CONTROL_HANDLER h, const double *pose, + double a, double v, double t, double lookahead_time, + double gain); +ARCS_ABI int servoJointWithAxes(MOTION_CONTROL_HANDLER h, const double *q, + const double *extq, double a, double v, + double t, double lookahead_time, double gain); +ARCS_ABI int servoCartesianWithAxes(MOTION_CONTROL_HANDLER h, + const double *pose, const double *extq, + double a, double v, double t, + double lookahead_time, double gain); +ARCS_ABI int trackJoint(MOTION_CONTROL_HANDLER h, const double *q, double t, + double smooth_scale, double delay_sacle); +ARCS_ABI int trackCartesian(MOTION_CONTROL_HANDLER h, const double *pose, + double t, double smooth_scale, double delay_sacle); +ARCS_ABI int followJoint(MOTION_CONTROL_HANDLER h, const double *q); +ARCS_ABI int followLine(MOTION_CONTROL_HANDLER h, const double *pose); +ARCS_ABI int speedJoint(MOTION_CONTROL_HANDLER h, const double *qd, double a, + double t); +ARCS_ABI int resumeSpeedJoint(MOTION_CONTROL_HANDLER h, const double *qd, + double a, double t); +ARCS_ABI int speedLine(MOTION_CONTROL_HANDLER h, const double *xd, double a, + double t); +ARCS_ABI int resumeSpeedLine(MOTION_CONTROL_HANDLER h, const double *xd, + double a, double t); +ARCS_ABI int moveSpline(MOTION_CONTROL_HANDLER h, const double *q, double a, + double v, double duration); +ARCS_ABI int moveJoint(MOTION_CONTROL_HANDLER h, const double *q, double a, + double v, double blend_radius, double duration); +ARCS_ABI int resumeMoveJoint(MOTION_CONTROL_HANDLER h, const double *q, + double a, double v, double duration); +ARCS_ABI int moveLine(MOTION_CONTROL_HANDLER h, const double *pose, double a, + double v, double blend_radius, double duration); +ARCS_ABI int moveProcess(MOTION_CONTROL_HANDLER h, const double *pose, double a, + double v, double blend_radius); +ARCS_ABI int resumeMoveLine(MOTION_CONTROL_HANDLER h, const double *pose, + double a, double v, double duration); +ARCS_ABI int moveCircle(MOTION_CONTROL_HANDLER h, const double *via_pose, + const double *end_pose, double a, double v, + double blend_radius, double duration); +ARCS_ABI int setCirclePathMode(MOTION_CONTROL_HANDLER h, int mode); +ARCS_ABI int moveCircle2(MOTION_CONTROL_HANDLER h, + const CircleParameters_C *param); +ARCS_ABI int pathBufferAlloc(MOTION_CONTROL_HANDLER h, const char *name, + int type, int size); +ARCS_ABI int pathBufferAppend(MOTION_CONTROL_HANDLER h, const char *name, + const double *waypoints, int rows); +ARCS_ABI int pathBufferEval(MOTION_CONTROL_HANDLER h, const char *name, + const double *a, const double *v, double t); +ARCS_ABI BOOL pathBufferValid(MOTION_CONTROL_HANDLER h, const char *name); +ARCS_ABI int pathBufferFree(MOTION_CONTROL_HANDLER h, const char *name); +ARCS_ABI int pathBufferList(MOTION_CONTROL_HANDLER h, char **result); +ARCS_ABI int movePathBuffer(MOTION_CONTROL_HANDLER h, const char *name); +ARCS_ABI int moveIntersection(MOTION_CONTROL_HANDLER h, const double *poses, + int rows, double a, double v, + double main_pipe_radius, double sub_pipe_radius, + double normal_distance, double normal_alpha); +ARCS_ABI int stopJoint(MOTION_CONTROL_HANDLER h, double acc); +ARCS_ABI int resumeStopJoint(MOTION_CONTROL_HANDLER h, double acc); +ARCS_ABI int stopLine(MOTION_CONTROL_HANDLER h, double acc, double acc_rot); +ARCS_ABI int resumeStopLine(MOTION_CONTROL_HANDLER h, double acc, + double acc_rot); +ARCS_ABI int weaveStart(MOTION_CONTROL_HANDLER h, const char *params); +ARCS_ABI int weaveEnd(MOTION_CONTROL_HANDLER h); +ARCS_ABI int storePath(MOTION_CONTROL_HANDLER h, BOOL keep_sync); +ARCS_ABI int stopMove(MOTION_CONTROL_HANDLER h, BOOL quick, BOOL all_tasks); +ARCS_ABI int startMove(MOTION_CONTROL_HANDLER h); +ARCS_ABI int clearPath(MOTION_CONTROL_HANDLER h); +ARCS_ABI int restoPath(MOTION_CONTROL_HANDLER h); +ARCS_ABI int setFuturePointSamplePeriod(MOTION_CONTROL_HANDLER h, + double sample_time); +ARCS_ABI int getFuturePathPointsJoint(MOTION_CONTROL_HANDLER h, + double **result); +ARCS_ABI int conveyorTrackCircle(MOTION_CONTROL_HANDLER h, int encoder_id, + const double *center, BOOL rotate_tool); +ARCS_ABI int conveyorTrackLine(MOTION_CONTROL_HANDLER h, int encoder_id, + const double *direction); +ARCS_ABI int conveyorTrackStop(MOTION_CONTROL_HANDLER h, int encoder_id, + double a); +ARCS_ABI int setConveyorTrackEncoder(MOTION_CONTROL_HANDLER h, int encoder_id, + int tick_per_meter); +ARCS_ABI int setConveyorTrackLimit(MOTION_CONTROL_HANDLER h, int encoder_id, + double limit); +ARCS_ABI int setConveyorTrackStartWindow(MOTION_CONTROL_HANDLER h, + int encoder_id, double window_min, + double window_max); +ARCS_ABI int setConveyorTrackSensorOffset(MOTION_CONTROL_HANDLER h, + int encoder_id, double offset); +ARCS_ABI int setConveyorTrackSyncSeparation(MOTION_CONTROL_HANDLER h, + int encoder_id, double distance, + double time); +ARCS_ABI int setConveyorTrackCompensate(MOTION_CONTROL_HANDLER h, + int encoder_id, double comp); +ARCS_ABI BOOL isConveyorTrackSync(MOTION_CONTROL_HANDLER h, int encoder_id); +ARCS_ABI BOOL isConveyorTrackExceed(MOTION_CONTROL_HANDLER h, int encoder_id); +ARCS_ABI int getConveyorTrackQueue(MOTION_CONTROL_HANDLER h, int encoder_id, + double *result); +ARCS_ABI int getConveyorTrackNextItem(MOTION_CONTROL_HANDLER h, int encoder_id); +ARCS_ABI int conveyorTrackCreatItem(MOTION_CONTROL_HANDLER h, int encoder_id, + int item_id, const double *offset); +ARCS_ABI BOOL hasItemOnConveyorToTrack(MOTION_CONTROL_HANDLER h, + int encoder_id); +ARCS_ABI BOOL conveyorTrackSwitch(MOTION_CONTROL_HANDLER h, int encoder_id); +ARCS_ABI int conveyorTrackClearItems(MOTION_CONTROL_HANDLER h, int encoder_id); +ARCS_ABI int moveSpiral(MOTION_CONTROL_HANDLER h, + const SpiralParameters_C *param, double blend_radius, + double v, double a, double t); +ARCS_ABI int pathOffsetLimits(MOTION_CONTROL_HANDLER h, double v, double a); +ARCS_ABI int pathOffsetCoordinate(MOTION_CONTROL_HANDLER h, int ref_coord); +ARCS_ABI int getLookAheadSize(MOTION_CONTROL_HANDLER h); +ARCS_ABI int setLookAheadSize(MOTION_CONTROL_HANDLER h, int size); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/win/include/aubo_sdk/robot/robot_algorithm_c.h b/third_party/AuboSdk/win/include/aubo_sdk/robot/robot_algorithm_c.h new file mode 100644 index 00000000..9a34d80c --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo_sdk/robot/robot_algorithm_c.h @@ -0,0 +1,69 @@ +#ifndef AUBO_SDK_RobotAlgorithm_C_H +#define AUBO_SDK_RobotAlgorithm_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI ForceSensorCalibResult_C +calibrateTcpForceSensor(ROBOT_ALGORITHM_HANDLER h, const double *forces, + int forces_rows, const double *poses, int poses_rows); +ARCS_ABI ForceSensorCalibResult_C +calibrateTcpForceSensor2(ROBOT_ALGORITHM_HANDLER h, const double *forces, + int forces_rows, const double *poses, int poses_rows); +ARCS_ABI int payloadIdentify(ROBOT_ALGORITHM_HANDLER h, + const char *data_no_payload, + const char *data_with_payload); +ARCS_ABI int payloadIdentify1(ROBOT_ALGORITHM_HANDLER h, const char *file_name); +ARCS_ABI int payloadCalculateFinished(ROBOT_ALGORITHM_HANDLER h); +ARCS_ABI Payload_C getPayloadIdentifyResult(ROBOT_ALGORITHM_HANDLER h); +ARCS_ABI int generatePayloadIdentifyTraj(ROBOT_ALGORITHM_HANDLER h, + const char *name, + const TrajConfig_C *traj_config); +ARCS_ABI int payloadIdentifyTrajGenFinished(ROBOT_ALGORITHM_HANDLER h); +ARCS_ABI BOOL frictionModelIdentify(ROBOT_ALGORITHM_HANDLER h, const double *q, + int q_rows, const double *qd, int qd_rows, + const double *qdd, int qdd_rows, + const double *temp, int temp_rows); +ARCS_ABI int calibWorkpieceCoordinatePara(ROBOT_ALGORITHM_HANDLER h, + const double *q, int q_rows, int type, + double *result); +ARCS_ABI int forwardDynamics(ROBOT_ALGORITHM_HANDLER h, const double *q, + const double *torqs, double *result); +ARCS_ABI int forwardKinematics(ROBOT_ALGORITHM_HANDLER h, const double *q, + double *result); +ARCS_ABI int forwardToolKinematics(ROBOT_ALGORITHM_HANDLER h, const double *q, + double *result); +ARCS_ABI int forwardDynamics1(ROBOT_ALGORITHM_HANDLER h, const double *q, + const double *torqs, const double *tcp_offset, + double *result); +ARCS_ABI int forwardKinematics1(ROBOT_ALGORITHM_HANDLER h, const double *q, + const double *tcp_offset, double *result); +ARCS_ABI int inverseKinematics(ROBOT_ALGORITHM_HANDLER h, const double *qnear, + const double *pose, double *result); +ARCS_ABI int inverseKinematicsAll(ROBOT_ALGORITHM_HANDLER h, const double *pose, + double **result); +ARCS_ABI int inverseKinematics1(ROBOT_ALGORITHM_HANDLER h, const double *qnear, + const double *pose, const double *tcp_offset, + double *result); +ARCS_ABI int inverseKinematicsAll1(ROBOT_ALGORITHM_HANDLER h, + const double *pose, const double *tcp_offset, + double **result); +ARCS_ABI int inverseToolKinematics(ROBOT_ALGORITHM_HANDLER h, + const double *qnear, const double *pose, + double *result); +ARCS_ABI int inverseToolKinematicsAll(ROBOT_ALGORITHM_HANDLER h, + const double *pose, double **result); +ARCS_ABI int pathMovej(ROBOT_ALGORITHM_HANDLER h, const double *q1, double r1, + const double *q2, double r2, double d, double **result); +ARCS_ABI int pathBlend3Points(ROBOT_ALGORITHM_HANDLER h, int type, + const double *q_start, const double *q_via, + const double *q_to, double r, double d, + double **result); +ARCS_ABI int calcJacobian(ROBOT_ALGORITHM_HANDLER h, const double *q, + BOOL base_or_end, double *result); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/win/include/aubo_sdk/robot/robot_config_c.h b/third_party/AuboSdk/win/include/aubo_sdk/robot/robot_config_c.h new file mode 100644 index 00000000..7dc9fd99 --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo_sdk/robot/robot_config_c.h @@ -0,0 +1,92 @@ +#ifndef AUBO_SDK_RobotConfig_C_H +#define AUBO_SDK_RobotConfig_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI int getDof(ROBOT_CONFIG_HANDLER h); +ARCS_ABI int getName(ROBOT_CONFIG_HANDLER h, char *result); +ARCS_ABI double getCycletime(ROBOT_CONFIG_HANDLER h); +ARCS_ABI int setSlowDownFraction(ROBOT_CONFIG_HANDLER h, int level, + double fraction); +ARCS_ABI double getSlowDownFraction(ROBOT_CONFIG_HANDLER h, int level); +ARCS_ABI int getRobotType(ROBOT_CONFIG_HANDLER h, char *result); +ARCS_ABI int getRobotSubType(ROBOT_CONFIG_HANDLER h, char *result); +ARCS_ABI int getControlBoxType(ROBOT_CONFIG_HANDLER h, char *result); +ARCS_ABI double getDefaultToolAcc(ROBOT_CONFIG_HANDLER h); +ARCS_ABI double getDefaultToolSpeed(ROBOT_CONFIG_HANDLER h); +ARCS_ABI double getDefaultJointAcc(ROBOT_CONFIG_HANDLER h); +ARCS_ABI double getDefaultJointSpeed(ROBOT_CONFIG_HANDLER h); +ARCS_ABI int setMountingPose(ROBOT_CONFIG_HANDLER h, const double *pose); +ARCS_ABI int getMountingPose(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int setCollisionLevel(ROBOT_CONFIG_HANDLER h, int level); +ARCS_ABI int getCollisionLevel(ROBOT_CONFIG_HANDLER h); +ARCS_ABI int setCollisionStopType(ROBOT_CONFIG_HANDLER h, int type); +ARCS_ABI int getCollisionStopType(ROBOT_CONFIG_HANDLER h); +ARCS_ABI int setHomePosition(ROBOT_CONFIG_HANDLER h, const double *positions); +ARCS_ABI int getHomePosition(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int setFreedriveDamp(ROBOT_CONFIG_HANDLER h, const double *damp); +ARCS_ABI int getFreedriveDamp(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int getTcpForceSensorNames(ROBOT_CONFIG_HANDLER h, char **result); +ARCS_ABI int selectTcpForceSensor(ROBOT_CONFIG_HANDLER h, const char *name); +ARCS_ABI BOOL hasTcpForceSensor(ROBOT_CONFIG_HANDLER h); +ARCS_ABI int setTcpForceOffset(ROBOT_CONFIG_HANDLER h, + const double *force_offset); +ARCS_ABI int getTcpForceOffset(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int getBaseForceSensorNames(ROBOT_CONFIG_HANDLER h, char **result); +ARCS_ABI int selectBaseForceSensor(ROBOT_CONFIG_HANDLER h, const char *name); +ARCS_ABI BOOL hasBaseForceSensor(ROBOT_CONFIG_HANDLER h); +ARCS_ABI int setBaseForceOffset(ROBOT_CONFIG_HANDLER h, + const double *force_offset); +ARCS_ABI int getBaseForceOffset(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int setPersistentParameters(ROBOT_CONFIG_HANDLER h, const char *param); +ARCS_ABI int setKinematicsCompensate(ROBOT_CONFIG_HANDLER h, + const DHParam_C *param); +ARCS_ABI int setHardwareCustomParameters(ROBOT_CONFIG_HANDLER h, + const char *param); +ARCS_ABI int getHardwareCustomParameters(ROBOT_CONFIG_HANDLER h, + const char *param, char *result); +ARCS_ABI int setRobotZero(ROBOT_CONFIG_HANDLER h); +ARCS_ABI DHParam_C *getKinematicsParam(ROBOT_CONFIG_HANDLER h, BOOL real); +ARCS_ABI DHComp_C *getKinematicsCompensate(ROBOT_CONFIG_HANDLER h, + double ref_temperature); +ARCS_ABI uint32_t getSafetyParametersCheckSum(ROBOT_CONFIG_HANDLER h); +ARCS_ABI int confirmSafetyParameters( + ROBOT_CONFIG_HANDLER h, const RobotSafetyParameterRange_C *parameters); +ARCS_ABI uint32_t calcSafetyParametersCheckSum( + ROBOT_CONFIG_HANDLER h, const RobotSafetyParameterRange_C *parameters); +ARCS_ABI int getJointMaxPositions(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int getJointMinPositions(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int getJointMaxSpeeds(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int getJointMaxAccelerations(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int getTcpMaxSpeeds(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int getTcpMaxAccelerations(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI BOOL toolSpaceInRange(ROBOT_CONFIG_HANDLER h, const double *pose); +ARCS_ABI int setPayload(ROBOT_CONFIG_HANDLER h, double m, const double *cog, + const double *aom, const double *inertia); +ARCS_ABI Payload_C getPayload(ROBOT_CONFIG_HANDLER h); +ARCS_ABI int getTcpOffset(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int getGravity(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int setGravity(ROBOT_CONFIG_HANDLER h, const double *gravity); +ARCS_ABI int setTcpOffset(ROBOT_CONFIG_HANDLER h, const double *offset); +ARCS_ABI int setToolInertial(ROBOT_CONFIG_HANDLER h, double m, + const double *com, const double *inertial); +ARCS_ABI int firmwareUpdate(ROBOT_CONFIG_HANDLER h, const char *fw); +ARCS_ABI double getFirmwareUpdateProcess(ROBOT_CONFIG_HANDLER h); +ARCS_ABI int setTcpForceSensorPose(ROBOT_CONFIG_HANDLER h, + const double *sensor_pose); +ARCS_ABI int getTcpForceSensorPose(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int getLimitJointMaxPositions(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int getLimitJointMinPositions(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int getLimitJointMaxSpeeds(ROBOT_CONFIG_HANDLER h, double *result); +ARCS_ABI int getLimitJointMaxAccelerations(ROBOT_CONFIG_HANDLER h, + double *result); +ARCS_ABI double getLimitTcpMaxSpeed(ROBOT_CONFIG_HANDLER h); +ARCS_ABI SafeguedStopType_C getSafeguardStopType(ROBOT_CONFIG_HANDLER h); +ARCS_ABI int getSafeguardStopSource(ROBOT_CONFIG_HANDLER h); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/win/include/aubo_sdk/robot/robot_interface_c.h b/third_party/AuboSdk/win/include/aubo_sdk/robot/robot_interface_c.h new file mode 100644 index 00000000..ca8521a0 --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo_sdk/robot/robot_interface_c.h @@ -0,0 +1,22 @@ +#ifndef AUBO_SDK_RobotInterface_C_H +#define AUBO_SDK_RobotInterface_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI ROBOT_CONFIG_HANDLER robot_getRobotConfig(ROBOT_HANDLER robot); +ARCS_ABI MOTION_CONTROL_HANDLER robot_getMotionControl(ROBOT_HANDLER robot); +ARCS_ABI FORCE_CONTROL_HANDLER robot_getForceControl(ROBOT_HANDLER robot); +ARCS_ABI IO_CONTROL_HANDLER robot_getIoControl(ROBOT_HANDLER robot); +ARCS_ABI SYNC_MOVE_HANDLER robot_getSyncMove(ROBOT_HANDLER robot); +ARCS_ABI ROBOT_ALGORITHM_HANDLER robot_getRobotAlgorithm(ROBOT_HANDLER robot); +ARCS_ABI ROBOT_MANAGE_HANDLER robot_getRobotManage(ROBOT_HANDLER robot); +ARCS_ABI ROBOT_STATE_HANDLER robot_getRobotState(ROBOT_HANDLER robot); +ARCS_ABI TRACE_HANDLER robot_getTrace(ROBOT_HANDLER robot); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/win/include/aubo_sdk/robot/robot_manage_c.h b/third_party/AuboSdk/win/include/aubo_sdk/robot/robot_manage_c.h new file mode 100644 index 00000000..7b94f3cb --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo_sdk/robot/robot_manage_c.h @@ -0,0 +1,38 @@ +#ifndef AUBO_SDK_RobotManage_C_H +#define AUBO_SDK_RobotManage_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI int poweron(ROBOT_MANAGE_HANDLER h); +ARCS_ABI int startup(ROBOT_MANAGE_HANDLER h); +ARCS_ABI int poweroff(ROBOT_MANAGE_HANDLER h); +ARCS_ABI int backdrive(ROBOT_MANAGE_HANDLER h, BOOL enable); +ARCS_ABI int freedrive(ROBOT_MANAGE_HANDLER h, BOOL enable); +ARCS_ABI int handguideMode(ROBOT_MANAGE_HANDLER h, int32_t *freeAxes, + const double *feature); +ARCS_ABI int exitHandguideMode(ROBOT_MANAGE_HANDLER h); +ARCS_ABI int getHandguideStatus(ROBOT_MANAGE_HANDLER h); +ARCS_ABI int getHandguideTrigger(ROBOT_MANAGE_HANDLER h); +ARCS_ABI BOOL isHandguideEnabled(ROBOT_MANAGE_HANDLER h); +ARCS_ABI int setSim(ROBOT_MANAGE_HANDLER h, BOOL enable); +ARCS_ABI int setOperationalMode(ROBOT_MANAGE_HANDLER h, + OperationalModeType_C mode); +ARCS_ABI OperationalModeType_C getOperationalMode(ROBOT_MANAGE_HANDLER h); +ARCS_ABI RobotControlModeType_C getRobotControlMode(ROBOT_MANAGE_HANDLER h); +ARCS_ABI BOOL isSimulationEnabled(ROBOT_MANAGE_HANDLER h); +ARCS_ABI BOOL isFreedriveEnabled(ROBOT_MANAGE_HANDLER h); +ARCS_ABI BOOL isBackdriveEnabled(ROBOT_MANAGE_HANDLER h); +ARCS_ABI int setUnlockProtectiveStop(ROBOT_MANAGE_HANDLER h); +ARCS_ABI int startRecord(ROBOT_MANAGE_HANDLER h, const char *file_name); +ARCS_ABI int stopRecord(ROBOT_MANAGE_HANDLER h); +ARCS_ABI int pauseRecord(ROBOT_MANAGE_HANDLER h, BOOL pause); +ARCS_ABI int restartInterfaceBoard(ROBOT_MANAGE_HANDLER h); +ARCS_ABI int setLinkModeEnable(ROBOT_MANAGE_HANDLER h, BOOL enable); +ARCS_ABI BOOL isLinkModeEnabled(ROBOT_MANAGE_HANDLER h); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/win/include/aubo_sdk/robot/robot_state_c.h b/third_party/AuboSdk/win/include/aubo_sdk/robot/robot_state_c.h new file mode 100644 index 00000000..7e214bb1 --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo_sdk/robot/robot_state_c.h @@ -0,0 +1,73 @@ +#ifndef AUBO_SDK_RobotState_C_H +#define AUBO_SDK_RobotState_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI RobotModeType_C getRobotModeType(ROBOT_STATE_HANDLER h); +ARCS_ABI SafetyModeType_C getSafetyModeType(ROBOT_STATE_HANDLER h); +ARCS_ABI BOOL isPowerOn(ROBOT_STATE_HANDLER h); +ARCS_ABI BOOL isSteady(ROBOT_STATE_HANDLER h); +ARCS_ABI BOOL isCollisionOccurred(ROBOT_STATE_HANDLER h); +ARCS_ABI BOOL isWithinSafetyLimits(ROBOT_STATE_HANDLER h); +ARCS_ABI int getTcpPose(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getActualTcpOffset(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getTargetTcpPose(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getToolPose(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getTcpSpeed(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getTcpForce(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getElbowPosistion(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getElbowVelocity(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getBaseForce(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getTcpTargetPose(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getTcpTargetSpeed(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getTcpTargetForce(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getJointState(ROBOT_STATE_HANDLER h, JointStateType_C *result); +ARCS_ABI int getJointServoMode(ROBOT_STATE_HANDLER h, + JointServoModeType_C *result); +ARCS_ABI int getJointPositions(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getJointPositionsHistory(ROBOT_STATE_HANDLER h, int steps, + double *result); +ARCS_ABI int getJointSpeeds(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getJointAccelerations(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getJointTorqueSensors(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getJointContactTorques(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getBaseForceSensor(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getTcpForceSensors(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getJointCurrents(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getJointVoltages(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getJointTemperatures(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getJointUniqueIds(ROBOT_STATE_HANDLER h, char **result); +ARCS_ABI int getJointFirmwareVersions(ROBOT_STATE_HANDLER h, int *result); +ARCS_ABI int getJointHardwareVersions(ROBOT_STATE_HANDLER h, int *result); +ARCS_ABI int getMasterBoardUniqueId(ROBOT_STATE_HANDLER h, char *result); +ARCS_ABI int getMasterBoardFirmwareVersion(ROBOT_STATE_HANDLER h); +ARCS_ABI int getMasterBoardHardwareVersion(ROBOT_STATE_HANDLER h); +ARCS_ABI int getSlaveBoardUniqueId(ROBOT_STATE_HANDLER h, char *result); +ARCS_ABI int getSlaveBoardFirmwareVersion(ROBOT_STATE_HANDLER h); +ARCS_ABI int getSlaveBoardHardwareVersion(ROBOT_STATE_HANDLER h); +ARCS_ABI int getToolUniqueId(ROBOT_STATE_HANDLER h, char *result); +ARCS_ABI int getToolFirmwareVersion(ROBOT_STATE_HANDLER h); +ARCS_ABI int getToolHardwareVersion(ROBOT_STATE_HANDLER h); +ARCS_ABI int getToolCommMode(ROBOT_STATE_HANDLER h); +ARCS_ABI int getPedestalUniqueId(ROBOT_STATE_HANDLER h, char *result); +ARCS_ABI int getPedestalFirmwareVersion(ROBOT_STATE_HANDLER h); +ARCS_ABI int getPedestalHardwareVersion(ROBOT_STATE_HANDLER h); +ARCS_ABI int getJointTargetPositions(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getJointTargetSpeeds(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getJointTargetAccelerations(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getJointTargetTorques(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI int getJointTargetCurrents(ROBOT_STATE_HANDLER h, double *result); +ARCS_ABI double getControlBoxTemperature(ROBOT_STATE_HANDLER h); +ARCS_ABI double getControlBoxHumidity(ROBOT_STATE_HANDLER h); +ARCS_ABI double getMainVoltage(ROBOT_STATE_HANDLER h); +ARCS_ABI double getMainCurrent(ROBOT_STATE_HANDLER h); +ARCS_ABI double getRobotVoltage(ROBOT_STATE_HANDLER h); +ARCS_ABI double getRobotCurrent(ROBOT_STATE_HANDLER h); +ARCS_ABI int getSlowDownLevel(ROBOT_STATE_HANDLER h); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/win/include/aubo_sdk/rpc.h b/third_party/AuboSdk/win/include/aubo_sdk/rpc.h new file mode 100644 index 00000000..ab5bd031 --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo_sdk/rpc.h @@ -0,0 +1,171 @@ +/** @file rpc.h + * @brief 用于RPC模块的交互,如登录、连接等功能 + */ + +#ifndef AUBO_SDK_RPC_H +#define AUBO_SDK_RPC_H + +#include + +#include +#include + +namespace arcs { +namespace aubo_sdk { +using namespace arcs::common_interface; + +/// RPC客户端 +class ARCS_ABI RpcClient : public AuboApi +{ +public: + enum Event + { + Connected = 0, + Disconnected = 1, + }; + + /** + * @brief RpcClient + * @param mode 0-TCP 1-UDS + */ + RpcClient(int mode = 0); + ~RpcClient(); + + /** + * 设置日志处理器 + * + * 此函数可设置自定义的日志处理函数来处理日志消息。 \n + * Aubo SDK 有一套默认的日志系统,按照默认的格式输出到默认的文件。 + * 如果用户不希望采用默认的格式或者不希望输出到默认的文件,那就可以通过这个接口重新自定义格式,或者输出路径。 + * 这个函数可以将用户自定义的日志系统与 Aubo SDK 默认的日志系统合并。 + * + * @note setLogHandler函数要放在即将触发的日志之前, + * 否则会按照默认的形式输出日志。 + * + * @param handler 日志处理函数 \n + * 此日志处理函数的下定义如下: \n + * void handler(int level, const char* filename, int line, const + * std::string& message) \n + * level 表示日志等级 \n + *   0: LOGLEVEL_FATAL 严重的错误 \n + *   1: LOGLEVEL_ERROR 错误 \n + *   2: LOGLEVEL_WARNING 警告 \n + *   3: LOGLEVEL_INFO 通知 \n + *   4: LOGLEVEL_DEBUG 调试 \n + *   5: LOGLEVEL_BACKTRACE 跟踪 \n + * filename 表示文件名 \n + * line 表示代码行号 \n + * message 表示日志信息 \n + * @return 无 + */ + void setLogHandler( + std::function + handler); + + /** + * 连接到RPC服务 + * + * @param ip IP地址 + * @param port 端口号,RPC的端口号是30004 + * @param ip和port为空时,采用unix domain sockets通讯方式 + * @retval 0 RPC连接成功 + * @retval -8 RPC连接失败,RPC连接被拒绝 + * @retval -15 RPC连接失败,SDK版本与Server版本不兼容 + */ + int connect(const std::string &ip = "", int port = 0); + + /** + * 断开RPC连接 + * + * @retval 0 成功 + * @retval -1 失败 + */ + int disconnect(); + + /** + * 判断是否连接RPC + * + * @retval true 已连接RPC + * @retval false 未连接RPC + */ + bool hasConnected() const; + + /** + * 登录 + * + * @param usrname 用户名 + * @param passwd 密码 + * @return 0 + */ + int login(const std::string &usrname, const std::string &passwd); + + /** + * 登出 + * + * @return 0 + */ + int logout(); + + /** + * 判断是否登录 + * + * @retval true 已登录 + * @retval false 未登录 + */ + bool hasLogined(); + + /** + * 设置RPC请求超时时间 + * + * @param timeout 请求超时时间,单位 ms + * @return 0 + */ + int setRequestTimeout(int timeout = 100); + + /** + * 设置事件处理 + * + * @param cb + * @return + */ + int setEventHandler(std::function cb); + + /** + * 是否关闭异常抛出 + * + * @param enable + * @return + */ + int setExceptionFree(bool enable); + + /** + * 返回错误代码 + * + * @return + */ + int errorCode() const; + + /** + * 设备关机 + * + * @return + */ + int shutdown(); +}; +using RpcClientPtr = std::shared_ptr; + +} // namespace aubo_sdk +} // namespace arcs + +#ifdef __cplusplus +extern "C" { +#endif + +ARCS_ABI arcs::aubo_sdk::RpcClient *createRpcClient(int mode = 0); +ARCS_ABI void destroyRpcClient(arcs::aubo_sdk::RpcClient *cli); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/third_party/AuboSdk/win/include/aubo_sdk/rpc_c.h b/third_party/AuboSdk/win/include/aubo_sdk/rpc_c.h new file mode 100644 index 00000000..8d5612ce --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo_sdk/rpc_c.h @@ -0,0 +1,313 @@ +/** @file rpc_c.h + * @brief 用于RPC模块的交互,如登录、连接等功能 + */ + +#ifndef AUBO_SDK_RPC_C_H +#define AUBO_SDK_RPC_C_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +enum Event +{ + Event_Connected = 0, + Event_Disconnected = 1, +}; + +ARCS_ABI RPC_HANDLER rpc_create_client(int mode = 0); +ARCS_ABI void rpc_destroy_client(RPC_HANDLER cli); + +/** + * 设置日志处理器 + * + * 此函数可设置自定义的日志处理函数来处理日志消息。 \n + * Aubo SDK 有一套默认的日志系统,按照默认的格式输出到默认的文件。 + * 如果用户不希望采用默认的格式或者不希望输出到默认的文件,那就可以通过这个接口重新自定义格式,或者输出路径。 + * 这个函数可以将用户自定义的日志系统与 Aubo SDK 默认的日志系统合并。 + * + * @note setLogHandler函数要放在即将触发的日志之前, + * 否则会按照默认的形式输出日志。 + * + * @param handler 日志处理函数 \n + * 此日志处理函数的下定义如下: \n + * void handler(int level, const char* filename, int line, const + * std::string& message) \n + * level 表示日志等级 \n + *   0: LOGLEVEL_FATAL 严重的错误 \n + *   1: LOGLEVEL_ERROR 错误 \n + *   2: LOGLEVEL_WARNING 警告 \n + *   3: LOGLEVEL_INFO 通知 \n + *   4: LOGLEVEL_DEBUG 调试 \n + *   5: LOGLEVEL_BACKTRACE 跟踪 \n + * filename 表示文件名 \n + * line 表示代码行号 \n + * message 表示日志信息 \n + * @return 无 + */ +ARCS_ABI void rpc_setLogHandler(RPC_HANDLER cli, LOG_HANDLER handler); + +/** + * 连接到RPC服务 + * + * @param ip IP地址 + * @param port 端口号,RPC的端口号是30004 + * @param ip和port为空时,采用unix domain sockets通讯方式 + * @retval 0 RPC连接成功 + * @retval -8 RPC连接失败,RPC连接被拒绝 + * @retval -15 RPC连接失败,SDK版本与Server版本不兼容 + */ +ARCS_ABI int rpc_connect(RPC_HANDLER cli, const char *ip = "", int port = 0); + +/** + * 断开RPC连接 + * + * @retval 0 成功 + * @retval -1 失败 + */ +ARCS_ABI int rpc_disconnect(RPC_HANDLER cli); + +/** + * 判断是否连接RPC + * + * @retval true 已连接RPC + * @retval false 未连接RPC + */ +ARCS_ABI bool rpc_hasConnected(RPC_HANDLER cli); + +/** + * 登录 + * + * @param usrname 用户名 + * @param passwd 密码 + * @return 0 + */ +ARCS_ABI int rpc_login(RPC_HANDLER cli, const char *usrname, + const char *passwd); + +/** + * 登出 + * + * @return 0 + */ +ARCS_ABI int rpc_logout(RPC_HANDLER cli); + +/** + * 判断是否登录 + * + * @retval true 已登录 + * @retval false 未登录 + */ +ARCS_ABI bool rpc_hasLogined(RPC_HANDLER cli); + +/** + * 设置RPC请求超时时间 + * + * @param timeout 请求超时时间,单位 ms + * @return 0 + */ +ARCS_ABI int rpc_setRequestTimeout(RPC_HANDLER cli, int timeout = 10); + +/** + * 设置事件处理 + * + * @param cb + * @return + */ +ARCS_ABI int rpc_setEventHandler(RPC_HANDLER cli, EVENT_CALLBACK cb); + +/** + * 返回错误代码 + * + * @return + */ +ARCS_ABI int rpc_errorCode(RPC_HANDLER cli); + +/** + * 设备关机 + * + * @return + */ +ARCS_ABI int rpc_shutdown(RPC_HANDLER cli); + +/** + * 获取纯数学相关接口 + * + * @return MathPtr对象的指针 + * + * @par Python函数原型 + * getMath(self: pyaubo_sdk.AuboApi) -> pyaubo_sdk.Math + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * MathPtr ptr = rpc_cli->getMath(); + * @endcode + * + */ +ARCS_ABI MATH_HANDLER rpc_getMath(RPC_HANDLER cli); + +/** + * 获取系统信息 + * + * @return SystemInfoPtr对象的指针 + * + * @par Python函数原型 + * getSystemInfo(self: pyaubo_sdk.AuboApi) -> pyaubo_sdk.SystemInfo + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * SystemInfoPtr ptr = rpc_cli->getSystemInfo(); + * @endcode + * + */ +ARCS_ABI SYSTEM_INFO_HANDLER rpc_getSystemInfo(RPC_HANDLER cli); + +/** + * 获取运行时接口 + * + * @return RuntimeMachinePtr对象的指针 + * + * @par Python函数原型 + * getRuntimeMachine(self: pyaubo_sdk.AuboApi) -> pyaubo_sdk.RuntimeMachine + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * RuntimeMachinePtr ptr = rpc_cli->getRuntimeMachine(); + * @endcode + * + */ +ARCS_ABI RUNTIME_MACHINE_HANDLER rpc_getRuntimeMachine(RPC_HANDLER cli); + +/** + * 对外寄存器接口 + * + * @return RegisterControlPtr对象的指针 + * + * @par Python函数原型 + * getRegisterControl(self: pyaubo_sdk.AuboApi) -> + * pyaubo_sdk.RegisterControl + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * RegisterControlPtr ptr = rpc_cli->getRegisterControl(); + * @endcode + * + */ +ARCS_ABI REGISTER_CONTROL_HANDLER rpc_getRegisterControl(RPC_HANDLER cli); + +/** + * 获取机器人列表 + * + * @return 机器人列表 + * + * @par Python函数原型 + * getRobotNames(self: pyaubo_sdk.AuboApi) -> List[str] + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * @endcode + * + * @par JSON-RPC请求示例 + * {"jsonrpc":"2.0","method":"getRobotNames","params":[],"id":1} + * + * @par JSON-RPC响应示例 + * {"id":1,"jsonrpc":"2.0","result":["rob1"]} + * + */ +ARCS_ABI int rpc_getRobotNames(RPC_HANDLER cli, char **names); + +/** + * 根据名字获取 RobotInterfacePtr 接口 + * + * @param name 机器人名字 + * @return RobotInterfacePtr对象的指针 + * + * @par Python函数原型 + * getRobotInterface(self: pyaubo_sdk.AuboApi, arg0: str) -> + * pyaubo_sdk.RobotInterface + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * auto robot_name = rpc_cli->getRobotNames().front(); + * RobotInterfacePtr ptr = rpc_cli->getRobotInterface(robot_name); + * @endcode + * + */ +ARCS_ABI ROBOT_HANDLER rpc_getRobotInterface(RPC_HANDLER cli, const char *name); + +/** + * 获取外部轴列表 + * + * @return + */ +ARCS_ABI int rpc_getAxisNames(RPC_HANDLER cli, char **names); + +/** + * 获取外部轴接口 + * + * @param name + * @return + */ +ARCS_ABI AXIS_HANDLER rpc_getAxisInterface(RPC_HANDLER cli, const char *name); + +/// 获取独立 IO 模块接口 + +/** + * 获取 socket + * @return SocketPtr对象的指针 + * + * @par Python函数原型 + * getSocket(self: pyaubo_sdk.AuboApi) -> arcs::common_interface::Socket + * @endcode + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * SocketPtr ptr = rpc_cli->getSocket(); + * @endcode + * + */ +ARCS_ABI SOCKET_HANDLER rpc_getSocket(RPC_HANDLER cli); + +/** + * + * @return SerialPtr对象的指针 + * + * @par Python函数原型 + * getSerial(self: pyaubo_sdk.AuboApi) -> arcs::common_interface::Serial + * + * @par C++示例 + * @code + * auto rpc_cli = std::make_shared(); + * SerialPtr ptr = rpc_cli->getSerial(); + * @endcode + */ +ARCS_ABI SERIAL_HANDLER rpc_getSerial(RPC_HANDLER cli); + +/** + * 获取同步运动接口 + * + * @return SyncMovePtr对象的指针 + */ +ARCS_ABI SYNC_MOVE_HANDLER rpc_getSyncMove(RPC_HANDLER cli, const char *name); + +/** + * 获取告警信息接口 + * + * @return TracePtr对象的指针 + */ +ARCS_ABI TRACE_HANDLER rpc_getTrace(RPC_HANDLER cli, const char *name); + +#ifdef __cplusplus +} +#endif +#endif // #define AUBO_SDK_RPC_C_H diff --git a/third_party/AuboSdk/win/include/aubo_sdk/rtde.h b/third_party/AuboSdk/win/include/aubo_sdk/rtde.h new file mode 100644 index 00000000..6c8b7ff7 --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo_sdk/rtde.h @@ -0,0 +1,302 @@ +/** @file rtde.h + * @brief 用于RPC模块的交互,如订阅、发布等功能 + */ +#ifndef AUBO_SDK_RTDE_H +#define AUBO_SDK_RTDE_H + +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace arcs { +namespace aubo_sdk { + +class RtdeClient; + +/// 向输出数据中增加 +class ARCS_ABI OutputBuilder +{ +public: + OutputBuilder(); + ~OutputBuilder(); + + OutputBuilder &push(int val); + OutputBuilder &push(double val); + OutputBuilder &push(const std::vector &val); + OutputBuilder &push(const std::tuple &val); + OutputBuilder &push(int16_t &val); + OutputBuilder &push(const std::vector &val); + OutputBuilder &push(const std::vector &val); + OutputBuilder &push(const std::string &val); + OutputBuilder &push(char val); + OutputBuilder &push(const common_interface::RtdeRecipe &val); + +private: + friend RtdeClient; + class Impl; + Impl *impl; +}; + +/// 解析输入 +class ARCS_ABI InputParser +{ +public: + InputParser(); + ~InputParser(); + + bool popBool(); + int popInt32(); + int64_t popInt64(); + int16_t popInt16(); + double popDouble(); + char popChar(); + std::vector popVectorInt(); + std::vector popVectorInt16(); + std::vector popVectorDouble(); + std::vector> popVectorVectorDouble(); + std::vector popVectorJointStateType(); + common_interface::RobotModeType popRobotModeType(); + common_interface::OperationalModeType popOperationalModeType(); + common_interface::SafetyModeType popSafetyModeType(); + common_interface::RuntimeState popRuntimeState(); + common_interface::RobotMsgVector popRobotMsgVector(); + common_interface::Payload popPayload(); + +private: + friend RtdeClient; + class Impl; + Impl *impl; +}; + +/// RTDE客户端 +class ARCS_ABI RtdeClient +{ +public: + enum Event + { + Connected, + Disconnected, + }; + + /** + * RTDE客户端初始化 + * + * @param mode 设置通讯方式, 0 tcp通讯 1 uds通讯 + */ + RtdeClient(int mode = 0); + ~RtdeClient(); + + /** + * 设置日志处理器 + * + * 此函数可设置自定义的日志处理函数来处理日志消息。 \n + * Aubo SDK 有一套默认的日志系统,按照默认的格式输出到默认的文件。 + * 如果用户不希望采用默认的格式或者不希望输出到默认的文件,那就可以通过这个接口重新自定义格式,或者输出路径。 + * 这个函数可以将用户自定义的日志系统与 Aubo SDK 默认的日志系统合并。 + * + * @note setLogHandler函数要放在即将触发的日志之前, + * 否则会按照默认的形式输出日志。 + * + * @param handler 日志处理函数 \n + * 此日志处理函数的下定义如下: \n + * void handler(int level, const char* filename, int line, const + * std::string& message) \n + * level 表示日志等级 \n + *   0: LOGLEVEL_FATAL 严重的错误 \n + *   1: LOGLEVEL_ERROR 错误 \n + *   2: LOGLEVEL_WARNING 警告 \n + *   3: LOGLEVEL_INFO 通知 \n + *   4: LOGLEVEL_DEBUG 调试 \n + *   5: LOGLEVEL_BACKTRACE 跟踪 \n + * filename 表示文件名 \n + * line 表示代码行号 \n + * message 表示日志信息 \n + * @return 无 + */ + void setLogHandler( + std::function + handler); + + /** + * 连接到服务器 + * + * @param ip IP地址 + * @param port 端口号,RTDE 端口号为30010 + * @retval 0 连接成功 + * @retval 1 在执行函数前,已连接 + * @retval -1 连接失败 + */ + int connect(const std::string &ip = "", int port = 0); + + /** + * socket 是否已连接 + * + * @retval true 已连接socket + * @retval false 未连接socket + */ + bool hasConnected() const; + + /** + * socket 是否已连接 + * + * @param callback + * @retval true 已连接socket + * @retval false 未连接socket + */ + bool hasConnected1(std::function callback); + + /** + * 登录 + * + * @param usrname 用户名 + * @param passwd 密码 + * @retval 0 成功 + * @retval -1 失败 + */ + int login(const std::string &usrname, const std::string &passwd); + + /** + * 是否已经登录 + * + * @retval true 已登录 + * @retval false 未登录 + */ + bool hasLogined(); + + /** + * 登出 + * + * @return 0 + */ + int logout(); + + /** + * 断开连接 + * + * @retval 0 成功 + * @retval -1 失败 + */ + int disconnect(); + + /** + * 获取协议版本号 + * + * @return 协议版本号 + */ + int getProtocolVersion(); + + /** + * 获取输入列表 + * + * @return 输入列表 + */ + std::map getInputMaps(); + + /** + * 获取输出列表 + * + * @return 输出列表 + */ + std::map getOutputMaps(); + + /** + * 设置话题 + * + * @param to_server 数据流向。 + * true 表示客户端给服务器发送消息,false 表示服务器给客户端发送消息 + * @param names 服务器推送的信息列表 + * @param freq 服务器推送信息的频率 + * @param expected_chanel 通道。 + * 取值范围:0~99, + * 发布不同的话题走不同的通道 + * @retval expected_chanel参数的值 成功 + * @retval -1 失败 + */ + int setTopic(bool to_server, const std::vector &names, + double freq, int expected_chanel); + + /** + * 取消订阅 + * + * @param to_server 数据流向 + * true 表示客户端给服务器发送消息,false 表示服务器给客户端发送消息 + * @param chanel 通道 + * @retval 0 成功 + * @retval 1 失败 + */ + int removeTopic(bool to_server, int chanel); + + /** + * 获取已注册的输入菜单 + * + * @return 已注册的输入菜单 + */ + std::unordered_map + getRegisteredInputRecipe(); + + /** + * 获取已注册的输出菜单 + * + * @return 已注册的输出菜单 + */ + std::unordered_map + getRegisteredOutputRecipe(); + + /** + * 订阅 subscribe from output + * + * @param chanel 通道 + * @param callback 回调函数,用于处理订阅的输入信息。\n + * 回调函数的定义如下: + * void callback(InputParser &parser) + * @return 0 + */ + int subscribe(int chanel, std::function callback); + + /** + * 发布 publish to input + * + * @param chanel 通道 + * @param callback 回调函数,用于构建发布的输出信息。\n + * 回调函数的定义如下: + * void callback(OutputBuilder &builder) + * @retval 0 成功 + * @retval -1 失败 + */ + int publish(int chanel, std::function callback); + + /** + * 设置事件处理 + * + * @param cb + * @return + */ + int setEventHandler(std::function cb); + +private: + class Impl; + Impl *impl; +}; +using RtdeClientPtr = std::shared_ptr; + +} // namespace aubo_sdk +} // namespace arcs + +#ifdef __cplusplus +extern "C" { +#endif + +ARCS_ABI arcs::aubo_sdk::RtdeClient *createRtdeClient(int mode = 0); +ARCS_ABI void destroyRtdeClient(arcs::aubo_sdk::RtdeClient *cli); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/third_party/AuboSdk/win/include/aubo_sdk/rtde_c.h b/third_party/AuboSdk/win/include/aubo_sdk/rtde_c.h new file mode 100644 index 00000000..527bf2d9 --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo_sdk/rtde_c.h @@ -0,0 +1,180 @@ +#ifndef AUBO_SDK_RTDE_C_H +#define AUBO_SDK_RTDE_C_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief 创建 RTDE 客户端实例。 + * + * @param mode 设置通讯方式,0 表示 TCP 通讯,1 表示 UDS 通讯。 + * @return 成功返回 RTDE 客户端句柄,失败返回 NULL。 + */ +ARCS_ABI RTDE_HANDLE rtde_create_client(int mode); + +/** + * @brief 销毁 RTDE 客户端实例。 + * + * @param cli RTDE 客户端句柄。 + */ +ARCS_ABI void rtde_destroy_client(RTDE_HANDLE cli); + +/** + * @brief 设置日志处理器。 + * + * @param cli RTDE 客户端句柄。 + * @param handler 日志处理函数。 + */ +ARCS_ABI void rtde_setLogHandler(RTDE_HANDLE cli, + void (*handler)(int level, + const char *filename, int line, + const char *message)); + +/** + * @brief 连接到服务器。 + * + * @param cli RTDE 客户端句柄。 + * @param ip IP 地址,NULL 表示使用默认地址。 + * @param port 端口号,0 表示使用默认端口。 + * @return 0 表示成功,-1 表示失败。 + */ +ARCS_ABI int rtde_connect(RTDE_HANDLE cli, const char *ip, int port); + +/** + * @brief 检查是否已连接。 + * + * @param cli RTDE 客户端句柄。 + * @return true 表示已连接,false 表示未连接。 + */ +ARCS_ABI bool rtde_hasConnected(RTDE_HANDLE cli); + +/** + * @brief 登录到服务器。 + * + * @param cli RTDE 客户端句柄。 + * @param username 用户名。 + * @param password 密码。 + * @return 0 表示成功,-1 表示失败。 + */ +ARCS_ABI int rtde_login(RTDE_HANDLE cli, const char *username, + const char *password); + +/** + * @brief 检查是否已登录。 + * + * @param cli RTDE 客户端句柄。 + * @return true 表示已登录,false 表示未登录。 + */ +ARCS_ABI bool rtde_hasLogined(RTDE_HANDLE cli); + +/** + * @brief 登出。 + * + * @param cli RTDE 客户端句柄。 + * @return 0 表示成功。 + */ +ARCS_ABI int rtde_logout(RTDE_HANDLE cli); + +/** + * @brief 断开连接。 + * + * @param cli RTDE 客户端句柄。 + * @return 0 表示成功,-1 表示失败。 + */ +ARCS_ABI int rtde_disconnect(RTDE_HANDLE cli); + +/** + * @brief 获取协议版本号。 + * + * @param cli RTDE 客户端句柄。 + * @return 协议版本号。 + */ +ARCS_ABI int rtde_getProtocolVersion(RTDE_HANDLE cli); + +/** + * @brief 设置话题。 + * + * @param cli RTDE 客户端句柄。 + * @param to_server 数据流向,true 表示客户端发送消息,false + * 表示服务器发送消息。 + * @param names 信息列表(逗号分隔的字符串)。 + * @param freq 推送频率。 + * @param expected_chanel 通道号。 + * @return 成功返回通道号,失败返回 -1。 + */ +ARCS_ABI int rtde_setTopic(RTDE_HANDLE cli, bool to_server, const char *names, + double freq, int expected_chanel); + +/** + * @brief 取消订阅。 + * + * @param cli RTDE 客户端句柄。 + * @param to_server 数据流向。 + * @param chanel 通道号。 + * @return 0 表示成功,-1 表示失败。 + */ +ARCS_ABI int rtde_removeTopic(RTDE_HANDLE cli, bool to_server, int chanel); + +/** + * @brief 订阅主题。 + * + * @param cli RTDE 客户端句柄。 + * @param chanel 通道号。 + * @param callback 回调函数,用于处理订阅的数据。 + * @return 0 表示成功,-1 表示失败。 + */ +ARCS_ABI int rtde_subscribe(RTDE_HANDLE cli, int chanel, + void (*callback)(void *parser)); + +/** + * @brief 发布数据。 + * + * @param cli RTDE 客户端句柄。 + * @param chanel 通道号。 + * @param callback 回调函数,用于生成发布数据。 + * @return 0 表示成功,-1 表示失败。 + */ +ARCS_ABI int rtde_publish(RTDE_HANDLE cli, int chanel, + void (*callback)(void *builder)); + +// OutputBuilder +ARCS_ABI int rtde_pushInt(OUTPUT_BUILDER_HANDLE builder, int val); +ARCS_ABI int rtde_pushDouble(OUTPUT_BUILDER_HANDLE builder, double val); +ARCS_ABI int rtde_pushVectorDouble(OUTPUT_BUILDER_HANDLE builder, const double* val, int size); +ARCS_ABI int rtde_pushTupleIntBool(OUTPUT_BUILDER_HANDLE builder, int first, bool second); +ARCS_ABI int rtde_pushInt16(OUTPUT_BUILDER_HANDLE builder, int16_t val); +ARCS_ABI int rtde_pushVectorInt16(OUTPUT_BUILDER_HANDLE builder, const int16_t* val, int size); +ARCS_ABI int rtde_pushVectorInt(OUTPUT_BUILDER_HANDLE builder, const int* val, int size); +ARCS_ABI int rtde_pushString(OUTPUT_BUILDER_HANDLE builder, const char* val); +ARCS_ABI int rtde_pushChar(OUTPUT_BUILDER_HANDLE builder, char val); +ARCS_ABI int rtde_pushRtdeRecipe(OUTPUT_BUILDER_HANDLE builder, const struct RtdeRecipe_C* val); + +// InputParser +ARCS_ABI bool rtde_popBool(INPUT_PARSER_HANDLE parser); +ARCS_ABI int32_t rtde_popInt32(INPUT_PARSER_HANDLE parser); +ARCS_ABI int64_t rtde_popInt64(INPUT_PARSER_HANDLE parser); +ARCS_ABI int16_t rtde_popInt16(INPUT_PARSER_HANDLE parser); +ARCS_ABI double rtde_popDouble(INPUT_PARSER_HANDLE parser); +ARCS_ABI char rtde_popChar(INPUT_PARSER_HANDLE parser); + +ARCS_ABI int rtde_popVectorInt(INPUT_PARSER_HANDLE* parser, int* data, int size); +ARCS_ABI int rtde_popVectorInt16(INPUT_PARSER_HANDLE parser, int16_t* data, int size); +ARCS_ABI int rtde_popVectorDouble(INPUT_PARSER_HANDLE parser, double* data, int size); +ARCS_ABI int rtde_popVectorVectorDouble(INPUT_PARSER_HANDLE parser, double*** data, int rows, int cols); + +ARCS_ABI JointStateType_C rtde_popVectorJointStateType(INPUT_PARSER_HANDLE parser); +ARCS_ABI RobotModeType_C rtde_popRobotModeType(INPUT_PARSER_HANDLE parser); +ARCS_ABI OperationalModeType_C rtde_popOperationalModeType(INPUT_PARSER_HANDLE parser); +ARCS_ABI SafetyModeType_C rtde_popSafetyModeType(INPUT_PARSER_HANDLE parser); +ARCS_ABI RuntimeState_C rtde_popRuntimeState(INPUT_PARSER_HANDLE parser); +ARCS_ABI int rtde_popRobotMsgVector(INPUT_PARSER_HANDLE parser, struct RobotMsgVector_C* robot_msg_vec); +ARCS_ABI int rtde_popPayload(INPUT_PARSER_HANDLE parser, struct Payload_C* payload); + +#ifdef __cplusplus +} +#endif + +#endif // AUBO_SDK_RTDE_C_H diff --git a/third_party/AuboSdk/win/include/aubo_sdk/runtime_machine_c.h b/third_party/AuboSdk/win/include/aubo_sdk/runtime_machine_c.h new file mode 100644 index 00000000..0afd4c75 --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo_sdk/runtime_machine_c.h @@ -0,0 +1,60 @@ +#ifndef AUBO_SDK_RuntimeMachine_C_H +#define AUBO_SDK_RuntimeMachine_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif + +ARCS_ABI int newTask(RUNTIME_MACHINE_HADNLER h, BOOL daemon); +ARCS_ABI int deleteTask(RUNTIME_MACHINE_HADNLER h, int tid); +ARCS_ABI int detachTask(RUNTIME_MACHINE_HADNLER h, int tid); +ARCS_ABI BOOL isTaskAlive(RUNTIME_MACHINE_HADNLER h, int tid); +ARCS_ABI int nop(RUNTIME_MACHINE_HADNLER h); +ARCS_ABI int switchTask(RUNTIME_MACHINE_HADNLER h, int tid); +ARCS_ABI int setLabel(RUNTIME_MACHINE_HADNLER h, int tid, const char *lineno); +ARCS_ABI int setPlanContext(RUNTIME_MACHINE_HADNLER h, int tid, int lineno, + const char *comment); +ARCS_ABI int gotoLine(RUNTIME_MACHINE_HADNLER h, int lineno); +ARCS_ABI int getAdvancePlanContext(RUNTIME_MACHINE_HADNLER h, int tid, + struct PlanContext_C *result); +ARCS_ABI int getAdvancePtr(RUNTIME_MACHINE_HADNLER h, int tid); +ARCS_ABI int getMainPtr(RUNTIME_MACHINE_HADNLER h, int tid); +ARCS_ABI int getInterpPtr(RUNTIME_MACHINE_HADNLER h, int tid); +ARCS_ABI int getPlanContext(RUNTIME_MACHINE_HADNLER h, int tid, + struct PlanContext_C *result); +ARCS_ABI int getExecutionStatus(RUNTIME_MACHINE_HADNLER h, + struct ExecutionStatus_C *result); +ARCS_ABI int getExecutionStatus1(RUNTIME_MACHINE_HADNLER h, + struct ExecutionStatus1_C *result); +ARCS_ABI int loadProgram(RUNTIME_MACHINE_HADNLER h, const char *program); +ARCS_ABI int runProgram(RUNTIME_MACHINE_HADNLER h); +ARCS_ABI int start(RUNTIME_MACHINE_HADNLER h); +ARCS_ABI int stop(RUNTIME_MACHINE_HADNLER h); +ARCS_ABI int abort1(RUNTIME_MACHINE_HADNLER h); +ARCS_ABI int pause(RUNTIME_MACHINE_HADNLER h); +ARCS_ABI int step(RUNTIME_MACHINE_HADNLER h); +ARCS_ABI int setResumeWait(RUNTIME_MACHINE_HADNLER h, BOOL wait); +ARCS_ABI int resume(RUNTIME_MACHINE_HADNLER h); +ARCS_ABI RuntimeState_C getStatus(RUNTIME_MACHINE_HADNLER h); +ARCS_ABI RuntimeState_C getRuntimeState(RUNTIME_MACHINE_HADNLER h); +ARCS_ABI int setBreakPoint(RUNTIME_MACHINE_HADNLER h, int lineno); +ARCS_ABI int removeBreakPoint(RUNTIME_MACHINE_HADNLER h, int lineno); +ARCS_ABI int clearBreakPoints(RUNTIME_MACHINE_HADNLER h); +ARCS_ABI int timerStart(RUNTIME_MACHINE_HADNLER h, const char *name); +ARCS_ABI int timerStop(RUNTIME_MACHINE_HADNLER h, const char *name); +ARCS_ABI int timerReset(RUNTIME_MACHINE_HADNLER h, const char *name); +ARCS_ABI int timerDelete(RUNTIME_MACHINE_HADNLER h, const char *name); +ARCS_ABI double getTimer(RUNTIME_MACHINE_HADNLER h, const char *name); +ARCS_ABI int triggBegin(RUNTIME_MACHINE_HADNLER h, double distance, + double delay); +ARCS_ABI int triggEnd(RUNTIME_MACHINE_HADNLER h); +ARCS_ABI int triggInterrupt(RUNTIME_MACHINE_HADNLER h, double distance, + double delay); +ARCS_ABI int getTriggInterrupts(RUNTIME_MACHINE_HADNLER h, int *result); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/win/include/aubo_sdk/script.h b/third_party/AuboSdk/win/include/aubo_sdk/script.h new file mode 100644 index 00000000..8cb97fe7 --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo_sdk/script.h @@ -0,0 +1,209 @@ +/** @file script.h + * @brief 用于SCRIPT模块的交互,如向服务器发送脚本 + */ +#ifndef AUBO_SDK_SCRIPT_H +#define AUBO_SDK_SCRIPT_H + +#include +#include +#include +#include + +namespace arcs { +namespace aubo_sdk { + +class ScriptWriter +{ +public: + virtual ~ScriptWriter() = default; + + virtual ScriptWriter &append(const std::string &line) = 0; + virtual ScriptWriter &append(const char *buf, size_t len) = 0; + virtual ScriptWriter &moveJoint() = 0; + virtual ScriptWriter &moveLine() = 0; + virtual ScriptWriter &ifCondition() = 0; + virtual ScriptWriter &elseCondition() = 0; + virtual ScriptWriter &elseIfCondition() = 0; + virtual ScriptWriter &whileCondition() = 0; + virtual ScriptWriter &end() = 0; +}; + +/// SCRIPT客户端 +class ARCS_ABI ScriptClient +{ +public: + enum Event + { + Connected, + Disconnected, + }; + + ScriptClient(int mode = 0); + ~ScriptClient(); + + /** + * 设置日志处理器 + * + * 此函数可设置自定义的日志处理函数来处理日志消息。 \n + * Aubo SDK 有一套默认的日志系统,按照默认的格式输出到默认的文件。 + * 如果用户不希望采用默认的格式或者不希望输出到默认的文件,那就可以通过这个接口重新自定义格式,或者输出路径。 + * 这个函数可以将用户自定义的日志系统与 Aubo SDK 默认的日志系统合并。 + * + * @note setLogHandler函数要放在即将触发的日志之前, + * 否则会按照默认的形式输出日志。 + * + * @param handler 日志处理函数 \n + * 此日志处理函数的下定义如下: \n + * void handler(int level, const char* filename, int line, const + * std::string& message) \n + * level 表示日志等级 \n + *   0: LOGLEVEL_FATAL 严重的错误 \n + *   1: LOGLEVEL_ERROR 错误 \n + *   2: LOGLEVEL_WARNING 警告 \n + *   3: LOGLEVEL_INFO 通知 \n + *   4: LOGLEVEL_DEBUG 调试 \n + *   5: LOGLEVEL_BACKTRACE 跟踪 \n + * filename 表示文件名 \n + * line 表示代码行号 \n + * message 表示日志信息 \n + * @return 无 + */ + void setLogHandler( + std::function + handler); + + /** + * 连接到服务器 + * + * @param ip IP地址 + * @param port 端口号。SCRIPT端口号为30004 + * @retval 0 连接成功 + * @retval 1 在执行函数前,已连接 + * @retval -1 连接失败 + */ + int connect(const std::string &ip = "", int port = 0); + + /** + * 是否处于连接状态 + * + * @retval true 已连接 + * @retval false 未连接 + */ + bool hasConnected() const; + + /** + * 登录 + * + * @param usrname 用户名 + * @param passwd 密码 + * @retval 0 成功 + * @retval -1 失败 + */ + int login(const std::string &usrname, const std::string &passwd); + + /** + * 返回客户端是否登录 + * + * @retval true 已登录 + * @retval false 未登录 + */ + bool hasLogined(); + + /** + * 登出 + * + * @return 0 + */ + int logout(); + + /** + * 断开连接 + * + * @retval 0 成功 + * @retval -1 失败 + */ + int disconnect(); + + /** + * 发送脚本文件 + * + * 远程调用机器人的脚本 + * + * @param path 文件在机器人端的路径 + * @retval 0 成功 + * @retval -1 失败 + */ + int sendFile(const std::string &path); + + /** + * 发送脚本内容 + * + * 调用本地的脚本 + * + * @param script 脚本内容 + * @retval 0 成功 + * @retval -1 失败 + */ + int sendString(const std::string &script); + + /** + * 使用ScriptWriter构建服务器脚本 + * + * @param chunck_name + * @param cb + * @retval 0 成功 + * @retval -1 失败 + */ + int send(const std::string &chunck_name, + std::function cb); + + /** + * 设置服务器脚本的全局变量 + * + * @param cb 脚本的全局变量 + * @return 0 + */ + int subscribeVariableUpdate( + std::function cb); + + /** + * 设置服务器脚本的错误码 + * + * @param cb 脚本的错误码 + * @return 0 + */ + ARCS_DEPRECATED int subscribeScriptError( + std::function cb); + + int subscribeScriptError2( + std::function cb); + + /** + * 设置事件处理 + * + * @param cb + * @return + */ + int setEventHandler(std::function cb); + +private: + class Impl; + Impl *impl; +}; +using ScriptClientPtr = std::shared_ptr; + +} // namespace aubo_sdk +} // namespace arcs + +#ifdef __cplusplus +extern "C" { +#endif + +ARCS_ABI arcs::aubo_sdk::ScriptClient *createScriptClient(int mode = 0); +ARCS_ABI void destroyScriptClient(arcs::aubo_sdk::ScriptClient *cli); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/third_party/AuboSdk/win/include/aubo_sdk/serial_c.h b/third_party/AuboSdk/win/include/aubo_sdk/serial_c.h new file mode 100644 index 00000000..bac17286 --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo_sdk/serial_c.h @@ -0,0 +1,32 @@ +#ifndef AUBO_SDK_Serial_C_H +#define AUBO_SDK_Serial_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI int serialOpen(SERIAL_HANDLER h, const char *device, int baud, + float stop_bits, int even, const char *serial_name); +ARCS_ABI int serialClose(SERIAL_HANDLER h, const char *serial_name); +ARCS_ABI int serialReadByte(SERIAL_HANDLER h, const char *variable, + const char *serial_name); +ARCS_ABI int serialReadByteList(SERIAL_HANDLER h, int number, + const char *variable, const char *serial_name); +ARCS_ABI int serialReadString(SERIAL_HANDLER h, const char *variable, + const char *serial_name, const char *prefix, + const char *suffix, BOOL interpret_escape); +ARCS_ABI int serialSendByte(SERIAL_HANDLER h, char value, + const char *serial_name); +ARCS_ABI int serialSendInt(SERIAL_HANDLER h, int value, + const char *serial_name); +ARCS_ABI int serialSendLine(SERIAL_HANDLER h, const char *str, + const char *serial_name); +ARCS_ABI int serialSendString(SERIAL_HANDLER h, const char *str, + const char *serial_name); +ARCS_ABI int serialSendAllString(SERIAL_HANDLER h, BOOL is_check, + const char *str, const char *serial_name); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/win/include/aubo_sdk/socket_c.h b/third_party/AuboSdk/win/include/aubo_sdk/socket_c.h new file mode 100644 index 00000000..ba95fa56 --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo_sdk/socket_c.h @@ -0,0 +1,38 @@ +#ifndef AUBO_SDK_Socket_C_H +#define AUBO_SDK_Socket_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI int socketOpen(SOCKET_HANDLER h, const char *address, int port, + const char *socket_name); +ARCS_ABI int socketClose(SOCKET_HANDLER h, const char *socket_name); +ARCS_ABI int socketReadAsciiFloat(SOCKET_HANDLER h, int number, + const char *variable, + const char *socket_name); +ARCS_ABI int socketReadBinaryInteger(SOCKET_HANDLER h, int number, + const char *variable, + const char *socket_name); +ARCS_ABI int socketReadByteList(SOCKET_HANDLER h, int number, + const char *variable, const char *socket_name); +ARCS_ABI int socketReadString(SOCKET_HANDLER h, const char *variable, + const char *socket_name, const char *prefix, + const char *suffix, BOOL interpret_escape); +ARCS_ABI int socketReadAllString(SOCKET_HANDLER h, const char *variable, + const char *socket_name); +ARCS_ABI int socketSendByte(SOCKET_HANDLER h, char value, + const char *socket_name); +ARCS_ABI int socketSendInt(SOCKET_HANDLER h, int value, + const char *socket_name); +ARCS_ABI int socketSendLine(SOCKET_HANDLER h, const char *str, + const char *socket_name); +ARCS_ABI int socketSendString(SOCKET_HANDLER h, const char *str, + const char *socket_name); +ARCS_ABI int socketSendAllString(SOCKET_HANDLER h, BOOL is_check, + const char *str, const char *socket_name); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/win/include/aubo_sdk/sync_move_c.h b/third_party/AuboSdk/win/include/aubo_sdk/sync_move_c.h new file mode 100644 index 00000000..2b8048f8 --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo_sdk/sync_move_c.h @@ -0,0 +1,22 @@ +#ifndef AUBO_SDK_SyncMove_C_H +#define AUBO_SDK_SyncMove_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI int syncMoveOn(SYNC_MOVE_HANDLER h, const char *syncident, + const char **taskset); +ARCS_ABI BOOL syncMoveSegment(SYNC_MOVE_HANDLER h, int id); +ARCS_ABI int syncMoveOff(SYNC_MOVE_HANDLER h, const char *syncident); +ARCS_ABI int syncMoveUndo(SYNC_MOVE_HANDLER h); +ARCS_ABI int waitSyncTasks(SYNC_MOVE_HANDLER h, const char *syncident, + const char **taskset); +ARCS_ABI BOOL isSyncMoveOn(SYNC_MOVE_HANDLER h); +ARCS_ABI int syncMoveSuspend(SYNC_MOVE_HANDLER h); +ARCS_ABI int syncMoveResume(SYNC_MOVE_HANDLER h); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/win/include/aubo_sdk/system_info_c.h b/third_party/AuboSdk/win/include/aubo_sdk/system_info_c.h new file mode 100644 index 00000000..7f37e318 --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo_sdk/system_info_c.h @@ -0,0 +1,18 @@ +#ifndef AUBO_SDK_SystemInfo_C_H +#define AUBO_SDK_SystemInfo_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI int getControlSoftwareVersionCode(SYSTEM_INFO_HANDLER h); +ARCS_ABI int getControlSoftwareFullVersion(SYSTEM_INFO_HANDLER h, char *result); +ARCS_ABI int getInterfaceVersionCode(SYSTEM_INFO_HANDLER h); +ARCS_ABI int getControlSoftwareBuildDate(SYSTEM_INFO_HANDLER h, char *result); +ARCS_ABI int getControlSoftwareVersionHash(SYSTEM_INFO_HANDLER h, char *result); +ARCS_ABI uint64_t getControlSystemTime(SYSTEM_INFO_HANDLER h); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/win/include/aubo_sdk/trace_c.h b/third_party/AuboSdk/win/include/aubo_sdk/trace_c.h new file mode 100644 index 00000000..fd46477a --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo_sdk/trace_c.h @@ -0,0 +1,20 @@ +#ifndef AUBO_SDK_Trace_C_H +#define AUBO_SDK_Trace_C_H +#include + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI int alarm(TRACE_HANDLER h, TraceLevel_C level, int code, + const char **args); +ARCS_ABI int popup(TRACE_HANDLER h, TraceLevel_C level, const char *title, + const char *msg, int mode); +ARCS_ABI int textmsg(TRACE_HANDLER h, const char *msg); +ARCS_ABI int notify(TRACE_HANDLER h, const char *msg); +ARCS_ABI int peek(TRACE_HANDLER h, uint64_t num, uint64_t last_time, + struct RobotMsg_C *result); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/win/include/aubo_sdk/type_def_c.h b/third_party/AuboSdk/win/include/aubo_sdk/type_def_c.h new file mode 100644 index 00000000..a60718c6 --- /dev/null +++ b/third_party/AuboSdk/win/include/aubo_sdk/type_def_c.h @@ -0,0 +1,750 @@ +#ifndef AUBO_SDK_TYPE_DEF_C_H +#define AUBO_SDK_TYPE_DEF_C_H +#include +#include +#include + +#ifdef _MSC_VER +#pragma execution_character_set("utf-8") +#endif + +/// Cartesion degree of freedom, 6 for x,y,z,rx,ry,rz +#define CARTESIAN_DOF 6 +#define SAFETY_PARAM_SELECT_NUM 2 /// normal + reduced +#define SAFETY_PLANES_NUM 8 /// 安全平面的数量 +#define SAFETY_CUBIC_NUM 10 /// 安全立方体的数量 +#define TOOL_CONFIGURATION_NUM 3 /// 工具配置数量 +#define MAX_DOF 7 /// 工具配置数量 +#define TRUE 1 +#define FALSE 0 + +typedef uint8_t BOOL; +typedef double Vector3d_C[3]; +typedef double Vector4d_C[4]; +typedef float Vector3f_C[3]; +typedef float Vector4f_C[4]; +typedef float Vector6f_C[6]; + +typedef void *RPC_HANDLER; +typedef void *RTDE_HANDLE; +typedef void *INPUT_PARSER_HANDLE; +typedef void *OUTPUT_BUILDER_HANDLE; +typedef void *MATH_HANDLER; +typedef void *SYSTEM_INFO_HANDLER; +typedef void *RUNTIME_MACHINE_HANDLER; +typedef void *REGISTER_CONTROL_HANDLER; +typedef void *RUNTIME_MACHINE_HADNLER; +typedef void *ROBOT_HANDLER; +typedef void *AXIS_HANDLER; +typedef void *SOCKET_HANDLER; +typedef void *SERIAL_HANDLER; +typedef void *SYNC_MOVE_HANDLER; +typedef void *TRACE_HANDLER; +typedef void *FORCE_CONTROL_HANDLER; +typedef void *IO_CONTROL_HANDLER; +typedef void *MOTION_CONTROL_HANDLER; +typedef void *ROBOT_ALGORITHM_HANDLER; +typedef void *ROBOT_MANAGE_HANDLER; +typedef void *ROBOT_CONFIG_HANDLER; +typedef void *ROBOT_STATE_HANDLER; + +typedef void (*LOG_HANDLER)(int /*level*/, const char * /*filename*/, + int /*line*/, const char * /*message*/); +typedef void (*EVENT_CALLBACK)(int /*event*/); + +struct RobotSafetyParameterRange_C +{ + uint32_t crc32{ 0 }; + + /// 最多可以保存2套参数, 默认使用第 0 套参数 + struct + { + float power; ///< sum of joint torques times joint angular speeds + float momentum; ///< 机器人动量限制 + float stop_time; ///< 停机时间 ms + float stop_distance; ///< 停机距离 m + float reduced_entry_time; ///< 进入缩减模式的最大时间 + float + reduced_entry_distance; ///< 进入缩减模式的最大距离(可由安全平面触发) + float tcp_speed; + float elbow_speed; + float tcp_force; + float elbow_force; + float qmin[MAX_DOF]; + float qmax[MAX_DOF]; + float qdmax[MAX_DOF]; + float joint_torque[MAX_DOF]; + Vector3f_C tool_orientation; ///< + float tool_deviation; + Vector4f_C planes[SAFETY_PLANES_NUM]; /// x,y,z,displacement + int restrict_elbow[SAFETY_PLANES_NUM]; + } params[SAFETY_PARAM_SELECT_NUM]; + + /// 8个触发平面 + struct + { + Vector4f_C plane; /// x,y,z,displacement + int restrict_elbow; + } trigger_planes[SAFETY_PLANES_NUM]; + + struct + { + Vector6f_C orig; ///< 立方块的原点 (x,y,z,rx,ry,rz) + Vector3f_C size; ///< 立方块的尺寸 (x,y,z) + int restrict_elbow; + } cubic[SAFETY_CUBIC_NUM]; ///< 10个安全空间 + + /// 3个工具 + Vector4f_C tools[TOOL_CONFIGURATION_NUM]; /// x,y,z,radius + + float tool_inclination{ 0. }; ///< 倾角 + float tool_azimuth{ 0. }; ///< 方位角 + float safety_home[MAX_DOF]; + + /// 可配置IO的输入输出安全功能配置 + uint32_t safety_input_emergency_stop; + uint32_t safety_input_safeguard_stop; + uint32_t safety_input_safeguard_reset; + uint32_t safety_input_auto_safeguard_stop; + uint32_t safety_input_auto_safeguard_reset; + uint32_t safety_input_three_position_switch; + uint32_t safety_input_operational_mode; + uint32_t safety_input_reduced_mode; + uint32_t safety_input_handguide; + + uint32_t safety_output_emergency_stop; + uint32_t safety_output_not_emergency_stop; + uint32_t safety_output_robot_moving; + uint32_t safety_output_robot_steady; + uint32_t safety_output_reduced_mode; + uint32_t safety_output_not_reduced_mode; + uint32_t safety_output_safe_home; + uint32_t safety_output_robot_not_stopping; + uint32_t safety_output_safetyguard_stop; + + int tp_3pe_for_handguide; ///< 是否将示教器三档位开关作为拖动功能开关 + int allow_manual_high_speed; ///< 手动模式下允许高速运行 +}; + +inline void RobotSafetyParameterRange_init( + struct RobotSafetyParameterRange_C *range) +{ + memset(range, 0, sizeof(struct RobotSafetyParameterRange_C)); + range->tp_3pe_for_handguide = 1; +} + +struct WObjectData_C +{ + /// 是否为外部工具 + bool remote_tool; + + /// 工件坐标系耦合的 + char attach_frame[100]; + + /// 用户坐标系 + /// 如果 robhold 为 false, 那 uframe 的数值是基于 world + /// 否则,uframe 的数值是基于 flange + double user_coord[6]; + + /// 工件坐标系,基于 uframe + double obj_coord[6]; +}; + +/// 接口函数返回值定义 +/// +/// 整数为警告,负数为错误,0为没有错误也没有警告 +#define ENUM_AuboErrorCodes_DECLARES \ + ENUM_ITEM(AUBO_OK, 0, "Success") \ + ENUM_ITEM(AUBO_BAD_STATE, 1, "State error") \ + ENUM_ITEM(AUBO_QUEUE_FULL, 2, "Planning queue full") \ + ENUM_ITEM(AUBO_BUSY, 3, "The previous command is executing") \ + ENUM_ITEM(AUBO_TIMEOUT, 4, "Timeout") \ + ENUM_ITEM(AUBO_INVL_ARGUMENT, 5, "Invalid parameters") \ + ENUM_ITEM(AUBO_NOT_IMPLETEMENT, 6, "Interface not implemented") \ + ENUM_ITEM(AUBO_NO_ACCESS, 7, "Cannot access") \ + ENUM_ITEM(AUBO_CONN_REFUSED, 8, "Connection refused") \ + ENUM_ITEM(AUBO_CONN_RESET, 9, "Connection is reset") \ + ENUM_ITEM(AUBO_INPROGRESS, 10, "Execution in progress") \ + ENUM_ITEM(AUBO_EIO, 11, "Input/Output error") \ + ENUM_ITEM(AUBO_NOBUFFS, 12, "") \ + ENUM_ITEM(AUBO_REQUEST_IGNORE, 13, "Request was ignored") \ + ENUM_ITEM(AUBO_ALGORITHM_PLAN_FAILED, 14, \ + "Motion planning algorithm error") \ + ENUM_ITEM(AUBO_VERSION_INCOMPAT, 15, "Interface version unmatch") \ + ENUM_ITEM(AUBO_DIMENSION_ERR, 16, \ + "Input parameter dimension is incorrect") \ + ENUM_ITEM(AUBO_SINGULAR_ERR, 17, "Input configuration may be singular") \ + ENUM_ITEM(AUBO_POS_BOUND_ERR, 18, \ + "Input position boundary exceeds the limit range") \ + ENUM_ITEM(AUBO_INIT_POS_ERR, 19, "Initial position input is unreasonable") \ + ENUM_ITEM(AUBO_ELP_SETTING_ERR, 20, "Envelope body setting error") \ + ENUM_ITEM(AUBO_TRAJ_GEN_FAIL, 21, "Trajectory generation failed") \ + ENUM_ITEM(AUBO_TRAJ_SELF_COLLISION, 22, "Trajectory self collision") \ + ENUM_ITEM( \ + AUBO_IK_NO_CONVERGE, 23, \ + "Inverse kinematics computation did not converge; computation failed") \ + ENUM_ITEM(AUBO_IK_OUT_OF_RANGE, 24, \ + "Inverse kinematics result out of robot range") \ + ENUM_ITEM(AUBO_IK_CONFIG_DISMATCH, 25, \ + "Inverse kinematics input configuration contains errors") \ + ENUM_ITEM(AUBO_IK_JACOBIAN_FAILED, 26, \ + "The calculation of the inverse Jacobian matrix failed") \ + ENUM_ITEM(AUBO_IK_NO_SOLU, 27, \ + "The target point has solutions, but it has exceeded the joint " \ + "limit conditions") \ + ENUM_ITEM(AUBO_IK_UNKOWN_ERROR, 28, "Inverse kinematics unkown error") \ + ENUM_ITEM(AUBO_ERR_UNKOWN, 99999, "Unkown error occurred.") + +// clang-format off +/** + * The RuntimeState enum + * + */ +#define ENUM_RuntimeState_DECLARES \ + ENUM_ITEM(Running, 0, "正在运行中") \ + ENUM_ITEM(Retracting, 1, "倒退") \ + ENUM_ITEM(Pausing, 2, "暂停中") \ + ENUM_ITEM(Paused, 3, "暂停状态") \ + ENUM_ITEM(Stepping, 4, "单步执行中") \ + ENUM_ITEM(Stopping, 5, "受控停止中(保持原有轨迹)") \ + ENUM_ITEM(Stopped, 6, "已停止") \ + ENUM_ITEM(Aborting, 7, "停止(最大速度关节运动停机)") + +/** + * @brief The RobotModeType enum + * + * 硬件强相关 + */ +#define ENUM_RobotModeType_DECLARES \ + ENUM_ITEM(NoController, -1, "提供给示教器使用的, 如果aubo_control进程崩溃则会显示为NoController") \ + ENUM_ITEM(Disconnected, 0, "没有连接到机械臂本体(控制器与接口板断开连接或是 EtherCAT 等总线断开)") \ + ENUM_ITEM(ConfirmSafety, 1, "正在进行安全配置, 断电状态下进行") \ + ENUM_ITEM(Booting, 2, "机械臂本体正在上电初始化") \ + ENUM_ITEM(PowerOff, 3, "机械臂本体处于断电状态") \ + ENUM_ITEM(PowerOn, 4, "机械臂本体上电成功, 刹车暂未松开(抱死), 关节初始状态未获取") \ + ENUM_ITEM(Idle, 5, "机械臂上电成功, 刹车暂未松开(抱死), 电机不通电, 关节初始状态获取完成") \ + ENUM_ITEM(BrakeReleasing, 6, "机械臂上电成功, 刹车正在松开") \ + ENUM_ITEM(BackDrive, 7, "反向驱动:刹车松开, 电机不通电") \ + ENUM_ITEM(Running, 8, "机械臂刹车松开, 运行模式, 控制权由硬件移交给软件") \ + ENUM_ITEM(Maintaince, 9, "维护模式: 包括固件升级、参数写入等") \ + ENUM_ITEM(Error, 10, "") \ + ENUM_ITEM(PowerOffing, 11, "机械臂本体处于断电过程中") + +#define ENUM_SafetyModeType_DECLARES \ + ENUM_ITEM(Undefined, 0, "安全状态待定") \ + ENUM_ITEM(Normal, 1, "正常运行模式") \ + ENUM_ITEM(ReducedMode, 2, "缩减运行模式") \ + ENUM_ITEM(Recovery, 3, "启动时如果在安全限制之外, 机器人将进入recovery模式") \ + ENUM_ITEM(Violation, 4, "超出安全限制(根据安全配置, 例如速度超限等)") \ + ENUM_ITEM(ProtectiveStop, 5, "软件触发的停机(保持轨迹, 不抱闸, 不断电)") \ + ENUM_ITEM(SafeguardStop, 6, "IO触发的防护停机(不保持轨迹, 抱闸, 不断电)") \ + ENUM_ITEM(SystemEmergencyStop,7, "系统急停:急停信号由外部输入(可配置输入), 不对外输出急停信号") \ + ENUM_ITEM(RobotEmergencyStop, 8, "机器人急停:控制柜急停输入或者示教器急停按键触发, 对外输出急停信号") \ + ENUM_ITEM(Fault, 9, "机械臂硬件故障或者系统故障") + //ValidateJointId + +/** + * 根据ISO 10218-1:2011(E) 5.7节 + * Automatic: In automatic mode, the robot shall execute the task programme and + * the safeguarding measures shall be functioning. Automatic operation shall be + * prevented if any stop condition is detected. Switching from this mode shall + * result in a stop. + */ +#define ENUM_OperationalModeType_DECLARES \ + ENUM_ITEM(Disabled, 0, "禁用模式: 不使用Operational Mode") \ + ENUM_ITEM(Automatic, 1, "自动模式: 机器人正常工作模式, 运行速度不会被限制") \ + ENUM_ITEM(Manual, 2, "手动模式: 机器人编程示教模式(T1), 机器人运行速度将会被限制或者机器人程序校验模式(T2)") + +/** + * 机器人的控制模式, 最终的控制对象 + */ +#define ENUM_RobotControlModeType_DECLARES \ + ENUM_ITEM(Unknown, 0, "未知的控制模式") \ + ENUM_ITEM(Position, 1, "位置控制 movej") \ + ENUM_ITEM(Speed, 2, "速度控制 speedj/speedl") \ + ENUM_ITEM(Servo, 3, "位置控制 servoj") \ + ENUM_ITEM(Freedrive, 4, "拖动示教 freedrive_mode") \ + ENUM_ITEM(Force, 5, "末端力控 force_mode") \ + ENUM_ITEM(Torque, 6, "关节力矩控制") \ + ENUM_ITEM(Collision, 7, "碰撞模式") + +#define ENUM_JointServoModeType_DECLARES \ + ENUM_ITEM(Unknown, -1, "未知") \ + ENUM_ITEM(Open, 0, "开环模式") \ + ENUM_ITEM(Current, 1, "电流伺服模式") \ + ENUM_ITEM(Velocity, 2, "速度伺服模式") \ + ENUM_ITEM(Position, 3, "位置伺服模式") \ + ENUM_ITEM(Torque, 4, "力矩伺服模式") + +#define ENUM_JointStateType_DECLARES \ + ENUM_ITEM(Poweroff, 0, "节点未连接到接口板或者已经断电") \ + ENUM_ITEM(Idle, 2, "节点空闲") \ + ENUM_ITEM(Fault, 3, "节点错误, 节点停止伺服运动, 刹车抱死") \ + ENUM_ITEM(Running, 4, "节点伺服") \ + ENUM_ITEM(Bootload, 5, "节点bootloader状态, 暂停一切通讯") + +#define ENUM_StandardInputAction_DECLARES \ + ENUM_ITEM(Default, 0, "无触发") \ + ENUM_ITEM(Handguide, 1, "拖动示教,高电平触发") \ + ENUM_ITEM(GoHome, 2, "运动到工程初始位姿,高电平触发") \ + ENUM_ITEM(StartProgram, 3, "开始工程,上升沿触发") \ + ENUM_ITEM(StopProgram, 4, "停止工程,上升沿触发") \ + ENUM_ITEM(PauseProgram, 5, "暂停工程,上升沿触发") \ + ENUM_ITEM(PopupDismiss, 6, "消除弹窗,上升沿触发") \ + ENUM_ITEM(PowerOn, 7, "机器人上电/松刹车,上升沿触发") \ + ENUM_ITEM(PowerOff, 8, "机器人抱死刹车/断电,上升沿触发") \ + ENUM_ITEM(ResumeProgram, 9, "恢复工程,上升沿触发") \ + ENUM_ITEM(SlowDown1, 10, "机器人减速触发1,高电平触发") \ + ENUM_ITEM(SlowDown2, 11, "机器人减速触发2,高电平触发") \ + ENUM_ITEM(SafeStop, 12, "安全停止,高电平触发") \ + ENUM_ITEM(RunningGuard, 13, "信号,高电平有效") \ + ENUM_ITEM(MoveToFirstPoint, 14, "运动到工程初始位姿,高电平触发") \ + ENUM_ITEM(xSlowDown1, 15, "机器人减速触发1,低电平触发") \ + ENUM_ITEM(xSlowDown2, 16, "机器人减速触发2,低电平触发") \ + ENUM_ITEM(ConveyorTrack, 17, "传送带检测到物品触发,高电平触发") \ + ENUM_ITEM(xConveyorTrack, 18, "传送带检测到物品触发,低电平触发") + +#define ENUM_StandardOutputRunState_DECLARES \ + ENUM_ITEM(None, 0, "标准输出状态未定义") \ + ENUM_ITEM(StopLow, 1, "低电平指示工程停止") \ + ENUM_ITEM(StopHigh, 2, "高电平指示机器人停止") \ + ENUM_ITEM(RunningHigh, 3, "指示工程正在运行") \ + ENUM_ITEM(PausedHigh, 4, "指示工程已经暂停") \ + ENUM_ITEM(AtHome, 5, "高电平指示机器人正在拖动") \ + ENUM_ITEM(Handguiding, 6, "高电平指示机器人正在拖动") \ + ENUM_ITEM(PowerOn, 7, "高电平指示机器人已经上电") \ + ENUM_ITEM(RobotEmergencyStop, 8, "高电平指示机器人急停按下") \ + ENUM_ITEM(SystemEmergencyStop, 9, "高电平指示外部输入系统急停按下") \ + ENUM_ITEM(InternalEmergencyStop, 8, "高电平指示机器人急停按下") \ + ENUM_ITEM(ExternalEmergencyStop, 9, "高电平指示外部输入系统急停按下") \ + ENUM_ITEM(SystemError, 10, "系统错误,包括故障、超限、急停、安全停止、防护停止 ") \ + ENUM_ITEM(NotSystemError, 11, "无系统错误,包括普通模式、缩减模式和恢复模式 ") \ + ENUM_ITEM(RobotOperable, 12, "机器人可操作,机器人上电且松刹车了 ") + +#define ENUM_SafetyInputAction_DECLARES \ + ENUM_ITEM(Unassigned, 0, "安全输入未分配动作") \ + ENUM_ITEM(EmergencyStop, 1, "安全输入触发急停") \ + ENUM_ITEM(SafeguardStop, 2, "安全输入触发防护停止, 边沿触发") \ + ENUM_ITEM(SafeguardReset, 3, "安全输入触发防护重置, 边沿触发") \ + ENUM_ITEM(ThreePositionSwitch, 4, "3档位使能开关") \ + ENUM_ITEM(OperationalMode, 5, "切换自动模式和手动模式") \ + ENUM_ITEM(HandGuide, 6, "拖动示教") \ + ENUM_ITEM(ReducedMode, 7, "安全参数切换1(缩减模式),序号越低优先级越高,三路输出都无效时,选用第0组安全参数") \ + ENUM_ITEM(AutomaticModeSafeguardStop, 8, "自动模式下防护停机输入(需要配置三档位使能设备)") \ + ENUM_ITEM(AutomaticModeSafeguardReset, 9, "自动模式下上升沿触发防护重置(需要配置三档位使能设备)") + +#define ENUM_SafetyOutputRunState_DECLARES \ + ENUM_ITEM(Unassigned, 0, "安全输出未定义") \ + ENUM_ITEM(SystemEmergencyStop, 1, "输出高当有机器人急停输入或者急停按键被按下") \ + ENUM_ITEM(NotSystemEmergencyStop, 2, "输出低当有机器人急停输入或者急停按键被按下") \ + ENUM_ITEM(RobotMoving, 3, "输出高当有关节运动速度超过 0.1rad/s") \ + ENUM_ITEM(RobotNotMoving, 4, "输出高当所有的关节运动速度不超过 0.1rad/s") \ + ENUM_ITEM(ReducedMode, 5, "输出高当机器人处于缩减模式") \ + ENUM_ITEM(NotReducedMode, 6, "输出高当机器人不处于缩减模式") \ + ENUM_ITEM(SafeHome, 7, "输出高当机器人已经处于安全Home位姿") \ + ENUM_ITEM(RobotNotStopping, 8, "输出低当机器人正在急停或者安全停止中") + +#define ENUM_PayloadIdentifyMoveAxis_DECLARES \ + ENUM_ITEM(Joint_2_6, 0,"第2和6关节运动") \ + ENUM_ITEM(Joint_3_6, 1,"第3和6关节运动") \ + ENUM_ITEM(Joint_4_6, 2,"第4和6关节运动") \ + ENUM_ITEM(Joint_4_5_6, 3,"第4、5、6关节运动") \ + +#define ENUM_EnvelopingShape_DECLARES \ + ENUM_ITEM(Cube, 1,"立方体") \ + ENUM_ITEM(Column, 2,"柱状体") \ + ENUM_ITEM(Stl, 3,"以STL文件的形式描述负载碰撞集合体") + +#define ENUM_TaskFrameType_DECLARES \ + ENUM_ITEM(NONE, 0,"") \ + ENUM_ITEM(POINT_FORCE, 1, "力控坐标系发生变换, 使得力控参考坐标系的y轴沿着机器人TCP指向力控所选特征的原点, x和z轴取决于所选特征的原始方向" \ + "力控坐标系发生变换, 使得力控参考坐标系的y轴沿着机器人TCP指向力控所选特征的原点, x和z轴取决于所选特征的原始方向" \ + "机器人TCP与所选特征的起点之间的距离至少为10mm" \ + "优先选择X轴, 为所选特征的X轴在力控坐标系Y轴垂直平面上的投影, 如果所选特征的X轴与力控坐标系的Y轴平行, " \ + "通过类似方法确定力控坐标系Z轴, Y-X或者Y-Z轴确定之后, 通过右手法则确定剩下的轴") \ + ENUM_ITEM(FRAME_FORCE, 2,"力控坐标系不发生变换 SIMPLE_FORC") \ + ENUM_ITEM(MOTION_FORCE, 3,"力控坐标系发生变换, 使得力控参考坐标系的x轴为机器人TCP速度在所选特征x-y平面上的投影y轴将垂直于机械臂运动, 并在所选特征的x-y平面内")\ + ENUM_ITEM(TOOL_FORCE, 4,"以工具末端坐标系作为力控参考坐标系") + +#ifdef ERROR +#undef ERROR +#endif + +#define ENUM_TraceLevel_DECLARES \ + ENUM_ITEM(FATAL, 0, "") \ + ENUM_ITEM(ERROR, 1, "") \ + ENUM_ITEM(WARNING, 2, "") \ + ENUM_ITEM(INFO, 3, "") \ + ENUM_ITEM(DEBUG, 4, "") + +#define ENUM_AxisModeType_DECLARES \ + ENUM_ITEM(NoController, -1, "提供给示教器使用的, 如果aubo_control进程崩溃则会显示为NoController") \ + ENUM_ITEM(Disconnected, 0, "未连接") \ + ENUM_ITEM(PowerOff, 1, "断电") \ + ENUM_ITEM(BrakeReleasing, 2, "刹车松开中") \ + ENUM_ITEM(Idle, 3, "空闲") \ + ENUM_ITEM(Running, 4, "运行中") \ + ENUM_ITEM(Fault, 5, "错误状态") + +#define ENUM_SafeguedStopType_DECLARES \ + ENUM_ITEM(None, 0, "无安全停止") \ + ENUM_ITEM(SafeguedStopIOInput, 1, "安全停止(IO输入)") \ + ENUM_ITEM(SafeguedStop3PE, 2, "安全停止(三态开关)") \ + ENUM_ITEM(SafeguedStopOperational, 3, "安全停止(操作模式)") +// clang-format on + +#define ENUM_ITEM(c, n, ...) c = n, +enum AuboErrorCodes_C : int +{ + ENUM_AuboErrorCodes_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) RuntimeState_##c = n, +enum RuntimeState_C : int +{ + ENUM_RuntimeState_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) RobotModeType_##c = n, +enum RobotModeType_C : int +{ + ENUM_RobotModeType_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) AxisModeType_##c = n, +enum AxisModeType_C : int +{ + ENUM_AxisModeType_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) SafetyModeType_##c = n, +enum SafetyModeType_C : int +{ + ENUM_SafetyModeType_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) OperationalModeType_##c = n, +enum OperationalModeType_C : int +{ + ENUM_OperationalModeType_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) RobotControlModeType_##c = n, +enum RobotControlModeType_C : int +{ + ENUM_RobotControlModeType_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) JointServoModeType_##c = n, +enum JointServoModeType_C : int +{ + ENUM_JointServoModeType_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) JointStateType_##c = n, +enum JointStateType_C : int +{ + ENUM_JointStateType_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) StandardOutputRunState_##c = n, +enum StandardOutputRunState_C : int +{ + ENUM_StandardOutputRunState_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) StandardInputAction_##c = n, +enum StandardInputAction_C : int +{ + ENUM_StandardInputAction_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) SafetyInputAction_##c = n, +enum SafetyInputAction_C : int +{ + ENUM_SafetyInputAction_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) SafetyOutputRunState_##c = n, +enum SafetyOutputRunState_C : int +{ + ENUM_SafetyOutputRunState_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) TaskFrameType_##c = n, +enum TaskFrameType_C +{ + ENUM_TaskFrameType_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) EnvelopingShape_##c = n, +enum EnvelopingShape_C : int +{ + ENUM_EnvelopingShape_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) PayloadIdentifyMoveAxis_##c = n, +enum PayloadIdentifyMoveAxis_C : int +{ + ENUM_PayloadIdentifyMoveAxis_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) TraceLevel_##c = n, +enum TraceLevel_C +{ + ENUM_TraceLevel_DECLARES +}; +#undef ENUM_ITEM + +#define ENUM_ITEM(c, n, ...) SafeguedStopType_##c = n, +enum SafeguedStopType_C : int +{ + ENUM_SafeguedStopType_DECLARES +}; +#undef ENUM_ITEM + +enum ForceControlState_C +{ + ForceControlState_Stopped, + ForceControlState_Starting, + ForceControlState_Stropping, + ForceControlState_Running +}; + +enum RefFrameType_C +{ + RefFrameType_None, /// + RefFrameType_Tool, ///< 工具坐标系 + RefFrameType_Path, ///< 轨迹坐标系 + RefFrameType_Base ///< 基坐标系 +}; + +/// 圆周运动参数定义 +struct CircleParameters_C +{ + double pose_via[6]; ///< 圆周运动途中点的位姿 + double pose_to[6]; ///< 圆周运动结束点的位姿 + double a; ///< 加速度, 单位: m/s^2 + double v; ///< 速度,单位: m/s + double blend_radius; ///< 交融半径,单位: m + double duration; ///< 运行时间,单位: s + double helix; + double spiral; + double direction; + int loop_times; ///< 暂不支持 +}; + +struct SpiralParameters_C +{ + double frame[6]; ///< 参考点,螺旋线的中心点和参考坐标系 + int plane; ///< 参考平面选择 0-XY 1-YZ 2-ZX + double angle; ///< 转动的角度,如果为正数,机器人逆时针旋转 + double spiral; ///< 正数外扩 + double helix; ///< 正数上升 +}; + +struct Enveloping_C +{ + EnvelopingShape_C shape; // 包络体形状 + double ep_args + [6]; // 包络体组合,shape为None或Stl时无需对ep_args赋值; + // shape为Cube时ep_args有9个元素,分别为xmin,xmax,ymin,ymax,zmin,zmax,rx,ry,rz; + // shape为Column时ep_args有5个元素,分别为radius,height,rx,ry,rz; + char stl_path[100]; // stl的路径(绝对路径),stl文件需为二进制文件, + // shape设置为Stl时,此项生效 +}; + +/// 用于负载辨识的轨迹配置 +struct TrajConfig_C +{ + Enveloping_C *envelopings; // 包络体组合 + PayloadIdentifyMoveAxis_C move_axis; // 运动的轴(ID), 下标从0开始 + double init_joint[MAX_DOF]; // 关节初始位置 + double upper_joint_bound[MAX_DOF]; // 运动轴上限 + double lower_joint_bound[MAX_DOF]; // 运动轴下限 + double max_velocity; // 关节运动的最大速度,默认值为 3.0 + double max_acceleration; // 关节运动的最大加速度,默认值为 5.0 +}; + +struct DHParam_C +{ + double theta[6]; + double beta[6]; + double d[6]; + double a[6]; + double alpha[6]; +}; + +struct DHComp_C +{ + double theta_comp[6]; + double beta_comp[6]; + double d_comp[6]; + double a_comp[6]; + double alpha_comp[6]; +}; + +struct Payload_C +{ + double mass; + double cog[3]; + double aom[3]; + double inertia[6]; +}; + +struct PlanContext_C +{ + int tid; + int lineno; + char comment[100]; +}; + +struct ExecutionStatus_C +{ + char name[100]; + char status[100]; +}; + +struct ExecutionStatus1_C +{ + char name[100]; + char status[100]; + int retval; +}; + +struct UpdateProcess_C +{ + char name[100]; + int process; +}; + +struct WorkObjectHold_C +{ + char module_name[100]; + double mounting_pose[][6]; +}; + +struct ForceSensorCalibResult_C +{ + double force_offset[6]; + double com[3]; + double mass; + double angle[6]; +}; + +// 动力学模型m,d,k +struct DynamicsModel_C +{ + double m[6]; + double d[6]; + double k[6]; +}; + +struct RobotMsg_C +{ + uint64_t timestamp; ///< 时间戳,即系统时间 + TraceLevel_C level; ///< 日志等级 + int code; ///< 错误码 + char source[100]; ///< 发送消息的机器人别名 alias + ///< 可在 /root/arcs_ws/config/aubo_control.conf + ///< 配置文件中查到机器人的alias + char** args; ///< 机器人参数(指针数组) + int args_count; ///< 参数数量 +}; + +struct RobotMsgVector_C +{ + struct RobotMsg_C *data; // 数组指针 + int size; // 数组元素个数 +} ; + +/// RTDE菜单 +struct RtdeRecipe_C +{ + bool to_server; ///< 输入/输出 + int chanel; ///< 通道 + double frequency; ///< 更新频率 + int trigger; ///< 触发方式(该功能暂未实现): 0 - 周期; 1 - 变化 + char **segments; ///< 字段列表 + int segments_count; ///< 字段数量 +}; + +/// 异常类型 +enum error_type_C +{ + parse_error = -32700, ///< 解析错误 + invalid_request = -32600, ///< 无效请求 + method_not_found = -32601, ///< 方法未找到 + invalid_params = -32602, ///< 无效参数 + internal_error = -32603, ///< 内部错误 + server_error, ///< 服务器错误 + invalid ///< 无效 +}; + +/// 异常码 +enum ExceptionCode_C +{ + EC_DISCONNECTED = -1, ///< 断开连接 + EC_NOT_LOGINED = -2, ///< 未登录 + EC_INVAL_SOCKET = -3, ///< 无效套接字 + EC_REQUEST_BUSY = -4, ///< 请求繁忙 + EC_SEND_FAILED = -5, ///< 发送失败 + EC_RECV_TIMEOUT = -6, ///< 接收超时 + EC_RECV_ERROR = -7, ///< 接收错误 + EC_PARSE_ERROR = -8, ///< 解析错误 + EC_INVALID_REQUEST = -9, ///< 无效请求 + EC_METHOD_NOT_FOUND = -10, ///< 方法未找到 + EC_INVALID_PARAMS = -11, ///< 无效参数 + EC_INTERNAL_ERROR = -12, ///< 内部错误 + EC_SERVER_ERROR = -13, ///< 服务器错误 + EC_INVALID = -14 ///< 无效 +}; + +inline const char *returnValue2Str(int retval) +{ + static const char *retval_str[] = { +#define ENUM_ITEM(n, v, s) s, + ENUM_AuboErrorCodes_DECLARES +#undef ENUM_ITEM + }; + + enum arcs_index_C + { +#define ENUM_ITEM(n, v, s) n##_INDEX, + ENUM_AuboErrorCodes_DECLARES +#undef ENUM_ITEM + }; + + int index = -1; + +#define ENUM_ITEM(n, v, s) \ + if (retval == v) \ + index = n##_INDEX; + ENUM_AuboErrorCodes_DECLARES +#undef ENUM_ITEM + + if (index == -1) + { + index = AUBO_ERR_UNKOWN; + } + + return retval_str[(unsigned)index]; +} + +#endif // AUBO_SDK_TYPE_DEF_C_H diff --git a/third_party/AuboSdk/win/include/robot_proxy/realtime_robot_state.h b/third_party/AuboSdk/win/include/robot_proxy/realtime_robot_state.h new file mode 100644 index 00000000..356dc3cc --- /dev/null +++ b/third_party/AuboSdk/win/include/robot_proxy/realtime_robot_state.h @@ -0,0 +1,477 @@ +#ifndef AUBO_SCOPE_REALTIME_ROBOT_STATE_H +#define AUBO_SCOPE_REALTIME_ROBOT_STATE_H + +#include +#include + +#include +#include + +namespace arcs { +namespace aubo_sdk { +using namespace common_interface; + +struct RobotInfo +{ + std::string robot_type_; + std::string robot_subtype_; + std::string cb_type_; + int dof_{ 6 }; + + Payload actual_payload_{ 0., std::vector(3, 0.), + std::vector(3, 0.), + std::vector(9, 0.) }; + + std::vector actual_q_{ std::vector(6, 0.) }; + std::vector actual_current_{ std::vector(6, 0.) }; + std::vector actual_TCP_pose_{ std::vector(6, 0.) }; + std::vector actual_TCP_speed_{ std::vector(6, 0.) }; + std::vector actual_tool_pose_{ std::vector(6, 0.) }; + std::vector actual_tcp_force_{ std::vector(6, 0.) }; + std::vector actual_tcp_force_sensor_{ std::vector(6, 0.) }; + + std::vector joint_voltages_{ std::vector(6, 0.) }; + std::vector joint_temperatures_{ std::vector(6, 0.) }; + std::vector joint_mode_{ std::vector( + 6, JointStateType::Idle) }; + RobotModeType robot_mode_{ RobotModeType::NoController }; + SafetyModeType safety_mode_{ SafetyModeType::Normal }; + OperationalModeType operational_mode_{ OperationalModeType::Disabled }; + bool link_mode_{ false }; + bool freedrive_enabled_{ false }; + + double actual_main_voltage_{ 0 }; + double actual_robot_voltage_{ 0 }; + double actual_robot_current_{ 0 }; + double cb_temperature_{ 0 }; + double cb_humidity_{ 0 }; + int collision_level_{ 0 }; + int slow_down_level_{ 0 }; + + std::string tool_uuid_; + std::string mb_uuid_; + std::string sb_uuid_; + std::string pedestal_uuid_; + std::vector joint_uuids_; + + std::string hardware_interface_verion_{ "" }; + + std::vector joint_fw_; + std::vector joint_hw_; + int tool_fw_; + int tool_hw_; + int m_ifb_fw_; + int m_ifb_hw_; + int s_ifb_fw_; + int s_ifb_hw_; + int pedestal_fw_; + int pedestal_hw_; + + int standardDigitalInputNum_{ 0 }; + int toolDigitalInputNum_{ 0 }; + int configurableDigitalInputNum_{ 0 }; + + int standardDigitalOutputNum_{ 0 }; + int toolDigitalOutputNum_{ 0 }; + int configurableDigitalOutputNum_{ 0 }; + + int standardAnalogInputNum_{ 0 }; + int toolAnalogInputNum_{ 0 }; + + int standardAnalogOutputNum_{ 0 }; + int toolAnalogOutputNum_{ 0 }; + int staticLinkInputNum_{ 0 }; + int staticLinkOutputNum_{ 0 }; + + std::unordered_map> dh_; + std::unordered_map> threory_dh_; + + std::vector standard_digital_input_data_{ std::vector(64, + false) }; + std::vector tool_digital_input_data_{ std::vector(64, false) }; + std::vector configurable_digital_input_data_{ std::vector( + 64, false) }; + std::vector link_digital_input_data_{ std::vector(64, false) }; + std::vector standard_digital_output_data_{ std::vector(64, + false) }; + std::vector tool_digital_output_data_{ std::vector(64, false) }; + std::vector configurable_digital_output_data_{ std::vector( + 64, false) }; + std::vector link_digital_output_data_{ std::vector(64, false) }; + + std::vector standard_analog_input_data_; + std::vector tool_analog_input_data_; + std::vector standard_analog_output_data_; + std::vector tool_analog_output_data_; + + std::vector joints_model_type_; + std::vector joint_max_positions_{ std::vector(6, 0.) }; + std::vector joint_min_positions_{ std::vector(6, 0.) }; + std::vector joint_max_speeds_{ std::vector(6, 0.) }; + std::vector joint_max_accelerations_{ std::vector(6, 0.) }; + std::vector tcp_max_speeds_{ std::vector(6, 0.) }; + std::vector tcp_max_accelerations_{ std::vector(6, 0.) }; + std::vector gravity_{ std::vector{ 0, 0, -9.81 } }; + + bool simulation_enabled_{ false }; + double speed_fraction_{ 0 }; + quint32 handle_io_status_{ 0 }; +}; + +class ARCS_ABI RealtimeRobotState : public QObject +{ + Q_OBJECT + friend class RobotProxy; + +public: + RealtimeRobotState(RpcClientPtr client, RtdeClientPtr rtde); + + ~RealtimeRobotState(); + + int updateRobotInformationOnLogin(); + int updateRobotInformationOnPoweron(int robot_index = -1); + int updateHDParamOnRobotTypeChanged(int robot_index = -1); + + std::vector getRobotNames() const; + + int getLineNumber(); + /// 弃用,只能返回主线程号 + ARCS_DEPRECATED int getThreadID(); + + RuntimeState getRuntimeState(); + + int getDof(); + + bool isSimulationEnabled(); + double getSpeedFraction(); + + std::string getRobotType() const; + std::string getRobotSubType() const; + std::string getControlBoxType() const; + + OperationalModeType getOperationalMode() const; + bool isLinkModeEnabled() const; + bool isFreedriveEnabled() const; + int getSlowDownLevel() const; + + int updateOperationMode(int robot_index); + int updateIsLinkModeEnabled(int robot_index); + + // 获取机器人的模式状态 + RobotModeType getRobotModeType(); + + // 获取安全模式 + SafetyModeType getSafetyModeType(); + + // 获取TCP的位姿 + std::vector getTcpPose(); + + // 获取工具端的位姿(不带TCP偏移) + std::vector getToolPose(); + + // 获取TCP速度 + std::vector getTcpSpeed(); + + // 获取TCP的力/力矩 + std::vector getTcpForce(); + std::vector getTcpForce(const std::vector &pose); + + std::vector getTcpForceSensor(); + + // 获取肘部的位置 + std::vector getElbowPosistion(); + + // 获取肘部速度 + std::vector getElbowVelocity(); + + // 获取基座力/力矩 + std::vector getBaseForce(); + + // 获取TCP目标位姿 + std::vector getTcpTargetPose(); + + // 获取TCP目标速度 + std::vector getTcpTargetSpeed(); + + // 获取TCP目标力/力矩 + std::vector getTcpTargetForce(); + + // 获取机械臂关节标志接口 + std::vector getJointState(); + + // 获取关节的伺服状态 + std::vector getJointServoMode(); + + // 获取实际负载 + Payload getPayload(); + + // 获取机械臂关节角度接口 + std::vector getJointPositions(); + + // 获取机械臂关节速度接口 + std::vector getJointSpeeds(); + + // 获取机械臂关节加速度接口 + std::vector getJointAccelerations(); + + // 获取机械臂关节力矩接口 + std::vector getJointTorqueSensors(); + + // 获取底座力传感器读数 + std::vector getBaseForceSensor(); + + // 获取TCP力传感器读数 + std::vector getTcpForceSensors(); + + // 获取机械臂关节电流接口 + std::vector getJointCurrents(); + + // 获取机械臂关节电压接口 + std::vector getJointVoltages(); + + // 获取机械臂关节温度接口 + std::vector getJointTemperatures(); + + // 获取关节固件版本 + std::vector getJointFirmwareVersions(); + + // 获取关节硬件版本 + std::vector getJointHardwareVersions(); + + std::string getToolUniqueId(); + std::string getMasterBoardUniqueId(); + std::string getSlaveBoardUniqueId(); + std::string getPedestalUniqueId(); + std::vector getJointUniqueIds(); + + // 获取新老协议区分 + std::string getHardwareInterfaceVersion(); + + // 获取 MasterBoard 固件版本 + int getMasterBoardFirmwareVersion(); + + // 获取 MasterBoard 硬件版本 + int getMasterBoardHardwareVersion(); + + // 获取 SlaveBoard 固件版本 + int getSlaveBoardFirmwareVersion(); + + // 获取 SlaveBoard 硬件版本 + int getSlaveBoardHardwareVersion(); + + // 获取工具端固件版本 + int getToolFirmwareVersion(); + + // 获取工具端硬件版本 + int getToolHardwareVersion(); + + // 获取 Pedestal 固件版本 + int getPedestalFirmwareVersion(); + + // 获取 Pedestal 硬件版本 + int getPedestalHardwareVersion(); + + // 获取机械臂关节目标位置角度接口 + std::vector getJointTargetPositions(); + + // 获取机械臂关节目标速度 + std::vector getJointTargetSpeeds(); + + // 获取机械臂关节目标加速度 + std::vector getJointTargetAccelerations(); + + // 获取机械臂关节目标力矩 + std::vector getJointTargetTorques(); + + // 获取机械臂关节目标电流 + std::vector getJointTargetCurrents(); + + // 获取关节最大位置(物理极限) + std::vector getJointMaxPositions(); + + // 获取关节最小位置(物理极限) + std::vector getJointMinPositions(); + + // 获取关节最大速度(物理极限) + std::vector getJointMaxSpeeds(); + + // 获取关节最大加速度(物理极限) + std::vector getJointMaxAccelerations(); + + // 获取TCP最大速度(物理极限) + std::vector getTcpMaxSpeeds(); + + // 获取TCP最大加速度(物理极限) + std::vector getTcpMaxAccelerations(); + + // 获取控制柜温度 + double getControlBoxTemperature(); + + // 获取控制柜湿度 + double getControlBoxHumidity(); + + // 获取母线电压 + double getMainVoltage(); + + // 获取母线电流 + double getMainCurrent(); + + int getCollisionLevel(); + + // 获取机器人电压 + double getRobotVoltage(); + + // 获取机器人电流 + double getRobotCurrent(); + + // 获取手柄 IO 状态 + uint32_t getHandleIoStatus(); + + int getStandardDigitalInputNum(); + int getToolDigitalInputNum(); + int getConfigurableDigitalInputNum(); + + int getStandardDigitalOutputNum(); + int getToolDigitalOutputNum(); + int getConfigurableDigitalOutputNum(); + + int getStandardAnalogInputNum(); + int getToolAnalogInputNum(); + + int getStandardAnalogOutputNum(); + int getToolAnalogOutputNum(); + + SafetyInputAction getConfigurableInputAction(int index); + SafetyOutputRunState getConfigurableOutputRunstate(int index); + + int setStandardDigitalInputAction(int index, StandardInputAction action); + int setToolDigitalInputAction(int index, StandardInputAction action); + int setConfigurableDigitalInputAction(int index, + StandardInputAction action); + + StandardInputAction getStandardDigitalInputAction(int index); + StandardInputAction getToolDigitalInputAction(int index); + StandardInputAction getConfigurableDigitalInputAction(int index); + + int setStandardDigitalOutputRunstate(int index, + StandardOutputRunState runstate); + int setToolDigitalOutputRunstate(int index, + StandardOutputRunState runstate); + int setConfigurableDigitalOutputRunstate(int index, + StandardOutputRunState runstate); + StandardOutputRunState getStandardDigitalOutputRunstate(int index); + StandardOutputRunState getToolDigitalOutputRunstate(int index); + StandardOutputRunState getConfigurableDigitalOutputRunstate(int index); + + int setStandardAnalogOutputRunstate(int index, + StandardOutputRunState runstate); + int setToolAnalogOutputRunstate(int index, StandardOutputRunState runstate); + + StandardOutputRunState getStandardAnalogOutputRunstate(int index); + StandardOutputRunState getToolAnalogOutputRunstate(int index); + + int setStandardAnalogInputDomain(int index, int domain); + int setToolAnalogInputDomain(int index, int domain); + + int getStandardAnalogInputDomain(int index); + int getToolAnalogInputDomain(int index); + + int setStandardAnalogOutputDomain(int index, int domain); + int setToolAnalogOutputDomain(int index, int domain); + + int getStandardAnalogOutputDomain(int index); + int getToolAnalogOutputDomain(int index); + + int setStandardDigitalOutput(int index, bool value); + int setToolDigitalOutput(int index, bool value); + int setConfigurableDigitalOutput(int index, bool value); + + int setStandardAnalogOutput(int index, double value); + int setToolAnalogOutput(int index, double value); + + bool getStandardDigitalInput(int index); + bool getToolDigitalInput(int index); + bool getConfigurableDigitalInput(int index); + + bool getStandardDigitalOutput(int index); + bool getToolDigitalOutput(int index); + bool getConfigurableDigitalOutput(int index); + + double getStandardAnalogInput(int index); + double getToolAnalogInput(int index); + + double getStandardAnalogOutput(int index); + double getToolAnalogOutput(int index); + + int getStaticLinkInputNum(); + int getStaticLinkOutputNum(); + bool getStaticLinkInput(int index); + bool getStaticLinkOutput(int index); + + int configSubscribe(); + int selectRobot(int index); + + void reset(); + + void updateModbusSignalNames(); + void addModbusSignalName(const std::string &name); + void removeModbusSignalName(const std::string &name); + std::vector getModbusSignalNames() const; + std::vector getModbusSignalValues() const; + std::vector getModbusSignalErrors() const; + std::vector getGravity(); + std::unordered_map> getRealDHParam(); + std::unordered_map> getTheoryDHParam(); + + int updateGravity(int robot_index); + + int startTrackRecord( + const std::function & /*q*/, + const std::vector & /*pose*/)> &cb, + double interval = 0.1); + + int stopTrackRecord(); + + // 获取关节类型 + std::vector getJointsModelType(); + +signals: + void interfaceBoardVersionInfoUpdated(int robot_index); + void jointVersionInfoUpdated(int robot_index); + void runtimeStateChanged(arcs::common_interface::RuntimeState state); + void safetyModeChanged(int robot_index, + arcs::common_interface::SafetyModeType mode); + void robotModeChanged(int robot_index, + arcs::common_interface::RobotModeType mode); + +private: + RpcClientPtr rpc_client_{ nullptr }; + RtdeClientPtr rtde_client_{ nullptr }; + mutable std::mutex rtde_mtx_; + + std::vector names_; + std::string name_; + int robot_index_{ -1 }; + + int tid_{ -1 }; + int line_{ -1 }; + RuntimeState runtime_state_{ RuntimeState::Stopped }; + + std::vector modbus_signals_; + std::vector modbus_signals_errors_; + std::vector modbus_names_; + + RobotInfo info_[4]; + + std::function &, + const std::vector &)> + track_record_callback_; + int track_record_sample_cnt_{ 0 }; + int track_record_sample_index_{ 0 }; +}; + +using RealtimeRobotStatePtr = std::shared_ptr; + +} // namespace aubo_sdk +} // namespace arcs +#endif diff --git a/third_party/AuboSdk/win/include/robot_proxy/robot_proxy.h b/third_party/AuboSdk/win/include/robot_proxy/robot_proxy.h new file mode 100644 index 00000000..ff8f2842 --- /dev/null +++ b/third_party/AuboSdk/win/include/robot_proxy/robot_proxy.h @@ -0,0 +1,263 @@ +#ifndef AUBO_SCOPE_ROBOT_PROXY_H +#define AUBO_SCOPE_ROBOT_PROXY_H + +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include + +namespace arcs { +namespace aubo_sdk { +class RtdeClient; +class ScriptClient; +class RpcClient; +using RtdeClientPtr = std::shared_ptr; +using ScriptClientPtr = std::shared_ptr; +using RpcClientPtr = std::shared_ptr; + +using arcs::common_interface::ForceControlPtr; +using arcs::common_interface::IoControlPtr; +using arcs::common_interface::MotionControlPtr; +using arcs::common_interface::RegisterControlPtr; +using arcs::common_interface::RobotAlgorithmPtr; +using arcs::common_interface::RobotConfigPtr; +using arcs::common_interface::RobotInterfacePtr; +using arcs::common_interface::RobotManagePtr; +using arcs::common_interface::RobotStatePtr; +using arcs::common_interface::RuntimeMachinePtr; +using arcs::common_interface::SyncMovePtr; +using arcs::common_interface::SystemInfoPtr; +using arcs::common_interface::TracePtr; + +using RobotInterface = common_interface::RobotInterface; + +/** + * 单个机器人代理接口类 + */ +class ARCS_ABI RobotProxy : public QObject +{ + Q_OBJECT + +public: + RobotProxy(QObject *parent = NULL); + ~RobotProxy(); + + /// 获取当前机器人的名称 + QString getRobotName() const; + + /// 获取当前机器人在所有机器人中的索引 + int getRobotIndex() const; + + /// 获取所有机器人的名字 + std::vector getRobotNames(); + + /// 连接到当前机器人 + int connect(const QString &ip, int port); + + /// 连接到当前机器人 + int nonblock_connect(const QString &ip, int port, + std::function cb); + int nonblock_connect2(const QString &ip, int port, + std::function cb); + + /// 登录到当前机器人 + int login(const QString &usrname, const QString &passwd); + + /// 断开与机器人的连接,如果不指定名称,则断开当前选中的机器人 + int disconnectFromServer(); + + /// 机器人是否已经连接,如果不指定名称,则断开当前选中的机器人 + bool hasConnected(); + + /// 机器人是否已经登录,如果不指定名称,则断开当前选中的机器人 + bool hasLogined(); + + /// 发送脚本程序到当前机器人 + int sendScript(const std::string &script); + + /// 获取当前机器人的脚本程序 + std::string getScript() const; + + /// 使用 RealtimeRobotState 中的 getRealDHParam getTheoryDHParam 替代 + ARCS_DEPRECATED std::unordered_map> getDH( + bool real = true); + + SystemInfoPtr getSystemInfo(); + RuntimeMachinePtr getRuntimeMachine(); + RegisterControlPtr getRegisterControl(); + + /// 获取RobotConfig接口 + RobotConfigPtr getRobotConfig(); + + /// 获取运动规划接口 + MotionControlPtr getMotionControl(); + + /// 获取力控接口 + ForceControlPtr getForceControl(); + + /// 获取IO控制的接口 + IoControlPtr getIoControl(); + + /// 获取同步运动接口 + SyncMovePtr getSyncMove(); + + /// 获取机器人实用算法接口 + RobotAlgorithmPtr getRobotAlgorithm(); + + /// 获取机器人管理接口(上电、启动、停止等) + RobotManagePtr getRobotManage(); + + /// 获取机器人状态接口 + RobotStatePtr getRobotState(); + + RealtimeRobotStatePtr getRealTimeState(); + + /// 获取告警信息接口 + TracePtr getTrace(); + + /// 根据机器人名字获取机器人接口 + RobotInterfacePtr getRobotInterface(const std::string &name); + + /// 切换机器人 + int selectRobot(int index); + + aubo_sdk::RpcClientPtr getRpcClient(); + aubo_sdk::RtdeClientPtr getRtdeClient(); + aubo_sdk::ScriptClientPtr getScriptClient(); + + /// 通过错误码获取消息文本 + QString getErrorCodeMsg(int code); + + /// 获取 ICM 连接状态 + bool icmIsConnected(); + + /// 获取 Profinet 地址表数据 + std::vector> getPnAddressData(); + +signals: + // FIXME: 断开连接和登出的信号需要从 RobotProxy 类主动发出 + + /// 建立连接的信号 + void connected(const QString &ip, int port); + + /// 断开连接的信号 + void disconnected(); + + /// 登录或者登出 + void logined(bool has_login); + + /// 弹窗信号 + void popup(int robot_index, int level, const QString &title, + const QString &msg, int mode); + + /// 解除弹窗信号 + void popupDismiss(const QString &src); + + /// 从控制器层上传的系统关机信号 + void systemHalt(const QString &src); + + /// 已弃用,推荐使用下面的重载函数 + ARCS_DEPRECATED void scriptError(const QString &); + /// aubo_control 报错 + void scriptError(int lineno, const QString &error); + /// 脚本运行报错 + void scriptError2(const QString &, const QString &); + + /// 脚本运行时里面的变量发生变化 + void variableUpdate(const QString &, const QString &); + + /// 运行时状态发生变化 + void runtimeStateChanged(arcs::common_interface::RuntimeState state); + + /// 拖动示教器使能状态切换 + void freedriveEnabled(int robot_index, bool enabled); + + /// 接收到机器人控制端消息 + void robotMessageRecieved(int robot_index, QString src, int level, int code, + const QString &msg); + void robotMessageRecieved(int robot_index, const QString &src, int level, + const RobotMsg &msg); + + /// 操作模式切换 + void operationalModeChanged( + int robot_index, arcs::common_interface::OperationalModeType mode); + + /// 联动模式切换 + void linkModeChanged(int robot_index, bool enable); + + /// 安全模式切换 + void safetyModeChanged(int robot_index, + arcs::common_interface::SafetyModeType mode); + + /// 机器人状态切换 + void robotModeChanged(int robot_index, + arcs::common_interface::RobotModeType mode); + + /// 机器人型号切换 + void robotTypeChanged(const QString &type, const QString &subtype); + + /// 缓速切换 + void slowDownChanged(int robot_index, int level); + + /// 运行时上下文更新 + void runtimeContextUpdated(int tid, int lineno, int index, + const QString &comment); + void interpContextUpdated(int tid, int lineno, int index, + const QString &comment); + + /// ICM 插件状态变化 + void icmStatusChanged(bool status); + + /// Modbus master + void modbusSignalCreated(const QString &name); + void modbusSignalRemoved(const QString &name); + + void jointMovedDuringPoweroff(int robot_index); + void robotCollisionOccurred(int robot_index, const QString &msg); + +private: + RobotInterfacePtr currentRobotRpcInterface(); + void robotMessageCallback(InputParser &parser); + void sendDisconnectedSignal(); + void initPNCacheData(); + void pnValueChanged(const std::vector &data); + +private: + QString name_; + int robot_index_{ -1 }; + std::vector robot_names_; + + std::string ip_; + int port_; + + aubo_sdk::RpcClientPtr rpc_client_{ nullptr }; + aubo_sdk::RtdeClientPtr rtde_client_{ nullptr }; + aubo_sdk::ScriptClientPtr script_client_{ nullptr }; + + RealtimeRobotStatePtr rt_state_{ nullptr }; + + bool initiallized_{ false }; + + QMap script_; + + bool icm_connected_{ false }; + bool pn_connected_{ false }; + + // Profinet 地址表数据 + std::shared_mutex mtx_pn_address_; + std::vector> cache_pn_address_; +}; +using RobotProxyPtr = std::shared_ptr; + +} // namespace aubo_sdk +} // namespace arcs +Q_DECLARE_METATYPE(arcs::aubo_sdk::RobotProxyPtr) +#endif diff --git a/third_party/AuboSdk/win/include/robotiomatetype.h b/third_party/AuboSdk/win/include/robotiomatetype.h new file mode 100644 index 00000000..6b867005 --- /dev/null +++ b/third_party/AuboSdk/win/include/robotiomatetype.h @@ -0,0 +1,103 @@ +#ifndef ROBOTIOMATETYPE_H +#define ROBOTIOMATETYPE_H + +//接口板用户DI 名称定义 +#define UESR_IO_DI_00_NAME "U_DI_00" +#define UESR_IO_DI_01_NAME "U_DI_01" +#define UESR_IO_DI_02_NAME "U_DI_02" +#define UESR_IO_DI_03_NAME "U_DI_03" +#define UESR_IO_DI_04_NAME "U_DI_04" +#define UESR_IO_DI_05_NAME "U_DI_05" +#define UESR_IO_DI_06_NAME "U_DI_06" +#define UESR_IO_DI_07_NAME "U_DI_07" +#define UESR_IO_DI_10_NAME "U_DI_10" +#define UESR_IO_DI_11_NAME "U_DI_11" +#define UESR_IO_DI_12_NAME "U_DI_12" +#define UESR_IO_DI_13_NAME "U_DI_13" +#define UESR_IO_DI_14_NAME "U_DI_14" +#define UESR_IO_DI_15_NAME "U_DI_15" +#define UESR_IO_DI_16_NAME "U_DI_16" +#define UESR_IO_DI_17_NAME "U_DI_17" + +//接口板用户DI 地址定义 +#define UESR_IO_DI_00_ADDR 0X24 +#define UESR_IO_DI_01_ADDR 0X25 +#define UESR_IO_DI_02_ADDR 0X26 +#define UESR_IO_DI_03_ADDR 0X27 +#define UESR_IO_DI_04_ADDR 0X28 +#define UESR_IO_DI_05_ADDR 0X29 +#define UESR_IO_DI_06_ADDR 0X2A +#define UESR_IO_DI_07_ADDR 0X2B +#define UESR_IO_DI_10_ADDR 0X2C +#define UESR_IO_DI_11_ADDR 0X2D +#define UESR_IO_DI_12_ADDR 0X2E +#define UESR_IO_DI_13_ADDR 0X2F +#define UESR_IO_DI_14_ADDR 0X30 +#define UESR_IO_DI_15_ADDR 0X31 +#define UESR_IO_DI_16_ADDR 0X32 +#define UESR_IO_DI_17_ADDR 0X33 + + +//接口板用户DO 名称定义 +#define UESR_IO_DO_00_NAME "U_DO_00" +#define UESR_IO_DO_01_NAME "U_DO_01" +#define UESR_IO_DO_02_NAME "U_DO_02" +#define UESR_IO_DO_03_NAME "U_DO_03" +#define UESR_IO_DO_04_NAME "U_DO_04" +#define UESR_IO_DO_05_NAME "U_DO_05" +#define UESR_IO_DO_06_NAME "U_DO_06" +#define UESR_IO_DO_07_NAME "U_DO_07" +#define UESR_IO_DO_10_NAME "U_DO_10" +#define UESR_IO_DO_11_NAME "U_DO_11" +#define UESR_IO_DO_12_NAME "U_DO_12" +#define UESR_IO_DO_13_NAME "U_DO_13" +#define UESR_IO_DO_14_NAME "U_DO_14" +#define UESR_IO_DO_15_NAME "U_DO_15" +#define UESR_IO_DO_16_NAME "U_DO_16" +#define UESR_IO_DO_17_NAME "U_DO_17" + +//接口板用户DO 地址定义 +#define UESR_IO_DO_00_ADDR 0X20 +#define UESR_IO_DO_01_ADDR 0X21 +#define UESR_IO_DO_02_ADDR 0X22 +#define UESR_IO_DO_03_ADDR 0X23 +#define UESR_IO_DO_04_ADDR 0X24 +#define UESR_IO_DO_05_ADDR 0X25 +#define UESR_IO_DO_06_ADDR 0X26 +#define UESR_IO_DO_07_ADDR 0X27 +#define UESR_IO_DO_10_ADDR 0X28 +#define UESR_IO_DO_11_ADDR 0X29 +#define UESR_IO_DO_12_ADDR 0X2A +#define UESR_IO_DO_13_ADDR 0X2B +#define UESR_IO_DO_14_ADDR 0X2C +#define UESR_IO_DO_15_ADDR 0X2D +#define UESR_IO_DO_16_ADDR 0X2E +#define UESR_IO_DO_17_ADDR 0X2F + + +//接口板用户AI 名称定义 +#define UESR_IO_AI_00_NAME "VI0" +#define UESR_IO_AI_01_NAME "VI1" +#define UESR_IO_AI_02_NAME "VI2" +#define UESR_IO_AI_03_NAME "VI3" + +//接口板用户AI 地址定义 +#define UESR_IO_AI_00_ADDR 0X00 +#define UESR_IO_AI_01_ADDR 0X01 +#define UESR_IO_AI_02_ADDR 0X02 +#define UESR_IO_AI_03_ADDR 0X03 + +//接口板用户AI 名称定义 +#define UESR_IO_AO_00_NAME "VO0" +#define UESR_IO_AO_01_NAME "VO1" +#define UESR_IO_AO_02_NAME "VO2" +#define UESR_IO_AO_03_NAME "VO3" + +//接口板用户AI 地址定义 +#define UESR_IO_AO_00_ADDR 0X00 +#define UESR_IO_AO_01_ADDR 0X01 +#define UESR_IO_AO_02_ADDR 0X02 +#define UESR_IO_AO_03_ADDR 0X03 + + +#endif // ROBOTIOMATETYPE_H diff --git a/third_party/AuboSdk/win/include/rsdef.h b/third_party/AuboSdk/win/include/rsdef.h new file mode 100644 index 00000000..bf34a7bf --- /dev/null +++ b/third_party/AuboSdk/win/include/rsdef.h @@ -0,0 +1,1583 @@ +#ifndef RSDEF_H +#define RSDEF_H +#include +#include "rstype.h" +#include "AuboRobotMetaType.h" + +#define TRUE 1 +#define FALSE 0 +#define RS_SUCC 0 +#define RS_FAILED -1 +#define MAX_RS_INSTANCE 32 +#define POS_SIZE 3 +#define ORI_SIZE 4 +#define INERTIA_SIZE 6 +#define JOINT_RADIAN_SIZE 6 + +#define RS_UNUSED(x) (void)x; +//#define _DEBUG + +using namespace aubo_robot_namespace; + +typedef CoordCalibrateByJointAngleAndTool CoordCalibrate; + +typedef struct +{ + CoordCalibrate user_coord; + char used; +} CustomUserCoord; + +typedef struct +{ + double rotateAxis[3]; +} Move_Rotate_Axis; + +typedef struct +{ + wayPoint_S waypoint[8]; + int solution_count; +} ik_solutions; + +#ifdef __cplusplus +extern "C" { +#endif + +// library initialize and uninitialize +/** + * @brief 初始化机械臂控制库 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_initialize(void); + +/** + * @brief 反初始化机械臂控制库 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_uninitialize(void); + +// robot service context +/** + * @brief 创建机械臂控制上下文句柄 + * @param rshd + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_create_context( + RSHD *rshd /*returned context handle*/); + +/** + * @brief 注销机械臂控制上下文句柄 + * @param rshd + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_destory_context(RSHD rshd); + +// login logout +/** + * @brief 链接机械臂服务器 + * @param rshd 械臂控制上下文句柄 + * @param addr 机械臂服务器的IP地址 + * @param port 机械臂服务器的端口号 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_login(RSHD rshd, const char *addr, + int port); + +/** + * @brief 断开机械臂服务器链接 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_logout(RSHD rshd); + +/** + * @brief 获取当前的连接状态 + * @param rshd 械臂控制上下文句柄 + * @param status true 在线 false 离线 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_login_status(RSHD rshd, bool *status); +// set move profile +/** + * @brief 初始化全局的运动属性 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_init_global_move_profile(RSHD rshd); + +// joint max acc,velc +/** + * @brief 设置六个关节的最大加速度 + * @param rshd 械臂控制上下文句柄 + * @param max_acc 六个关节的最大加速度,单位(rad/ss) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_global_joint_maxacc( + RSHD rshd, const JointVelcAccParam *max_acc); + +/** + * @brief 设置六个关节的最大速度 + * @param rshd 械臂控制上下文句柄 + * @param max_velc 六个关节的最大速度,单位(rad/s) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_global_joint_maxvelc( + RSHD rshd, const JointVelcAccParam *max_velc); + +/** + * @brief 获取六个关节的最大加速度 + * @param rshd 械臂控制上下文句柄 + * @param max_acc 返回六个关节的最大加速度单位(rad/s^2) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_global_joint_maxacc( + RSHD rshd, JointVelcAccParam *max_acc); + +/** + * @brief 获取六个关节的最大速度 + * @param rshd 械臂控制上下文句柄 + * @param max_velc 返回六个关节的最大加度单位(rad/s) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_global_joint_maxvelc( + RSHD rshd, JointVelcAccParam *max_velc); + +// end line max acc,velc +/** + * @brief 设置机械臂末端最大线加速度 + * @param rshd 械臂控制上下文句柄 + * @param max_acc 末端最大加线速度,单位(m/s^2) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_global_end_max_line_acc(RSHD rshd, + double max_acc); + +/** + * @brief 设置机械臂末端最大线速度 + * @param rshd 械臂控制上下文句柄 + * @param max_velc 末端最大线速度,单位(m/s) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_global_end_max_line_velc( + RSHD rshd, double max_velc); + +/** + * @brief 获取机械臂末端最大线加速度 + * @param rshd 械臂控制上下文句柄 + * @param max_acc 机械臂末端最大线加速度,单位(m/s^2) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_global_end_max_line_acc( + RSHD rshd, double *max_acc); + +/** + * @brief 获取机械臂末端最大线速度 + * @param rshd 械臂控制上下文句柄 + * @param max_velc 机械臂末端最大线速度,单位(m/s) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_global_end_max_line_velc( + RSHD rshd, double *max_velc); + +// end line max acc,velc +/** + * @brief 设置机械臂末端最大角加速度 + * @param rshd 械臂控制上下文句柄 + * @param max_acc 末端最大角加速度,单位(rad/s^2) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_global_end_max_angle_acc( + RSHD rshd, double max_acc); + +/** + * @brief 设置机械臂末端最大角速度 + * @param rshd 械臂控制上下文句柄 + * @param max_velc 末端最大速度,单位(rad/s) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_global_end_max_angle_velc( + RSHD rshd, double max_velc); + +/** + * @brief 获取机械臂末端最大角加速度 + * @param rshd 械臂控制上下文句柄 + * @param max_acc 机械臂末端最大角加速度,单位(m/s^2) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_global_end_max_angle_acc( + RSHD rshd, double *max_acc); + +/** + * @brief 获取机械臂末端最大角加速度 + * @param rshd 械臂控制上下文句柄 + * @param max_velc 机械臂末端最大角速度,单位(m/s) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_global_end_max_angle_velc( + RSHD rshd, double *max_velc); + +/** + * @brief 设置机械臂关节运动范围 + * @param rshd 械臂控制上下文句柄 + * @param joint_range + * 机械臂每个关节的运动范围(±175°)注意!!!单位使用弧度(rad) + * @param enable 使能关节运动范围控制 true:启用 false:禁用 + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_robot_joint_motion_range( + RSHD rshd, RangeOfMotion joint_range[ARM_DOF], bool enable = true); + +// robot move +/** + * @brief 机械臂轴动 + * @param rshd 械臂控制上下文句柄 + * @param joint_radian 六个关节的关节角,单位(rad) + * @param isblock isblock==true + * 代表阻塞,机械臂运动直到到达目标位置或者出现故障后返回。 isblock==false + * 代表非阻塞,立即返回,运动指令发送成功就返回,函数返回后机械臂开始运动。 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_move_joint(RSHD rshd, + double joint_radian[ARM_DOF], + bool isblock = true); + +/** + * @brief 机械臂轴动 + * @param rshd 械臂控制上下文句柄 + * @param move_profile 运动属性 + * @param joint_radian 六个关节的关节角,单位(rad) + * @param isblock isblock==true + * 代表阻塞,机械臂运动直到到达目标位置或者出现故障后返回。 isblock==false + * 代表非阻塞,立即返回,运动指令发送成功就返回,函数返回后机械臂开始运动。 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_move_joint_ex(RSHD rshd, + MoveProfile_t *move_profile, + double joint_radian[ARM_DOF], + bool isblock = true); + +/** + * @brief 跟随模式机械臂轴动 + * @param rshd 械臂控制上下文句柄 + * @param joint_radian 六个关节的关节角,单位(rad) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_follow_mode_move_joint( + RSHD rshd, double joint_radian[ARM_DOF]); + +/** + * @brief 机械臂保持当前姿态直线运动 + * @param rshd 械臂控制上下文句柄 + * @param joint_radian 六个关节的关节角,单位(rad) + * @param isblock isblock==true + * 代表阻塞,机械臂运动直到到达目标位置或者出现故障后返回。 isblock==false + * 代表非阻塞,立即返回,运动指令发送成功就返回,函数返回后机械臂开始运动。 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_move_line(RSHD rshd, + double joint_radian[ARM_DOF], + bool isblock = true); + +/** + * @brief 机械臂保持当前姿态直线运动 + * @param rshd 械臂控制上下文句柄 + * @param move_profile 运动属性 + * @param joint_radian 六个关节的关节角,单位(rad) + * @param isblock isblock==true + * 代表阻塞,机械臂运动直到到达目标位置或者出现故障后返回。 isblock==false + * 代表非阻塞,立即返回,运动指令发送成功就返回,函数返回后机械臂开始运动。 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_move_line_ex(RSHD rshd, + MoveProfile_t *move_profile, + double joint_radian[ARM_DOF], + bool isblock = true); + +/** + * @brief rs_move_rotate_to_waypoint保持当前位置变换姿态旋转运动至目标路点 + * @param rshd 械臂控制上下文句柄 + * @param target_waypiont 目标路点 + * @param isblock isblock==true + * 代表阻塞,机械臂运动直到到达目标位置或者出现故障后返回。 isblock==false + * 代表非阻塞,立即返回,运动指令发送成功就返回,函数返回后机械臂开始运动。 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_move_rotate_to_waypoint( + RSHD rshd, aubo_robot_namespace::wayPoint_S *target_waypiont, + bool isblock = true); + +/** + * @brief 保持当前位置变换姿态做旋转运动 + * @param rshd 械臂控制上下文句柄 + * @param user_coord 用户坐标系 + * @param rotate_axis :转轴(x,y,z) 例如:(1,0,0)表示沿Y轴转动 + * @param rotate_angle 旋转角度 单位(rad) + * @param isblock isblock==true + * 代表阻塞,机械臂运动直到到达目标位置或者出现故障后返回。 isblock==false + * 代表非阻塞,立即返回,运动指令发送成功就返回,函数返回后机械臂开始运动。 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_move_rotate( + RSHD rshd, const CoordCalibrate *user_coord, + const Move_Rotate_Axis *rotate_axis, double rotate_angle, + bool isblock = true); + +/** + * rs_get_rotate_target_waypiont + * 根据根据起始点姿态及基坐标系下描述的旋转轴、旋转角,获取目标位姿 + * @param rshd 械臂控制上下文句柄 + * @param originateWayPointOnBaseCoord 起始路点信息 + * @param rotateAxisOnBaseCoord 基坐标系下表示的旋转轴 + * @param rotateAngle 旋转角 + * @param targetWayPointOnBaseCoord 目标路点信息 (传出参数) + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_rotate_target_waypiont( + RSHD rshd, + const aubo_robot_namespace::wayPoint_S *originateWayPointOnBaseCoord, + const double rotateAxisOnBaseCoord[], double rotateAngle, + aubo_robot_namespace::wayPoint_S *targetWayPointOnBaseCoord); + +/** + * @brief rs_get_rotateaxis_user_to_Base + * 将用户坐标系下描述的旋转轴转换到基坐标系下描述 + * @param rshd 械臂控制上下文句柄 + * @param oriOnUserCoord 用户做标系旋转姿态 + * @param rotateAxisOnUserCoord 用户坐标系下描述的旋转轴 + * @param rotateAxisOnBaseCoord 基坐标系下描述的旋转轴 + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_rotateaxis_user_to_Base( + RSHD rshd, const aubo_robot_namespace::Ori *oriOnUserCoord, + const double rotateAxisOnUserCoord[], double rotateAxisOnBaseCoord[]); + +/** + * @brief 清除所有已经设置的全局路点 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_remove_all_waypoint(RSHD rshd); + +/** + * @brief 添加全局路点用于轨迹运动 + * @param rshd 械臂控制上下文句柄 + * @param joint_radian 六个关节的关节角,单位(rad) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_add_waypoint(RSHD rshd, + double joint_radian[ARM_DOF]); + +/** + * @brief 设置交融半径 + * @param rshd 械臂控制上下文句柄 + * @param radius 交融半径,单位(m) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_blend_radius(RSHD rshd, double radius); + +/** + * @brief 设置圆运动圈数 + * @param rshd 械臂控制上下文句柄 + * @param times 当times大于0时,机械臂进行圆运动times次 + * 当times等于0时,机械臂进行圆弧轨迹运动 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_circular_loop_times(RSHD rshd, + int times); + +/** + * @brief 设置用户坐标系 + * @param rshd 械臂控制上下文句柄 + * @param user_coord 用户坐标系 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_user_coord( + RSHD rshd, const CoordCalibrate *user_coord); + +/** + * @brief 设置基座坐标系 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_base_coord(RSHD rshd); + +/** + * @brief 检查用户坐标系参数设置是否合理 + * @param rshd 械臂控制上下文句柄 + * @param user_coord 用户坐标系 + * @return RS_SUCC 成功 其他失败 合理返回: 0 不合理返回: 其他 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_check_user_coord( + RSHD rshd, const CoordCalibrate *user_coord); + +/** + * @brief 检查用户坐标系标定 + * @param rshd + * @param user_coord + * @param bInWPos 在世界坐标系中的位置 + * @param bInWOri 在世界坐标系中的姿态 + * @param wInBPos 在基座坐标系中的位置 + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_user_coord_calibrate( + RSHD rshd, const CoordCalibrate *user_coord, double bInWPos[3], + double bInWOri[9], double wInBPos[3]); + +/** + * @brief rs_tool_calibration 工具标定  该函数能标定出工具的位置信息和姿态信息 + * @param toolCalibrate 工具标定结构体 用于储存标定点,标定方法等 + * @param toolInEndDesc       标定的结果 + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_tool_calibration( + RSHD rshd, const ToolCalibrate &toolCalibrate, + ToolInEndDesc &toolInEndDesc); +/** + * @brief 设置基于基座标系运动偏移量 + * @param rshd 械臂控制上下文句柄 + * @param relative 相对位移(x, y, z) 单位(m) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_relative_offset_on_base( + RSHD rshd, const MoveRelative *relative); + +/** + * @brief 设置基于用户标系运动偏移量 + * @param rshd 械臂控制上下文句柄 + * @param relative 相对位移(x, y, z) 单位(m) + * @param user_coord 用户坐标系 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_relative_offset_on_user( + RSHD rshd, const MoveRelative *relative, const CoordCalibrate *user_coord); + +/** + * @brief 取消提前到位设置 + * @param rshd + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_no_arrival_ahead(RSHD rshd); + +/** + * @brief 设置距离模式下的提前到位距离 + * @param rshd + * @param distance 提前到位距离 单位(米) + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_arrival_ahead_distance(RSHD rshd, + double distance); + +/** + * @brief 设置时间模式下的提前到位时间 + * @param rshd + * @param sec 提前到位时间 单位(秒) + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_arrival_ahead_time(RSHD rshd, + double sec); + +/** + * @brief 设置距离模式下交融半径距离 + * @param rshd + * @param distance 提前到位距离 单位(米) + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_arrival_ahead_blend(RSHD rshd, + double radius); + +/** + * @brief 轨迹运动 + * @param rshd 械臂控制上下文句柄 + * @param sub_move_mode 轨迹类型: + * 2:圆弧 + * 3:轨迹 + * @param isblock isblock==true + * 代表阻塞,机械臂运动直到到达目标位置或者出现故障后返回。 isblock==false + * 代表非阻塞,立即返回,运动指令发送成功就返回,函数返回后机械臂开始运动。 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_move_track(RSHD rshd, + move_track sub_move_mode, + bool isblock = true); + +/** + * @brief + * 保持当前位姿通过直线运动的方式运动到目标位置,其中目标位置是通过相对当前位置的偏移给出 + * @param rshd 械臂控制上下文句柄 + * @param target 基于用户平面表示的目标位置 + * @param tool 工具参数 + * @param isblock isblock==true + * 代表阻塞,机械臂运动直到到达目标位置或者出现故障后返回。 isblock==false + * 代表非阻塞,立即返回,运动指令发送成功就返回,函数返回后机械臂开始运动。 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_move_line_to(RSHD rshd, const Pos *target, + const ToolInEndDesc *tool, + bool isblock = true); + +/** + * @brief 保持当前位姿通过关节运动的方式运动到目标位置 + * @param rshd 械臂控制上下文句柄 + * @param target 基于用户平面表示的目标位置 + * @param tool 工具参数 + * @param isblock isblock==true + * 代表阻塞,机械臂运动直到到达目标位置或者出现故障后返回。 isblock==false + * 代表非阻塞,立即返回,运动指令发送成功就返回,函数返回后机械臂开始运动。 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_move_joint_to(RSHD rshd, const Pos *target, + const ToolInEndDesc *tool, + bool isblock = true); + +/** + * @brief 设置示教坐标系 + * @param rshd 械臂控制上下文句柄 + * @param user_coord 示教坐标系 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_teach_coord( + RSHD rshd, const CoordCalibrate *teach_coord); + +/** + * @brief 开始轴动示教 + * @param rshd 械臂控制上下文句柄 + * @param mode 示教关节:JOINT1,JOINT2,JOINT3, JOINT4,JOINT5,JOINT6, + * 位置示教:MOV_X,MOV_Y,MOV_Z 姿态示教:ROT_X,ROT_Y,ROT_Z + * @param dir 运动方向 正方向true 反方向false + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_teach_move_start(RSHD rshd, teach_mode mode, + bool dir); + +/** + * @brief 结束示教 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_teach_move_stop(RSHD rshd); + +/** + * @brief 清理服务器上的非在线轨迹运动数据 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_clear_offline_track(RSHD rshd); + +/** + * @brief 向服务器添加非在线轨迹运动路点 + * @param rshd 械臂控制上下文句柄 + * @param waypoints 路点数组 (路点个数小于等于3000) + * @param waypoint_count 路点数组大小 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_append_offline_track_waypoint( + RSHD rshd, const JointParam waypoints[], int waypoint_count); + +/** + * @brief 向服务器添加非在线轨迹运动路点文件 + * @param rshd 械臂控制上下文句柄 + * @param filename + * 路点文件全路径,路点文件的每一行包含六个关节的关节角(弧度),用逗号隔开 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_append_offline_track_file( + RSHD rshd, const char *filename); + +/** + * @brief 通知服务器启动非在线轨迹运动 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_startup_offline_track(RSHD rshd); + +/** + * @brief 通知服务器停止非在线轨迹运动 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_stop_offline_track(RSHD rshd); + +/** + * @brief 通知服务器启动非在线轨迹运动 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_startup_excit_traj_track( + RSHD rshd, const char *trackfile, char type, char subtype); + +/** + * @brief 设置轨迹回放采样周期 + * @param rshd 械臂控制上下文句柄 + * @param second 采样周期(秒) + * @param RS_SUCC 成功 其他失败 + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_track_playback_cycle(RSHD rshd, + double second); + +/** + * @brief rs_get_dynidentify_results + * @param param + * @param len + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT bool rs_get_dynidentify_results( + RSHD rshd, std::vector ¶mVector); + +/** + * @brief 通知服务器进入TCP2CANBUS透传模式 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_enter_tcp2canbus_mode(RSHD rshd); + +/** + * @brief 通知服务器退出TCP2CANBUS透传模式 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_leave_tcp2canbus_mode(RSHD rshd); + +/** + * @brief 透传运动路点到CANBUS + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_waypoint_to_canbus( + RSHD rshd, double joint_radian[ARM_DOF]); + +/** + * @brief 透传运动路点到CANBUS + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_waypoints_to_canbus( + RSHD rshd, double joint_radian[][ARM_DOF], int waypint_count); + +/** + * @brief 正解     此函数为正解函数,已知关节角求对应位置的位置和姿态。 + * @param rshd 械臂控制上下文句柄 + * @param joint_radian 六个关节的关节角,单位(rad) + * @param waypoint 六个关节角,位置,姿态 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_forward_kin( + RSHD rshd, const double joint_radian[ARM_DOF], wayPoint_S *waypoint); + +/** + * @brief 逆解 + * 此函数为机械臂逆解函数,根据位置信息(x,y,z)和对应位置的参考姿态(w,x,y,z)得到对应位置的关节角信息。 + * @param rshd 械臂控制上下文句柄 + * @param joint_radian 参考关节角(通常为当前机械臂位置)单位(rad) + * @param pos 目标路点的位置 单位:米 + * @param ori 目标路点的参考姿态 + * @param waypoint 目标路点信息 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_inverse_kin(RSHD rshd, + double joint_radian[ARM_DOF], + const Pos *pos, const Ori *ori, + wayPoint_S *waypoint); + +/** + * @brief 逆解 + * 此函数为机械臂逆解函数,根据位置信息(x,y,z)和对应位置的参考姿态(w,x,y,z)得到对应位置的关节角信息。 + * @param rshd 械臂控制上下文句柄 + * @param pos 目标路点的位置 单位:米 + * @param ori 目标路点的参考姿态 + * @param ik_solutions + * 目标路点信息(最多返回八组解,逆解结果超过8个则仅返回前8个) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_inverse_kin_closed_form( + RSHD rshd, const Pos *pos, const Ori *ori, ik_solutions *solutions); + +/** + * @brief 用户坐标系转基座坐标系 + * 概述: + * 将法兰盘中心基于基座标系下的位置和姿态 转成 工具末端基于用户座标系下的位置和姿态。 + * + *  扩展1: 法兰盘中心可以看成是一个特殊的工具,即工具的位置为(0,0,0) + * + * 因此当工具为(0,0,0)时,相当于将法兰盘中心基于基座标系下的位置和姿态 转成 法兰盘中心基于用户座标系下的位置和姿态。 + * + *     扩展2: 用户坐标系也可以选择成基座标系,  即:userCoord.coordType = + * BaseCoordinate + * 因此当用户平面为基座标系时,相当于将法兰盘中心基于基座标系下的位置和姿态 转成 工具末端基于基座标系下的位置和姿态, + * 即在基座标系加工具。 + * @param rshd 械臂控制上下文句柄 + * @param pos_onbase 基于基座标系的法兰盘中心位置信息(x,y,z) 单位(m) + * @param ori_onbase 基于基座标系的姿态信息(w, x, y, z) + * @param user_coord 用户坐标系 + * @param tool_pos 工具信息 + * @param pos_onuser 基于用户座标系的工具末端位置信息,输出参数 + * @param ori_onuser 基于用户座标系的工具末端姿态信息,输出参数 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_base_to_user( + RSHD rshd, const Pos *pos_onbase, const Ori *ori_onbase, + const CoordCalibrate *user_coord, const ToolInEndDesc *tool_pos, + Pos *pos_onuser, Ori *ori_onuser); + +/** + * @brief 用户坐标系转基座标系 + * @param rshd 械臂控制上下文句柄 + * @param pos_onuser 基于用户座标系的工具末端位置信息 + * @param ori_onuser 基于用户座标系的工具末端姿态信息 + * @param user_coord 用户坐标系 + * @param tool_pos 工具信息 + * @param pos_onbase 基于基座标系的法兰盘中心位置信息 + * @param ori_onbase 基于基座标系的姿态信息 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_user_to_base( + RSHD rshd, const Pos *pos_onuser, const Ori *ori_onuser, + const CoordCalibrate *user_coord, const ToolInEndDesc *tool_pos, + Pos *pos_onbase, Ori *ori_onbase); + +/** + * @brief  基坐标系转基座标得到工具末端点的位置和姿态 + * @param rshd 械臂控制上下文句柄 + * @param flange_center_pos_onbase 基于基座标系的法兰盘中心位置信息 + * @param flange_center_ori_onbase 基于基座标系的姿态信息 + * @param tool 工具信息 + * @param tool_end_pos_onbase 基于基座标系的工具末端位置信息 + * @param tool_end_ori_onbase 基于基座标系的工具末端姿态信息 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_base_to_base_additional_tool( + RSHD rshd, const Pos *flange_center_pos_onbase, + const Ori *flange_center_ori_onbase, const ToolInEndDesc *tool, + Pos *tool_end_pos_onbase, Ori *tool_end_ori_onbase); + +/** + * @brief rs_get_target_waypoint_by_position   根据位置获取目标路点信息 + * @param sourceWayPointOnBaseCoord     起始路点(基于基坐标系) + * @param userCoordSystem           用户坐标系 + * @param toolEndPosition           工具末端位置 + * @param toolInEndDesc            工具末端偏移 + * @param targetWayPointOnBaseCoord     目标路点(基于基坐标系) + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_target_waypoint_by_position( + RSHD rshd, + const aubo_robot_namespace::wayPoint_S &sourceWayPointOnBaseCoord, + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &userCoordSystem, + const aubo_robot_namespace::Pos &toolEndPosition, + const aubo_robot_namespace::ToolInEndDesc &toolInEndDesc, + aubo_robot_namespace::wayPoint_S &targetWayPointOnBaseCoord); + +/** + * @brief 欧拉角转四元素 + * @param rshd 械臂控制上下文句柄 + * @param rpy 姿态的欧拉角表示方法 + * @param ori 姿态的四元素表示方法 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_rpy_to_quaternion(RSHD rshd, const Rpy *rpy, + Ori *ori); + +/** + * @brief 四元素转欧拉角 + * @param rshd 械臂控制上下文句柄 + * @param ori 姿态的四元素表示方法 + * @param rpy 姿态的欧拉角表示方法 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_quaternion_to_rpy(RSHD rshd, const Ori *ori, + Rpy *rpy); + +/** + * @brief 设置工具的运动学参数 + * @param rshd 械臂控制上下文句柄 + * @param tool 工具的运动学参数 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_tool_end_param( + RSHD rshd, const ToolInEndDesc *tool); + +// end tool parameters +/** + * @brief 设置无工具的动力学参数 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_none_tool_dynamics_param(RSHD rshd); + +/** + * @brief 设置工具的动力学参数 + * @param rshd 械臂控制上下文句柄 + * @param tool 工具的动力学参数 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_tool_dynamics_param( + RSHD rshd, const ToolDynamicsParam *tool); + +/** + * @brief 获取工具的动力学参数 + * @param rshd 械臂控制上下文句柄 + * @param tool 工具的动力学参数 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_tool_dynamics_param( + RSHD rshd, ToolDynamicsParam *tool); + +/** + * @brief 获取工具的动力学参数 + * @param rshd 械臂控制上下文句柄 + * @param tool 工具的动力学参数 + * @return RS_SUCC 成功 其他失败 + * @note 由于rs_get_tool_dynamics_param获取的位置值单位是mm,增加此 + * 函数将单位与rs_set_tool_dynamics_param统一 + */ +inline int rs_get_tool_dynamics_param2(RSHD rshd, ToolDynamicsParam *tool) +{ + int retval = rs_get_tool_dynamics_param(rshd, tool); + tool->positionX /= 1000.; + tool->positionY /= 1000.; + tool->positionZ /= 1000.; + + return retval; +} + +/** + * @brief 设置无工具运动学参数 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_none_tool_kinematics_param(RSHD rshd); + +/** + * @brief 设置工具的运动学参数 + * @param rshd 械臂控制上下文句柄 + * @param tool 工具的运动学参数 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_tool_kinematics_param( + RSHD rshd, const ToolKinematicsParam *tool); + +/** + * @brief 获取工具的运动学参数 + * @param rshd 械臂控制上下文句柄 + * @param tool 工具的运动学参数 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_tool_kinematics_param( + RSHD rshd, ToolKinematicsParam *tool); + +// robot control +/** + * @brief 启动机械臂 + * @param rshd 械臂控制上下文句柄 + * @param tool_dynamics 动力学参数 + * @param colli_class 碰撞等级 + * @param read_pos 是否允许读取位置 + * @param static_colli_detect 是否允许侦测静态碰撞 + * @param board_maxacc 接口板允许的最大加速度 + * @param state 机械臂启动状态 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_robot_startup( + RSHD rshd, const ToolDynamicsParam *tool_dynamics, uint8 colli_class, + bool read_pos, bool static_colli_detect, int board_maxacc, + ROBOT_SERVICE_STATE *state); + +/** + * @brief 关闭机械臂 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_robot_shutdown(RSHD rshd); + +/** + * @brief 停止机械臂运动加速度设置 + * @param rshd 械臂控制上下文句柄 + * @param jerkRatio [0.1,20] + * @param double acc 6维数组, + * 1,末端型运动,只使用acc[0] 最大加速度 + * 2,轴动,使用acc[0,5] 关节最大加速度 + * @param size 6 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_reduce_para(RSHD rshd, + const double jerkRatio, + const double acc[], + int size); + +/** + * @brief 停止机械臂运动 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_move_stop(RSHD rshd); + +/** + * @brief 停止机械臂运动 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_move_fast_stop(RSHD rshd); + +/** + * @brief 暂停机械臂运动 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_move_pause(RSHD rshd); + +/** + * @brief 暂停后回复机械臂运动 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_move_continue(RSHD rshd); + +/** + * @brief 机械臂碰撞后恢复 + * @param rshd 械臂控制上下文句柄 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_collision_recover(RSHD rshd); + +/** + * @brief 获取机械臂当前状态 + * @param rshd 械臂控制上下文句柄 + * @param state 机械臂当前状态 + * 机械臂当前停止:RobotStatus.Stopped + * 机械臂当前运行:RobotStatus.Running + * 机械臂当前暂停:RobotStatus.Paused + * 机械臂当前恢复:RobotStatus.Resumed + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_robot_state(RSHD rshd, + RobotState *state); + +/** + * @brief 设置机械臂运动进入缩减模式 + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT bool rs_enter_reduce_mode(RSHD rshd); + +/** + * @brief 设置机械臂运动退出缩减模式 + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT bool rs_exit_reduce_mode(RSHD rshd); + +/** + * @brief 通知机械臂工程启动,服务器同时开始检测安全IO + * @param rshd + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT bool rs_project_startup(RSHD rshd); + +/** + * @brief 通知机械臂工程停止,服务器停止检测安全IO + * @param rshd + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT bool rs_project_stop(RSHD rshd); + +// tool interface + +// robot parameters +/** + * @brief 设置机械臂服务器工作模式 + * @param rshd 械臂控制上下文句柄 + * @param mode 机械臂服务器工作模式 + * 机械臂仿真模式:RobotRunningMode.RobotModeSimulator + * 机械臂真实模式:RobotRunningMode.RobotModeReal + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_work_mode(RSHD rshd, + RobotWorkMode mode); + +/** + * @brief 获取机械臂服务器当前工作模式 + * @param rshd 械臂控制上下文句柄 + * @param mode 机械臂服务器工作模式 + * 机械臂仿真模式:RobotRunningMode.RobotModeSimulator + * 机械臂真实模式:RobotRunningMode.RobotModeReal + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_work_mode(RSHD rshd, + RobotWorkMode *mode); + +/** + * @brief 获取重力分量 + * @param rshd 械臂控制上下文句柄 + * @param gravity 重力分量 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_gravity_component( + RSHD rshd, RobotGravityComponent *gravity); + +/** + * @brief 设置机械臂碰撞等级 + * @param rshd 械臂控制上下文句柄 + * @param grade 碰撞等级 范围(0~10) + * @param mode 碰撞模式 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_collision_class(RSHD rshd, int grade); +SERVICE_INTERFACE_ABI_EXPORT int rs_set_collision_class2(RSHD rshd, int grade, + CollisionMode mode); + +/** + * @brief 获取当前碰撞等级 + * @param rshd 机械臂控制上下文句柄 + * @param grade 碰撞等级 范围(0~10) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_collision_class(RSHD rshd, int *grade); + +/** + * @brief 获取设备信息 + * @param rshd 械臂控制上下文句柄 + * @param dev 设备信息 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_device_info(RSHD rshd, + RobotDevInfo *dev); + +/** + * @brief 获取当前是否已经链接真实机械臂 + * @param rshd 械臂控制上下文句柄 + * @param exist true:存在 false:不存在 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_is_have_real_robot(RSHD rshd, bool *exist); + +/** + * @brief 当前机械臂是否运行在联机模式 + * @param rshd 械臂控制上下文句柄 + * @param isonline true:在 false:不在 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_is_online_mode(RSHD rshd, bool *isonline); + +/** + * @brief 当前机械臂是否运行在联机主模式 + * @param rshd 械臂控制上下文句柄 + * @param ismaster true:主模式 false:从模式 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_is_online_master_mode(RSHD rshd, + bool *ismaster); + +/** + * @brief 获取机械臂当前状态信息 + * @param rshd 械臂控制上下文句柄 + * @param jointStatus 返回六个关节状态,包括:电流,电压,温度 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_joint_status( + RSHD rshd, JointStatus jointStatus[ARM_DOF]); + +/** + * @brief 获取机械臂当前位置信息 + * @param rshd 械臂控制上下文句柄 + * @param waypoint 关节位置信息 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_current_waypoint(RSHD rshd, + wayPoint_S *waypoint); + +/** + * @brief 获取机械臂诊断信息 + * @param rshd 械臂控制上下文句柄 + * @param info 机械臂诊断信息 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_diagnosis_info( + RSHD rshd, RobotDiagnosis *robotDiagnosisInfo); + +/** + * @brief 根据错误号获取错误信息 + * @param rshd 机械臂控制上下文句柄 + * @param err_code 错误号 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ +SERVICE_INTERFACE_ABI_EXPORT const char *rs_get_error_information_by_errcode( + RSHD rshd, RobotErrorCode err_code); + +/** + * @brief 获取socket链接状态 + * @param rshd 械臂控制上下文句柄 + * @param connected true:已连接 false:未连接 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_socket_status(RSHD rshd, + bool *connected); + +/** + * @brief 获取机械表末端速度 + * @param rshd 械臂控制上下文句柄 + * @param endspeed 末端速度 单位(m/s) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_robot_end_speed(RSHD rshd, + float *endspeed); + +// IO interaface +/** + * @brief 获取接口板指定IO集合的配置信息 + * @param rshd 械臂控制上下文句柄 + * @param type IO类型 + * @param config IO配置信息集合 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_board_io_config( + RSHD rshd, RobotIoType type, std::vector *config); + +/** + * @brief 根据接口板IO类型和地址设置IO状态 + * @param rshd 械臂控制上下文句柄 + * @param type IO类型 + * @param name IO名称 + * @param val IO状态 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_board_io_status_by_name( + RSHD rshd, RobotIoType type, const char *name, double val); + +/** + * @brief 根据接口板IO类型和地址设置IO状态 + * @param rshd 械臂控制上下文句柄 + * @param type IO类型 + * @param addr IO状态 + * @param val IO状态 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_board_io_status_by_addr( + RSHD rshd, RobotIoType type, int addr, double val); + +/** + * @brief 根据接口板IO类型和地址获取IO状态 + * @param rshd 械臂控制上下文句柄 + * @param type IO类型 + * @param name IO名称 + * @param val IO状态 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_board_io_status_by_name( + RSHD rshd, RobotIoType type, const char *name, double *val); + +/** + * @brief 根据接口板IO类型和地址获取IO状态 + * @param rshd 械臂控制上下文句柄 + * @param type IO类型 + * @param addr IO地址 + * @param val + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_board_io_status_by_addr( + RSHD rshd, RobotIoType type, int addr, double *val); + +// tool device interface +/** + * @brief 设置工具端电源电压类型 + * @param rshd 械臂控制上下文句柄 + * @param type ower_type:电源类型 + * 0:.OUT_0V + * 1:.OUT_12V + * 2:.OUT_24V + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_tool_power_type(RSHD rshd, + ToolPowerType type); + +/** + * @brief 获取工具端电源电压类型 + * @param rshd 械臂控制上下文句柄 + * @param type ower_type:电源类型 + * 0:.OUT_0V + * 1:.OUT_12V + * 2:.OUT_24V + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_tool_power_type(RSHD rshd, + ToolPowerType *type); + +/** + * @brief 设置工具端数字量IO的类型 + * @param rshd 械臂控制上下文句柄 + * @param addr 地址 + * @param type 类型 0:输入 1:输出 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_tool_io_type(RSHD rshd, + ToolDigitalIOAddr addr, + ToolIOType type); + +/** + * @brief 获取工具端电压数值 + * @param rshd 械臂控制上下文句柄 + * @param voltage 电压数值,单位(伏特) + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_tool_power_voltage(RSHD rshd, + double *voltage); + +/** + * @brief 获取工具端IO状态 + * @param rshd 械臂控制上下文句柄 + * @param name IO名称 + * @param val 工具端IO状态 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_tool_io_status(RSHD rshd, + const char *name, + double *val); + +/** + * @brief 设置工具端IO状态 + * @param rshd 械臂控制上下文句柄 + * @param name IO名称 + * @param status 工具端IO状态 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_tool_do_status(RSHD rshd, + const char *name, + IO_STATUS status); + +/** + * @brief 暂停工程 + * @param rshd + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_client_status_pause(RSHD rshd); + +/** + * @brief 继续工程 + * @param rshd + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_client_status_continue(RSHD rshd); + +/** + * @brief 工程停止 + * @param rshd + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_client_status_stop(RSHD rshd); + +/** + * @brief 工程启动 + * @param rshd + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_client_status_run(RSHD rshd); + +/** + * @brief 通知接口板上位机停止状态 + * @param data + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_robot_orpe_stop(RSHD rshd, uint8 data); + +/** + * @brief rs_robot_control + * @param rshd + * @param cmd + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_robot_control(RSHD rshd, + RobotControlCommand cmd); + +/** + * @brief 设置机械臂辨识参数 + * @param param + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_robot_recognition_param( + RSHD rshd, const RobotRecongnitionParam *param); + +/** + * @brief 获取机械臂辨识参数 + * @param type + * @param param + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_robot_recognition_param( + RSHD rshd, int type, RobotRecongnitionParam *param); + +/** + * @brief 获取机械臂安全配置 + * @param rshd + * @param safetyConfig + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_robot_safety_config( + RSHD rshd, RobotSafetyConfig *param); + +/** + * @brief 获取机械臂安全配置 + * @param rshd + * @param safetyConfig + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_robot_safety_config( + RSHD rshd, RobotSafetyConfig *param); + +/** + * @brief 获取机械臂安全状态 + * @param rshd + * @param safetyStatus + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_robot_safety_status( + RSHD rshd, OrpeSafetyStatus *param); + +//#ifndef FOR_FORCE_LIBRARY +/** + * @brief 设置底座参数信息 + * @param rshd + * @param param + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_robot_base_parameters( + RSHD rshd, const RobotBaseParameters *param); + +/** + * @brief 获取底座参数信息 + * @param rshd + * @param param + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_robot_base_parameters( + RSHD rshd, RobotBaseParameters *param); + +/** + * @brief 设置关节参数信息 + * @param rshd + * @param param + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_robot_joints_parameter( + RSHD rshd, const RobotJointsParameter *param); + +/** + * @brief 获取关节参数信息 + * @param rshd + * @param param + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_robot_joints_parameter( + RSHD rshd, RobotJointsParameter *param); + +/** + * @brief 刷新关节参数信息 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_robot_refresh_robot_arm_paramter( + RSHD rshd); + +//#else + +/** + * @brief 设置调速模式配置 + * @param rshd + * @param config + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_regulate_speed_param( + RSHD rshd, const RegulateSpeedModeParamConfig_t *config); + +/** + * @brief 获取调速模式配置 + * @param rshd + * @param config + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_regulate_speed_param( + RSHD rshd, RegulateSpeedModeParamConfig_t *config); + +/** + * @brief 使能/失能调速模式 + * @param rshd + * @param enbaleFlag + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_enable_regulate_speed_mode(RSHD rshd, + bool enbaleFlag); + +/** + * @brief 获取"主动探寻力"参数 + * @param rshd + * @param forceLimit + * @param distLimit + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_force_control_mode_explore_force_param( + RSHD rshd, double *forceLimit, double *distLimit); + +/** + * @brief 设置"主动探寻力"参数 + * @param rshd + * @param forceLimit + * @param distLimit + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_set_force_control_mode_explore_force_param( + RSHD rshd, double forceLimit, double distLimit); + +/** + * @brief 使能/失能力控模式 + * @param rshd + * @param enbaleFlag + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_enable_force_control_mode(RSHD rshd, + bool enbaleFlag); + +/** + * @brief 获取实时力数据 + * @param rshd + * @param 传出参数 + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_get_realtime_force_data( + RSHD rshd, double forceData[6]); + +/** + * @brief 将一个轨迹文件(位置+姿态)转换为路点容器,进行平滑处理和限制条件检查 + * @param rshd 械臂控制上下文句柄 + * @param filePath 轨迹文件路径 输入参数 + * @param poseType 位姿类型 + * @param referPointJointAngle 逆解参考点的关节角 输入参数 + * @param toolInEndDesc 末端工具的信息 输入参数 + * @param wayPointVector 路点集合 输出参数 + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_parse_file_as_roadpoint_collection( + RSHD rshd, const char *filePath, + aubo_robot_namespace::POSITION_ORIENTATION_TYPE poseType, + const double *referPointJointAngle, + const aubo_robot_namespace::ToolInEndDesc *toolInEndDesc, + aubo_robot_namespace::wayPoint_S wayPoint[], int waypointSize, + int *sizeReturn); + +/** + * @brief 解析路点文件并缓存结果 + * @param rshd 械臂控制上下文句柄 + * @param filePath 轨迹文件路径 输入参数 + * @param referPointJointAngle 逆解参考点的关节角 输入参数 + * @param toolInEndDesc 末端工具的信息 输入参数 + * @param firstWayPoint 轨迹的第一个点 输出参数 + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_parse_roadpoint_file_and_cache_result( + RSHD rshd, const char *filePath, const double *referPointJointAngle, + aubo_robot_namespace::ToolInEndDesc *toolInEndDesc, + aubo_robot_namespace::wayPoint_S *firstWayPoint); +/** + * @brief 运行缓存好的轨迹 + * 即:运行rs_parse_roadpoint_file_and_cache_result的结果 + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_move_cached_track(RSHD rshd); + +//#endif + +// callback +/** + * @brief 注册用于获取实时路点的回调函数 + * @param rshd 械臂控制上下文句柄 + * @param ptr 获取实时路点信息的函数指针 + * @param arg + * 这个参数系统不做任何处理,只是进行了缓存,当回调函数触发时该参数会通过回调函数的参数传回 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_setcallback_realtime_roadpoint( + RSHD rshd, const RealTimeRoadPointCallback ptr, void *arg); + +/** + * @brief 注册用于获取关节状态的回调函数 + * @param rshd 械臂控制上下文句柄 + * @param ptr 获取实时关节状态信息的函数指针 + * @param arg + * 这个参数系统不做任何处理,只是进行了缓存,当回调函数触发时该参数会通过回调函数的参数传回 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_setcallback_realtime_joint_status( + RSHD rshd, const RealTimeJointStatusCallback ptr, void *arg); + +/** + * @brief 注册用于获取实时末端速度的回调函数 + * @param rshd 械臂控制上下文句柄 + * @param ptr 获取实时末端速度的函数指针 + * @param arg + * 个参数系统不做任何处理,只是进行了缓存,当回调函数触发时该参数会通过回调函数的参数传回 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_setcallback_realtime_end_speed( + RSHD rshd, const RealTimeEndSpeedCallback ptr, void *arg); + +/** + * @brief 注册用于获取机械臂事件信息的回调函数 + * @param rshd 械臂控制上下文句柄 + * @param ptr 获取机械臂事件信息的函数指针 + * @param arg + * 个参数系统不做任何处理,只是进行了缓存,当回调函数触发时该参数会通过回调函数的参数传回 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_setcallback_robot_event( + RSHD rshd, const RobotEventCallback ptr, void *arg); + +/** + * @brief 注册用于获取函数的日志信息的回调函数 + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_setcallback_robot_loginfo( + RSHD rshd, const RobotLogPrintCallback ptr, void *arg); + +/** + * @brief 注册用于获取MOVEP运动进度信息的回调函数 + * @return + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_setcallback_movep_step_num( + RSHD rshd, const RealTimeMovepStepNumNotifyCallback ptr, void *arg); + +// enable push information +/** + * @brief 设置是否允许实时路点信息推送 + * @param rshd 械臂控制上下文句柄 + * @param enable true表示允许 false表示不允许 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_enable_push_realtime_roadpoint(RSHD rshd, + bool enable); + +/** + * @brief 设置是否允许实时关节状态推送 + * @param rshd 械臂控制上下文句柄 + * @param enable true表示允许 false表示不允许 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_enable_push_realtime_joint_status( + RSHD rshd, bool enable); + +/** + * @brief 设置是否允许实时末端速度推送 + * @param rshd 械臂控制上下文句柄 + * @param enable true表示允许 false表示不允许 + * @return RS_SUCC 成功 其他失败 + */ +SERVICE_INTERFACE_ABI_EXPORT int rs_enable_push_realtime_end_speed(RSHD rshd, + bool enable); + +// other +SERVICE_INTERFACE_ABI_EXPORT const char *rs_str_error(RSHD rshd, int err); +SERVICE_INTERFACE_ABI_EXPORT void print_plan(const CoordCalibrate *user_coord); +SERVICE_INTERFACE_ABI_EXPORT void print_move_relative_offset( + const MoveRelative *relative); +SERVICE_INTERFACE_ABI_EXPORT void print_waypoint(wayPoint_S *waypoint); +SERVICE_INTERFACE_ABI_EXPORT void print_tool_dynamics( + ToolDynamicsParam *tool_dynamics); + +#ifdef __cplusplus +} +#endif + +#endif // RSDEF_H diff --git a/third_party/AuboSdk/win/include/rserrors.h b/third_party/AuboSdk/win/include/rserrors.h new file mode 100644 index 00000000..d7b1c7ab --- /dev/null +++ b/third_party/AuboSdk/win/include/rserrors.h @@ -0,0 +1,12 @@ +#ifndef RSERRORS_H +#define RSERRORS_H + +/*robot service errors*/ +#define RSERR_BASE 1000 +#define RSERR_SUCC 0 +#define RSERR_NOT_ENOUGH_RSHD_BUFFER RSERR_BASE + 1 +#define RSERR_RSHD_NO_FOUND RSERR_BASE + 2 +#define RSERR_PARAMETER_ERROR RSERR_BASE + 3 +#define RSERR_CREATE_THREAD_ERROR RSERR_BASE + 4 + +#endif // RSERRORS_H diff --git a/third_party/AuboSdk/win/include/rspidcfg.h b/third_party/AuboSdk/win/include/rspidcfg.h new file mode 100644 index 00000000..a7a98469 --- /dev/null +++ b/third_party/AuboSdk/win/include/rspidcfg.h @@ -0,0 +1,125 @@ +#ifndef RSPIDCFG_H +#define RSPIDCFG_H +#include "rstype.h" +#include "AuboRobotMetaType.h" + +using namespace aubo_robot_namespace; + +typedef struct +{ + JointCommonData data[ARM_DOF]; +} RobotJointCommonData; + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief 获取机械臂配置表 + * @param rshd + * @param data 六个关节配置数据 + * @return + */ +int rs_get_joint_common_data(RSHD rshd, RobotJointCommonData &data); + +/** + * @brief 设置机械臂电流环参数P + * @param joint_id 机械臂ID(1~6) + * @param P 电流环参数P + * @return + */ +int rs_set_current_ip(RSHD rshd, int joint_id, uint16 P); + +/** + * @brief 设置机械臂电流环参数I + * @param joint_id 机械臂ID(1~6) + * @param I 电流环参数I + * @return + */ +int rs_set_current_ii(RSHD rshd, int joint_id, uint16 I); + +/** + * @brief 设置机械臂电流环参数D + * @param joint_id 机械臂ID(1~6) + * @param D 电流环参数D + * @return + */ +int rs_set_current_id(RSHD rshd, int joint_id, uint16 D); + +/** + * @brief 设置机械臂速度环参数P + * @param joint_id 机械臂ID(1~6) + * @param P 速度环参数P + * @return + */ +int rs_set_speed_p(RSHD rshd, int joint_id, uint16 P); + +/** + * @brief 设置机械臂速度环参数I + * @param joint_id 机械臂ID(1~6) + * @param I 速度环参数I + * @return + */ +int rs_set_speed_i(RSHD rshd, int joint_id, uint16 I); + +/** + * @brief 设置机械臂速度环参数D + * @param joint_id 机械臂ID(1~6) + * @param D 速度环参数D + * @return + */ +int rs_set_speed_d(RSHD rshd, int joint_id, uint16 D); + +/** + * @brief 设置机械臂速度环参数DS + * @param joint_id 机械臂ID(1~6) + * @param DS 速度环参数DS + * @return + */ +int rs_set_speed_ds(RSHD rshd, int joint_id, uint16 DS); + +/** + * @brief 设置机械臂位置环参数P + * @param joint_id 机械臂ID(1~6) + * @param P 位置环参数P + * @return + */ +int rs_set_pos_p(RSHD rshd, int joint_id, uint16 P); + +/** + * @brief 设置机械臂位置环参数I + * @param joint_id 机械臂ID(1~6) + * @param I 位置环参数I + * @return + */ +int rs_set_pos_i(RSHD rshd, int joint_id, uint16 I); + +/** + * @brief 设置机械臂位置环参数D + * @param joint_id 机械臂ID(1~6) + * @param D 位置环参数D + * @return + */ +int rs_set_pos_d(RSHD rshd, int joint_id, uint16 D); + +/** + * @brief 设置机械臂位置环参数DS + * @param joint_id 机械臂ID(1~6) + * @param DS 位置环参数DS + * @return + */ +int rs_set_pos_ds(RSHD rshd, int joint_id, uint16 DS); + +/** + * @brief 保存机械臂PID参数到关节flash + * @param rshd + * @param joint_id + * @return + */ +int rs_joint_save_data_flash(RSHD rshd, int joint_id); + +#ifdef __cplusplus +} +#endif + +#endif // RSPIDCFG_H diff --git a/third_party/AuboSdk/win/include/rstype.h b/third_party/AuboSdk/win/include/rstype.h new file mode 100644 index 00000000..fa1a2488 --- /dev/null +++ b/third_party/AuboSdk/win/include/rstype.h @@ -0,0 +1,29 @@ +#ifndef RSTYPE_H +#define RSTYPE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/* General types */ +typedef uint8_t boolean; +typedef int8_t int8; +typedef int16_t int16; +typedef int32_t int32; +typedef uint8_t uint8; +typedef uint16_t uint16; +typedef uint32_t uint32; +typedef int64_t int64; +typedef uint64_t uint64; +typedef float float32; +typedef double float64; + +typedef uint16_t RSHD; // robot servcie handle + +#ifdef __cplusplus +} +#endif + +#endif // RSTYPE_H diff --git a/third_party/AuboSdk/win/include/serviceinterface.h b/third_party/AuboSdk/win/include/serviceinterface.h new file mode 100644 index 00000000..a1b08519 --- /dev/null +++ b/third_party/AuboSdk/win/include/serviceinterface.h @@ -0,0 +1,1934 @@ +/** +CopyRight © AUBO Robotics Technology Co.Ltd. All Rights Reserved + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of mosquitto nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef SERVICEINTERFACE_H +#define SERVICEINTERFACE_H + +#include +#include + +#include "AuboRobotMetaType.h" //接口需要用到的数据类型 +#include + +namespace arcs { +namespace aubo_sdk { +class RpcClient; +typedef std::shared_ptr RpcClientPtr; + +class RtdeClient; +typedef std::shared_ptr RtdeClientPtr; +} // namespace aubo_sdk +} // namespace arcs + +// 对外接口类 : 为用户提供开发接口 +class SERVICE_INTERFACE_ABI_EXPORT ServiceInterface +{ +public: + ServiceInterface(); + ~ServiceInterface(); + + /** 数据类型初始化*/ + static void initPosDataType(aubo_robot_namespace::Pos &postion); + static void initOriDataType(aubo_robot_namespace::Ori &ori); + static void initMoveRelativeDataType( + aubo_robot_namespace::MoveRelative &moveRelative); + static void initWayPointDataType( + aubo_robot_namespace::wayPoint_S &wayPoint); + static void initToolInEndDescDataType( + aubo_robot_namespace::ToolInEndDesc &toolInEndDesc); + static void initCoordCalibrateByJointAngleAndToolDataType( + aubo_robot_namespace::CoordCalibrateByJointAngleAndTool &coord); + static void initToolInertiaDataType( + aubo_robot_namespace::ToolInertia &toolInertia); + static void initToolDynamicsParamDataType( + aubo_robot_namespace::ToolDynamicsParam &toolDynamicsParam); + + /********************************************************************************************************************************************** + ***********                                 机械臂系统接口                                 ********** + **********************************************************************************************************************************************/ + /** + * @brief 登录  与机械臂服务器建立网络连接; + * 该接口的成功是调用其他接口的前提。 + * + * @param host 机械臂服务器的IP地址 + * @param port 机械臂服务器的端口号 + * @param userName 用户名 默认为Aubo + * @param possword 密码   默认为123456 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceLogin(const char *host, int port, const char *userName, + const char *password); + + int robotServiceLogin(const char *host, int port, const char *userName, + const char *password, + aubo_robot_namespace::RobotType &robotType, + aubo_robot_namespace::RobotDhPara &robotDhPara); + + /** + * @brief robotServiceGetConnectStatus 获取当前的连接状态 + * @param connectStatus           输出参数 + */ + void robotServiceGetConnectStatus(bool &connectStatus); + + /** + * @brief 退出登录 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceLogout(); + + // + int robotServiceRobotHandShake(bool isBlock); + + aubo_robot_namespace::RobotType getRobotType(); + + /********************************************************************************************************************************************** + *****                                 状态推送                                         ******* + **********************************************************************************************************************************************/ + + /** + * @brief robotServiceSetRealTimeJointStatusPush + * 设置是否允许实时关节状态推送 + * @param enable true表示允许   false表示不允许 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetRealTimeJointStatusPush(bool enable); + + /** + * @brief robotServiceRegisterRealTimeJointStatusCallback + * 注册用于获取关节状态的回调函数 + * 注册回调函数后,服务器实时推送当前的关节状态信息. + * @param ptr + * 获取实时关节状态信息的函数指针,当ptr==NULL时,相当于取消回调函数的注册,取消该推送信息也可以通过该接口robotServiceSetRealTimeJointStatusPush进行。 + * @param arg + * 这个参数系统不做任何处理,只是进行了缓存,当回调函数触发时该参数会通过回调函数的参数传回。 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceRegisterRealTimeJointStatusCallback( + RealTimeJointStatusCallback ptr, void *arg); + + /** + * @brief robotServiceSetRealTimeRoadPointPush 设置是否允许实时路点信息推送 + * @param enable  true表示允许   false表示不允许 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetRealTimeRoadPointPush(bool enable); + + /** + * @brief robotServiceRegisterRealTimeRoadPointCallback + * 注册用于获取实时路点的回调函数 + * 注册回调函数后,服务器会推送当前的路点信息 当ptr==NULL时,相等于取消回调函数的注册。 + * @param ptr + * 获取实时路点信息的函数指针,当ptr==NULL时,相当于取消回调函数的注册,取消该推送信息也可以通过该接口robotServiceSetRealTimeRoadPointPush进行。 + * @param + * arg 这个参数系统不做任何处理,只是进行了缓存,当回调函数触发时该参数会通过回调函数的参数传回。 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceRegisterRealTimeRoadPointCallback( + const RealTimeRoadPointCallback ptr, void *arg); + + /** + * @brief robotServiceSetRealTimeEndSpeedPush 设置是否允许实时末端速度推送 + * @param enable true表示允许   false表示不允许 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetRealTimeEndSpeedPush(bool enable); + + /** + * @brief robotServiceRegisterRealTimeEndSpeedCallback + * 注册用于获取实时末端速度的回调函数 + * @param ptr + * 获取实时末端速度的函数指针 当ptr==NULL时,相等于取消回调函数的注册,取消该推送信息也可以通过该接口robotServiceSetRealTimeEndSpeedPush进行。 + * @param + * arg 这个参数系统不做任何处理,只是进行了缓存,当回调函数触发时该参数会通过回调函数的参数传回。 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceRegisterRealTimeEndSpeedCallback( + const RealTimeEndSpeedCallback ptr, void *arg); + + /** + * @brief robotServiceRegisterRobotEventInfoCallback + * 注册用于获取机械臂事件信息的回调函数 + * 注:关于事件信息信息的推送没有提供是否允许推送的接口,因为机械臂的很多重要通知都是通过事件推送实现的,所以事件信息是系统默认推送的,不允许取消的。 + * @param ptr + * 获取机械臂事件信息的函数指针 当ptr==NULL时,相等于取消回调函数的注册。 + * @param + * arg  这个参数系统不做任何处理,只是进行了缓存,当回调函数触发时该参数会通过回调函数的参数传回。 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceRegisterRobotEventInfoCallback(RobotEventCallback ptr, + void *arg); + + //注册movep进度通知的回调函数 + int robotServiceRegisterMovepStepNumNotifyCallback( + RealTimeMovepStepNumNotifyCallback ptr, void *arg); + + //注册日志输出回调函数 + int robotServiceRegisterLogPrintCallback(RobotLogPrintCallback ptr, + void *arg); + + /** + * @brief robotServiceInitGlobalMoveProfile 初始化全局的运动属性 + * 调用此函数时机械臂不运动,该函数初始化各个运动属性为默认值。 + *     初始化后各属性的默认值为: + * 0:关节型运动的最大速度和加速度属性: 关节最大速度默认为25度米每秒;关节最大加速度默认为25度米每秒方 + * 1:末端型运动的最大速度和加速度属性: + * 末端最大速度默认为3米每秒;末端最大加速度3米每秒方 + * 2:路点信息缓存属性:  默认路点缓存为空 + * 3:交融半径属性: 默认为0.02米 + * 4:圆的圈数属性: 默认为0 + * 5:偏移量属性属性: 默认没有偏移 + * 6:工具参数属性属性: 无工具即工具的位置为000; + * 7:示教坐标系属性:  示教坐标系为基座标系 + * + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceInitGlobalMoveProfile(); + + /** + * 设置和获取 关节型 运动的最大速度和加速度 + * 关节型运动包含: + *     关节运动; + *     示教运动中的关节示教(JOINT1,JOINT2,JOINT3,JOINT4,JOINT5,JOINT6) + *     轨迹运动下的(JIONT_CUBICSPLINE,JOINT_UBSPLINEINTP) + * + * 注意:用户在设置速度和加速度时,需要根据运动的类型设置, + *    关节型运动设置关节型运动的最大速度和加速度,关节型运动的最大速度是180度每秒,最大加速度为180度每秒方; + *    末端型运动会设置末端型运动的最大速度和加速度,末端型运动的最大速度为2米每秒,最大加速度为2米每秒方; + * + **/ + int robotServiceSetGlobalMoveJointMaxAcc( + const aubo_robot_namespace::JointVelcAccParam &moveMaxAcc); + + int robotServiceSetGlobalMoveJointMaxVelc( + const aubo_robot_namespace::JointVelcAccParam &moveMaxVelc); + + void robotServiceGetGlobalMoveJointMaxAcc( + aubo_robot_namespace::JointVelcAccParam &moveMaxAcc); + + void robotServiceGetGlobalMoveJointMaxVelc( + aubo_robot_namespace::JointVelcAccParam &moveMaxVelc); + + /** + * 设置和获取 末端型 运动的最大速度和加速度 + * 末端型包含: 直线运动(MODEL); + *     示教运动中的位置示教和姿态示教(MOV_X,MOV_Y,MOV_Z,ROT_X,ROT_Y,ROT_Z); + *     轨迹运动下的(ARC_CIR, CARTESIAN_MOVEP, CARTESIAN_CUBICSPLINE, CARTESIAN_UBSPLINEINTP) + * + * 注意:用户在设置速度和加速度时,需要根据运动的类型设置, + * 关节型运动设置关节型运动的最大速度和加速度,关节型运动的最大速度是180度每秒,最大加速度为180度每秒方; + *    末端型运动会设置末端型运动的最大速度和加速度,末端型运动的最大速度为2米每秒,最大加速度为2米每秒方; + * + **/ + int robotServiceSetGlobalMoveEndMaxLineAcc(double moveMaxAcc); + + int robotServiceSetGlobalMoveEndMaxLineVelc(double moveMaxVelc); + + void robotServiceGetGlobalMoveEndMaxLineAcc(double &moveMaxAcc); + + void robotServiceGetGlobalMoveEndMaxLineVelc(double &moveMaxVelc); + + int robotServiceSetGlobalMoveEndMaxAngleAcc(double moveMaxAcc); + + int robotServiceSetGlobalMoveEndMaxAngleVelc(double moveMaxVelc); + + void robotServiceGetGlobalMoveEndMaxAngleAcc(double &moveMaxAcc); + + void robotServiceGetGlobalMoveEndMaxAngleVelc(double &moveMaxVelc); + + /** + * 设置加加速度 + */ + int robotServiceSetJerkAccRatio(double acc); + + void robotServiceGetJerkAccRatio(double &acc); + + int robotServiceSetAngleJerkAccRatio(double acc); + + void robotServiceGetAngleJerkAccRatio(double &acc); + + /** 运动属性中的路点设置与获取 多用于轨迹运动**/ + void robotServiceClearGlobalWayPointVector(); + + /** + * @brief robotServiceAddGlobalWayPoint + * 添加路点,一般用于robotServiceTrackMove中 + * @param wayPoint  法兰盘中心基于基座标系的路点信息 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceAddGlobalWayPoint( + const aubo_robot_namespace::wayPoint_S &wayPoint); + + /** + * @brief robotServiceAddGlobalWayPoint + *添加路点,一般用于robotServiceTrackMove中 + * @param jointAngle    关节信息 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + **/ + + int robotServiceAddGlobalWayPoint( + const double jointAngle[aubo_robot_namespace::ARM_DOF]); + + void robotServiceGetGlobalWayPointVector( + std::vector &wayPointVector); + + /** 运动属性之交融半径的设置与获取 交融半径的范围:0.001m~1m + * 注意:交融半径必须大于或等于 0.001 + **/ + float robotServiceGetGlobalBlendRadius(); + + int robotServiceSetGlobalBlendRadius(float value); + + double robotServiceGetTrackPlaybackCycle(); + + int robotServiceSetTrackPlaybackCycle(double second); + + /** 运动属性之圆轨迹时圆的圈数 + * 当轨迹类型为ARC_CIR时有效,当圆的圈数属性(CircularLoopTimes)为0时,表示圆弧轨迹; + * 当圆的圈数属性(CircularLoopTimes)大于0时,表示圆轨迹。 + **/ + int robotServiceGetGlobalCircularLoopTimes(); + + void robotServiceSetGlobalCircularLoopTimes(int times); + + /** + * @brief robotServiceSetMoveRelativeParam 设置运动属性中的偏移属性 + * @param relativeMove 基于基座标系的偏移 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetMoveRelativeParam( + const aubo_robot_namespace::MoveRelative + &relativeMoveOnBase); //基于基座标系 + + /** + * @brief robotServiceSetMoveRelativeParam 设置运动属性中的偏移属性 + * @param relativeMoveOnUserCoord 基于用户坐标系(下面参数userCoord)下的偏移 + * @param userCoord 用户坐标系 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetMoveRelativeParam( + const aubo_robot_namespace::MoveRelative &relativeMoveOnUserCoord, + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &userCoord); //基于自定义坐标系 + + /** 跟随模式之提前到位 当前仅适用于关节运动**/ + int robotServiceSetNoArrivalAhead(); + + int robotServiceSetArrivalAheadDistanceMode(double distance /*米*/); + + int robotServiceSetArrivalAheadTimeMode(double second /*秒*/); + + int robotServiceSetArrivalAheadBlendDistanceMode(double distance /*米*/); + + /** + * @brief robotServiceSetTeachCoordinateSystem 设置示教运动的坐标系 + * @param coordSystem   用户坐标系 + * 通过该参数确定一个坐标系,具体使用参考类型定义处的使用说明 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetTeachCoordinateSystem( + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &coordSystem); + int waitarrive(); + /** + * @brief robotServiceJointMove 运动接口之关节运动 + * 属于关节型运动,调用该函数机械臂开始运动 + * @param wayPoint  目标路点信息 + * @param IsBolck IsBolck==true + * 代表阻塞,机械臂运动直到到达目标位置或者出现故障后返回。 IsBolck==false + * 代表非阻塞,立即返回,运动指令发送成功就返回,函数返回后机械臂开始运动。 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceJointMove(aubo_robot_namespace::wayPoint_S &wayPoint, + bool IsBolck); + + int robotServiceJointMove(double jointAngle[aubo_robot_namespace::ARM_DOF], + bool IsBolck); + + int robotServiceJointMove(aubo_robot_namespace::MoveProfile_t &moveProfile, + double jointAngle[aubo_robot_namespace::ARM_DOF], + bool IsBolck); + + //基于跟随模式的轴动接口 + int robotServiceFollowModeJointMove( + double jointAngle[aubo_robot_namespace::ARM_DOF]); + + /** + * @brief robotServiceLineMove 运动接口之直线运动 + * 属于末端型运动,调用该函数机械臂开始运动 + * @param wayPoint   目标路点信息 + * @param IsBolck 参考robotServiceJointMove函数的解释 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceLineMove(aubo_robot_namespace::wayPoint_S &wayPoint, + bool IsBolck); + + int robotServiceLineMove(double jointAngle[aubo_robot_namespace::ARM_DOF], + bool IsBolck); + + int robotServiceLineMove(aubo_robot_namespace::MoveProfile_t &moveProfile, + double jointAngle[aubo_robot_namespace::ARM_DOF], + bool IsBolck); + + /** + * @brief robotServiceRotateMove 运动接口之保持当前位置变换姿态做旋转运动 + * @param rotateAxis 转轴[x,y,z] 当绕X转,[1,0,0] + * @param rotateAngle  转角 + * @param IsBolck 是否阻塞 + * @return + */ + int robotServiceRotateMove( + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &userCoord, + const double rotateAxisOnUserCoord[3], double rotateAngle, + bool IsBolck); + /** 旋转运动到目标路点 **/ + int robotServiceRotateMoveToWaypoint( + const aubo_robot_namespace::wayPoint_S &targetWayPointOnBaseCoord, + bool IsBolck); + + /** + * @brief robotServiceGetRotateTargetWaypiont + * 根据当前位姿及基坐标系下表示的旋转轴、旋转角,获取目标位姿 + * @param originateWayPointOnBaseCoord 起始路点信息 + * @param rotateAxisOnBaseCoord 基坐标系下表示的旋转轴 + * @param rotateAngle 旋转角 + * @param targetWayPointOnBaseCoord 目标路点信息 (传出参数) + * @return + */ + int robotServiceGetRotateTargetWaypiont( + const aubo_robot_namespace::wayPoint_S &originateWayPointOnBaseCoord, + const double rotateAxisOnBaseCoord[], double rotateAngle, + aubo_robot_namespace::wayPoint_S &targetWayPointOnBaseCoord); + + /** + * @brief robotServiceGetRotateAxisUserToBase + * 将用户坐标系描述的旋转轴变换到基坐标系下描述 + * @param oriOnUserCoord 用户坐标系姿态 + * @param rotateAxisOnUserCoord 用户坐标系下描述的旋转轴 + * @param rotateAxisOnBaseCoord 基坐标系下描述的旋转轴(传出参数) + * @return + */ + int robotServiceGetRotateAxisUserToBase( + const aubo_robot_namespace::Ori &oriOnUserCoord, + const double rotateAxisOnUserCoord[], double rotateAxisOnBaseCoord[]); + + /** + * @brief robotServiceTrackMove 运动接口之轨迹运动 + * + * @param subMoveMode + * 当subMoveMode==ARC_CIR, CARTESIAN_MOVEP, CARTESIAN_CUBICSPLINE, CARTESIAN_UBSPLINEINTP时,该运动属于末端型运动; + * 当subMoveMode==JIONT_CUBICSPLINE,JOINT_UBSPLINEINTP时,该运动属于关节型运动; + * + * 当subMoveMode==ARC_CIR 表示圆或者圆弧    当圆的圈数属性(CircularLoopTimes)为0时,表示圆弧轨迹, + * + * 当圆的圈数属性(CircularLoopTimes)大于0时,表示圆轨迹。 + * + * 当subMoveMode==CARTESIAN_MOVEP + *      表示MOVEP轨迹,需要用户这只交融半径的属性。 + * + * 当subMoveMode==JOINT_UBSPLINEINTP    轨迹复现接口 + * + * @param IsBolck    参考robotServiceJointMove函数的解释 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceTrackMove(aubo_robot_namespace::move_track subMoveMode, + bool IsBolck); + + /** + * @brief robotMoveLineToTargetPosition + * 保持当前位姿通过直线运动的方式运动到目标位置,其中目标位置是通过相对当前位置的偏移给出 + * @param userCoord + * 用户坐标系 该坐标系参数(userCoord),表示下面的偏移量参数(relativeMoveOnUserCoord)是基于该平面的。 + * @param toolInEndDesc 工具参数   当没有使用工具时,将此参数设置为0; + * @param relativeMoveOnUserCoord 基于用户坐标系下的偏移 + * @param + * IsBolck                是否阻塞   参考robotServiceJointMove函数的解释 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotMoveLineToTargetPositionByRelative( + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &userCoord, + const aubo_robot_namespace::MoveRelative + &relativeMoveOnUserCoord, //目标位置相对当前位置的偏移 + bool IsBolck); //是否阻塞 + + /** 保持当前位姿通过关节运动的方式运动到目标位置 + * 参数描述参考robotMoveJointToTargetPosition **/ + int robotMoveJointToTargetPositionByRelative( + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &userCoord, + const aubo_robot_namespace::MoveRelative + &relativeMoveOnUserCoord, //目标位置相对当前位置的偏移 + bool IsBolck = false); //是否阻塞 + + //不进行运动 + int getJointAngleByTargetPositionKeepCurrentOri( + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &coordSystem, + const aubo_robot_namespace::Pos &toolEndPositionOnUserCoord, + const aubo_robot_namespace::ToolInEndDesc + &toolInEndDesc, //相对于用户坐标系的目标位置 + double jointAngle[aubo_robot_namespace::ARM_DOF]); + + int getJointAngleByTargetPositionKeepCurrentOri( + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &userCoordSystem, + const aubo_robot_namespace::Pos &position, + const aubo_robot_namespace::ToolInEndDesc &toolInEndDesc, + aubo_robot_namespace::wayPoint_S &targetWayPointOnBaseCoord); + + /** + * @brief robotMoveLineToTargetPosition + * 保持当前位姿通过直线运动的方式运动到目标位置。 + * @param userCoord + * 用户坐标系 该坐标系参数(userCoord),表示下面的目标位置(positionOnUserCoord)是基于该平面的。 + * @param positionOnUserCoord 基于用户平面表示的目标位置 + * @param toolInEndDesc + 工具参数   当没有使用工具时,将此参数设置为0; + * @param + * IsBolck               是否阻塞   参考robotServiceJointMove函数的解释 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotMoveLineToTargetPosition( + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &userCoord, + const aubo_robot_namespace::Pos &toolEndPositionOnUserCoord, + const aubo_robot_namespace::ToolInEndDesc + &toolInEndDesc, //相对于用户坐标系的目标位置 + bool IsBolck = false); //是否阻塞 + + /** 保持当前位姿通过关节运动的方式运动到目标位置 + * 参数描述参考robotMoveJointToTargetPosition **/ + int robotMoveJointToTargetPosition( + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &userCoord, + const aubo_robot_namespace::Pos &toolEndPositionOnUserCoord, + const aubo_robot_namespace::ToolInEndDesc + &toolInEndDesc, //相对于用户坐标系的目标位置 + bool IsBolck = false); //是否阻塞 + + /** + * @brief 获取机械臂运动轨迹(目前支持轴动及笛卡尔直线运动) + * @param mode 运动类型: 0为轴动,1为笛卡尔直线运动 + * @param resolution 轨迹点的更新步长,单位:m + * @param joint_start 起始点六个关节弧度值 + * @param joint_end 终点六个关节弧度值 + * @param wayPoint_Vector 两点之间轨迹路点的六个关节角度值 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetTrackAtResolutionLength( + int mode, double resolution, const double joint_start[], + const double joint_end[], + std::vector &way_point); + + /** + * @brief 开始示教 + * @param mode 示教关节:JOINT1,JOINT2,JOINT3, JOINT4,JOINT5,JOINT6, + * 位置示教:MOV_X,MOV_Y,MOV_Z 姿态示教:ROT_X,ROT_Y,ROT_Z + * @param direction 运动方向 正方向true 反方向false + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceTeachStart(aubo_robot_namespace::teach_mode mode, + bool direction); + + /** @brief 结束示教 **/ + int robotServiceTeachStop(); + + /** + * @brief 机械臂运动控制 停止,暂停,继续 + * @param cmd 控制命令 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int rootServiceRobotMoveControl( + aubo_robot_namespace::RobotMoveControlCommand cmd); + + /** @brief 机械臂运动快速停止 **/ + int robotMoveFastStop(); + + /** @brief 终止机械臂运动**/ + int robotMoveStop(); + + // 等待非阻塞运动到位或结束 + int robotWaitMotionFinish(int timeout_ms = 0); + + /** + * @brief robotSetReducePara + * @param jerkRatio [0.1,20] + * @param acc 6维数组, + * 1,末端型运动,只使用acc[0] 最大加速度 + * 2,轴动,使用acc[0,5] 关节最大加速度 + * @param size + * @return 0 成功,其他失败 + */ + int robotSetReducePara(const double jerkRatio, const double acc[], + int size); + + /** 离线轨迹 **/ + /** @brief 将离线路点缓存进类成员变量中 + * @param wayPointVector 离线路点 + * @return 调用成功返回ErrnoSucc + */ + int robotServiceOfflineTrackWaypointAppend( + const std::vector &wayPointVector); + + /** + * @brief robotServiceOfflineTrackWaypointAppend + * 从文件中读取路点并缓存进类成员变量 + * @param fileName + * 路点存储文件名 + * @return 调用成功返回ErrnoSucc + */ + int robotServiceOfflineTrackWaypointAppend(const char *fileName); + + /** + * @brief robotServiceOfflineTrackWaypointClear + * 清空离线路点缓存 + * @return 调用成功返回ErrnoSucc + */ + int robotServiceOfflineTrackWaypointClear(); + + /** + * @brief robotServiceOfflineTrackMoveStartup + * 离线轨迹开始运动 + * @param IsBolck + * 是否阻塞 + * @return 调用成功返回ErrnoSucc + */ + int robotServiceOfflineTrackMoveStartup(bool IsBolck); + + /** + * @brief robotServiceOfflineTrackMoveStop + * 终止离线轨迹运动 + * @return 调用成功返回ErrnoSucc + */ + int robotServiceOfflineTrackMoveStop(); + + /** tcp转can透传 **/ + /** + * @brief robotServiceEnterTcp2CanbusMode + * 进入tcp转can透传模式 + * @return 调用成功返回ErrnoSucc + */ + int robotServiceEnterTcp2CanbusMode(); + + /** + * @brief robotServiceLeaveTcp2CanbusMode + * 退出tcp转can透传模式 + * @return 调用成功返回ErrnoSucc + */ + int robotServiceLeaveTcp2CanbusMode(); + + /** + * @brief robotServiceSetRobotPosData2Canbus + * 机械臂位姿tcp转can透传 + * @param jointAngle + * 机械臂关节角度 + * @return 调用成功返回ErrnoSucc + */ + int robotServiceSetRobotPosData2Canbus( + double jointAngle[aubo_robot_namespace::ARM_DOF]); + + /** + * @brief robotServiceSetRobotPosData2Canbus + * 机械臂位姿tcp转can透传 + * @param wayPointVector + * 路点 + * @return 调用成功返回ErrnoSucc + */ + int robotServiceSetRobotPosData2Canbus( + const std::vector &wayPointVector); + + int startupOfflineExcitTrajService( + const char *trackFile, + aubo_robot_namespace::Robot_Dyn_identify_traj type, int subtype, + bool isBolck); + + int getDynIdentifyResultsService(std::vector ¶mVector); + + int startMoveGroup(aubo_robot_namespace::MoveModeType type = + aubo_robot_namespace::MoveModeType::MOVE_GROUP, + bool conveyer = false, int conveyer_index = 0); + + int setEndOfMoveGroup(); + + int waitMoveGroupFinished(); + + /*******************************************************************工具接口************************************************************* + * 工具接口:正解接口, + * 逆解接口, + * 工具标定接口 + * 坐标系标定接口 + *      基座标系转用户坐标系接口 + *      用户坐标系转基坐标系接口 + * + **************************************************************************************************************************************************/ + /** + * @brief 正解     此函数为正解函数,已知关节角求对应位置的位置和姿态。 + * @param jointAngle 六个关节的关节角    输入参数 单位:弧度(rad) + * @param size 关节角数组长度 规定为6个 + * @param wayPoint 正解结果    输出参数 + *    结果示例: 六个关节角 {'joint': [1.0, 1.0, 1.0, 1.0, 1.0, 1.0], + * 位置 'pos': [-0.06403157614989634, -0.4185973810159096, + * 0.816883228463401], 姿态 'ori': [-0.11863209307193756, + * 0.3820514380931854, 0.0, 0.9164950251579285]} + * + * @return 调用成功返回ErrnoSucc;错误返回错误号 + * 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceRobotFk(const double *jointAngle, int size, + aubo_robot_namespace::wayPoint_S &wayPoint); + + /** + * @brief用于计算第五、六关节后盖位置。 + * @param jointAngle 六个关节的关节角    输入参数 单位:弧度(rad) + * @param size 需要计算的关节 规定为 4(五关节)或5(六关节) + * @param wayPoint 结果    输出参数 + *调用示例,计算第六关节后盖位置,size为5,补偿值为-0.0598 + * ret = robotService.robotServiceRobotFk(wp_start, + *5,true,-0.0598,wayPoint); + * @return 调用成功返回ErrnoSucc;错误返回错误号 + *调用成功返回ErrnoSucc;错误返回错误号 + **/ + int robotServiceRobotFk(const double *jointAngle, int size, bool enable, + double compensate, + aubo_robot_namespace::wayPoint_S &wayPoint); + + /** + * @brief + * 逆解     此函数为机械臂逆解函数,根据位置信息(x,y,z)和对应位置的参考姿态(w,x,y,z)得到对应位置的关节角信息。 + * 机器人运动学方程的逆解,也称机器人的逆运动学问题。 + * 逆运动学问题:对某个机器人,当给出机器人手部(法兰盘中心)在基座标系中所处的位置和姿态时,求出其对应的关节角信息。 + * @param position 目标路点的位置    单位:米 输入参数 + * @param ori 目标路点的参考姿态 + *  输入参数    例如:可以获取当前位置位姿作为此参数,这样相当于保持当前姿态 + * @param wayPoint 计算结果----目标路点信息 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceRobotIk(const double *startPointJointAngle, + const aubo_robot_namespace::Pos &position, + const aubo_robot_namespace::Ori &ori, + aubo_robot_namespace::wayPoint_S &wayPoint); + + int robotServiceRobotIk( + const aubo_robot_namespace::Pos &position, + const aubo_robot_namespace::Ori &ori, + std::vector &wayPointVector); + + //工具标定 + int robotServiceToolCalibration( + const std::vector &wayPointPosVector, + char poseCalibMethod, + aubo_robot_namespace::ToolInEndDesc &toolInEndDesc); + + /** + * @brief toolCalibration + *  工具标定  该函数能标定出工具的位置信息和姿态信息 + * @param wayPointPosCalibVector  提供4个或4个以上的点用于位置标定 + * @param wayPointOriCalibVector  提供两个点用于姿态标定 + * @param poseCalibMethod      标定方法 + * @param toolInEndDesc       标定的结果 + * @return + */ + int robotServiceToolCalibration( + const std::vector + &wayPointPosCalibVector, + const std::vector + &wayPointOriCalibVector, + aubo_robot_namespace::ToolKinematicsOriCalibrateMathod poseCalibMethod, + aubo_robot_namespace::ToolInEndDesc &toolInEndDesc); + + /** + * @brief robotServiceCheckUserCoordinate 检查提供的参数是否标定出一个坐标系 + * @param coordSystem    坐标系提供的参数 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceCheckUserCoordinate( + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &coordSystem); + int calculate_Feature_Poses( + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &userCoord, + std::vector &coord_arcs); + /** + * @brief robotServiceUserCoordinateCalibration 用户坐标系校准 + * @param coordSystem 坐标系提供的参数 + * @param bInWPos + * @param bInWOri + * @param wInBPos + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceUserCoordinateCalibration( + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &coordSystem, + double bInWPos[3], double bInWOri[9], double wInBPos[3]); + bool circleFourthPoint(const std::vector &p1, + const std::vector &p2, + const std::vector &p3, + std::vector &p4); + int robotServiceOriMatrixToQuaternion(double eerot[], + aubo_robot_namespace::Ori &result); + + /** + * @brief baseToUserCoordinate 基座标系转用户坐标系 + * + * 概述: + * 将法兰盘中心基于基座标系下的位置和姿态 转成 工具末端基于用户座标系下的位置和姿态。 + * + *  扩展1: + * 法兰盘中心可以看成是一个特殊的工具,即工具的位置为(0,0,0)姿态为(1,0,0,0) + * + * 因此当工具为(0,0,0)时,相当于将法兰盘中心基于基座标系下的位置和姿态 转成 法兰盘中心基于用户座标系下的位置和姿态。 + * + *     扩展2: + * 用户坐标系也可以选择成基座标系,  即:userCoord.coordType = + * BaseCoordinate + * 因此当用户平面为基座标系时,相当于将法兰盘中心基于基座标系下的位置和姿态 转成 工具末端基于基座标系下的位置和姿态, + * 即在基座标系加工具。 + * + * @param flangeCenterPositionOnBase + * 基于基座标系的法兰盘中心位置信息(x,y,z) 单位(m) + * @param flangeCenterOrientationOnBase 基于基座标系的姿态信息(w, x, + * y, z) + * @param userCoord 用户坐标系 + * 通过该参数确定一个坐标系 + * @param toolInEndDesc 工具信息 + * @param toolEndPositionOnUserCoord 基于用户座标系的工具末端位置信息 + * 输出参数 + * @param toolEndOrientationOnUserCoord 基于用户座标系的工具末端姿态信息 + * 输出参数 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int baseToUserCoordinate( + const aubo_robot_namespace::Pos + &flangeCenterPositionOnBase, //基于基座标系的法兰盘中心位置信息 + const aubo_robot_namespace::Ori + &flangeCenterOrientationOnBase, //基于基座标系的姿态信息 + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &userCoord, //用户坐标系 + const aubo_robot_namespace::ToolInEndDesc &toolInEndDesc, //工具参数 + aubo_robot_namespace::Pos + &toolEndPositionOnUserCoord, //基于用户座标系的工具末端位置信息 + aubo_robot_namespace::Ori + &toolEndOrientationOnUserCoord //基于用户座标系的工具末端姿态信息 + ); + + /** + * @brief baseToBaseAdditionalTool + *  基坐标系转基座标得到工具末端点的位置和姿态 + * + * @param flangeCenterPositionOnBase 基于基座标系的法兰盘中心位置信息 + * @param flangeCenterOrientationOnBase 基于基座标系的姿态信息 + * @param toolInEndDesc 工具信息 + * @param toolEndPositionOnUserCoord 基于基座标系的工具末端位置信息 + * 输出参数 + * @param toolEndOrientationOnUserCoord 基于基座标系的工具末端姿态信息 + * 输出参数 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int baseToBaseAdditionalTool( + const aubo_robot_namespace::Pos + &flangeCenterPositionOnBase, //基于基座标系的法兰盘中心位置信息 + const aubo_robot_namespace::Ori + &flangeCenterOrientationOnBase, //基于基座标系的法兰盘姿态信息 + const aubo_robot_namespace::ToolInEndDesc &toolInEndDesc, //工具信息 + aubo_robot_namespace::Pos + &toolEndPositionOnBase, //基于基座标系的工具末端位置信息 + aubo_robot_namespace::Ori + &toolEndOrientationOnBase //基于基座标系的工具末端姿态信息); + ); + + /** + * @brief userToBaseCoordinate + * 用户坐标系位置和姿态信息转基座标系下位置和姿态信息 + * + * 概述: + * 将工具末端基于用户座标系下的位置和姿态 转成 法兰盘中心基于基座标系下的位置和姿态。 + * + *  扩展1: + * 法兰盘中心可以看成是一个特殊的工具,即工具的位置为(0,0,0)姿态为(1,0,0,0) + * + * 因此当工具工具的位置为(0,0,0)姿态为(1,0,0,0)时,表示toolEndPositionOnUserCoord和toolEndOrientationOnUserCoord是无工具的。 + * + *     扩展2: + * 用户坐标系也可以选择成基座标系,  即:userCoord.coordType = + * BaseCoordinate 因此当用户平面为基座标系时,相当于 + * 将工具末端基于基座标系下的位置和姿态 转成 法兰盘中心基于基座标系下的位置和姿态, + * 即在基座标系去工具. + * + * 扩展3: + * 利用该函数和逆解组合实现     当用户提供自定义坐标系(特殊为基座标系)下工具末端的位置和姿态 得到 基座标系下法兰盘中心的位置和姿态 + *         然后在逆解,得到目标路点。 + * + * @param toolEndPositionOnUserCoord 基于用户座标系的工具末端位置信息 + * @param toolEndOrientationOnUserCoord 基于用户座标系的工具末端姿态信息 + * @param userCoord 用户坐标系 + * 通过该参数确定一个坐标系 + * @param toolInEndDesc 工具信息 + * @param flangeCenterPositionOnBase 基于基座标系的法兰盘中心位置信息 + * @param flangeCenterOrientationOnBase 基于基座标系的姿态信息 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + * + * 注:这个的坐标系转换不支持末端系  即不支持userCoord==EndCoordinate,如果userCoord==EndCoordinate会报参数错误(ErrCode_ParamError) + */ + int userToBaseCoordinate( + const aubo_robot_namespace::Pos + &toolEndPositionOnUserCoord, //基于用户座标系的工具末端位置信息 + const aubo_robot_namespace::Ori + &toolEndOrientationOnUserCoord, //基于用户座标系的工具末端姿态信息 + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &userCoord, //用户坐标系 + const aubo_robot_namespace::ToolInEndDesc &toolInEndDesc, //工具信息 + aubo_robot_namespace::Pos + &flangeCenterPositionOnBase, //基于基座标系的法兰盘中心位置信息 + aubo_robot_namespace::Ori + &flangeCenterOrientationOnBase //基于基座标系的法兰盘中心姿态信息 + ); + + /** + * @brief userCoordPointToBasePoint + * 将空间内一个基于用户坐标系的位置信息(x,y,z) 转换成基于 基座标下的位置信息(x,y,z) + * + * @param userCoordPoint 用户坐标系下的位置信息 + * x,y,z(必须的基于下面参数提供的坐标系下的) + * @param userCoordSystem    用户坐标系描述 + * 通过该参数确定一个坐标系 不能为末端坐标系 如果userCoord==EndCoordinate会报参数错误(ErrCode_ParamError) + * @param basePoint        基于基坐标系下的位置信息x,y,z + * @return 调用成功返回ErrnoSucc;错误返回错误号 + * + * 注:这个的坐标系转换不支持末端系  即不支持userCoord==EndCoordinate,如果userCoord==EndCoordinate会报参数错误(ErrCode_ParamError) + */ + int userCoordPointToBasePoint( + const aubo_robot_namespace::Pos &userCoordPoint, + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &userCoordSystem, + aubo_robot_namespace::Pos &basePoint); + + //法兰盘姿态转成工具姿态 + static int endOrientation2ToolOrientation( + aubo_robot_namespace::Ori &tcpOriInEnd, + const aubo_robot_namespace::Ori &endOri, + aubo_robot_namespace::Ori &toolOri); + + //工具姿态转成法兰盘姿态 + static int toolOrientation2EndOrientation( + aubo_robot_namespace::Ori &tcpOriInEnd, + const aubo_robot_namespace::Ori &toolOri, + aubo_robot_namespace::Ori &endOri); + + //根据位置获取目标路点信息 + int getTargetWaypointByPosition( + const aubo_robot_namespace::wayPoint_S &sourceWayPointOnBaseCoord, + const aubo_robot_namespace::CoordCalibrateByJointAngleAndTool + &userCoordSystem, + const aubo_robot_namespace::Pos &toolEndPosition, + const aubo_robot_namespace::ToolInEndDesc &toolInEndDesc, + aubo_robot_namespace::wayPoint_S &targetWayPointOnBaseCoord); + + /** + * @brief quaternionToRPY 四元素转欧拉角 + * @param ori     姿态的四元素表示方法 + * @param rpy     姿态的欧拉角表示方法 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + static int quaternionToRPY(const aubo_robot_namespace::Ori &ori, + aubo_robot_namespace::Rpy &rpy); + + /** + * @brief RPYToQuaternion 欧拉角转四元素 + * @param rpy 姿态的欧拉角表示方法 + * @param ori 姿态的四元素表示方法 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + static int RPYToQuaternion(const aubo_robot_namespace::Rpy &rpy, + aubo_robot_namespace::Ori &ori); + + /** + * @brief 坐标变换(F_c_a = F_c_b * F_b_a) + * @param F_b_a: a 相对于 b 的位姿 + * @param F_c_b: b 相对于 c 的位姿 + * @return a 相对于 c 的位姿 + */ + int poseTrans(const aubo_robot_namespace::PositionAndQuaternion &F_b_a, + const aubo_robot_namespace::PositionAndQuaternion &F_c_b, + aubo_robot_namespace::PositionAndQuaternion &F_c_a); + + /** + * @brief 齐次变换矩阵的逆 + * @param F_b_a: a 相对于 b 的位姿 + * @return b 相对于 a 的位姿 + */ + int poseInv(const aubo_robot_namespace::PositionAndQuaternion &F_b_a, + aubo_robot_namespace::PositionAndQuaternion &F_a_b); + + /** + * @brief getErrDescByCode 根据错误号获取错误信息 + * @param code  错误号 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + std::string getErrDescByCode(aubo_robot_namespace::RobotErrorCode code); + + /********************************************************************************************************************************************** + ************************************************************机械臂控制接口********************************************************************** + **********************************************************************************************************************************************/ + /** + * @brief 机械臂控制 + * @param cmd 控制命令 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int rootServiceRobotControl( + const aubo_robot_namespace::RobotControlCommand cmd); + + /** + * @brief 设置机械臂的电源状态 + * @param value + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServicePowerControl(bool value); + + int robotServiceReleaseBrake(); + + /** + * @brief rootServiceRobotStartup + * 启动机械臂-----该操作会完成机械臂的上电,松刹车,设置碰撞等级,设置动力学参数等功能。 + * @param toolDynamicsParam      动力学参数 + * @param collisionClass        碰撞等级 + * @param readPose 是否允许读取位置   默认是true + * @param staticCollisionDetect + * @param boardBaxAcc + * @param result + * @param IsBolck + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int rootServiceRobotStartup( + const aubo_robot_namespace::ToolDynamicsParam &toolDynamicsParam, + uint8 collisionClass, bool readPose, bool staticCollisionDetect, + int boardBaxAcc, aubo_robot_namespace::ROBOT_SERVICE_STATE &result, + bool IsBolck = true); + + /** + * @brief 关机 + * @param IsBolck 是否阻塞 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceRobotShutdown(bool IsBolck = true); + + /********************************************************************************************************************************************** + ********************************************************************************************************************************************** + ************************************************************关于末端工具的接口******************************************************************* + ********************************************************************************************************************************************** + **********************************************************************************************************************************************/ + /** 设置无工具的动力学参数 **/ + int robotServiceSetNoneToolDynamicsParam(); + + /** 设置工具的动力学参数  **/ + int robotServiceSetToolDynamicsParam( + const aubo_robot_namespace::ToolDynamicsParam &toolDynamicsParam); + + /** 获取工具的动力学参数  **/ + int robotServiceGetToolDynamicsParam( + aubo_robot_namespace::ToolDynamicsParam &toolDynamicsParam); + + /** 设置无工具运动学参数  **/ + int robotServiceSetNoneToolKinematicsParam(); + + /** 设置工具的运动学参数  **/ + int robotServiceSetToolKinematicsParam( + const aubo_robot_namespace::ToolKinematicsParam &toolKinematicsParam); + + /** 获取工具的运动学参数  **/ + int robotServiceGetToolKinematicsParam( + aubo_robot_namespace::ToolKinematicsParam &toolKinematicsParam); + + /********************************************************************************************************************************************** + ************************************************************机械臂相关参数设置与获取的接口********************************************************* + **********************************************************************************************************************************************/ + /** + * @brief robotServiceGetRobotWorkMode   获取当前机械臂模式 + * @param mode 输出参数  仿真或真实的枚举类型 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetRobotWorkMode(aubo_robot_namespace::RobotWorkMode &mode); + + /** + * @brief robotServiceSetRobotWorkMode 设置当前机械臂模式 仿真或真实 + * @param mode   仿真或真实的枚举类型 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetRobotWorkMode(aubo_robot_namespace::RobotWorkMode mode); + + /** + * @brief robotServiceSetEnableForceTeachWhenProjectIsRunning + * 在工程运行的时候使能/失能力控模式 + * @param enable true:使能 false:失能 + * @return + */ + int robotServiceSetEnableForceTeachWhenProjectIsRunning(bool enable); + + /** + * @brief robotServiceSetRobotWorkMode 获取重力分量 + * @param mode   输出参数  仿真或真实的枚举类型 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetRobotGravityComponent( + aubo_robot_namespace::RobotGravityComponent &gravityComponent); + + //业务接口: 获取当前碰撞等级 + int robotServiceGetRobotCollisionCurrentService(int &collisionGrade); + + //业务接口: 设置碰撞等级 + int robotServiceSetRobotCollisionClass(int grade); + int robotServiceSetRobotCollisionClass( + int grade, aubo_robot_namespace::CollisionMode collisionMode); + + //业务接口:获取设备信息 + int robotServiceGetRobotDevInfoService( + aubo_robot_namespace::RobotDevInfo &devInfo); + int robotServiceGetRobotIoConfigService( + aubo_robot_namespace::IoConfig &ioconfig); + + //设置最大加速度 + int robotServiceSetRobotMaxACC(int maxAcc); + + //碰撞恢复 + int robotServiceCollisionRecover(); + + // 关节回复到安全限制以内 + int robotServiceJointPosRecover(bool confirm); + + //获取机械臂当前状态 + int robotServiceGetRobotCurrentState( + aubo_robot_namespace::RobotState &state); + + //获取通讯状态 + int robotServiceGetMacCommunicationStatus(bool &value); + + /** + * @brief robotServiceGetIsRealRobotExist 获取是否存在真实机械臂 + * @param value 输出参数  存在为true,不存在为false + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetIsRealRobotExist(bool &value); + + /** + * @brief robotServiceGetJoint6Rotate360EnableFlag 获取6关节旋转360使能标志 + * @param value + * @return + */ + int robotServiceGetJoint6Rotate360EnableFlag(bool &value); + + /** + * @brief robotServiceGetRobotJointStatus 获取机械臂关节状态 + * @param jointStatus 关节角缓冲区  输出参数 + * @param size 关节角缓冲区长度 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetRobotJointStatus( + aubo_robot_namespace::JointStatus *jointStatus, int size); + + /** + * @brief robotServiceGetRobotDiagnosisInfo 获取机械臂诊断信息 + * @param robotDiagnosisInfo 输出参数 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetRobotDiagnosisInfo( + aubo_robot_namespace::RobotDiagnosis &robotDiagnosisInfo); + + /** + * @brief robotServiceGetJointAngleInfo 获取机械臂当前关节角信息 + * @param jointParam 输出参数 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetJointAngleInfo( + aubo_robot_namespace::JointParam &jointParam); + + int robotServiceGetCorrectedWaypoint( + const aubo_robot_namespace::wayPoint_S source, + aubo_robot_namespace::wayPoint_S &waypint); + + /** + * @brief robotServiceGetCurrentWaypointInfo 获取机械臂当前路点信息 + * @param wayPoint 输出参数 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetCurrentWaypointInfo( + aubo_robot_namespace::wayPoint_S &wayPoint); + + /** + * @brief robotServerGetToolForceSensorData 获取力传感器数据 + * @param data 输出力传感器数据 + * @return 调用成功返回ErrnoSucc + */ + int robotServerGetToolForceSensorData( + aubo_robot_namespace::ForceSensorData &data); + + /** + * @brief robotServiceSetJointRangeOfMotion 设置关节运动范围 + * @param rangeOfMotion + * @return + */ + int robotServiceSetJointRangeOfMotion( + const aubo_robot_namespace::JointRangeOfMotion &rangeOfMotion); + + /** + * @brief robotServiceGetJointRangeOfMotion 获取关节运动范围 + * @param rangeOfMotion + * @return + */ + int robotServiceGetJointRangeOfMotion( + aubo_robot_namespace::JointRangeOfMotion &rangeOfMotion); + int robotServiceGetJointPositionLimit( + aubo_robot_namespace::JointRangeOfMotion &rangeOfMotion); + + /*****************************************************************************************************************************************************/ + /* 安全IO相关 */ + /* */ + /****************************************************************************************************************************************************/ + int robotServiceSetRobotAtOriginPose(); + + /** + * @brief 通知接口板上位机暂停状态 + * @param data + * @return + */ + int robotServiceSetRobotOrpePause(uint8 data); + + /** + * @brief 通知接口板上位机停止状态 + * @param data + * @return + */ + int robotServiceSetRobotOrpeStop(uint8 data); + + /** + * @brief 通知机械臂工程启动,服务器同时开始检测安全IO + * @return + */ + int robotServiceSetRobotProjectStartup(); + + /** + * @brief 通知机械臂工程停止,服务器停止检测安全IO + * @return + */ + int robotServiceSetRobotProjectStop(); + + /** + * @brief 通知接口板上位机错误 + * @param 16个字节的错误数据,每个错误占一个bit + * @return + */ + int robotServiceSetRobotOrpeError(uint8 data[], int len); + + /** + * @brief 解除系统紧急停止输出信号 0-无动作 1-解除 + * @param data + * @return + */ + int robotServiceClearSystemEmergencyStop(uint8 data); + + /** + * @brief 解除缩减模式错误 0-无效 1-解除 + * @param data + * @return + */ + int robotServiceClearReducedModeError(uint8 data); + + /** + * @brief 防护重置成功 0-无动作 1-解除 + * @param data + * @return + */ + int robotServiceRobotSafetyguardResetSucc(uint8 data); + + /** + * @brief 设置机械臂运动进入缩减模式 + * @return + */ + bool robotServiceEnterRobotReduceMode(); + + /** + * @brief 设置机械臂运动退出缩减模式 + * @return + */ + bool robotServiceExitRobotReduceMode(); + + /********************************************************************************************************************************************** + ************************************************************关于接口板IO的接口********************************************************************** + **********************************************************************************************************************************************/ + /** + * @brief 获取接口板指定IO集合的配置信息 + * @param ioType IO类型的集合 输入参数 + * @param configVector IO配置信息的集合 输出参数 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetBoardIOConfig( + const std::vector &ioType, + std::vector &configVector); + + /** + * @brief 获取接口板指定IO集合的状态信息 + * @param ioType + * @param statusVector + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetBoardIOStatus( + const std::vector ioType, + std::vector &statusVector); + + /** + * @brief 根据接口板IO类型和名称设置IO状态 + * @param type IO类型 + * @param name IO名称 + * @param value IO状态 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetBoardIOStatus(aubo_robot_namespace::RobotIoType type, + std::string name, double value); + + /** + * @brief 根据接口板IO类型和地址设置IO状态 + * @param type IO类型 + * @param addr IO地址 + * @param value IO状态 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetBoardIOStatus(aubo_robot_namespace::RobotIoType type, + int addr, double value); + + /** + * @brief 根据接口板IO类型和名称设置脉冲 + * @param type IO类型 + * @param addr IO地址 + * @param value IO状态 + * @param duration 脉冲时长(ms) + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetBoardIOPulse(aubo_robot_namespace::RobotIoType type, + std::string name, double value, + int millisecond); + + /** + * @brief 根据接口板IO类型和地址设置脉冲 + * @param type IO类型 + * @param addr IO地址 + * @param value IO状态 + * @param duration 脉冲时长(ms) + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetBoardIOPulse(aubo_robot_namespace::RobotIoType type, + int addr, double value, int millisecond); + + /** + * @brief 根据接口板IO类型和名称获取IO状态 + * @param type IO类型 + * @param name IO名称 + * @param value IO状态 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetBoardIOStatus(aubo_robot_namespace::RobotIoType type, + std::string name, double &value); + + /** + * @brief 根据接口板IO类型和地址获取IO状态 + * @param type IO类型 + * @param addr IO地址 + * @param value IO状态 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetBoardIOStatus(aubo_robot_namespace::RobotIoType type, + int addr, double &value); + + /** + * @brief 返回当前机械臂是否运行在联机模式 + * @param isOnlineMode true:联机 false:非联机 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceIsOnlineMode(bool &isOnlineMode); + + /** + * @brief 返回当前机械臂是否运行在联机主模式 + * @param isOnlineMode true:联机主模式 false:联机从模式 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceIsOnlineMasterMode(bool &isOnlineMasterMode); + + //业务接口: 获取机械臂安全配置 + int robotServiceGetRobotSafetyConfig( + aubo_robot_namespace::RobotSafetyConfig &safetyConfig); + + //业务接口: 设置机械臂安全配置 + int robotServiceSetRobotSafetyConfig( + const aubo_robot_namespace::RobotSafetyConfig &safetyConfig); + + //业务接口: 获取机械臂安全状态 + int robotServiceGetOrpeSafetyStatus( + aubo_robot_namespace::OrpeSafetyStatus &safetyStatus); + + /********************************************************************************************************************************************** + ************************************************************关于tool + *IO的接口********************************************************************** + **********************************************************************************************************************************************/ + /** + * @brief 设置工具端电源电压类型 + * @param type 电源电压类型 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetToolPowerVoltageType( + aubo_robot_namespace::ToolPowerType type); + + /** + * @brief 获取工具端电源电压类型 + * @param 输出参数 接口调用成功后返回的电源电压类型 + * @return + */ + int robotServiceGetToolPowerVoltageType( + aubo_robot_namespace::ToolPowerType &type); + + /** + * @brief 获取工具端的电源电压 + * @param value 输出参数 + * @return + */ + int robotServiceGetToolPowerVoltageStatus(double &value); + + /** + * @brief robotServiceSetToolPowerTypeAndDigitalIOType + * 设置工具端电源电压类型and所有数字量IO的类型 + * @param type + * @param io0 + * @param io1 + * @param io2 + * @param io3 + * @return + */ + int robotServiceSetToolPowerTypeAndDigitalIOType( + aubo_robot_namespace::ToolPowerType type, + aubo_robot_namespace::ToolIOType io0, + aubo_robot_namespace::ToolIOType io1, + aubo_robot_namespace::ToolIOType io2, + aubo_robot_namespace::ToolIOType io3); + + /** + * @brief 设置工具端数字量IO的类型 输入或者输出 + * @param 地址 + * @param 类型 输入或者输出 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetToolDigitalIOType( + aubo_robot_namespace::ToolDigitalIOAddr addr, + aubo_robot_namespace::ToolIOType type); + + /** + * @brief 获取工具端所有数字量IO的状态 + * @param statusVector 输出参数 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetAllToolDigitalIOStatus( + std::vector &statusVector); + + /** + * @brief 根据地址设置工具端数字量IO的状态 + * @param addr IO地址 + * @param value IO状态 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetToolDOStatus( + aubo_robot_namespace::ToolDigitalIOAddr addr, + aubo_robot_namespace::IO_STATUS value); + + /** + * @brief 根据名称设置工具端数字量IO的状态 + * @param addr IO地址 + * @param value IO状态 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetToolDOStatus(std::string name, + aubo_robot_namespace::IO_STATUS value); + + /** + * @brief 根据地址设置工具端数字量IO的脉冲 + * @param addr IO地址 + * @param value IO状态 + * @param duration 脉冲时长(ms) + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetToolDOPulse(int addr, double value, int millisecond); + + /** + * @brief 根据名称设置工具端数字量IO的脉冲 + * @param addr IO地址 + * @param value IO状态 + * @param duration 脉冲时长(ms) + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetToolDOPulse(std::string name, double value, + int millisecond); + + /** + * @brief 根据名称获取工具端IO的状态 + * @param name IO名称 + * @param value IO状态 输出参数 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetToolIoStatus(std::string name, double &value); + + /** + * @brief 获取工具端所有AI的状态 + * @param 输出参数 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetAllToolAIStatus( + std::vector &statusVector); + + /** + * @brief robotServiceUpdateRobotBoardFirmware 接口板固件升级 + * @param cmd 接口板固件升级类型 + * @param data + * @param length z + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceUpdateRobotBoardFirmware( + aubo_robot_namespace::update_board_firmware_cmd cmd, const void *data, + uint16 length); + + /** + * @brief robotServiceGetBoardFirmwareUpdateResultService + * 获取接口板固件升级结果 + * @param value 返回是否成功 + * @return + */ + int robotServiceGetBoardFirmwareUpdateResultService(bool &value); + + /** + * @brief robotServiceGetRobotEthernetDeviceName 获取网卡设备名称 + * @param ethernetDeviceName 返回网卡设备名称 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetRobotEthernetDeviceName(std::string ðernetDeviceName); + + //获取服务器版本信息 + int robotServiceGetServerVersionInfo(std::string &versionInfo); + + /** + * @brief 设置关节碰撞补偿(范围0.00~0.51度) + * @param jointOffset + * @return + */ + int robotServiceSetRobotJointOffset( + aubo_robot_namespace::RobotJointOffset &jointOffset); + + int robotServiceSetConveyorEncoderReset(void); + + /** + * @brief 启动传送带 + * @return + */ + int robotServiceSetConveyorStartup(void); + + /** + * @brief 停止传送带 + * @return + */ + int robotServiceSetConveyorStop(void); + + /** + * @brief 设置传送带方向 + * @param dir + * @return + */ + int robotServiceSetConveyorDir(int dir); + + /** + * @brief 设置手眼标定结果关系 + * @param robotCameraCalib + */ + int robotServiceSetRobotCameraCalib( + const aubo_robot_namespace::RobotCameraCalib &robotCameraCalib); + + /** + * @brief 设置传送带线速度 + * @param conveyorVelc (米/秒) + */ + int robotServiceSetConveyorVelc(const double conveyorVelc); + + /** + * @brief 设置编码器距离关系 + * @param encoderValPerMeter 编码器距离关系(编码器脉冲个数/米) + */ + int robotServiceSetEncoderValPerMeter(const uint32_t &encoderValPerMeter); + + /** + * @brief 设置传送带起始窗口上限 + * @param startWindowUpstream 单位:米 + */ + int robotServiceSetStartWindowUpstream(double startWindowUpstream); + + /** + * @brief 设置传送带起始窗口下限 + * @param startWindowDownstream 单位:米 + */ + int robotServiceSetStartWindowDownstream(double startWindowDownstream); + + /** + * @brief 设置传送带跟踪轨迹下限 单位:米 + * @param trackDownstream + */ + int robotServiceSetConveyorTrackDownstream(double trackDownstream); + + /** + * @brief robotServiceAppendObject2ConveyorTrackQueue + * 在传送带队列中添加object + * @param objectPos object位置 + * @param objectOri object姿态 + * @param timestamp + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceAppendObject2ConveyorTrackQueue( + const aubo_robot_namespace::Pos &objectPos, + const aubo_robot_namespace::Ori &objectOri, uint32_t timestamp); + + /** + * @brief robotServiceEnableConveyorTrack 使能传送带跟踪 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceEnableConveyorTrack(); + + /** + * @brief robotServiceGetConveyorEncoderVal 获取传送带编码器速度 + * @param value 返回的速度值 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetConveyorEncoderVal(int &value); + + //设置传送带跟踪的最大速度 + int robotServiceSetRobotConveyorTrackMaxVelc( + double robotConveyorTrackMaxVelc); + + //设置传送带跟踪的最大加速度 + int robotServiceSetRobotConveyorTrackMaxAcc( + double robotConveyorTrackMaxAcc); + + //设置传送带跟踪的系统延时时间 + int robotServiceSetRobotConveyorSystemDelay( + double robotConveyorSystemDelay); + + //设置机械臂工具 + int robotServiceSetRobotTool( + const aubo_robot_namespace::ToolInEndDesc &robotTool); + /** + * @brief robotServiceSetWeaveMoveParameters 设置焊接摇摆 + * @param weaveMove 焊接摇摆结构体 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetWeaveMoveParameters( + const aubo_robot_namespace::WeaveMove &weaveMove); + + /** + * @brief robotServiceSetRobotRecognitionParam 设置机械臂辨识参数 + * @param param 机械臂辨识参数 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetRobotRecognitionParam( + const aubo_robot_namespace::RobotRecongnitionParam ¶m); + + /** + * @brief robotServiceGetRobotRecognitionParam 获取机械臂辨识参数 + * @param type + * @param param 机械臂辨识参数 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetRobotRecognitionParam( + int type, aubo_robot_namespace::RobotRecongnitionParam ¶m); + + /** + * @brief robotServiceSetSeamTrackingParameters 设置焊缝跟踪参数 + * @param seamTrack 焊缝跟踪参数 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetSeamTrackingParameters( + const aubo_robot_namespace::SeamTracking &seamTrack); + + /** + * @brief robotServiceGetSeamTrackingParameters 获取焊缝跟踪参数 + * @param seamTrack 焊缝跟踪参数 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetSeamTrackingParameters( + aubo_robot_namespace::SeamTracking &seamTrack); + + /** + * @brief robotServiceGetJointCommonData 获取机械臂关节数据 + * @param jointCommonDataArray 机械臂关节数据 + * @param size + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetJointCommonData( + aubo_robot_namespace::JointCommonData jointCommonDataArray[], int size); + + /** + * @brief robotServiceSetJointParam_CurrentIP 设置关节电流P值 + * @param jointID 关节角ID + * @param P P值 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetJointParam_CurrentIP(int jointID, uint16 P); + + /** + * @brief robotServiceSetJointParam_CurrentII 设置关节电流I值 + * @param jointID 关节角ID + * @param I I值 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetJointParam_CurrentII(int jointID, uint16 I); + + /** + * @brief robotServiceSetJointParam_CurrentID 设置关节电流D值 + * @param jointID 关节角ID + * @param D D值 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetJointParam_CurrentID(int jointID, uint16 D); + + /** + * @brief robotServiceSetJointParam_SpeedP 设置关节速度P值 + * @param jointID 关节角ID + * @param P P值 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetJointParam_SpeedP(int jointID, uint16 P); + + /** + * @brief robotServiceSetJointParam_SpeedI 设置关节速度I值 + * @param jointID 关节角ID + * @param I I值 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetJointParam_SpeedI(int jointID, uint16 I); + + /** + * @brief robotServiceSetJointParam_SpeedD 设置关节速度D值 + * @param jointID 关节角ID + * @param D D值 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetJointParam_SpeedD(int jointID, uint16 D); + + /** + * @brief robotServiceSetJointParam_SpeedDS 设置关节速度死区 + * @param jointID 关节角ID + * @param DS 死区 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetJointParam_SpeedDS(int jointID, uint16 DS); + + /** + * @brief robotServiceSetJointParam_PosP 设置关节位置P值 + * @param jointID 关节角ID + * @param P P值 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetJointParam_PosP(int jointID, uint16 P); + + /** + * @brief robotServiceSetJointParam_PosI 设置关节位置I值 + * @param jointID 关节角ID + * @param I I值 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetJointParam_PosI(int jointID, uint16 I); + + /** + * @brief robotServiceSetJointParam_PosD 设置关节位置D值 + * @param jointID 关节角ID + * @param D D值 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetJointParam_PosD(int jointID, uint16 D); + + /** + * @brief robotServiceSetJointParam_PosDS 设置关节位置DS值 + * @param jointID 关节角ID + * @param DS DS值 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetJointParam_PosDS(int jointID, uint16 DS); + + int robotServiceJointSaveDataFlash(int jointID); + + /** + * @brief robotServiceSetRobotBaseParameters 设置机械臂基础数据 + * @param baseParameters 机械臂基础数据 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetRobotBaseParameters( + const aubo_robot_namespace::RobotBaseParameters &baseParameters); + + //设置调速模式配置 + int robotServiceSetRegulateSpeedModeParam( + const aubo_robot_namespace::RegulateSpeedModeParamConfig_t + ®ulateSpeedModeConfig); + + /** + * @brief robotServiceGetRobotBaseParameters 获取机械臂基础数据 + * @param baseParameters 机械臂基础数据 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetRobotBaseParameters( + aubo_robot_namespace::RobotBaseParameters &baseParameters); + + //获取调速模式配置 + int robotServiceGetRegulateSpeedModeParam( + aubo_robot_namespace::RegulateSpeedModeParamConfig_t + ®ulateSpeedModeConfig); + + /** + * @brief robotServiceSetRobotJointsParameter 设置机械臂关节数据 + * @param jointsParameter 机械臂关节数据 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceSetRobotJointsParameter( + const aubo_robot_namespace::RobotJointsParameter &jointsParameter); + + //使能/失能调速模式 + int robotServiceEnableRegulateSpeedMode(bool enbaleFlag); + + /** + * @brief robotServiceGetRobotJointsParameter 获取机械臂关节数据 + * @param jointsParameter 机械臂关节数据 + * @return 调用成功返回ErrnoSucc;错误返回错误号 + */ + int robotServiceGetRobotJointsParameter( + aubo_robot_namespace::RobotJointsParameter &jointsParameter); + + //获取力控参数 + int robotServiceGetForceControlModeAdmittancePatam( + aubo_robot_namespace::AdmittancePatam_t &admittancePatam); + + int robotServiceRefreshRobotArmParamter(); + //设置力控参数 + int robotServiceSetForceControlModeAdmittancePatam( + const aubo_robot_namespace::AdmittancePatam_t &admittancePatam); + + //获取"主动探寻力"参数 + int robotServiceGetForceControlModeExploreForceParam(double &forceLimit, + double &distLimit); + + // int robotServiceGetForceSensorData(WrenchParam &data); + //设置"主动探寻力"参数 + int robotServiceSetForceControlModeExploreForceParam(double forceLimit, + double distLimit); + + // int robotServiceCalibToolAndSensor(aubo_robot_namespace::JointParam + // JointParamGroup[3], WrenchParam wrenchParamGroup[3], FtSensorCalResult + // &result); 使能/失能力控模式 + int robotServicEnableForceControlModeService(bool enbaleFlag); + + int robotServiceEnableForceControlPlan(bool enableFlag); + //获取实时力数据 + int robotServiceGetRealtimeForceData(double forceData[6]); + + int robotServiceSetForceDeviation(double data[6]); + + /** + * @brief parseFileAsRoadpointCollection + * 将一个轨迹文件(位置+姿态)转换为路点容器,进行平滑处理和限制条件检查 + * @param filePath 轨迹文件路径 输入参数 + * @param referPointJointAngle 逆解参考点的关节角 输入参数 + * @param toolInEndDesc 末端工具的信息 输入参数 + * @param wayPointVector 路点集合 输出参数 + * @return + */ + int parseFileAsRoadpointCollection( + const char *filePath, + aubo_robot_namespace::POSITION_ORIENTATION_TYPE poseType, + const double *referPointJointAngle, + const aubo_robot_namespace::ToolInEndDesc &toolInEndDesc, + std::vector &wayPointVector); + + int robotServiceSetForceMaxValue(double data[6]); + /** + * @brief parsePoseListeAsRoadpointCollection + * 将位姿集合(位置+四元数)转换为路点容器, 进行平滑处理和限制条件检查 + * @param referPointJointAngle 逆解参考点的关节角 输入参数 + * @param toolInEndDesc 末端工具的信息 输入参数 + * @param toolEndPoseVector 位姿集合 输入参数 + * @param wayPointVector 路点集合 输出参数 + * @return + */ + int parsePoseListeAsRoadpointCollection( + const double *referPointJointAngle, + const aubo_robot_namespace::ToolInEndDesc &toolInEndDesc, + const std::vector + &toolEndPoseVector, + std::vector &wayPointVector); + + int robotServiceSetForceControlStiffness(double data[6]); + + int robotServiceSetForceControlDamp(double data[6]); + //解析路点文件并缓存结果 + int parseRoadPointFileAndCacheResult( + const char *filePath, const double *referPointJointAngle, + aubo_robot_namespace::ToolInEndDesc &toolInEndDesc, + aubo_robot_namespace::wayPoint_S &firstWayPoint); + + int robotServiceSetForceControlMass(double data[6]); + //运行缓存轨迹(parseRoadPointFileAndCacheResult 结果) + int moveCacheTrack(); + + int robotServiceForceControlCalibrationZero(); + + int HandlePosesFromFile( + const char *filePath, const double *referPointJointAngle, + aubo_robot_namespace::ToolInEndDesc &toolInEndDesc, + std::vector &wayPointVector); + + // 脚本管理 + int robotServiceScriptRunSetSpeedLimitPercent(const double speedLimit); + + //针对瀚维的轨迹处理 + int hanweiRoadPointHandle( + const char *filePath, const double *referPointJointAngle, + aubo_robot_namespace::ToolInEndDesc &toolInEndDesc, + aubo_robot_namespace::wayPoint_S &firstWayPoint); + + //针对瀚维使用 + int moveHanweiTrack(); + + //获取SDK版本 + std::string getVersion(); + + arcs::aubo_sdk::RpcClientPtr getRpcClient(); + arcs::aubo_sdk::RtdeClientPtr getRtdeClient(); + + // private: + class PrivateData; + PrivateData *pd_ = nullptr; + + bool fast_stop_{ false }; +}; +#endif // SERVICEINTERFACE_H diff --git a/third_party/AuboSdk/win/include/skill_interface/force_control.h b/third_party/AuboSdk/win/include/skill_interface/force_control.h new file mode 100644 index 00000000..c8f143f9 --- /dev/null +++ b/third_party/AuboSdk/win/include/skill_interface/force_control.h @@ -0,0 +1,329 @@ +// 力控相关的工艺封装接口 +#ifndef AUBO_SDK_SKILL_INTERFACE_H +#define AUBO_SDK_SKILL_INTERFACE_H + +#include +#include +#include +#include + +using namespace arcs::common_interface; + +namespace arcs { +namespace aubo_sdk { + +class RtdeClient; +class RpcClient; +using RtdeClientPtr = std::shared_ptr; +using RpcClientPtr = std::shared_ptr; + +class GuideTrajMove; +using GuideTrajMovePtr = std::shared_ptr; + +class ARCS_ABI ForceControl +{ +public: + enum ForceStage + { + TOUCH = 1, // 接近 + SEARCH = 2, // 搜孔 + INSERT = 3, // 插孔 + CONSTANT = 4, // 恒力 + + }; // enum ForceStage + + enum StateCode + { + // 失败状态码 + TimeOut = -100, // 超时 + Search_MaxForce = -4, // 搜孔达到最大力 + Insert_MaxForce = -3, // 插入达到最大力 + Constant_NotTouch = -2, // 恒力过程中未接触 + Touch_Distance = -1, // 超出探寻距离 + + Running = 0, // 力控执行中 + + // 成功状态码 + Touch_Succeed = 1, // 接触成功 + Insert_Succeed = 2, // 插孔成功 + Search_Succeed = 3, // 搜孔成功 + Constant_Succeed = 4, // 接触成功 + + }; // StateCode + + // 轨迹类型 + enum GuideTrajType + { + NONE = 0, // 无参考轨迹 + LINE1 = 1, // 直线 speedLine + LINE2 = 2, // 直线 moveLine + SPIRAL = 3, // 螺旋线 + WEAVE = 4, // 摆线 + }; + + // 螺旋线平面 + enum class SpiralPlane + { + xy = 0, + yz = 1, + zx = 2 + }; + + // 螺旋线轨迹参数 + struct SpiralTrajParams + { + double step = 0.0; // 圈数 + double direction = -1; // 旋转方向 -1顺时针旋转,1逆时针旋转 + SpiralPlane plane = SpiralPlane::xy; // 参考平面选择 + double spiral = 0.0; // 螺旋线外扩 + double helix = 0.0; // 螺旋上升 m + double radius = 0.0; // 第一圈半径 m + }; + + // 摆线方向 + enum class WeaveSelect + { + x = 1, + y = 2, + z = 3, + rx = 4, + ry = 5, + rz = 6 + }; + + // 摆线轨迹参数 + struct WeaveTrajParams + { + double step = 0.0; // 周期 + double amplitude = 0.0; // 幅度 + WeaveSelect direction = WeaveSelect::x; // 方向 + double hold_distance = 0.0; // 保持距离 m + double angle = 0.0; // 角度 + double type; // 类型 + }; + + // 插孔方向 + enum class InsertSelect + { + x = 1, + y = 2, + z = 3, + }; + + // 插孔参数 + struct InsertParams + { + InsertSelect insert_select = InsertSelect::z; // 插入方向,可选x\y\z + double hole_diameter = 0.0; // 轴孔直径 m + double insert_max_speed = 0.01; // 插入速度限制 m/s + double insert_time = 1000; // 插入时间限制 ms + GuideTrajType guide_traj_type = NONE; // 主动轨迹类型 + std::vector insert_max_force = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 + }; // 最大力限制 + double insert_max_depth = 0.01; // 插入距离限制 m + double insert_guide_force = 10; // 插入引导力 + // 力控调节参数 + std::vector insert_damp_scale = { + 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 + }; + std::vector insert_stiff_scale = { + 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 + }; + + SpiralTrajParams spiral_param; // 螺旋轨迹参数 + WeaveTrajParams weave_param; // 摆动轨迹参数 + }; + + // 搜孔平面 + enum class SearchPlane + { + yz = 1, + xz = 2, + xy = 3 + }; + + // 搜孔参数 + struct SearchParams + { + SearchPlane search_plane = SearchPlane::xy; // 搜孔平面 + double hole_diameter = 0.0; // 轴孔直径 m + double search_range = 0.1; // 搜孔范围 + double search_time = 1000; // 搜孔时间限制 ms + GuideTrajType guide_traj_type = NONE; // 搜孔过程主动轨迹类型 + double search_max_force = 10; // 最大力限制 + double search_guide_force = 1; // 搜孔引导力 + // 力控调节参数 + std::vector search_damp_scale = { + 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 + }; + std::vector search_stiff_scale = { + 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 + }; + + SpiralTrajParams spiral_param; + WeaveTrajParams weave_param; + }; + + struct ConstantParams + { + TaskFrameType frame_type = MOTION_FORCE; + std::vector feature = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + std::vector compliance = { true, true, true, true, true, true }; + std::vector wrench = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + + // 力控调节参数 + std::vector env_stiff = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + std::vector damp_scale = { 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 }; + std::vector stiff_scale = { 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 }; + + std::vector contact_threshold = { + 1.0, 1.0, 1.0, 0.2, 0.2, 0.2 + }; // 接触判断阈值 + double constant_time = 5000; // 默认5s + }; + + struct TouchParams + { + TaskFrameType frame_type = TOOL_FORCE; + std::vector feature = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + std::vector compliance = { true, true, true, true, true, true }; + std::vector wrench = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + std::vector env_stiff = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + // std::vector damp_scale = { 0.5, 0.5, 0.5, 0.5, 0.5, + // 0.5 }; + std::vector stiff_scale = { 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 }; + std::vector speed = { 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 }; + double distance = 0.0; + double touch_time = 1000; // 默认5s + }; + + ForceControl(const RpcClientPtr rpc, const RtdeClientPtr rtde); + ~ForceControl(); + + /** + * @brief 获取实时力控参考系下的力描述 + * + * @return 未开启力控时返回全0 + */ + std::vector getTaskForce(const TaskFrameType &type, + const std::vector &feature); + + // 接近 + int fcTouch(const TouchParams ¶m); + + // 恒力 + int fcConstant(const ConstantParams ¶m); + + // 插入 + int fcInsert(const InsertParams ¶m); + + // 搜孔 + int fcSearch(const SearchParams ¶m); + + // 等待力控结束 + int fcWaitCondition(); + + int fcExit(); + + // 注册状态回调函数 + void registerStateCallBack(std::function func); + +private: + // 注册实时状态订阅 + void subscribeRealtimeState(); + + // 力控过程监控线程 + void monitor(); + + // 超时监控 + void timeoutMonitor(); + + // 距离监控 + void distanceMonitor(); + + // 单方向距离监控 + void signalDistanceMonitor(); + + // 力监控 + void forceMonitor(); + + // 接触监控 + void contactMonitor(); + +private: + RpcClientPtr rpc_; + RtdeClientPtr rtde_; + + std::atomic_bool is_exit_; + std::atomic_bool is_stop_; + std::mutex monitor_thread_mutex_; + std::condition_variable monitor_cond_; + std::thread *monitor_thread_ptr_; + + // 用于恒力和接近之间的切换 + std::atomic_bool last_is_contact_; + + // 记录当前参数 + std::shared_mutex mutex_; + TaskFrameType frame_type_; + std::vector feature_; + ForceStage cur_process_type_; + std::vector compliance_; + std::vector env_stiff_; + std::vector damp_scale_; + std::vector stiff_scale_; + std::vector wrench_; + std::vector start_tcp_pose_; // 开始力控位姿 + double distance_; // 力控执行距离 + double direction_; // 搜孔/插孔方向 + std::chrono::steady_clock::time_point start_time_; // 开启力控时间点 + double interval_; // 超时间隔 + + // 参考轨迹运行 + GuideTrajMovePtr guide_traj_move_; + + // 状态回调函数 + std::atomic state_code_ = Running; + std::function func_; + + // RTDE相关 + std::shared_mutex rtde_mutex_; + std::vector actual_tcp_pose_; + std::vector actual_tcp_speed_; + std::vector actual_tcp_force_; + std::vector actual_tcp_force_sensor_; +}; // namespace aubo_sdk + +class GuideTrajMove +{ +public: + GuideTrajMove(const RpcClientPtr rpc); + ~GuideTrajMove(); + + void speedLine(const std::vector &speed, const double &time); + void moveLine(const std::vector &target_pose, const double &speed); + void moveSpiral(const ForceControl::SpiralTrajParams &spiral_param); + void moveWeave(const ForceControl::WeaveTrajParams &weave_param, + const int &move_direction); + + void stop(); + +private: + int waitArrival(); + + RpcClientPtr rpc_; + + std::atomic_bool is_exit_; + std::atomic_bool is_stop_; + std::mutex thread_mutex_; + std::condition_variable cond_; + std::thread thread_; + + ForceControl::GuideTrajType traj_type_ = ForceControl::NONE; +}; + +} // namespace aubo_sdk +} // namespace arcs + +#endif // AUBO_SDK_SKILL_INTERFACE_H diff --git a/third_party/AuboSdk/win/include/skill_interface/force_control_c.h b/third_party/AuboSdk/win/include/skill_interface/force_control_c.h new file mode 100644 index 00000000..d7b0b92e --- /dev/null +++ b/third_party/AuboSdk/win/include/skill_interface/force_control_c.h @@ -0,0 +1,194 @@ +#ifndef AUBO_SDK_ForceControl_C_H +#define AUBO_SDK_ForceControl_C_H +#include + +enum ForceStage_C +{ + TOUCH = 1, // 接近 + SEARCH = 2, // 搜孔 + INSERT = 3, // 插孔 + CONSTANT = 4, // 恒力 + +}; // enum ForceStage + +enum StateCode_C +{ + // 失败状态码 + TimeOut = -100, // 超时 + Search_MaxForce = -4, // 搜孔达到最大力 + Insert_MaxForce = -3, // 插入达到最大力 + Constant_NotTouch = -2, // 恒力过程中未接触 + Touch_Distance = -1, // 超出探寻距离 + + Running = 0, // 力控执行中 + + // 成功状态码 + Touch_Succeed = 1, // 接触成功 + Insert_Succeed = 2, // 插孔成功 + Search_Succeed = 3, // 搜孔成功 + Constant_Succeed = 4, // 接触成功 + +}; // StateCode + +// 轨迹类型 +enum GuideTrajType_C +{ + NONE = 0, // 无参考轨迹 + LINE1 = 1, // 直线 speedLine + LINE2 = 2, // 直线 moveLine + SPIRAL = 3, // 螺旋线 + WEAVE = 4, // 摆线 +}; + +// 螺旋线平面 +enum class SpiralPlane_C +{ + xy = 0, + yz = 1, + zx = 2 +}; + +// 螺旋线轨迹参数 +struct SpiralTrajParams_C +{ + double step = 0.0; // 圈数 + double direction = -1; // 旋转方向 -1顺时针旋转,1逆时针旋转 + SpiralPlane_C plane = SpiralPlane_C::xy; // 参考平面选择 + double spiral = 0.0; // 螺旋线外扩 + double helix = 0.0; // 螺旋上升 m + double radius = 0.0; // 第一圈半径 m +}; + +// 摆线方向 +enum class WeaveSelect_C +{ + x = 1, + y = 2, + z = 3, + rx = 4, + ry = 5, + rz = 6 +}; + +// 摆线轨迹参数 +struct WeaveTrajParams_C +{ + double step = 0.0; // 周期 + double amplitude = 0.0; // 幅度 + WeaveSelect_C direction = WeaveSelect_C::x; // 方向 + double hold_distance = 0.0; // 保持距离 m + double angle = 0.0; // 角度 + double type; // 类型 +}; + +// 插孔方向 +enum class InsertSelect_C +{ + x = 1, + y = 2, + z = 3, +}; + +// 插孔参数 +struct InsertParams_C +{ + InsertSelect_C insert_select = InsertSelect_C::z; // 插入方向,可选x\y\z + double hole_diameter = 0.0; // 轴孔直径 m + double insert_max_speed = 0.01; // 插入速度限制 m/s + double insert_time = 1000; // 插入时间限制 ms + GuideTrajType_C guide_traj_type = NONE; // 主动轨迹类型 + double insert_max_force[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // 最大力限制 + double insert_max_depth = 0.01; // 插入距离限制 m + double insert_guide_force = 10; // 插入引导力 + // 力控调节参数 + double insert_damp_scale[6] = { 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 }; + double insert_stiff_scale[6] = { 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 }; + + SpiralTrajParams_C spiral_param; // 螺旋轨迹参数 + WeaveTrajParams_C weave_param; // 摆动轨迹参数 +}; + +// 搜孔平面 +enum class SearchPlane_C +{ + yz = 1, + xz = 2, + xy = 3 +}; + +// 搜孔参数 +struct SearchParams_C +{ + SearchPlane_C search_plane = SearchPlane_C::xy; // 搜孔平面 + double hole_diameter = 0.0; // 轴孔直径 m + double search_range = 0.1; // 搜孔范围 + double search_time = 1000; // 搜孔时间限制 ms + GuideTrajType_C guide_traj_type = NONE; // 搜孔过程主动轨迹类型 + double search_max_force = 10; // 最大力限制 + double search_guide_force = 1; // 搜孔引导力 + // 力控调节参数 + double search_damp_scale[6] = { 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 }; + double search_stiff_scale[6] = { 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 }; + + SpiralTrajParams_C spiral_param; + WeaveTrajParams_C weave_param; +}; + +struct ConstantParams_C +{ + TaskFrameType_C frame_type = TaskFrameType_MOTION_FORCE; + double feature[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + bool compliance[6] = { true, true, true, true, true, true }; + double wrench[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + + // 力控调节参数 + double env_stiff[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + double damp_scale[6] = { 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 }; + double stiff_scale[6] = { 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 }; + + double contact_threshold[6] = { + 1.0, 1.0, 1.0, 0.2, 0.2, 0.2 + }; // 接触判断阈值 + double constant_time = 5000; // 默认5s +}; + +struct TouchParams_C +{ + TaskFrameType_C frame_type = TaskFrameType_TOOL_FORCE; + double feature[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + bool compliance[6] = { true, true, true, true, true, true }; + double wrench[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + double env_stiff[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + // std::vector damp_scale = { 0.5, 0.5, 0.5, 0.5, 0.5, + // 0.5 }; + double stiff_scale[6] = { 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 }; + double speed[6] = { 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 }; + double distance = 0.0; + double touch_time = 1000; // 默认5s +}; + +#ifdef __cplusplus +extern "C" { +#endif +ARCS_ABI int getTaskForce(FORCE_CONTROL_HANDLER h, TaskFrameType_C type, + const double *feature, double *result); + +ARCS_ABI int fcTouch(FORCE_CONTROL_HANDLER h, const TouchParams_C ¶m); + +ARCS_ABI int fcConstant(FORCE_CONTROL_HANDLER h, const ConstantParams_C ¶m); + +ARCS_ABI int fcInsert(FORCE_CONTROL_HANDLER h, const InsertParams_C ¶m); + +ARCS_ABI int fcSearch(FORCE_CONTROL_HANDLER h, const SearchParams_C ¶m); + +ARCS_ABI int fcWaitCondition(FORCE_CONTROL_HANDLER h); + +ARCS_ABI int fcExit(FORCE_CONTROL_HANDLER h); + +// ARCS_ABI void registerStateCallBack(std::function func); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third_party/AuboSdk/win/include/skill_interface/type_convert.h b/third_party/AuboSdk/win/include/skill_interface/type_convert.h new file mode 100644 index 00000000..b5156202 --- /dev/null +++ b/third_party/AuboSdk/win/include/skill_interface/type_convert.h @@ -0,0 +1,135 @@ +#ifndef AUBO_SDK_FORCE_CONTROL_TYPE_CONVERT_C_H +#define AUBO_SDK_FORCE_CONTROL_TYPE_CONVERT_C_H + +#include +#include + +// 用于将SpiralTrajParams_C转化为SpiralTrajParams +inline arcs::aubo_sdk::ForceControl::SpiralTrajParams convertToSpiralTrajParams( + const SpiralTrajParams_C &source) +{ + arcs::aubo_sdk::ForceControl::SpiralTrajParams result; + + result.step = source.step; + result.direction = source.direction; + result.plane = (arcs::aubo_sdk::ForceControl::SpiralPlane)source.plane; + result.spiral = source.spiral; + result.helix = source.helix; + result.radius = source.radius; + + return result; +} + +// 用于将WeaveTrajParams_C转化为WeaveTrajParams +inline arcs::aubo_sdk::ForceControl::WeaveTrajParams convertToWeaveTrajParams( + const WeaveTrajParams_C &source) +{ + arcs::aubo_sdk::ForceControl::WeaveTrajParams result; + + result.step = source.step; + result.amplitude = source.amplitude; + result.direction = + (arcs::aubo_sdk::ForceControl::WeaveSelect)source.direction; + result.hold_distance = source.hold_distance; + result.angle = source.angle; + result.type = source.type; + + return result; +} + +// 用于将TouchParams_C转化为TouchParams +inline arcs::aubo_sdk::ForceControl::TouchParams convertToTouchParams( + const TouchParams_C &source) +{ + arcs::aubo_sdk::ForceControl::TouchParams result; + + result.frame_type = + (arcs::common_interface::TaskFrameType)source.frame_type; + + for (int i = 0; i < 6; i++) { + result.feature[i] = source.feature[i]; + result.compliance[i] = source.compliance[i]; + result.wrench[i] = source.wrench[i]; + result.env_stiff[i] = source.env_stiff[i]; + result.stiff_scale[i] = source.stiff_scale[i]; + result.speed[i] = source.speed[i]; + } + result.distance = source.distance; + result.touch_time = source.touch_time; + + return result; +} + +inline arcs::aubo_sdk::ForceControl::ConstantParams convertToConstantParams( + const ConstantParams_C &source) +{ + arcs::aubo_sdk::ForceControl::ConstantParams result; + + result.frame_type = + (arcs::common_interface::TaskFrameType)source.frame_type; + for (int i = 0; i < 6; i++) { + result.feature[i] = source.feature[i]; + result.compliance[i] = source.compliance[i]; + result.wrench[i] = source.wrench[i]; + result.env_stiff[i] = source.env_stiff[i]; + result.damp_scale[i] = source.damp_scale[i]; + result.stiff_scale[i] = source.stiff_scale[i]; + result.contact_threshold[i] = source.contact_threshold[i]; + } // 接触判断阈值 + result.constant_time = source.constant_time; // 默认5sams result; + + return result; +} + +inline arcs::aubo_sdk::ForceControl::InsertParams convertToInsertParams( + const InsertParams_C &source) +{ + arcs::aubo_sdk::ForceControl::InsertParams result; + + result.insert_select = + (arcs::aubo_sdk::ForceControl::InsertSelect)source.insert_select; + result.hole_diameter = source.hole_diameter; + result.insert_max_speed = source.insert_max_speed; + result.insert_time = source.insert_time; + result.guide_traj_type = + (arcs::aubo_sdk::ForceControl::GuideTrajType)source.guide_traj_type; + result.insert_max_depth = source.insert_max_depth; + result.insert_guide_force = source.insert_guide_force; + for (int i = 0; i < 6; i++) { + result.insert_max_force[i] = source.insert_max_force[i]; + result.insert_damp_scale[i] = source.insert_damp_scale[i]; + result.insert_stiff_scale[i] = source.insert_stiff_scale[i]; + } + + result.spiral_param = convertToSpiralTrajParams(source.spiral_param); + result.weave_param = convertToWeaveTrajParams(source.weave_param); + + return result; +} + +// 用于将SearchParams_C转化为SearchParams +inline arcs::aubo_sdk::ForceControl::SearchParams convertToSearchParams( + const SearchParams_C &source) +{ + arcs::aubo_sdk::ForceControl::SearchParams result; + + result.search_plane = + (arcs::aubo_sdk::ForceControl::SearchPlane)source.search_plane; + result.hole_diameter = source.hole_diameter; + result.search_range = source.search_range; + result.search_time = source.search_time; + result.guide_traj_type = + (arcs::aubo_sdk::ForceControl::GuideTrajType)source.guide_traj_type; + result.search_max_force = source.search_max_force; + result.search_guide_force = source.search_guide_force; + for (int i = 0; i < 6; i++) { + result.search_damp_scale[i] = source.search_damp_scale[i]; + result.search_stiff_scale[i] = source.search_stiff_scale[i]; + } + result.spiral_param = convertToSpiralTrajParams(source.spiral_param); + result.weave_param = convertToWeaveTrajParams(source.weave_param); + + return result; +} + +#endif diff --git a/third_party/AuboSdk/win/lib/aubo_sdk.dll b/third_party/AuboSdk/win/lib/aubo_sdk.dll new file mode 100644 index 00000000..324e31b7 Binary files /dev/null and b/third_party/AuboSdk/win/lib/aubo_sdk.dll differ diff --git a/third_party/AuboSdk/win/lib/aubo_sdk.lib b/third_party/AuboSdk/win/lib/aubo_sdk.lib new file mode 100644 index 00000000..3c955e19 Binary files /dev/null and b/third_party/AuboSdk/win/lib/aubo_sdk.lib differ diff --git a/third_party/AuboSdk/win/lib/aubo_sdkd.dll b/third_party/AuboSdk/win/lib/aubo_sdkd.dll new file mode 100644 index 00000000..920ee01b Binary files /dev/null and b/third_party/AuboSdk/win/lib/aubo_sdkd.dll differ diff --git a/third_party/AuboSdk/win/lib/aubo_sdkd.lib b/third_party/AuboSdk/win/lib/aubo_sdkd.lib new file mode 100644 index 00000000..84f9a632 Binary files /dev/null and b/third_party/AuboSdk/win/lib/aubo_sdkd.lib differ diff --git a/third_party/AuboSdk/win/lib/cmake/aubo_sdk/aubo_sdkConfig.cmake b/third_party/AuboSdk/win/lib/cmake/aubo_sdk/aubo_sdkConfig.cmake new file mode 100644 index 00000000..4ee1eb53 --- /dev/null +++ b/third_party/AuboSdk/win/lib/cmake/aubo_sdk/aubo_sdkConfig.cmake @@ -0,0 +1,11 @@ +include(CMakeFindDependencyMacro) + +# 如果想要获取Config阶段的变量,可以使用这个 +# set(my-config-var ) + +# 如果你的项目需要依赖其他的库,可以使用下面语句,用法与find_package相同 +# find_dependency(MYDEP REQUIRED) + +# Any extra setup +# Add the targets file +include("${CMAKE_CURRENT_LIST_DIR}/aubo_sdkTargets.cmake") diff --git a/third_party/AuboSdk/win/lib/cmake/aubo_sdk/aubo_sdkConfigVersion.cmake b/third_party/AuboSdk/win/lib/cmake/aubo_sdk/aubo_sdkConfigVersion.cmake new file mode 100644 index 00000000..00f8ba94 --- /dev/null +++ b/third_party/AuboSdk/win/lib/cmake/aubo_sdk/aubo_sdkConfigVersion.cmake @@ -0,0 +1,48 @@ +# This is a basic version file for the Config-mode of find_package(). +# It is used by write_basic_package_version_file() as input file for configure_file() +# to create a version-file which can be installed along a config.cmake file. +# +# The created file sets PACKAGE_VERSION_EXACT if the current version string and +# the requested version string are exactly the same and it sets +# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version. +# The variable CVF_VERSION must be set before calling configure_file(). + +set(PACKAGE_VERSION "0.26.0") + +if (PACKAGE_FIND_VERSION_RANGE) + # Package version must be in the requested version range + if ((PACKAGE_FIND_VERSION_RANGE_MIN STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MIN) + OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_GREATER PACKAGE_FIND_VERSION_MAX) + OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_GREATER_EQUAL PACKAGE_FIND_VERSION_MAX))) + set(PACKAGE_VERSION_COMPATIBLE FALSE) + else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + endif() +else() + if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) + set(PACKAGE_VERSION_COMPATIBLE FALSE) + else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) + set(PACKAGE_VERSION_EXACT TRUE) + endif() + endif() +endif() + + +# if the installed project requested no architecture check, don't perform the check +if("FALSE") + return() +endif() + +# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "") + return() +endif() + +# check that the installed version has the same 32/64bit-ness as the one which is currently searching: +if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8") + math(EXPR installedBits "8 * 8") + set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") + set(PACKAGE_VERSION_UNSUITABLE TRUE) +endif() diff --git a/third_party/AuboSdk/win/lib/cmake/aubo_sdk/aubo_sdkTargets-debug.cmake b/third_party/AuboSdk/win/lib/cmake/aubo_sdk/aubo_sdkTargets-debug.cmake new file mode 100644 index 00000000..7568ace9 --- /dev/null +++ b/third_party/AuboSdk/win/lib/cmake/aubo_sdk/aubo_sdkTargets-debug.cmake @@ -0,0 +1,29 @@ +#---------------------------------------------------------------- +# Generated CMake target import file for configuration "Debug". +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Import target "aubo_sdk::aubo_sdk" for configuration "Debug" +set_property(TARGET aubo_sdk::aubo_sdk APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) +set_target_properties(aubo_sdk::aubo_sdk PROPERTIES + IMPORTED_IMPLIB_DEBUG "${_IMPORT_PREFIX}/lib/aubo_sdkd.lib" + IMPORTED_LOCATION_DEBUG "${_IMPORT_PREFIX}/lib/aubo_sdkd.dll" + ) + +list(APPEND _cmake_import_check_targets aubo_sdk::aubo_sdk ) +list(APPEND _cmake_import_check_files_for_aubo_sdk::aubo_sdk "${_IMPORT_PREFIX}/lib/aubo_sdkd.lib" "${_IMPORT_PREFIX}/lib/aubo_sdkd.dll" ) + +# Import target "aubo_sdk::robot_proxy" for configuration "Debug" +set_property(TARGET aubo_sdk::robot_proxy APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) +set_target_properties(aubo_sdk::robot_proxy PROPERTIES + IMPORTED_IMPLIB_DEBUG "${_IMPORT_PREFIX}/lib/robot_proxyd.lib" + IMPORTED_LOCATION_DEBUG "${_IMPORT_PREFIX}/lib/robot_proxyd.dll" + ) + +list(APPEND _cmake_import_check_targets aubo_sdk::robot_proxy ) +list(APPEND _cmake_import_check_files_for_aubo_sdk::robot_proxy "${_IMPORT_PREFIX}/lib/robot_proxyd.lib" "${_IMPORT_PREFIX}/lib/robot_proxyd.dll" ) + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) diff --git a/third_party/AuboSdk/win/lib/cmake/aubo_sdk/aubo_sdkTargets-release.cmake b/third_party/AuboSdk/win/lib/cmake/aubo_sdk/aubo_sdkTargets-release.cmake new file mode 100644 index 00000000..dccf867a --- /dev/null +++ b/third_party/AuboSdk/win/lib/cmake/aubo_sdk/aubo_sdkTargets-release.cmake @@ -0,0 +1,29 @@ +#---------------------------------------------------------------- +# Generated CMake target import file for configuration "Release". +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Import target "aubo_sdk::aubo_sdk" for configuration "Release" +set_property(TARGET aubo_sdk::aubo_sdk APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(aubo_sdk::aubo_sdk PROPERTIES + IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/aubo_sdk.lib" + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/aubo_sdk.dll" + ) + +list(APPEND _cmake_import_check_targets aubo_sdk::aubo_sdk ) +list(APPEND _cmake_import_check_files_for_aubo_sdk::aubo_sdk "${_IMPORT_PREFIX}/lib/aubo_sdk.lib" "${_IMPORT_PREFIX}/lib/aubo_sdk.dll" ) + +# Import target "aubo_sdk::robot_proxy" for configuration "Release" +set_property(TARGET aubo_sdk::robot_proxy APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(aubo_sdk::robot_proxy PROPERTIES + IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/robot_proxy.lib" + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/robot_proxy.dll" + ) + +list(APPEND _cmake_import_check_targets aubo_sdk::robot_proxy ) +list(APPEND _cmake_import_check_files_for_aubo_sdk::robot_proxy "${_IMPORT_PREFIX}/lib/robot_proxy.lib" "${_IMPORT_PREFIX}/lib/robot_proxy.dll" ) + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) diff --git a/third_party/AuboSdk/win/lib/cmake/aubo_sdk/aubo_sdkTargets.cmake b/third_party/AuboSdk/win/lib/cmake/aubo_sdk/aubo_sdkTargets.cmake new file mode 100644 index 00000000..40f3b27b --- /dev/null +++ b/third_party/AuboSdk/win/lib/cmake/aubo_sdk/aubo_sdkTargets.cmake @@ -0,0 +1,122 @@ +# Generated by CMake + +if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8) + message(FATAL_ERROR "CMake >= 2.8.0 required") +endif() +if(CMAKE_VERSION VERSION_LESS "2.8.3") + message(FATAL_ERROR "CMake >= 2.8.3 required") +endif() +cmake_policy(PUSH) +cmake_policy(VERSION 2.8.3...3.22) +#---------------------------------------------------------------- +# Generated CMake target import file. +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Protect against multiple inclusion, which would fail when already imported targets are added once more. +set(_cmake_targets_defined "") +set(_cmake_targets_not_defined "") +set(_cmake_expected_targets "") +foreach(_cmake_expected_target IN ITEMS aubo_sdk::aubo_sdk aubo_sdk::common_interface aubo_sdk::robot_proxy) + list(APPEND _cmake_expected_targets "${_cmake_expected_target}") + if(TARGET "${_cmake_expected_target}") + list(APPEND _cmake_targets_defined "${_cmake_expected_target}") + else() + list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}") + endif() +endforeach() +unset(_cmake_expected_target) +if(_cmake_targets_defined STREQUAL _cmake_expected_targets) + unset(_cmake_targets_defined) + unset(_cmake_targets_not_defined) + unset(_cmake_expected_targets) + unset(CMAKE_IMPORT_FILE_VERSION) + cmake_policy(POP) + return() +endif() +if(NOT _cmake_targets_defined STREQUAL "") + string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}") + string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}") + message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n") +endif() +unset(_cmake_targets_defined) +unset(_cmake_targets_not_defined) +unset(_cmake_expected_targets) + + +# Compute the installation prefix relative to this file. +get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +if(_IMPORT_PREFIX STREQUAL "/") + set(_IMPORT_PREFIX "") +endif() + +# Create imported target aubo_sdk::aubo_sdk +add_library(aubo_sdk::aubo_sdk SHARED IMPORTED) + +set_target_properties(aubo_sdk::aubo_sdk PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" + INTERFACE_LINK_LIBRARIES "aubo_sdk::common_interface;wsock32;ws2_32" +) + +# Create imported target aubo_sdk::common_interface +add_library(aubo_sdk::common_interface INTERFACE IMPORTED) + +set_target_properties(aubo_sdk::common_interface PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" +) + +# Create imported target aubo_sdk::robot_proxy +add_library(aubo_sdk::robot_proxy SHARED IMPORTED) + +set_target_properties(aubo_sdk::robot_proxy PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" + INTERFACE_LINK_LIBRARIES "aubo_sdk::aubo_sdk;Qt5::Core" +) + +if(CMAKE_VERSION VERSION_LESS 3.0.0) + message(FATAL_ERROR "This file relies on consumers using CMake 3.0.0 or greater.") +endif() + +# Load information for each installed configuration. +file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/aubo_sdkTargets-*.cmake") +foreach(_cmake_config_file IN LISTS _cmake_config_files) + include("${_cmake_config_file}") +endforeach() +unset(_cmake_config_file) +unset(_cmake_config_files) + +# Cleanup temporary variables. +set(_IMPORT_PREFIX) + +# Loop over all imported files and verify that they actually exist +foreach(_cmake_target IN LISTS _cmake_import_check_targets) + foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}") + if(NOT EXISTS "${_cmake_file}") + message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file + \"${_cmake_file}\" +but this file does not exist. Possible reasons include: +* The file was deleted, renamed, or moved to another location. +* An install or uninstall procedure did not complete successfully. +* The installation package was faulty and contained + \"${CMAKE_CURRENT_LIST_FILE}\" +but not all the files it references. +") + endif() + endforeach() + unset(_cmake_file) + unset("_cmake_import_check_files_for_${_cmake_target}") +endforeach() +unset(_cmake_target) +unset(_cmake_import_check_targets) + +# This file does not depend on other imported targets which have +# been exported from the same project but in a separate export set. + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) +cmake_policy(POP) diff --git a/third_party/AuboSdk/win/lib/robot_proxy.dll b/third_party/AuboSdk/win/lib/robot_proxy.dll new file mode 100644 index 00000000..8fcf6c6c Binary files /dev/null and b/third_party/AuboSdk/win/lib/robot_proxy.dll differ diff --git a/third_party/AuboSdk/win/lib/robot_proxy.lib b/third_party/AuboSdk/win/lib/robot_proxy.lib new file mode 100644 index 00000000..2f3b107c Binary files /dev/null and b/third_party/AuboSdk/win/lib/robot_proxy.lib differ diff --git a/third_party/AuboSdk/win/lib/robot_proxyd.dll b/third_party/AuboSdk/win/lib/robot_proxyd.dll new file mode 100644 index 00000000..fe09b191 Binary files /dev/null and b/third_party/AuboSdk/win/lib/robot_proxyd.dll differ diff --git a/third_party/AuboSdk/win/lib/robot_proxyd.lib b/third_party/AuboSdk/win/lib/robot_proxyd.lib new file mode 100644 index 00000000..c1e40874 Binary files /dev/null and b/third_party/AuboSdk/win/lib/robot_proxyd.lib differ