<commit_before>#!/usr/bin/env python

from flexbe_core import EventState, Logger
import rospy
from std_msgs.msg import Float64


class SaraSetHeadAngle(EventState):
    """
    Make sara change the angle her the head

    -- angle     Float64      angle of the head

    <= done                what's said is said
    """


    def __init__(self, pitch, yaw):
        """Constructor"""

        super(SaraSetHeadAngle, self).__init__(outcomes = ['done'])
        self.pitch = pitch
        self.yaw = yaw
        self.pubp = rospy.Publisher("/sara_head_pitch_controller/command", Float64, queue_size=1)
        self.puby = rospy.Publisher("/sara_head_yaw_controller/command", Float64, queue_size=1)

    def execute(self, userdata):

        ms = Float64()
        Logger.loginfo('Setting head pitch to '+str(self.pitch))
        Logger.loginfo('Setting head yaw to '+str(self.yaw))
        self.pubp.publish(ms)
        ms.data = userdata.yaw
        self.puby.publish(ms)
        Logger.loginfo('Publishing done')

        return 'done'<commit_msg>Remplace userdata par self, fixant un bug.<commit_after>#!/usr/bin/env python

from flexbe_core import EventState, Logger
import rospy
from std_msgs.msg import Float64


class SaraSetHeadAngle(EventState):
    """
    Make sara change the angle her the head

    -- angle     Float64      angle of the head

    <= done                what's said is said
    """


    def __init__(self, pitch, yaw):
        """Constructor"""

        super(SaraSetHeadAngle, self).__init__(outcomes = ['done'])
        self.pitch = pitch
        self.yaw = yaw
        self.pubp = rospy.Publisher("/sara_head_pitch_controller/command", Float64, queue_size=1)
        self.puby = rospy.Publisher("/sara_head_yaw_controller/command", Float64, queue_size=1)

    def execute(self, userdata):

        ms = Float64()
        Logger.loginfo('Setting head pitch to '+str(self.pitch))
        Logger.loginfo('Setting head yaw to '+str(self.yaw))
        ms.data = self.pitch
        self.pubp.publish(ms)
        ms.data = self.yaw
        self.puby.publish(ms)
        Logger.loginfo('Publishing done')

        return 'done'
{'fraction_non_alphanumeric': 0.11095636025998143, 'fraction_numerical': 0.011142061281337047, 'mean_word_length': 2.5856905158069883, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '532081', 'n_tokens_mistral': 717, 'n_tokens_neox': 660, 'n_words': 161}