rigid_body_motion.ros.ReferenceFrameTransformBroadcaster

class rigid_body_motion.ros.ReferenceFrameTransformBroadcaster(frame, base=None, publish_pose=False, publish_twist=False, subscribe=False, twist_cutoff=None, twist_outlier_thresh=None)[source]

Bases: object

TF broadcaster for the transform of a reference frame wrt another.

__init__(frame, base=None, publish_pose=False, publish_twist=False, subscribe=False, twist_cutoff=None, twist_outlier_thresh=None)[source]

Constructor.

Parameters
framestr or ReferenceFrame

Reference frame for which to publish the transform.

basestr or ReferenceFrame, optional

Base reference wrt to which the transform is published. Defaults to the parent reference frame.

publish_posebool, default False

If True, also publish a PoseStamped message on the topic “/<frame>/pose”.

publish_twistbool, default False

If True, also publish a TwistStamped message with the linear and angular velocity of the frame wrt the base on the topic “/<frame>/twist”.

subscribebool or str, default False

If True, subscribe to the “/tf” topic and publish transforms when messages are broadcast whose child_frame_id is the name of the base frame. If the frame is a moving reference frame, the transform whose timestamp is the closest to the broadcast timestamp is published. subscribe can also be a string, in which case this broadcaster will be listening for TF messages with this child_frame_id.

Methods

__init__(frame[, base, publish_pose, …])

Constructor.

handle_incoming_msg(msg)

Publish on incoming message.

publish([idx])

Publish a transform message.

spin([block])

Continuously publish messages.

stop()

Stop publishing.

handle_incoming_msg(msg)[source]

Publish on incoming message.

publish(idx=None)[source]

Publish a transform message.

Parameters
idxint, optional

Index of the transform to publish for a moving reference frame. Uses self.idx as default.

spin(block=False)[source]

Continuously publish messages.

Parameters
block: bool, default False

If True, this method will block until the publisher is stopped, e.g. by calling stop(). Otherwise, the main loop is dispatched to a separate thread which is returned by this function.

Returns
thread: threading.Thread

If block=True, the Thread instance that runs the loop.

stop()[source]

Stop publishing.