controller
robot_teach_interface.h 文件参考

机器人示教接口 更多...

浏览源代码.

函数

int set_robot_index (int robot_index)
 设置要操作机器人的索引 更多...
 
int get_robot_index ()
 获取当前操作机器人索引 更多...
 
int set_robot_tool (const char *tool_name)
 设置当前操作机器人工具 更多...
 
const char * get_robot_tool ()
 获取当前操作机器人工具 更多...
 
int set_robot_wobj (const char *wobj_name)
 设置当前操作机器人工具 更多...
 
const char * get_robot_wobj ()
 获取当前操作机器人工件 更多...
 
int set_robot_teach_coordinate (int frame)
 设置当前操作机器人的坐标系 更多...
 
int get_robot_teach_coordinate ()
 获取当前操作机器人的坐标系 更多...
 
int get_robot_num ()
 获取机器人数目 更多...
 
int get_robot_dof ()
 获取当前操作机器人的自由度 更多...
 
int get_robot_joint (double *joint)
 获取当前操作机器人的关节位置 更多...
 
int get_robot_cartesian (double *cartesin)
 获取当前操作机器人的笛卡尔位置 更多...
 
void set_robot_teach_velocity (double vel_percent)
 设置当前操作机器人的示教速度 更多...
 
double get_robot_teach_velocity ()
 获取当前操作机器人的示教速度 更多...
 
void set_robot_run_type (int isSimulation)
 设置当前操作机器人的运行方式 更多...
 
int get_robot_run_type ()
 获取当前操作机器人的运行方式 更多...
 
int get_robot_run_state ()
 获取当前操作机器人的运行状态 更多...
 
int create_robot_torque_sensor (const char *torqueSensorName)
 创建末端六维力传感器 更多...
 
int calibration_robot_torque_sensor (const char *torqueSensorName)
 末端六维力传感器标定(仅需一次,永久生效) 更多...
 
int get_robot_torque_sensor (const char *torqueSensorName, double *torque)
 获取末端六维力传感器数据 更多...
 
int get_robot_torque_sensor_transform (const char *torqueSensorName, double *torque)
 获取末端六维力传感器转换到工具数据 更多...
 
int create_robot_grip (const char *gripName)
 创建夹爪 更多...
 
int control_robot_grip (const char *gripName, double close_percent)
 夹爪开合控制 更多...
 
void robot_move_error_clear ()
 清除当前操作机器人的错误运动状态 更多...
 
int start_robot_project (const char *project_name)
 启动机器人项目 更多...
 
int close_robot_project ()
 关闭机器人项目 更多...
 
int start_robot_c_project (const char *project_name)
 启动机器人C项目 更多...
 
int close_robot_c_project ()
 关闭机器人C项目 更多...
 
int start_robot_lua_project (const char *project_name)
 启动机器人lua项目 更多...
 
int close_robot_lua_project ()
 关闭机器人lua项目 更多...
 
int save_robot_current_joint_data (const char *data_name)
 保存当期操作机器人的当前关节数据 更多...
 
int save_robot_current_cartesian_data (const char *data_name)
 保存当期操作机器人的当前位置及姿态数据 更多...
 
int set_robot_data_path (const char *path)
 设置机器人系统使用的数据所在路径 更多...
 
int set_robot_data_default_path ()
 设置机器人系统当前使用的数据所在路径为默认路径 更多...
 
const char * get_robot_data_path ()
 获取机器人系统使用的数据所在路径 更多...
 
int robot_direct_teach_start (double inertia, double damping, int *teach_axis, int is_tool_ctrl)
 启动基于末端力矩传感器的拖动 更多...
 
int robot_direct_teach_end ()
 关闭基于末端力矩传感器的拖动 更多...
 
int robot_teach_enable ()
 使能当前操作机器人 更多...
 
int robot_teach_disenable ()
 去使能当前操作机器人 更多...
 
int robot_teach_stop ()
 停止当前操作机器人的示教移动 更多...
 
int robot_home ()
 当前操作机器人回零运动 更多...
 
int robot_goto (double *J, int dof)
 当前操作机器人运动到指定目标关节位置 更多...
 
int robot_teach_joint (int axis_index, int dir)
 在关节空间示教当前操作机器人 更多...
 
int robot_teach_cartesian (int axis_index, int dir)
 在笛卡尔空间示教当前操作机器人,运动相对坐标系包括:基座坐标系,工件坐标系,工具坐标系,由当前设置的坐标系决定。 更多...
 
