![]() |
AUBO SDK
0.25.0
|
#include <sync_move.h>
Public 成员函数 | |
SyncMove () | |
virtual | ~SyncMove () |
int | syncMoveOn (const std::string &syncident, const TaskSet &taskset) |
syncMoveOn 用于启动同步运动模式。 | |
bool | syncMoveSegment (int id) |
设置同步路径段的ID 在同步运动模式下,所有同时执行的移动指令必须全部编程为圆角区(corner zones)或全部为停止点(stop points)。 这意味着具有相同ID的移动指令要么全部带有圆角区,要么全部带有停止点。 如果在各自的任务程序中同步执行的移动指令中,一个带有圆角区而另一个带有停止点,则会发生错误。 同步执行的移动指令可以有不同大小的圆角区(例如,一个使用z10,另一个使用z50)。 | |
int | syncMoveOff (const std::string &syncident) |
syncMoveOff 用于结束同步运动模式。 | |
int | syncMoveUndo () |
syncMoveUndo 用于关闭同步运动,即使不是所有其他任务程序都执行了 syncMoveUndo 指令。 | |
int | waitSyncTasks (const std::string &syncident, const TaskSet &taskset) |
waitSyncTasks 用于在程序中的特定点同步多个任务程序。 | |
bool | isSyncMoveOn () |
isSyncMoveOn 用于判断机械单元组是否处于同步运动模式。 | |
int | syncMoveSuspend () |
暂停同步运动模式。 | |
int | syncMoveResume () |
恢复同步运动模式。 | |
int | frameAdd (const std::string &name, const std::vector< double > &pose, const std::string &ref_name) |
添加一个名为 name 的坐标系,其初始位姿为 pose,位姿以 ref_frame 坐标系表达。 此命令仅向世界模型添加一个坐标系,并不会将其附加到 ref_frame 坐标系。 如需将新添加的坐标系附加到 ref_frame,请使用 frameAttach()。 | |
int | frameAttach (const std::string &child, const std::string &parent) |
将子坐标系附加到父世界模型对象。附加时会设置父子之间的相对变换,使得子坐标系在世界中不会移动。 | |
int | frameDeleteAll () |
删除所有已添加到世界模型的坐标系。 | |
int | frameDelete (const std::string &name) |
删除指定名称的坐标系。 | |
int | frameMove (const std::string &name, const std::vector< double > &pose, const std::string &ref_name) |
更改名为 name 的坐标系的位置,将其移动到由 pose 指定的新位置,pose 以 ref_name 坐标系表达。 | |
std::vector< double > | frameGetPose (const std::string &name, const std::string &rel_frame, const std::string &ref_frame) |
获取名为 name 的坐标系相对于 rel_frame 坐标系的位姿,并以 ref_frame 坐标系表达。 如果未提供 ref_frame,则返回 name 坐标系相对于 rel_frame 坐标系的位姿,并以 rel_frame 坐标系表达。 | |
std::vector< double > | frameConvertPose (const std::vector< double > &pose, const std::string &from_frame, const std::string &to_frame) |
将位姿从 from_frame 坐标系转换到 to_frame 坐标系。 | |
bool | frameExist (const std::string &name) |
查询指定名称的坐标系是否存在。 | |
std::string | frameGetParent (const std::string &name) |
获取名为 name 的坐标系在世界模型中的父坐标系名称。 | |
std::vector< std::string > | frameGetChildren (const std::string &name) |
返回指定父对象的直接子对象坐标系名称列表。父子关系由世界模型的附加关系定义。 如果用于 MotionPlus,子对象也可以是轴组或轴。 | |
int | axisGroupAdd (const std::string &name, const std::vector< double > &pose, const std::string &ref_frame) |
向世界模型添加一个新的轴组,名称为 name。轴组基座放置在 ref_frame 坐标系下的 pose 位置。 | |
int | axisGroupDelete (const std::string &name) |
删除具有给定名称的轴组。 | |
int | axisGroupAddAxis (const std::string &group_name, const std::string &name, const std::string &parent, const std::vector< double > &pose) |
向名为 group_name 的轴组添加一个名为 name 的外部轴。该轴在 parent 坐标系下的 pose 位置附加,pose 表示轴位置为 0 时的位姿。 轴的类型、最大速度、最大加速度、位置限制和索引分别由 type、v_limit、a_limit、q_limits 和 axis_index 定义。 pose 参数通常通过外部轴调试标定流程获得。 如果该轴组正被其他函数控制,或附加关系形成闭环,则操作会失败。 | |
int | axisGroupUpdateAxis (const std::string &name, const std::vector< double > &pose) |
更新指定名称的轴的相关属性。pose 参数通常通过外部轴调试标定流程获得。 如果该轴所属的轴组正被其他命令控制,则操作会失败。 如果该轴组中任何已附加的轴处于激活和使能状态,则操作会失败。 | |
int | axisGroupGetAxisIndex (const std::string &name) |
返回指定轴名称在 RTDE 目标位置和实际位置数组中的索引。 | |
std::string | axisGroupGetAxisName (int index) |
返回指定轴索引对应的轴名称。 | |
std::vector< double > | axisGroupGetTargetPositions (const std::string &group_name) |
返回指定轴组的当前目标位置。 如果未指定 group_name,则返回所有外部轴的目标位置。 | |
std::vector< double > | axisGroupGetActualPositions (const std::string &group_name) |
返回指定轴组的当前实际位置。 如果未指定 group_name,则返回所有外部轴的实际位置。 | |
int | axisGroupOffsetPositions (const std::string &group_name, const std::vector< double > &offset) |
通过给定的 offset,将轴组 group_name 的目标位置和实际位置整体偏移。 | |
int | axisGroupMoveJoint (const std::string &group_name, const std::vector< double > &q, double a, double v) |
以梯形速度曲线将名为 group_name 的轴组移动到新的位置 q。 参数 a 指定本次运动的最大加速度占各轴加速度极限的百分比。 参数 v 指定本次运动的最大速度占各轴速度极限的百分比。 | |
int | axisGroupSpeedJoint (const std::string &group_name, const std::vector< double > &qd, double a, double t) |
以指定的加速度因子 a,将名为 group_name 的轴组加速到目标速度 qd。该函数会运行 t 秒。 | |
Protected 属性 | |
void * | d_ |
在文件 sync_move.h 第 37 行定义.
arcs::common_interface::SyncMove::SyncMove | ( | ) |
|
virtual |
int arcs::common_interface::SyncMove::axisGroupAdd | ( | const std::string & | name, |
const std::vector< double > & | pose, | ||
const std::string & | ref_frame | ||
) |
向世界模型添加一个新的轴组,名称为 name。轴组基座放置在 ref_frame 坐标系下的 pose 位置。
轴组只能附加到世界坐标系。
每个轴组的基座都附加有一个坐标系,可以通过轴组名称作为参数传递给其他世界模型函数。
世界模型最多可添加 6 个轴组。
name | 要添加的轴组名称,不能为空字符串。世界模型对象(如坐标系、轴组、轴等)的名称必须唯一。 |
pose | 轴组基座在参考坐标系下的位姿。 |
ref_frame | (可选): pose 所在的参考坐标系名称,可以是任何带有坐标系的世界模型实体(如坐标系、轴组、轴等)。默认值 "base" 表示机器人基座坐标系。 |
int arcs::common_interface::SyncMove::axisGroupAddAxis | ( | const std::string & | group_name, |
const std::string & | name, | ||
const std::string & | parent, | ||
const std::vector< double > & | pose | ||
) |
向名为 group_name 的轴组添加一个名为 name 的外部轴。该轴在 parent 坐标系下的 pose 位置附加,pose 表示轴位置为 0 时的位姿。 轴的类型、最大速度、最大加速度、位置限制和索引分别由 type、v_limit、a_limit、q_limits 和 axis_index 定义。 pose 参数通常通过外部轴调试标定流程获得。 如果该轴组正被其他函数控制,或附加关系形成闭环,则操作会失败。
group_name | 要添加轴的轴组名称,需已通过 axis_group_add() 创建且存在。 |
name | 新轴的名称,不能为空且需唯一。 |
parent | 父轴名称,若为空或与 group_name 相同,则附加到轴组基座。父轴需已存在于该轴组。 |
pose | 轴在父坐标系下的零位姿。type 为 0(旋转轴)时,z 轴为旋转轴;type 为 1(直线轴)时,z 轴为移动方向。 |
type | 轴类型,0 表示旋转轴,1 表示直线轴。 |
v_limit | 最大速度。 |
a_limit | 最大加速度。 |
q_limits | 位置限制。 |
axis_index | 轴索引。 |
int arcs::common_interface::SyncMove::axisGroupDelete | ( | const std::string & | name | ) |
删除具有给定名称的轴组。
所有附加的轴也会被禁用(如果处于活动状态)并删除。
如果该轴组正被其他函数控制,则操作会失败。
name | 要删除的轴组名称。该名称的轴组必须存在。 |
std::vector< double > arcs::common_interface::SyncMove::axisGroupGetActualPositions | ( | const std::string & | group_name | ) |
返回指定轴组的当前实际位置。 如果未指定 group_name,则返回所有外部轴的实际位置。
如果外部轴总线被禁用,则该函数会失败。
group_name | (可选): (string) 要查询的轴组名称。该名称的轴组必须真实存在。 |
int arcs::common_interface::SyncMove::axisGroupGetAxisIndex | ( | const std::string & | name | ) |
返回指定轴名称在 RTDE 目标位置和实际位置数组中的索引。
axis_name | (string) 要查询的轴名称。该名称的轴必须存在。 |
std::string arcs::common_interface::SyncMove::axisGroupGetAxisName | ( | int | index | ) |
返回指定轴索引对应的轴名称。
axis_index | (整数) 要查询的轴索引。该索引的轴必须存在。 |
std::vector< double > arcs::common_interface::SyncMove::axisGroupGetTargetPositions | ( | const std::string & | group_name | ) |
返回指定轴组的当前目标位置。 如果未指定 group_name,则返回所有外部轴的目标位置。
如果外部轴总线被禁用,则该函数会失败。
group_name | (可选): (string) 要查询的轴组名称。该名称的轴组必须真实存在。 |
int arcs::common_interface::SyncMove::axisGroupMoveJoint | ( | const std::string & | group_name, |
const std::vector< double > & | q, | ||
double | a, | ||
double | v | ||
) |
以梯形速度曲线将名为 group_name 的轴组移动到新的位置 q。 参数 a 指定本次运动的最大加速度占各轴加速度极限的百分比。 参数 v 指定本次运动的最大速度占各轴速度极限的百分比。
实际的加速度和速度由最受限制的轴决定,以确保所有轴在加速、匀速和减速阶段同时完成。
group_name | (string) 要移动的轴组名称。该名称的轴组必须存在。 |
q | (float[]) 目标位置,旋转轴为弧度,直线轴为米。如果目标超出位置极限,则会被限制在最近的极限值。涉及的轴按其索引递增排序。q 的大小必须与该轴组包含的轴数量一致。 |
a | (float) 本次运动的最大加速度因子,取值范围 (0,1],表示占加速度极限的百分比。 |
v | (float) 本次运动的最大速度因子,取值范围 (0,1],表示占速度极限的百分比。 |
返回值: 无
int arcs::common_interface::SyncMove::axisGroupOffsetPositions | ( | const std::string & | group_name, |
const std::vector< double > & | offset | ||
) |
通过给定的 offset,将轴组 group_name 的目标位置和实际位置整体偏移。
这是一个仅在控制器内部进行的软件偏移,不会影响外部轴驱动器。该偏移也会应用于通过 RTDE 发布的任何目标和实际位置流。
group_name | (string) 要应用偏移的轴组名称。该名称的轴组必须存在。 |
offset | (float[]) 目标和实际位置需要整体偏移的量。offset 的大小必须与该轴组所包含的轴数量一致。 |
int arcs::common_interface::SyncMove::axisGroupSpeedJoint | ( | const std::string & | group_name, |
const std::vector< double > & | qd, | ||
double | a, | ||
double | t | ||
) |
以指定的加速度因子 a,将名为 group_name 的轴组加速到目标速度 qd。该函数会运行 t 秒。
group_name | (string) 要控制的外部轴组名称,必须已存在。 |
qd | (float[]) 轴组各轴的目标速度。如果目标速度超过速度极限,则会被限制在极限值。涉及的轴按其索引递增排序。qd 的大小必须与该轴组包含的轴数量一致。 |
a | (float) 本次运动的最大加速度因子,取值范围 (0,1],表示占加速度极限的百分比。 |
t | (可选): (float) 函数运行的持续时间(秒)。若 t < 0,则函数将在目标速度达到时返回;若 t ≥ 0,则函数将在该持续时间后返回,无论实际速度是否达到目标值。 |
int arcs::common_interface::SyncMove::axisGroupUpdateAxis | ( | const std::string & | name, |
const std::vector< double > & | pose | ||
) |
更新指定名称的轴的相关属性。pose 参数通常通过外部轴调试标定流程获得。 如果该轴所属的轴组正被其他命令控制,则操作会失败。 如果该轴组中任何已附加的轴处于激活和使能状态,则操作会失败。
name | 要更新的轴的名称,需已存在。 |
pose | (可选): 轴在父轴(或轴组)坐标系下的零位姿。即轴位置为 0 时的位姿。 |
int arcs::common_interface::SyncMove::frameAdd | ( | const std::string & | name, |
const std::vector< double > & | pose, | ||
const std::string & | ref_name | ||
) |
添加一个名为 name 的坐标系,其初始位姿为 pose,位姿以 ref_frame 坐标系表达。 此命令仅向世界模型添加一个坐标系,并不会将其附加到 ref_frame 坐标系。 如需将新添加的坐标系附加到 ref_frame,请使用 frameAttach()。
name | 要添加的坐标系名称。名称不能与任何已存在的世界模型对象(坐标系、轴或轴组)重复,否则会抛出异常。 |
pose | 新对象的初始位姿。 |
ref_frame | 位姿所表达的参考坐标系对象名称。若未指定,默认使用机器人“base”坐标系。 |
int arcs::common_interface::SyncMove::frameAttach | ( | const std::string & | child, |
const std::string & | parent | ||
) |
将子坐标系附加到父世界模型对象。附加时会设置父子之间的相对变换,使得子坐标系在世界中不会移动。
子坐标系不能为“world”、“flange”、“tcp”,也不能与父坐标系同名。
如果子或父不是已存在的坐标系,或导致形成闭环,则操作会失败。
如果用于 MotionPlus,parent 参数可以是外部轴或轴组的名称。
child | 要附加的子坐标系名称,不能为“world”、“flange”或“tcp”。 |
parent | 子坐标系将要附加到的父对象名称。 |
std::vector< double > arcs::common_interface::SyncMove::frameConvertPose | ( | const std::vector< double > & | pose, |
const std::string & | from_frame, | ||
const std::string & | to_frame | ||
) |
将位姿从 from_frame 坐标系转换到 to_frame 坐标系。
如果任一坐标系参数不是已存在的坐标系,则操作会失败。
如果用于 MotionPlus,所有三个参数也可以是外部轴或轴组的名称。
pose | 要转换的位姿 |
from_frame | 原始坐标系的参考坐标系名称 |
to_frame | 新坐标系的参考坐标系名称 |
int arcs::common_interface::SyncMove::frameDelete | ( | const std::string & | name | ) |
删除指定名称的坐标系。
“world”、“base”、“flange”和“tcp”坐标系不能被删除。
任何附加到被删除坐标系的坐标系将会被附加到“world”坐标系,并设置新的偏移,使得被分离的坐标系在世界中不会移动。
如果指定的坐标系不存在,则操作会失败。
name | 要删除的坐标系名称 |
int arcs::common_interface::SyncMove::frameDeleteAll | ( | ) |
删除所有已添加到世界模型的坐标系。
“world”、“base”、“flange”和“tcp”坐标系不能被删除。
任何附加到被删除坐标系的坐标系将会被附加到“world”坐标系,并设置新的偏移,使得被分离的坐标系在世界中不会移动。
bool arcs::common_interface::SyncMove::frameExist | ( | const std::string & | name | ) |
查询指定名称的坐标系是否存在。
name | 要查询的坐标系名称。 |
std::vector< std::string > arcs::common_interface::SyncMove::frameGetChildren | ( | const std::string & | name | ) |
返回指定父对象的直接子对象坐标系名称列表。父子关系由世界模型的附加关系定义。 如果用于 MotionPlus,子对象也可以是轴组或轴。
name | 父对象的名称。 |
std::string arcs::common_interface::SyncMove::frameGetParent | ( | const std::string & | name | ) |
获取名为 name 的坐标系在世界模型中的父坐标系名称。
如果该坐标系没有附加到其他坐标系,则其父坐标系为 "world"。
name | 要查询的坐标系名称 |
std::vector< double > arcs::common_interface::SyncMove::frameGetPose | ( | const std::string & | name, |
const std::string & | rel_frame, | ||
const std::string & | ref_frame | ||
) |
获取名为 name 的坐标系相对于 rel_frame 坐标系的位姿,并以 ref_frame 坐标系表达。 如果未提供 ref_frame,则返回 name 坐标系相对于 rel_frame 坐标系的位姿,并以 rel_frame 坐标系表达。
如果任一参数不是已存在的坐标系,则操作会失败。
如果用于 MotionPlus,所有三个参数也可以是外部轴或轴组的名称。
name | 要查询的坐标系名称。 |
rel_frame | “相对坐标系”,用于计算相对位姿的坐标系。 |
ref_frame | “参考坐标系”,用于表达结果相对位姿的坐标系。如果未提供,则默认为 rel_frame。 |
int arcs::common_interface::SyncMove::frameMove | ( | const std::string & | name, |
const std::vector< double > & | pose, | ||
const std::string & | ref_name | ||
) |
更改名为 name 的坐标系的位置,将其移动到由 pose 指定的新位置,pose 以 ref_name 坐标系表达。
如果 name 为 “world”、“flange”、“tcp”,或该坐标系不存在,则操作会失败。注意:如需移动 “tcp” 坐标系,请使用 set_tcp() 命令。
如果用于 MotionPlus,ref_name 参数可以是外部轴或轴组的名称。
name | 要移动的坐标系名称 |
pose | 新的位置 |
ref_name | pose 所表达的参考坐标系,默认值为机器人的 “base” 坐标系。 |
bool arcs::common_interface::SyncMove::isSyncMoveOn | ( | ) |
isSyncMoveOn 用于判断机械单元组是否处于同步运动模式。
不控制任何机械单元的任务可以通过该函数判断参数“使用机械单元组”中定义的机械单元是否处于同步运动模式。
int arcs::common_interface::SyncMove::syncMoveOff | ( | const std::string & | syncident | ) |
syncMoveOff 用于结束同步运动模式。
syncMoveOff 指令会等待其他任务程序。当所有任务程序都到达 syncMoveOff 时, 它们将继续以非同步模式执行。在 syncMoveOff 指令之前必须编程一个停止点。
syncident |
int arcs::common_interface::SyncMove::syncMoveOn | ( | const std::string & | syncident, |
const TaskSet & | taskset | ||
) |
syncMoveOn 用于启动同步运动模式。
syncMoveOn 指令会等待其他任务程序。当所有任务程序都到达 syncMoveOn 时, 它们将继续以同步运动模式执行。不同任务程序中的移动指令将同时执行, 直到执行 syncMoveOff 指令为止。在 syncMoveOn 指令之前必须编程一个停止点。
syncident | |
taskset |
int arcs::common_interface::SyncMove::syncMoveResume | ( | ) |
恢复同步运动模式。
bool arcs::common_interface::SyncMove::syncMoveSegment | ( | int | id | ) |
设置同步路径段的ID 在同步运动模式下,所有同时执行的移动指令必须全部编程为圆角区(corner zones)或全部为停止点(stop points)。 这意味着具有相同ID的移动指令要么全部带有圆角区,要么全部带有停止点。 如果在各自的任务程序中同步执行的移动指令中,一个带有圆角区而另一个带有停止点,则会发生错误。 同步执行的移动指令可以有不同大小的圆角区(例如,一个使用z10,另一个使用z50)。
id |
int arcs::common_interface::SyncMove::syncMoveSuspend | ( | ) |
暂停同步运动模式。
int arcs::common_interface::SyncMove::syncMoveUndo | ( | ) |
syncMoveUndo 用于关闭同步运动,即使不是所有其他任务程序都执行了 syncMoveUndo 指令。
syncMoveUndo 主要用于 UNDO 处理程序。当程序指针从过程移动时,syncMoveUndo 用于关闭同步。
int arcs::common_interface::SyncMove::waitSyncTasks | ( | const std::string & | syncident, |
const TaskSet & | taskset | ||
) |
waitSyncTasks 用于在程序中的特定点同步多个任务程序。
waitSyncTasks 指令会等待其他任务程序。当所有任务程序都到达 waitSyncTasks 指令时, 它们将继续执行。
syncident | |
taskset |
|
protected |
在文件 sync_move.h 第 974 行定义.