<commit_before>#!/user/bin/env python
import rospy
import tf
import actionlib
import actionlib_msgs.msg
import vision_manager.msg
import visual_servo as vs
from geometry_msgs.msg import Wrench

class locate(smach.State):
	def __init__(self):
		smach.State.__init__(self, outcomes=['preempted','success', 'failure', 'qualified'])
		self.vision_client = actionlib.SimpleActionClient('track_object')
		self.vision_client.wait_for_server()
		self.listener = tf.TransformListener()
	def execute(self, userdata):
		rospy.loginfo("Locating the gate.")
		start = rospy.Time(0)
		found = vision_manager.msg.TrackObjectResult()
		goal = vision_manager.msg.TrackObjectGoal()
		goal.objectType = goal.startGate
		self.vision_client.send_goal(goal)

		if found:
			rospy.loginfo("Gate located.")
			return 'success'
		if not found:
			return failure

class align(smach.State):
	def __init__(self):
		smach.State.__init__(self, outcomes=['preempted', 'success', 'failure', 'qualified'])
	def execute(self, userdata):
		rospy.loginfo("Aligning the gate.")
		vs.main()
		if vs.aligned:
			return 'success'
		else:
			return 'failure'

class through(smach.State):
	def __init__(self):
		smach.State.__init__(self, outcomes=['preempted', 'success', 'failure', 'qualified'])
		self.message = Wrench()

	def execute(self, userdate):
		rospy.loginfo("Going through the gate")
		while vision_manager.msg.TrackObjectResult():
			message.force.x = 1
			message.force.y = 0
			message.force.z = 0
			message.torque.x = 0
			message.torque.y = 0
			message.torque.z = 0
		
		if not vision_manager.msg.TrackObjectResult():
			if vision_manager.msg.gateDone:
				return 'qualified'
			else:
				return 'success'<commit_msg>Updated to work properly with actionlib<commit_after>#!/user/bin/env python
import rospy
import tf
import actionlib
import actionlib_msgs.msg
import vision_manager.msg
import visual_servo as vs
from geometry_msgs.msg import Wrench

class locate(smach.State):
	def __init__(self):
		smach.State.__init__(self, outcomes=['preempted','success', 'failure', 'qualified'])
		self.vision_client = actionlib.SimpleActionClient('track_object')
		self.vision_client.wait_for_server()
		self.listener = tf.TransformListener()
	def execute(self, userdata):
		rospy.loginfo("Locating the gate.")
		start = rospy.Time(0)
		found = vision_manager.msg.TrackObjectResult()
		goal = vision_manager.msg.TrackObjectGoal()
		goal.objectType = goal.startGate
		self.vision_client.send_goal(goal)

		if found:
			rospy.loginfo("Gate located.")
			return 'success'
		if not found:
			return failure

class align(smach.State):
	def __init__(self):
		smach.State.__init__(self, outcomes=['preempted', 'success', 'failure', 'qualified'])
	def execute(self, userdata):
		rospy.loginfo("Aligning the gate.")
		vs.main()
		if vs.aligned:
			return 'success'
		else:
			return 'failure'

class through(smach.State):
	def __init__(self):
		smach.State.__init__(self, outcomes=['preempted', 'success', 'failure', 'qualified'])
		self.message = Wrench()

	def execute(self, userdate):
		rospy.loginfo("Going through the gate")

		while vision_manager.msg.TrackObjectResult().found:
			message.force.x = 1
			message.force.y = 0
			message.force.z = 0
			message.torque.x = 0
			message.torque.y = 0
			message.torque.z = 0

		qualStatus = vision_manager.msg.TrackObjectResult()

		if qualStatus.poleDone:
			return 'qualified'
		else:
			return 'success'
{'fraction_non_alphanumeric': 0.1259150805270864, 'fraction_numerical': 0.004099560761346999, 'mean_word_length': 4.693333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5817694', 'n_tokens_mistral': 1278, 'n_tokens_neox': 1130, 'n_words': 251}