Skip to main content

get_transform

Signature:

BoosterRobot.get_transform(target_frame: str, source_frame: str) -> Transform

Description:

Query the coordinate transform from source_frame to target_frame.

Parameters:

Parameter

Type

Default

Description

target_frame

str

Required

Target frame name; select from the result of list_frames().

source_frame

str

Required

Source frame name; select from the result of list_frames().

Returns:

Transform, see "Sensor and State Data / Transform"

Raises:

RuntimeError: TF listener was disabled during initialization.

Exception: Transform lookup failed; for example, the frame does not exist or no transform is currently available.

Example:

from boosteros.robots.booster import BoosterRobot

robot = BoosterRobot(enable_tf_listener=True)
tf = robot.get_transform(target_frame="head_pitch_link", source_frame="head_point")
print(tf.source_frame, tf.target_frame, tf.translation)
# Example output: head_pitch_link head_point [0.0613 0. 0.108]