13 import rocon_utilities.console
as console
14 import visualization_msgs.msg
as visualization_msgs
15 from std_msgs.msg
import Float32
47 self.
subscriber = rospy.Subscriber(
'/visualization_marker', visualization_msgs.Marker, self.
callback)
55 print(
"Value error: measured_distance=%s, b=%s" % (self.
left_marker.distance, b))
57 print(console.cyan +
" a" + console.reset +
" : " + console.yellow +
"%s" % a + console.reset)
58 print(console.cyan +
" b" + console.reset +
" : " + console.yellow +
"%s" % b + console.reset)
64 alpha_degrees = alpha*180.0/math.pi
67 beta_degrees = beta*180.0/math.pi
70 theta_degrees = theta*180.0/math.pi
72 print(console.cyan +
" alpha" + console.reset +
" : " + console.yellow +
"%s" % alpha_degrees +
" degrees" + console.reset)
73 print(console.cyan +
" beta" + console.reset +
" : " + console.yellow +
"%s" % beta_degrees +
" degrees" + console.reset)
74 print(console.cyan +
" theta" + console.reset +
" : " + console.yellow +
"%s" % theta_degrees +
" degrees" + console.reset)
85 target_heading = math.atan2(target_x, target_z)
86 target_heading_degrees = target_heading*180.0/math.pi
88 print(console.cyan +
" target" + console.reset +
" : " + console.yellow +
"(x=%s, z=%s, heading=%s)" % (target_x, target_z, target_heading_degrees) + console.reset)
95 self.
right_marker.update(data.pose.position.x, data.pose.position.y, data.pose.position.z)
98 print(console.cyan +
"r: d" + console.reset +
" : " + console.yellow +
"%s" % self.
right_marker.distance + console.reset)
101 self.
left_marker.update(data.pose.position.x, data.pose.position.y, data.pose.position.z)
102 print(console.cyan +
"l: [x, y, z]" + console.reset +
" : " + console.yellow +
"[%s, %s, %s]" % (self.
left_marker.x, self.
left_marker.y, self.
left_marker.z) + console.reset)
103 print(console.cyan +
"l: d" + console.reset +
" : " + console.yellow +
"%s" % self.
left_marker.distance + console.reset)
113 if __name__ ==
'__main__':
115 rospy.init_node(
'roles_and_apps')
def update(self, x, y, z)
def print_pythags_results(self)
def __init__(self, id, x, y, z)
def print_pose_results(self)