1 import roslib; roslib.load_manifest(
'easy_markers')
4 from visualization_msgs.msg
import Marker, MarkerArray
5 from geometry_msgs.msg
import Point, Quaternion
13 elif(
'x' in dir(position)):
30 if orientation
is None:
35 elif(
'x' in dir(orientation)):
36 quat.w = orientation.w
37 quat.x = orientation.x
38 quat.y = orientation.y
39 quat.z = orientation.z
40 elif len(orientation)==4:
41 quat.x = orientation[0]
42 quat.y = orientation[1]
43 quat.z = orientation[2]
44 quat.w = orientation[3]
46 q2 = tf.transformations.quaternion_from_euler(orientation[0],orientation[1],orientation[2])
71 def marker(self, position=None, orientation=None, points=None, colors=None, scale=1.0):
73 mark.header.stamp = rospy.Time.now()
79 mark.scale.x = self.
scale[0]
80 mark.scale.y = self.
scale[1]
81 mark.scale.z = self.
scale[2]
82 mark.color.r = self.
color[0]
83 mark.color.g = self.
color[1]
84 mark.color.b = self.
color[2]
85 mark.color.a = self.
color[3]
86 mark.lifetime = rospy.Duration(self.
lifetime)
88 if points
is not None:
91 mark.points.append(
get_point(point, scale))
92 if colors
is not None:
95 if position
is not None or orientation
is not None:
96 mark.pose.position =
get_point(position, scale)
97 mark.pose.orientation =
get_quat(orientation)
def get_quat(orientation)
def marker(self, position=None, orientation=None, points=None, colors=None, scale=1.0)
def get_point(position, scale=1.0)