cmvr-es/third_party/AuboSdk/linux/include/serviceinterface.h

1939 lines
81 KiB
C
Raw Normal View History

2025-11-17 13:48:22 +08:00
/**
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 <vector>
#include <memory>
#include "AuboRobotMetaType.h" //接口需要用到的数据类型
#include <aubo/error_stack/error_stack.h>
namespace arcs {
namespace aubo_sdk {
class RpcClient;
typedef std::shared_ptr<RpcClient> RpcClientPtr;
class RtdeClient;
typedef std::shared_ptr<RtdeClient> 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:: 2525
* 1::
* ;
* 2::  
* 3:: 0.02
* 4:: 0
* 5::
* 6:: ;
* 7:: 
*
* @return ErrnoSucc;
*/
int robotServiceInitGlobalMoveProfile();
/**
*   
*
*     
*     JOINT1JOINT2JOINT3JOINT4JOINT5JOINT6
*     JIONT_CUBICSPLINEJOINT_UBSPLINEINTP
*
*
*    ,180180;
*    22;
*
**/
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_XMOV_YMOV_ZROT_XROT_YROT_Z
*     ARC_CIR, CARTESIAN_MOVEP, CARTESIAN_CUBICSPLINE, CARTESIAN_UBSPLINEINTP
*
*
* ,180180;
*    22;
*
**/
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<aubo_robot_namespace::wayPoint_S> &wayPointVector);
/** 运动属性之交融半径的设置与获取 交融半径的范围0.001m~1m
* 0.001
**/
float robotServiceGetGlobalBlendRadius();
int robotServiceSetGlobalBlendRadius(float value);
double robotServiceGetTrackPlaybackCycle();
int robotServiceSetTrackPlaybackCycle(double second);
/** 运动属性之圆轨迹时圆的圈数
* ARC_CIR时有效CircularLoopTimes;
* CircularLoopTimes
**/
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] []
* @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_CUBICSPLINEJOINT_UBSPLINEINTP时
*
* subMoveMode==ARC_CIR     CircularLoopTimes
*
* CircularLoopTimes
*
* 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    使
* @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
   使;
* @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 01线
* @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<aubo_robot_namespace::wayPoint_S> &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<aubo_robot_namespace::wayPoint_S> &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<aubo_robot_namespace::wayPoint_S> &wayPointVector);
int startupOfflineExcitTrajService(
const char *trackFile,
aubo_robot_namespace::Robot_Dyn_identify_traj type, int subtype,
bool isBolck);
int getDynIdentifyResultsService(std::vector<int> &paramVector);
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 45
* @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<aubo_robot_namespace::wayPoint_S> &wayPointVector);
//工具标定
int robotServiceToolCalibration(
const std::vector<aubo_robot_namespace::wayPoint_S> &wayPointPosVector,
char poseCalibMethod,
aubo_robot_namespace::ToolInEndDesc &toolInEndDesc);
/**
* @brief toolCalibration
*    姿
* @param wayPointPosCalibVector  
* @param wayPointOriCalibVector  姿
* @param poseCalibMethod      
* @param toolInEndDesc       
* @return
*/
int robotServiceToolCalibration(
const std::vector<aubo_robot_namespace::wayPoint_S>
&wayPointPosCalibVector,
const std::vector<aubo_robot_namespace::wayPoint_S>
&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<double> &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<double> &p1,
const std::vector<double> &p2,
const std::vector<double> &p3,
std::vector<double> &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,0toolEndPositionOnUserCoord和toolEndOrientationOnUserCoord是无工具的
*
*     2:
*   userCoord.coordType =
* BaseCoordinate
* 姿  姿
* .
*
* :
*      姿  姿
*         
*
* @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 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 16bit
* @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<aubo_robot_namespace::RobotIoType> &ioType,
std::vector<aubo_robot_namespace::RobotIoDesc> &configVector);
/**
* @brief IO集合的状态信息
* @param ioType
* @param statusVector
* @return ErrnoSucc;
*/
int robotServiceGetBoardIOStatus(
const std::vector<aubo_robot_namespace::RobotIoType> ioType,
std::vector<aubo_robot_namespace::RobotIoDesc> &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<aubo_robot_namespace::RobotIoDesc> &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<aubo_robot_namespace::RobotIoDesc> &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 &ethernetDeviceName);
//获取服务器版本信息
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 &param);
/**
* @brief robotServiceGetRobotRecognitionParam
* @param type
* @param param
* @return ErrnoSucc;
*/
int robotServiceGetRobotRecognitionParam(
int type, aubo_robot_namespace::RobotRecongnitionParam &param);
/**
* @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
* @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
* @param jointID ID
* @param 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
* @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
&regulateSpeedModeConfig);
/**
* @brief robotServiceGetRobotBaseParameters
* @param baseParameters
* @return ErrnoSucc;
*/
int robotServiceGetRobotBaseParameters(
aubo_robot_namespace::RobotBaseParameters &baseParameters);
//获取调速模式配置
int robotServiceGetRegulateSpeedModeParam(
aubo_robot_namespace::RegulateSpeedModeParamConfig_t
&regulateSpeedModeConfig);
/**
* @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<aubo_robot_namespace::wayPoint_S> &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<aubo_robot_namespace::PositionAndQuaternion>
&toolEndPoseVector,
std::vector<aubo_robot_namespace::wayPoint_S> &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<aubo_robot_namespace::wayPoint_S> &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