int robot_teach_move (int axis_index, int dir)
 示教当前操作机器人,运动相对坐标系包括:关节坐标系,基座坐标系,工件坐标系,工具坐标系,由当前设置的坐标系决定。 更多...
 

详细描述

机器人示教接口

作者
hanbing
版本
1.0
日期
2020-05-23

函数说明

◆ calibration_robot_torque_sensor()

int calibration_robot_torque_sensor ( const char *  torqueSensorName)

末端六维力传感器标定(仅需一次,永久生效)

参数
torqueSensorName创建时指定的名字
返回
int 0: 成功, 其他:失败

◆ close_robot_c_project()

int close_robot_c_project ( )

关闭机器人C项目

return int 0: 成功, 其他:失败

◆ close_robot_lua_project()

int close_robot_lua_project ( )

关闭机器人lua项目

return int 0: 成功, 其他:失败

◆ close_robot_project()

int close_robot_project ( )

关闭机器人项目

return int 0: 成功, 其他:失败

◆ control_robot_grip()

int control_robot_grip ( const char *  gripName,
double  close_percent 
)

夹爪开合控制

参数
gripName创建时指定的名字
close_percent夹爪闭合程度,0.0~1.0之间取值,0.0完全伸展开,1.0完全夹紧;
返回
int 0: 成功, 其他:失败

◆ create_robot_grip()

int create_robot_grip ( const char *  gripName)

创建夹爪

参数
gripName创建时指定的名字,其他操作用到该名字。该名字与设备描述配置文件名一致(不包含后缀)
返回
int 0: 成功, -1:传感器已创建,-2:设备初始化失败

◆ create_robot_torque_sensor()

int create_robot_torque_sensor ( const char *  torqueSensorName)

创建末端六维力传感器

参数
torqueSensorName创建时指定的名字,其他操作用到该名字。该名字与设备描述配置文件名一致(不包含后缀)
返回
int 0: 成功, -1:传感器已创建,-2:设备初始化失败

◆ get_robot_cartesian()

int get_robot_cartesian ( double *  cartesin)

获取当前操作机器人的笛卡尔位置

参数
cartesin机器人笛卡尔位置(mm, rad), 数据相对设置的坐标系描述
返回
int 0: 成功, 其他: 失败

◆ get_robot_data_path()

const char* get_robot_data_path ( )

获取机器人系统使用的数据所在路径

返回
const char* 路径数据指针

◆ get_robot_dof()

int get_robot_dof ( )

获取当前操作机器人的自由度

返回
int 机器人自由度

◆ get_robot_index()

int get_robot_index ( )

获取当前操作机器人索引

返回
int 机器人索引

◆ get_robot_joint()

int get_robot_joint ( double *  joint)

获取当前操作机器人的关节位置

参数
joint机器人关节位置(rad)
返回
int 0: 成功, 其他: 失败

◆ get_robot_num()

int get_robot_num ( )

获取机器人数目

返回
int 机器人数目

◆ get_robot_run_state()

int get_robot_run_state ( )

获取当前操作机器人的运行状态

返回
_move_finish(0):运动完成,_move_run_joint(1),_move_run_line(2),_move_run_cricle(3),_move_run_helical(4),_move_run_bspline(5),_move_run_zone(6),_move_stop(7),_move_run_zone_finish(8);其他:运动状态错误:_move_error(-1)

◆ get_robot_run_type()

int get_robot_run_type ( )

获取当前操作机器人的运行方式

返回
int 0:非仿真运行;1:仿真运行

◆ get_robot_teach_coordinate()

int get_robot_teach_coordinate ( )

获取当前操作机器人的坐标系

返回
int 坐标系编号, 0:关节;1:机器人基坐标系;2:机器人工具坐标系;3:机器人工件坐标系

◆ get_robot_teach_velocity()

double get_robot_teach_velocity ( )

获取当前操作机器人的示教速度

返回
double 示教速度百分比(0~1)

◆ get_robot_tool()

const char* get_robot_tool ( )

获取当前操作机器人工具

返回
char* 工具名称

◆ get_robot_torque_sensor()

int get_robot_torque_sensor ( const char *  torqueSensorName,
double *  torque 
)

获取末端六维力传感器数据

参数
torqueSensorName创建时指定的名字
torque六维传感器数据,[fx,fy,fz,tx,ty,tz](N, Nm)
返回
int 0: 成功, 其他:失败

