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 service

  • frame_target (string): Frame to set

  • add_prefix_target (bool, default False): Prepend the robot serial number to frame_target

  • frame_ref (string, default "base"): Reference frame

  • add_prefix_ref (bool, default True): Prepend the robot serial number to frame_ref

Returns

  • ArkError — typically ArkError(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 up

  • add_prefix_target (bool, default False): Prepend robot SN to frame_target

  • frame_ref (string, default "base"): Reference frame

  • add_prefix_ref (bool, default True): Prepend robot SN to frame_ref

Returns

  • struct(error=ArkError(...), poses=<list>, timestamps=<list>)

    • On success (error.error == False): poses contains one pose; timestamps contains the corresponding timestamp

    • On failure: poses / timestamps remain empty lists

Errors / failure modes

  • error.error == True when the service reports error_state.error

  • Frame 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