![]() |
ARCS SDK API
0.25.0
|
#include <sync_move.h>
Public 成员函数 | |
SyncMove () | |
virtual | ~SyncMove () |
int | syncMoveOn (const std::string &syncident, const TaskSet &taskset) |
syncMoveOn is used to start synchronized movement mode. | |
bool | syncMoveSegment (int id) |
设置同步路径段的ID In synchronized movements mode, all or none of the simultaneous move instructions must be programmed with corner zones. | |
int | syncMoveOff (const std::string &syncident) |
syncMoveOff is used to end synchronized movement mode. | |
int | syncMoveUndo () |
syncMoveUndo is used to turn off synchronized movements, even if not all the other task programs execute the syncMoveUndo instruction. | |
int | waitSyncTasks (const std::string &syncident, const TaskSet &taskset) |
waitSyncTasks used to synchronize several task programs at a special point in the program. | |
bool | isSyncMoveOn () |
isSyncMoveOn is used to tell if the mechanical unit group is in synchron- ized movement mode. | |
int | syncMoveSuspend () |
int | syncMoveResume () |
int | frameAdd (const std::string &name, const std::vector< double > &pose, const std::string &ref_name) |
Add a frame with the name name initialized at the specified pose expressed in the ref_frame coordinate frame. | |
int | frameAttach (const std::string &child, const std::string &parent) |
Attaches the child frame to the parent world model object. | |
int | frameDeleteAll () |
Delete all frames that have been added to the world model. | |
int | frameDelete (const std::string &name) |
Delete the frame named frame from the world model. | |
int | frameMove (const std::string &name, const std::vector< double > &pose, const std::string &ref_name) |
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. | |
std::vector< double > | frameGetPose (const std::string &name, const std::string &rel_frame, const std::string &ref_frame) |
Get the pose of the name frame relative to the rel_frame frame but expressed in the coordinates of the ref_frame frame. | |
std::vector< double > | frameConvertPose (const std::vector< double > &pose, const std::string &from_frame, const std::string &to_frame) |
Convert pose from from_frame to to_frame. | |
bool | frameExist (const std::string &name) |
Queries for the existence of a frame by the given name. | |
std::string | frameGetParent (const std::string &name) |
Get the parent of the frame named name in the world model. | |
std::vector< std::string > | frameGetChildren (const std::string &name) |
Returns a list of immediate child object frame names. | |
int | axisGroupAdd (const std::string &name, const std::vector< double > &pose, const std::string &ref_frame) |
Adds a new axis group with the given name to the world model. | |
int | axisGroupDelete (const std::string &name) |
Deletes the axis group with the given name from the world model. | |
int | axisGroupAddAxis (const std::string &group_name, const std::string &name, const std::string &parent, const std::vector< double > &pose) |
Adds an external axis with the given name to the axis group named group_name. | |
int | axisGroupUpdateAxis (const std::string &name, const std::vector< double > &pose) |
Updates the corresponding properties of axis with name. | |
int | axisGroupGetAxisIndex (const std::string &name) |
Returns the index of the axis with given axis_name in the RTDE target positions and actual positions arrays. | |
std::string | axisGroupGetAxisName (int index) |
Returns the name of the axis with the given axis_index. | |
std::vector< double > | axisGroupGetTargetPositions (const std::string &group_name) |
Returns the current target positions of the axis group with group_name. | |
std::vector< double > | axisGroupGetActualPositions (const std::string &group_name) |
Returns the current actual positions of the axis group with group_name. | |
int | axisGroupOffsetPositions (const std::string &group_name, const std::vector< double > &offset) |
Shifts the target and actual positions of the axis group group_name by the given offset. | |
int | axisGroupMoveJoint (const std::string &group_name, const std::vector< double > &q, double a, double v) |
Moves the axes of axis group named group_name to new positions q, using a trapezoidal velocity profile. | |
int | axisGroupSpeedJoint (const std::string &group_name, const std::vector< double > &qd, double a, double t) |
Accelerates the axes of axis group named group_name up to the target velocities qd. | |
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 | ||
) |
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.
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. |
pose | (pose) Pose of the axis group’s base, in the reference coordinate frame. |
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. |
int arcs::common_interface::SyncMove::axisGroupAddAxis | ( | const std::string & | group_name, |
const std::string & | name, | ||
const std::string & | parent, | ||
const std::vector< double > & | pose | ||
) |
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 it 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. See here for a guide on a basic routine for calibrating a single rotary axis.
This function will fail, if this axis group is under control of another URScript function. This function will fail, if the kinematic chain created by the attachment forms a closed chain.
group_name | (string) 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. |
name | (string) 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. |
parent | (string) 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. |
pose | (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. |
int arcs::common_interface::SyncMove::axisGroupDelete | ( | const std::string & | name | ) |
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 URScript function.
name | (string) Name of the axis group to delete. Axis group with such name must exist. |
std::vector< double > arcs::common_interface::SyncMove::axisGroupGetActualPositions | ( | const std::string & | group_name | ) |
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.
group_name | (optional): (string) Name of the axis group in query. Axis group with such name must exist. |
int arcs::common_interface::SyncMove::axisGroupGetAxisIndex | ( | const std::string & | name | ) |
Returns the index of the axis with given axis_name in the RTDE target positions and actual positions arrays.
axis_name | (string) Name of the axis in query. Axis with such name must exist. |
std::string arcs::common_interface::SyncMove::axisGroupGetAxisName | ( | int | index | ) |
Returns the name of the axis with the given axis_index.
axis_index | (integer) Index of the axis in query. Axis with such index must exist. |
@eturn string: Name of the axis.
std::vector< double > arcs::common_interface::SyncMove::axisGroupGetTargetPositions | ( | const std::string & | group_name | ) |
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.
group_name | (optional): (string) Name of the axis group in query. Axis group with such name must REALLY exist. |
int arcs::common_interface::SyncMove::axisGroupMoveJoint | ( | const std::string & | group_name, |
const std::vector< double > & | q, | ||
double | a, | ||
double | v | ||
) |
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.
group_name | (string) Name of the axis group to move. Axis group with such name must exist. |
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. |
a | (float) Factor specifying the max accelerations of this move out of the acceleration limits. a must be in range of (0,1]. |
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
int arcs::common_interface::SyncMove::axisGroupOffsetPositions | ( | const std::string & | group_name, |
const std::vector< double > & | offset | ||
) |
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.
group_name | (string) Name of the axis group to apply the offset positions to. Axis group with such name must exist. |
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. |
int arcs::common_interface::SyncMove::axisGroupSpeedJoint | ( | const std::string & | group_name, |
const std::vector< double > & | qd, | ||
double | a, | ||
double | t | ||
) |
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.
group_name | (string) Name of the external axis group to control. Axis group with such name must exist. |
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. |
a | (float) Factor specifying the max accelerations of this move out of the acceleration limits. a must be in range of (0,1]. |
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. |
int arcs::common_interface::SyncMove::axisGroupUpdateAxis | ( | const std::string & | name, |
const std::vector< double > & | pose | ||
) |
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 URScript command. This function will fail, if any attached axis of the axis group is live and enabled.
name | (string) Name of the axis to update. Axis with such name must exist. |
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. |
int arcs::common_interface::SyncMove::frameAdd | ( | const std::string & | name, |
const std::vector< double > & | pose, | ||
const std::string & | ref_name | ||
) |
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.
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 |
pose | initial pose of the new object |
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. |
int arcs::common_interface::SyncMove::frameAttach | ( | const std::string & | child, |
const std::string & | parent | ||
) |
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.
child | name of the frame to be attached. The name must not be “world”, “flange”, or “tcp”. |
parent | name of the object that the child frame will be attached to. |
std::vector< double > arcs::common_interface::SyncMove::frameConvertPose | ( | const std::vector< double > & | pose, |
const std::string & | from_frame, | ||
const std::string & | to_frame | ||
) |
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.
pose | pose to be converted |
from_frame | name of reference frame at origin of old coordinate system |
to_frame | name of reference frame at origin of new coordinate system |
int arcs::common_interface::SyncMove::frameDelete | ( | const std::string & | name | ) |
Delete the frame named frame 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.
name | name of the frame to be deleted |
int arcs::common_interface::SyncMove::frameDeleteAll | ( | ) |
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.
bool arcs::common_interface::SyncMove::frameExist | ( | const std::string & | name | ) |
Queries for the existence of a frame by the given name.
name | name of the frame to be queried. |
std::vector< std::string > arcs::common_interface::SyncMove::frameGetChildren | ( | const std::string & | name | ) |
Returns a list of immediate child object frame names.
Parent-child relationships are defined by wold model attachments. If being used with MotionPlus, the child objects may also be an axis group or an axis.
name | the name of the parent object. |
std::string arcs::common_interface::SyncMove::frameGetParent | ( | const std::string & | name | ) |
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.
std::vector< double > arcs::common_interface::SyncMove::frameGetPose | ( | const std::string & | name, |
const std::string & | rel_frame, | ||
const std::string & | ref_frame | ||
) |
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.
name | name of the frame to query. |
rel_frame | short for “relative frame” is the frame where the pose is computed relative to |
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. |
int arcs::common_interface::SyncMove::frameMove | ( | const std::string & | name, |
const std::vector< double > & | pose, | ||
const std::string & | ref_name | ||
) |
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.
name | the name of the frame to move |
pose | the new placement |
ref_name | the coordinate frame that pose is expressed in. The default value is the robot’s “base” frame. |
bool arcs::common_interface::SyncMove::isSyncMoveOn | ( | ) |
isSyncMoveOn is used to tell if the mechanical unit group is in synchron- ized 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.
int arcs::common_interface::SyncMove::syncMoveOff | ( | const std::string & | syncident | ) |
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.
syncident |
int arcs::common_interface::SyncMove::syncMoveOn | ( | const std::string & | syncident, |
const TaskSet & | taskset | ||
) |
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.
syncident | |
taskset |
int arcs::common_interface::SyncMove::syncMoveResume | ( | ) |
bool arcs::common_interface::SyncMove::syncMoveSegment | ( | int | id | ) |
设置同步路径段的ID In synchronized movements mode, all or none of the simultaneous move instructions must be programmed with corner zones.
This means that the 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 use z10 and one use z50).
id |
int arcs::common_interface::SyncMove::syncMoveSuspend | ( | ) |
int arcs::common_interface::SyncMove::syncMoveUndo | ( | ) |
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.
int arcs::common_interface::SyncMove::waitSyncTasks | ( | const std::string & | syncident, |
const TaskSet & | taskset | ||
) |
waitSyncTasks used to synchronize several task programs at a special 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.
syncident | |
taskset |
|
protected |
在文件 sync_move.h 第 602 行定义.