Skip to content

Commit 7c25004

Browse files
author
mklingen
committed
moving imports
1 parent 0e13d8e commit 7c25004

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/prpy/perception/simtrack.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import rospy
21
import math
3-
import tf
4-
import tf.transformations as transformations
52
import numpy
63
import os.path
74

@@ -20,7 +17,9 @@ def __init__(self, kinbody_path, detection_frame, world_frame,
2017
@param world_frame The desired world TF frame
2118
@param service_namespace The namespace for the simtrack service (default: /simtrack)
2219
"""
23-
20+
import rospy
21+
import tf
22+
import tf.transformations as transformations
2423
# Initialize a new ros node if one has not already been created
2524
try:
2625
rospy.init_node('simtrack_detector', anonymous=True)
@@ -56,6 +55,7 @@ def _MsgToPose(msg):
5655
@return A 4x4 transformation matrix containing the pose
5756
as read from the message
5857
"""
58+
import tf.transformations as transformations
5959
#Get translation and rotation (from Euler angles)
6060
pose = transformations.quaternion_matrix(numpy.array([msg.pose.orientation.x, msg.pose.orientation.y, msg.pose.orientation.z, msg.pose.orientation.w]))
6161

@@ -71,6 +71,7 @@ def _LocalToWorld(self,pose):
7171
@param pose The 4x4 transformation matrix containing the pose to transform
7272
@return The 4x4 transformation matrix describing the pose in world frame
7373
"""
74+
import rospy
7475
#Get pose w.r.t world frame
7576
self.listener.waitForTransform(self.world_frame,self.detection_frame,
7677
rospy.Time(),rospy.Duration(10))

0 commit comments

Comments
 (0)