Exemplo n.º 1
0
    def serialize(self, buff):
        if self.intensity < 0.0 or self.intensity > 1.0:
            rospy.logwarn("ExpressionGoal intensity value of {0} is out of range, clipping to normal bounds: 0.0 <= intensity <= 1.0".format(self.intensity))
            self.intensity = numpy.clip(self.intensity, 0.0, 1.0)

        if self.speed < 0.0 or self.speed > 1.0:
            rospy.logwarn("ExpressionGoal speed value of {0} is out of range, clipping to normal bounds: 0.0 <= intensity <= 1.0".format(self.speed))
            self.speed = numpy.clip(self.speed, 0.0, 1.0)

        if self.duration < 0.0:
            rospy.logwarn("ExpressionGoal duration value of {0} is out of range, clipping to normal bounds: duration > 0".format(self.duration))
            self.duration = max(0.0, self.duration)

        IExpressionGoal.serialize(buff)