◆ get_robot_torque_sensor_transform()

int get_robot_torque_sensor_transform ( const char *  torqueSensorName,
double *  torque 
)

获取末端六维力传感器转换到工具数据

参数
torqueSensorName创建时指定的名字
torque六维传感器数据,[fx,fy,fz,tx,ty,tz](N, Nm)
返回
int 0: 成功, 其他:失败

◆ get_robot_wobj()

const char* get_robot_wobj ( )

获取当前操作机器人工件

返回
char* 工件名称

◆ robot_direct_teach_end()

int robot_direct_teach_end ( )

关闭基于末端力矩传感器的拖动

返回
int 0:执行成功;其他:错误

◆ robot_direct_teach_start()

int robot_direct_teach_start ( double  inertia,
double  damping,
int *  teach_axis,
int  is_tool_ctrl 
)

启动基于末端力矩传感器的拖动

参数
inertia惯性系数
damping阻尼系数
teach_axis拖动轴向量[x,y,z,Rx,Ry,Rz],为1表示拖动轴,0表示非拖动轴。
is_tool_ctrl拖动轴的参考坐标系,为1表示参考坐标系为工具坐标系,0表示工件坐标系
返回
int 0:执行成功;其他:错误

◆ robot_goto()

int robot_goto ( double *  J,
int  dof 
)

当前操作机器人运动到指定目标关节位置

参数
J机器人目标关节位置(rad)
dof机器人机器人自由度
返回
_move_finish(0):运动完成,_move_run_joint(1),_move_run_line(2),_move_run_cricle(3),_move_run_helical(4),_move_run_bspline(5),_move_run_zone(6),_move_stop(7),_move_run_zone_finish(8);其他:运动状态错误:_move_error(-1)

◆ robot_home()

int robot_home ( )

当前操作机器人回零运动

返回
_move_finish(0):运动完成,_move_run_joint(1),_move_run_line(2),_move_run_cricle(3),_move_run_helical(4),_move_run_bspline(5),_move_run_zone(6),_move_stop(7),_move_run_zone_finish(8);其他:运动状态错误:_move_error(-1)

◆ robot_move_error_clear()

void robot_move_error_clear ( )

清除当前操作机器人的错误运动状态

◆ robot_teach_cartesian()

int robot_teach_cartesian ( int  axis_index,
int  dir 
)

在笛卡尔空间示教当前操作机器人,运动相对坐标系包括:基座坐标系,工件坐标系,工具坐标系,由当前设置的坐标系决定。

参数
axis_index机器人笛卡尔轴索引(0:x,1:y,2:z,3:rx,4:ry,5:rz)
dir运动方向,>0:正方向运动,<0:负方向运动,=0:不运动
返回
_move_finish(0):运动完成,_move_run_joint(1),_move_run_line(2),_move_run_cricle(3),_move_run_helical(4),_move_run_bspline(5),_move_run_zone(6),_move_stop(7),_move_run_zone_finish(8);其他:运动状态错误, (-4~-2:初始化数据错误,-5关节达到运动极限),_move_error(-1)

◆ robot_teach_disenable()

int robot_teach_disenable ( )

去使能当前操作机器人

返回
0:执行成功;其他:运动状态错误或去使能失败(-1),_move_run_joint(1),_move_run_line(2),_move_run_cricle(3),_move_run_helical(4),_move_run_bspline(5),_move_run_zone(6),_move_stop(7),_move_run_zone_finish(8)

◆ robot_teach_enable()

int robot_teach_enable ( )

使能当前操作机器人

返回
0:执行成功;其他:运动状态错误或使能失败(-1),_move_run_joint(1),_move_run_line(2),_move_run_cricle(3),_move_run_helical(4),_move_run_bspline(5),_move_run_zone(6),_move_stop(7),_move_run_zone_finish(8)

◆ robot_teach_joint()

int robot_teach_joint ( int  axis_index,
int  dir 
)

在关节空间示教当前操作机器人

参数
axis_index机器人关节索引(0,1,2,...)
dir运动方向,>0:正方向运动,<0:负方向运动,=0:不运动
返回
_move_finish(0):运动完成,_move_run_joint(1),_move_run_line(2),_move_run_cricle(3),_move_run_helical(4),_move_run_bspline(5),_move_run_zone(6),_move_stop(7),_move_run_zone_finish(8);其他:运动状态错误, (-4~-2:初始化数据错误,-5关节达到运动极限),_move_error(-1)

