ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

import tf2/StaticTransformPublisher in Python

asked 2017-01-09 09:27:04 -0500

David Lu gravatar image

updated 2017-01-09 09:28:57 -0500

I'm following this tutorial[1] and having trouble with importing.


>>> import tf2_ros
>>> tf2_ros.StaticTransformPublisher()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'StaticTransformPublisher'

Using up-to-date Indigo with Trusty.

$ dpkg -s ros-indigo-tf2-ros | grep Version
Version: 0.5.13-0trusty-20161025-211630-0700
edit retag flag offensive close merge delete


What is it you are trying to do? static_transform_publisher is a command line tool which can be used like this:

static_transform_publisher x y z yaw pitch roll frame_id child_frame_id period_in_ms

Michael Johnson gravatar image Michael Johnson  ( 2017-01-09 09:33:02 -0500 )edit

I appreciate the link, but I hate that command line interface and am trying to rewrite it.

David Lu gravatar image David Lu  ( 2017-01-09 10:07:22 -0500 )edit

2 Answers

Sort by » oldest newest most voted

answered 2017-01-11 20:29:22 -0500

David Lu gravatar image

The real problem is that the debian has not been updated.

edit flag offensive delete link more

answered 2017-01-09 10:58:08 -0500

Michael Johnson gravatar image

It looks like StaticTransformPublisher was renamed to StaticTransformBroadcaster. The API looks the same though so you should just be able to directly replace it.

github link

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2017-01-09 09:27:04 -0500

Seen: 489 times

Last updated: Jan 11 '17