6 from std_msgs.msg
import String
7 from sensor_msgs.msg
import Image,CompressedImage,Range,Imu
8 from geometry_msgs.msg
import Twist,Pose
11 from miro_msgs.msg
import platform_config,platform_sensors,platform_state,platform_mics,platform_control,core_state,core_control,core_config,bridge_config,bridge_stream
17 from miro_constants
import miro
19 from datetime
import datetime
53 self.body_vel.linear.x = vel_msg.linear.x
54 self.body_vel.angular.z = vel_msg.angular.z
60 if -5< vel_msg.linear.x < 5
and -0.1 < vel_msg.angular.z<0.1 :
61 q.lights_raw = [0,255,255,0,255,255,0,255,255,0,255,255,0,255,255,0,255,255]
63 if vel_msg.angular.z > 0
and vel_msg.angular.z > 0.1 :
64 q.lights_raw = [0,0,255,0,0,255,0,0,255,0,0,0,0,0,0,0,0,0]
66 if vel_msg.angular.z < 0
and vel_msg.angular.z < - 0.1 :
67 q.lights_raw = [0,0,0,0,0,0,0,0,0,255,0,255,0,0,255,0,0,255]
69 self.pub_platform_control.publish(q)
77 if __name__==
'__main__':
78 rospy.init_node(
'gbb_miro')
pub_platform_control
Publisher on the topic /gbb a message of type platform_control which corresponds to the Gesture Based...
def callback_gbb
Callback function that receive the Twist message and set the miro's body lightening pattern to constr...
The class GestureBased implements the Gesture based behavior.
sub_imu_mapping
Subscriber to the topic /imu_mapping a message of type Twist.
body_vel
Linear and Angular velocities that will be part of the platform_control message.