◆ robot_teach_move()

int robot_teach_move ( int  axis_index,
int  dir 
)

示教当前操作机器人,运动相对坐标系包括:关节坐标系,基座坐标系,工件坐标系,工具坐标系,由当前设置的坐标系决定。

参数
axis_index机器人关节索引(0,1,2,...)或机器人笛卡尔轴索引(0:x,1:y,2:z,3:rx,4:ry,5:rz)
dir运动方向,>0:正方向运动,<0:负方向运动,=0:不运动
返回
_move_finish(0):运动完成,_move_run_joint(1),_move_run_line(2),_move_run_cricle(3),_move_run_helical(4),_move_run_bspline(5),_move_run_zone(6),_move_stop(7),_move_run_zone_finish(8);其他:运动状态错误, (-4~-2:初始化数据错误,-5关节达到运动极限(关节空间示教)),_move_error(-1)

◆ robot_teach_stop()

int robot_teach_stop ( )

停止当前操作机器人的示教移动

return int 0: 成功, 其他:失败

◆ save_robot_current_cartesian_data()

int save_robot_current_cartesian_data ( const char *  data_name)

保存当期操作机器人的当前位置及姿态数据

参数
data_name数据名字,建议数据命名规则:”p1","p2",...,"pn",重名数据被覆盖
返回
int 0: 成功, 其他:失败(-1:指定名字无效)

◆ save_robot_current_joint_data()

int save_robot_current_joint_data ( const char *  data_name)

保存当期操作机器人的当前关节数据

参数
data_name数据名字,建议数据命名规则:”j1","j2",...,"jn",重名数据被覆盖
返回
int 0: 成功, 其他:失败(-1:指定名字无效)

◆ set_robot_data_default_path()

int set_robot_data_default_path ( )

设置机器人系统当前使用的数据所在路径为默认路径

返回
int 0: 成功, 其他:失败

◆ set_robot_data_path()

int set_robot_data_path ( const char *  path)

设置机器人系统使用的数据所在路径

参数
path路径
返回
int 0: 成功, 其他:失败(-1:路径设置失败,-2默认使用路径设置失败)

◆ set_robot_index()

int set_robot_index ( int  robot_index)

设置要操作机器人的索引

参数
robot_index机器人索引
返回
int 0: 成功, 其他: 失败

◆ set_robot_run_type()

void set_robot_run_type ( int  isSimulation)

设置当前操作机器人的运行方式

参数
isSimulation0:非仿真运行;1:仿真运行

◆ set_robot_teach_coordinate()

int set_robot_teach_coordinate ( int  frame)

设置当前操作机器人的坐标系

参数
frame坐标系编号, 0:关节;1:机器人基坐标系;2:机器人工具坐标系;3:机器人工件坐标系
返回
int 0: 成功, 其他: 失败

◆ set_robot_teach_velocity()

void set_robot_teach_velocity ( double  vel_percent)

设置当前操作机器人的示教速度

参数
vel_percent示教速度百分比(0~1)

◆ set_robot_tool()

int set_robot_tool ( const char *  tool_name)

设置当前操作机器人工具

参数
tool_name工具名称
返回
int 0: 成功, 其他: 失败

◆ set_robot_wobj()

int set_robot_wobj ( const char *  wobj_name)

设置当前操作机器人工具

参数
wobj_name工件名称
返回
int 0: 成功, 其他: 失败

◆ start_robot_c_project()

int start_robot_c_project ( const char *  project_name)

启动机器人C项目

参数
project_name机器人项目名
返回
int 0:项目成功执行;-1:输入项目名过长;-2:系统处于繁忙状态;-3:机器人运动状态不正确;-4: 项目编译失败;-5:创建启动项目失败;

◆ start_robot_lua_project()

int start_robot_lua_project ( const char *  project_name)

启动机器人lua项目

参数
project_name机器人项目名
返回
int 0:项目成功执行;-1:输入项目名过长;-2:系统处于繁忙状态;-3:机器人运动状态不正确;-4: 创建启动项目失败;

◆ start_robot_project()

int start_robot_project ( const char *  project_name)

启动机器人项目

参数
project_name机器人项目名
返回
int 0:项目成功执行;-1:输入项目名过长;-2:系统处于繁忙状态;-3:机器人运动状态不正确;-4: 创建启动项目失败;-5:项目编译失败;-6:项目加载失败;-7:项目主函数定位失败