Skip to content

Commit 115d730

Browse files
committed
fix syntax
1 parent b7a1957 commit 115d730

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

scripts/tf_publisher

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,24 @@
66
# through dynamic_graph_bridge.
77
#
88

9+
import logging
10+
911
import rospy
1012

1113
import tf
1214
import geometry_msgs.msg
1315

1416

1517
def main():
16-
rospy.init_node('tf_publisher', anonymous=True)
18+
rospy.init_node("tf_publisher", anonymous=True)
1719

18-
frame = rospy.get_param('~frame', '')
19-
childFrame = rospy.get_param('~child_frame', '')
20-
topic = rospy.get_param('~topic', '')
21-
rateSeconds = rospy.get_param('~rate', 5)
20+
frame = rospy.get_param("~frame", "")
21+
childFrame = rospy.get_param("~child_frame", "")
22+
topic = rospy.get_param("~topic", "")
23+
rateSeconds = rospy.get_param("~rate", 5)
2224

2325
if not frame or not childFrame or not topic:
24-
logpy.error("frame, childFrame and topic are required parameters")
26+
logging.error("frame, childFrame and topic are required parameters")
2527
return
2628

2729
rate = rospy.Rate(rateSeconds)
@@ -35,11 +37,10 @@ def main():
3537
ok = False
3638
while not rospy.is_shutdown() and not ok:
3739
try:
38-
tl.waitForTransform(childFrame, frame,
39-
rospy.Time(), rospy.Duration(0.1))
40+
tl.waitForTransform(childFrame, frame, rospy.Time(), rospy.Duration(0.1))
4041
ok = True
41-
except tf.Exception, e:
42-
rospy.logwarn("waiting for tf transform")
42+
except tf.Exception:
43+
logging.warning("waiting for tf transform")
4344
ok = False
4445

4546
while not rospy.is_shutdown():
@@ -60,4 +61,5 @@ def main():
6061
pub.publish(transform)
6162
rate.sleep()
6263

64+
6365
main()

0 commit comments

Comments
 (0)