|
| Robot (std::string ip, bool simulator=false) |
| 构造Robot对象.
|
|
virtual | ~Robot () |
| 析构Robot对象.
|
|
std::tuple< int, std::string > | call (const std::string &method, const std::string ¶ms) |
| 用JSON格式字符串调用机械臂的接口.
|
|
bool | is_network_connected () |
| 返回是否和机械臂的网络连接正常,如果网络连接异常,调用和机械臂交互的接口会抛出异常std::runtime_error。
|
|
void | start_sys () |
| 启动机械臂(机械臂上使能).
|
|
void | stop_sys () |
| 停止机械臂(机械臂下使能).
|
|
void | powerdown () |
| 关闭机器人电源(关机).
|
|
void | stop () |
| 停止运动(但不下电).
|
|
void | estop () |
| 紧急停止(急停).
|
|
void | teach_mode () |
| 进入示教模式.
|
|
void | end_teach_mode () |
| 退出示教模式.
|
|
void | pause () |
| 暂停运动.
|
|
void | resume () |
| 恢复运动.
|
|
void | reboot () |
| 重新启动机箱
|
|
int | movej (const std::vector< double > &joint_positions, double a, double v, double t, double r) |
| 通过关节位置发送机械臂关节移动
|
|
int | movej (const CartesianPose &cart_pose, double a, double v, double t, double r) |
| 通过坐标位置发送机械臂关节移动
|
|
int | movel (const std::vector< double > &joint_positions, double a, double v, double t, double r) |
| 通过关节位置发送机械臂直线移动
|
|
int | movel (const CartesianPose &cart_pose, double a, double v, double t, double r) |
| 通过坐标位置发送机械臂直线移动
|
|
int | movec (const std::vector< double > &joint_via, const std::vector< double > &joint, double rad, double a, double v, double t, double r) |
| 通过关节位置发送机械臂圆弧运动.
|
|
int | movec (const CartesianPose &cart_via, const CartesianPose &cart, double rad, double a, double v, double t, double r) |
| 通过坐标位置发送机械臂圆弧运动
|
|
int | speedj (double a, const std::vector< double > &v, double t=0.0) |
| 通过关节速度矢量发送机械臂关节匀速运动
|
|
int | speedl (double a, const CartesianPose &v, double t=0.0, const CartesianPose &reference={{"x", 0.0}, {"y", 0.0}, {"z", 0.0}, {"rx", 0.0}, {"ry", 0.0}, {"rz", 0.0}}) |
| 通过坐标速度矢量发送机械臂关节匀速运动
|
|
int | towardj (const std::vector< double > &joint_positions, double a, double v, double t, double r) |
| 通过关节位置发送机械臂关节自由移动.
|
|
void | move_pvat (std::vector< double > p, std::vector< double > v, std::vector< double > a, double t) |
| 伺服运动PVAT
|
|
void | wait_move (unsigned int id) |
| 等待运动完成.
|
|
void | wait_move () |
| 等待所有运动完成.
|
|
unsigned int | get_running_motion () |
| 查询当前正在运动的MotionId(无运动时返回上次MotionId).
|
|
std::string | get_motion_state (unsigned int id) |
| 查询指定MotionId的运动状态.
|
|
void | stop_move () |
| 停止所有运动.
|
|
int | get_robot_mode () |
| 获取机器人状态码
|
|
int | get_estop_reason () |
| 查看急停原因
|
|
bool | is_disconnected () |
| 是否已与手臂断开连接
|
|
bool | is_down () |
| 手臂是否已下电
|
|
std::vector< double > | get_actual_joint_positions () |
| 获取机械臂关节当前反馈位置
|
|
std::vector< double > | get_target_joint_positions () |
| 获取机械臂关节当前控制位置
|
|
std::vector< double > | get_actual_joint_speed () |
| 获取机械臂关节当前反馈速度
|
|
std::vector< double > | get_target_joint_speed () |
| 获取机械臂关节当前控制力矩
|
|
CartesianPose | get_actual_tcp_pose () |
| 获取机械臂末端在机械臂基坐标系下的实际位姿,CartesianPose = std::map<std::string,double>,应当包括键为x,y,z,rz,ry,rx的值.
|
|
CartesianPose | get_target_tcp_pose () |
| 获取机械臂末端在机械臂基坐标系下的控制位姿,CartesianPose = std::map<std::string,double>,应当包括键为x,y,z,rz,ry,rx的值.
|
|
double | get_joint_temp (unsigned int joint_index) |
| 获取单个关节温度
|
|
std::vector< double > | get_actual_joint_torques () |
| 获取机械臂关节当前反馈力矩
|
|
std::vector< double > | get_target_joint_torques () |
| 获取机械臂关节当前控制力矩
|
|
void | set_do (std::string device, unsigned int pin, unsigned int value) |
| 设置数字输出
|
|
unsigned int | get_do (std::string device, unsigned int pin) |
| 获取数字输出
|
|
std::vector< unsigned int > | get_dos (std::string device, unsigned int pin, unsigned int num) |
| 获取多个数字输出
|
|
unsigned int | get_di (std::string device, unsigned int pin) |
| 获取数字输入
|
|
std::vector< unsigned int > | get_dis (std::string device, unsigned int pin, unsigned int num) |
| 获取多个数字输入
|
|
void | set_ao (std::string device, unsigned int pin, double value) |
| 设置模拟输出
|
|
double | get_ao (std::string device, unsigned int pin) |
| 获取模拟输出
|
|
std::vector< double > | get_aos (std::string device, unsigned int pin, unsigned int num) |
| 获取多个模拟输出
|
|
double | get_ai (std::string device, unsigned int pin) |
| 获取模拟输入
|
|
std::vector< double > | get_ais (std::string device, unsigned int pin, unsigned int num) |
| 获取多个模拟输入
|
|
void | set_dio_mode (std::string device, unsigned int pin, bool value) |
| 设置数字端口模式
|
|
std::vector< bool > | get_dios_mode (std::string device, unsigned int pin, unsigned int count) |
| 获取数字端口模式
|
|
void | set_claw (double force, double amplitude) |
| 设置夹爪力度(力控)和幅度(位控).如果在闭合过程中抓取到物体,则不再继续闭合以避免夹坏物体,判断的准则为这里设置的力的大小.
|
|
std::tuple< double, double, bool > | get_claw () |
| 获取夹爪当前数据
|
|
ClawData | get_claw_data () |
| 获取夹爪当前数据
|
|
void | set_led (unsigned int mode, unsigned int speed, const std::vector< unsigned int > &color) |
| 设置LED灯状态.
|
|
void | set_voice (unsigned int voice, unsigned int volume) |
| 设置声音
|
|
void | set_fan (unsigned int status) |
| 开关风扇
|
|
void | set_signal (unsigned int index, int value) |
| 设置信号量
|
|
int | get_signal (unsigned int index) |
| 获取信号量
|
|
void | add_signal (unsigned int index, int value) |
| 增加指定下标的信号量值,该操作是原子的.
|
|
unsigned int | start_task (const std::string &name, const std::vector< std::string > ¶ms, const std::string &dir, bool is_parallel, unsigned int loop_to) |
| 调用场景
|
|
unsigned int | start_task (const std::string &name) |
| 调用场景
|
|
std::vector< unsigned int > | load_task_list () |
| 查询任务列表
|
|
bool | wait_task (unsigned int id) |
| 等待任务完成
|
|
void | pause_task (unsigned int id, unsigned long time, bool wait) |
| 暂停任务与运动
|
|
void | pause_task (unsigned int id) |
| 暂停任务与运动
|
|
void | resume_task (unsigned int id) |
| 恢复任务与运动
|
|
void | cancel_task (unsigned int id) |
| 取消任务与运动.
|
|
unsigned int | exec_hook (unsigned int id) |
| 根据已设置的Hook执行对应场景
|
|
std::string | get_task_state () |
| 获取任务状态.
|
|
std::string | get_task_state (unsigned int id) |
| 获取任务状态.
|
|
KinematicsForwardResp | kinematics_forward (const std::vector< double > &joint_positions) |
| 根据机械臂关节位置计算机器人末端位姿(位置的运动学正解).
|
|
KinematicsInverseResp | kinematics_inverse (const CartesianPose &pose, const std::vector< double > &joint_init_positions={}) |
| 根据机械臂的末端位姿计算关节位置(位置的运动学逆解).
|
|
CartesianPose | pose_times (const CartesianPose &a, const CartesianPose &b) |
| 位姿变换乘法(等价于对应的齐次坐标矩阵乘法)
|
|
CartesianPose | pose_inverse (const CartesianPose &in) |
| 位姿变换的逆(等价于对应的齐次坐标矩的逆)
|
|
void | save_file (const std::string &dir, const std::string &name, bool is_dir, const std::string &data) |
| 保存文件(以字节形式).
|
|
void | rename_file (const std::string &from_dir, const std::string &from_name, const std::string &to_dir, const std::string &to_name) |
| 重命名文件
|
|
std::tuple< bool, std::string > | load_file (const std::string &dir, const std::string &name) |
| 查询文件
|
|
std::vector< std::tuple< bool, std::string > > | load_file_list (const std::string &dir, const std::string &prefix, const std::string &suffix) |
| 查询文件列表.
|
|
void | set_tcp (std::array< double, 6 > tcp) |
| 设置工具中心点(TCP)坐标,坐标值相对于工具坐标系.
|
|
std::array< double, 6 > | get_tcp () |
| 获取当前机器人工具中心点设置.
|
|
void | set_velocity_factor (int factor) |
| 设置速度因子.
|
|
int | get_velocity_factor () |
| 获取当前的速度因子.
|
|
void | set_payload (double mass, std::map< std::string, double > cog) |
| 设置机器人末端负载.
|
|
void | set_payload_mass (double mass) |
| 设置机器人末端负载质量.
|
|
void | set_payload_cog (std::map< std::string, double > cog) |
| 设置机器人末端负载重心.
|
|
std::map< std::string, double > | get_payload () |
| 获取末端负载设置.
|
|
void | set_gravity (std::map< std::string, double > gravity) |
| 设置机器人重力加速度方向.
|
|
std::map< std::string, double > | get_gravity () |
| 获取机器人重力加速度的方向.
|
|
CartesianPose | load_tcp (std::string name, std::string dir="") |
| 从资源库加载tcp.
|
|
void | write_single_coil (std::string device, std::string addr, bool value) |
| 写单个线圈.
|
|
void | wirte_multiple_coils (std::string device, std::string addr, std::vector< bool > values) |
| 写多个线圈
|
|
std::vector< bool > | read_coils (std::string device, std::string addr, unsigned int num) |
| 读线圈
|
|
std::vector< bool > | read_discrete_inputs (std::string device, std::string addr, unsigned int num) |
| 读离散输入
|
|
void | write_single_register (std::string device, std::string addr, unsigned int value) |
| 写单个寄存器
|
|
void | write_multiple_registers (std::string device, std::string addr, std::vector< unsigned int > values) |
| 写多个寄存器
|
|
std::vector< unsigned int > | read_holding_registers (std::string device, std::string addr, unsigned int num) |
| 读保持寄存器
|
|
std::vector< unsigned int > | read_input_registers (std::string device, std::string addr, unsigned int num) |
| 读输入寄存器
|
|
void | set_serial_baud_rate (std::string device, unsigned int baud_rate) |
| 设置串口波特率.
|
|
void | set_serial_parity (std::string device, unsigned int parity) |
| 设置串口校验位.
|
|