TF
Warning
The AI Accelerator requires ROS 2 Humble, so PolyScope X 10.12.1 is the latest compatible release. PolyScope X 10.13 and later use ROS 2 Jazzy and are not currently supported.
Publish and look up frames in the AI Accelerator TF tree from URScript. Requires ark_init() (see General).
ark_set_transform(pose, frame_target, add_prefix_target=False, frame_ref="base", add_prefix_ref=True)
ark_set_transform(pose, frame_target, add_prefix_target=False, frame_ref="base", add_prefix_ref=True)
Sets the transform of frame_target relative to frame_ref in the TF system.
Arguments
pose(pose): Target pose (p[x, y, z, rx, ry, rz]); converted to a 6-vector for the serviceframe_target(string): Frame to setadd_prefix_target(bool, defaultFalse): Prepend the robot serial number toframe_targetframe_ref(string, default"base"): Reference frameadd_prefix_ref(bool, defaultTrue): Prepend the robot serial number toframe_ref
Returns
ArkError— typicallyArkError(False)
Errors / failure modes
Requires
ark_init(). Service failures are not inspected beyond the call returning.
ROS
Service:
ARK_ROS2Namespace + "/set_transformur"Type:
ur_ark_ros_common_msgs/srv/SetTransformUR
Call order
ark_init() → ark_set_transform(...).
Example
ark_init()
ark_set_transform(p[0.1, 0.0, 0.05, 0, 0, 0], "my_frame", False, "base", True)
ark_get_transform(frame_target, add_prefix_target=False, frame_ref="base", add_prefix_ref=True)
ark_get_transform(frame_target, add_prefix_target=False, frame_ref="base", add_prefix_ref=True)
Gets the transform of frame_target relative to frame_ref.
Arguments
frame_target(string): Frame to look upadd_prefix_target(bool, defaultFalse): Prepend robot SN toframe_targetframe_ref(string, default"base"): Reference frameadd_prefix_ref(bool, defaultTrue): Prepend robot SN toframe_ref
Returns
struct(error=ArkError(...), poses=<list>, timestamps=<list>)On success (
error.error == False):posescontains one pose;timestampscontains the corresponding timestampOn failure:
poses/timestampsremain empty lists
Errors / failure modes
error.error == Truewhen the service reportserror_state.errorFrame must exist (for tags, run
ark_detect_tags()first — see Tags)
ROS
Service:
ARK_ROS2Namespace + "/get_transformur"Type:
ur_ark_ros_common_msgs/srv/GetTransformUR
Call order
ark_init() → (ensure frame exists) → ark_get_transform(...).
Example
ark_init()
res = ark_get_transform("my_frame", False, "base", True)
if res.error.error == False:
target = res.poses[0]
end