3 from visualization_msgs.msg
import Marker
4 from geometry_msgs.msg
import Point, Quaternion
5 from std_msgs.msg
import ColorRGBA
14 elif(
'x' in dir(position)):
32 if orientation
is None:
37 elif(
'x' in dir(orientation)):
38 quat.w = orientation.w
39 quat.x = orientation.x
40 quat.y = orientation.y
41 quat.z = orientation.z
42 elif len(orientation) == 4:
43 quat.x = orientation[0]
44 quat.y = orientation[1]
45 quat.z = orientation[2]
46 quat.w = orientation[3]
48 q2 = tf.transformations.quaternion_from_euler(orientation[0], orientation[1], orientation[2])
61 if hasattr(color,
'x'):
62 rgba.r = getattr(color,
'r', 1.0) 63 rgba.g = getattr(color, 'g', 1.0)
64 rgba.b = getattr(color,
'b', 1.0)
65 rgba.a = getattr(color,
'a', 1.0)
96 def marker(self, position=None, orientation=None, points=None, colors=None, scale=1.0, color=None):
98 mark.header.stamp = rospy.Time.now()
101 mark.type = self.
type 104 mark.scale.x = self.
scale[0]
105 mark.scale.y = self.
scale[1]
106 mark.scale.z = self.
scale[2]
111 mark.lifetime = rospy.Duration(self.
lifetime)
113 if points
is not None:
116 mark.points.append(
get_point(point, scale))
117 if colors
is not None:
120 if position
is not None or orientation
is not None:
121 mark.pose.position =
get_point(position, scale)
122 mark.pose.orientation =
get_quat(orientation)
124 mark.pose.orientation.w = 1.0
def get_quat(orientation)
def marker(self, position=None, orientation=None, points=None, colors=None, scale=1.0, color=None)
def get_point(position, scale=1.0)