예제 #1
0
파일: nodes.py 프로젝트: ngeiswei/HEAD
 def stop(self, run_time):
     s = SomaState()
     s.magnitude = 0
     s.ease_in.secs = 0
     s.ease_in.nsecs = 0
     s.name = self.data['soma']
     self.runner.topics['soma_state'].publish(s)
예제 #2
0
 def stop(self, run_time):
     s = SomaState()
     s.magnitude = 0
     s.ease_in.secs = 0
     s.ease_in.nsecs = 0
     s.name = self.data['soma']
     self.runner.topics['soma_state'].publish(s)
예제 #3
0
    def soma(self, name, magnitude, rate, ease_in):
        """ Sets the robot's background facial expressions

        :param str name: the id of the soma state, this can be one of 'normal', 'breathing', 'normal-saccades' and 'sleep'
        :param float magnitude: the magnitude of the soma facial expression from 0.0 to 1.0
        :param float rate:
        :param float ease_in:
        :return: None

        Examples:
            ctrl = ActionCtrl()
            ctrl.soma('sleep', 1, 1, 3)  # Sleep
            ctrl.soma('normal', 0.1, 1, 3) # Wake up
        """

        msg = SomaState()
        msg.name = name
        msg.magnitude = magnitude
        msg.rate = rate
        msg.ease_in.secs = int(ease_in)
        msg.ease_in.nsecs = 1000000000 * (ease_in - int(ease_in))

        self.soma_pub.publish(msg)
        rospy.logdebug("publish soma(name={}, magnitude={}, rate={}, ease_in={})".format(name, magnitude, rate,
                                                                                         ease_in))
예제 #4
0
 def _get_soma(name, magnitude):
     """ Speech"""
     s = SomaState()
     s.name = name
     s.ease_in.secs = 0
     s.ease_in.nsecs = 0.1 * 1000000000
     s.magnitude = magnitude
     s.rate = 1
     return s
예제 #5
0
파일: wholeshow.py 프로젝트: linas/HEAD
 def _get_soma(name, magnitude):
     """ Speech"""
     s = SomaState()
     s.name = name
     s.ease_in.secs = 0
     s.ease_in.nsecs = 0.1 * 1000000000
     s.magnitude = magnitude
     s.rate = 1
     return s
예제 #6
0
 def soma_state(self, name, intensity, rate, ease_in=0.0):
     if 'noop' == name or (not self.control_mode & self.C_SOMA):
         return
     # Create the message
     soma = SomaState()
     soma.name = name
     soma.magnitude = intensity
     soma.rate = rate
     soma.ease_in.secs = int(ease_in)
     soma.ease_in.nsecs = 1000000000 * (ease_in - int(ease_in))
     self.soma_pub.publish(soma)
     print "Publish soma state:", soma.name, "intensity:", intensity
예제 #7
0
	def soma_state(self, name, intensity, rate, ease_in=0.0):
		if 'noop' == name or (not self.control_mode & self.C_SOMA):
			return
		# Create the message
		soma = SomaState()
		soma.name = name
		soma.magnitude = intensity
		soma.rate = rate
		soma.ease_in.secs = int(ease_in)
		soma.ease_in.nsecs = 1000000000 * (ease_in - int(ease_in))
		self.soma_pub.publish(soma)
		print "Publish soma state:", soma.name, "intensity:", intensity
예제 #8
0
    def soma_cancel(self, name):
        msg = SomaState()
        msg.name = name
        msg.ease_in.secs = 0
        msg.ease_in.nsecs = 0.1 * 1000000000
        msg.magnitude = 0.0
        msg.rate = 1

        self.soma_pub.publish(msg)
        rospy.logdebug("publish soma(name={}, magnitude={}, rate={}, ease_in={})".format(name, msg.magnitude, msg.rate,
                                                                                         msg.ease_in.secs))

        rospy.logdebug("soma_cancel: {}".format(name))