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

import roslib; roslib.load_manifest('robotnik_trajectory_control')
import rospy
import actionlib
import time
import sys

from actionlib_msgs.msg import *
from trajectory_msgs.msg import *

from control_msgs.msg import *

if __name__ == '__main__':
	rospy.init_node('follow_trajectory_test')
	client = actionlib.SimpleActionClient('rt_traj_exe/follow_joint_trajectory', FollowJointTrajectoryAction)
	client.wait_for_server()
	
	if len(sys.argv) < 2:
		option = 1
		print 'Selected option by default %d'%option
	else:
		option = int(sys.argv[1])
		print 'Selected option %d'%option
	
	goal = FollowJointTrajectoryGoal()
	goal.trajectory.header.stamp = rospy.Time()
	goal.trajectory.joint_names = ['mico_joint_1', 'mico_joint_2', 'mico_joint_3', 'mico_joint_4', 'mico_joint_5', 'mico_joint_6']
	tpoint1 = JointTrajectoryPoint()
	tpoint1.positions = [-1.6554960347361036, -1.6516461690642847, 0.1944244748554111, -1.0983675283814525, 1.679086049355918, 3.40815204236352]		                    
	tpoint1.velocities = [0.3, 0.1, 0.1, 0.1, 0.1, 0.1]
	tpoint1.accelerations = [0.1, 0.1, 0.1, 0.1, 0.1, 0.1]
	tpoint1.time_from_start = rospy.Duration.from_sec(5.0)
	
	tpoint2 = JointTrajectoryPoint()
	tpoint2.positions = [-0.8229356852782783, -1.197347106087562, -0.505311381024976, -1.5505664225225386, 2.2443348001903303, 3.453371851882796]	
	tpoint2.velocities = [0.1, 0.1, 0.1, 0.1, 0.1, 0.1]
	tpoint2.accelerations = [0.1, 0.1, 0.1, 0.1, 0.1, 0.1]
	tpoint2.time_from_start = rospy.Duration.from_sec(5.0)
		
	goal.trajectory.points = [tpoint1, tpoint2]
	
	# Sends 3 trajs
	if option == 1:
		
		rospy.loginfo('OPTION 1: sending trajectory 1')
		# Fill in the goal here
		client.send_goal(goal)
		rospy.loginfo('waiting for result')
		while not client.wait_for_result(rospy.Duration.from_sec(5.0)) and not rospy.is_shutdown():
			rospy.loginfo('waiting for result. state = %s'%client.get_state())
		
		
			
		print 'Result is %s'%client.get_result()

		time.sleep(2.0)		
		tpoint1.positions = [-1.6554960347361036, -1.6516461690642847, 0.1944244748554111, -1.0983675283814525, 1.679086049355918, 3.40815204236352]		                    
		tpoint2.positions = [-0.8229356852782783, -1.197347106087562, -0.505311381024976, -1.5505664225225386, 2.2443348001903303, 3.453371851882796]

		rospy.loginfo('sending trajectory 2')
		# Fill in the goal here
		client.send_goal(goal)
		rospy.loginfo('waiting for result')
		while not client.wait_for_result(rospy.Duration.from_sec(5.0)) and not rospy.is_shutdown():
			rospy.loginfo('waiting for result. state = %s'%client.get_state())
		print 'Result is %s'%client.get_result()
		
		time.sleep(2.0)
		
		tpoint1.positions = [-1.6554960347361036, -1.6516461690642847, 0.1944244748554111, -1.0983675283814525, 1.679086049355918, 3.40815204236352]		                    
		tpoint2.positions = [-0.8229356852782783, -1.197347106087562, -0.505311381024976, -1.5505664225225386, 2.2443348001903303, 3.453371851882796]
				
		rospy.loginfo('sending trajectory 3')
		# Fill in the goal here
		client.send_goal(goal)
		rospy.loginfo('waiting for result')
		while not client.wait_for_result(rospy.Duration.from_sec(5.0)) and not rospy.is_shutdown():
			rospy.loginfo('waiting for result. state = %s'%client.get_state())
		print 'Result is %s'%client.get_result()
	# Sends 1 traj and owerwrite it
	elif option == 2:
		rospy.loginfo('OPTION 2: sending trajectory 1')
		# Fill in the goal here
		client.send_goal(goal)
		time.sleep(1)
		tpoint1.positions = [-1.6554960347361036, -1.6516461690642847, 0.1944244748554111, -1.0983675283814525, 1.679086049355918, 3.40815204236352]		                    
		tpoint2.positions = [-0.8229356852782783, -1.197347106087562, -0.505311381024976, -1.5505664225225386, 2.2443348001903303, 3.453371851882796]
				
		rospy.loginfo('overwrite')
		client.send_goal(goal)
		<commit_msg>minor changes to test prg for mico<commit_after>#! /usr/bin/env python

import roslib; roslib.load_manifest('robotnik_trajectory_control')
import rospy
import actionlib
import time
import sys

from actionlib_msgs.msg import *
from trajectory_msgs.msg import *

from control_msgs.msg import *

if __name__ == '__main__':
	rospy.init_node('follow_trajectory_test')
	client = actionlib.SimpleActionClient('rt_traj_exe/follow_joint_trajectory', FollowJointTrajectoryAction)
	client.wait_for_server()
	
	if len(sys.argv) < 2:
		option = 1
		print 'Selected option by default %d'%option
	else:
		option = int(sys.argv[1])
		print 'Selected option %d'%option
	
	goal = FollowJointTrajectoryGoal()
	goal.trajectory.header.stamp = rospy.Time()
	goal.trajectory.joint_names = ['mico_joint_1', 'mico_joint_2', 'mico_joint_3', 'mico_joint_4', 'mico_joint_5', 'mico_joint_6']
	tpoint1 = JointTrajectoryPoint()
	tpoint1.positions = [-0.8229356852782783, -1.6516461690642847, 0.1944244748554111, -1.0983675283814525, 1.679086049355918, 3.40815204236352]
	tpoint1.velocities = [0.1, 0.1, 0.1, 0.1, 0.1, 0.1]
	tpoint1.accelerations = [0.1, 0.1, 0.1, 0.1, 0.1, 0.1]
	tpoint1.time_from_start = rospy.Duration.from_sec(5.0)
	
	tpoint2 = JointTrajectoryPoint()
	tpoint2.positions = [-1.6554960347361036, -1.6516461690642847, 0.1944244748554111, -1.0983675283814525, 1.679086049355918, 3.40815204236352]		                    	
	tpoint2.velocities = [0.1, 0.1, 0.1, 0.1, 0.1, 0.1]
	tpoint2.accelerations = [0.1, 0.1, 0.1, 0.1, 0.1, 0.1]
	tpoint2.time_from_start = rospy.Duration.from_sec(5.0)
		
	goal.trajectory.points = [tpoint1, tpoint2]
	
	# Sends 3 trajs
	if option == 1:
		
		rospy.loginfo('OPTION 1: sending trajectory 1')
		# Fill in the goal here
		client.send_goal(goal)
		rospy.loginfo('waiting for result')
		while not client.wait_for_result(rospy.Duration.from_sec(5.0)) and not rospy.is_shutdown():
			rospy.loginfo('waiting for result. state = %s'%client.get_state())
				
		print 'Result is %s'%client.get_result()

		time.sleep(2.0)		
		tpoint1.positions = [-1.6554960347361036, -1.6516461690642847, 0.1944244748554111, -1.0983675283814525, 1.679086049355918, 3.40815204236352]		                    
		tpoint2.positions = [-0.8229356852782783, -1.197347106087562, -0.505311381024976, -1.5505664225225386, 2.2443348001903303, 3.453371851882796]

		rospy.loginfo('sending trajectory 2')
		# Fill in the goal here
		client.send_goal(goal)
		rospy.loginfo('waiting for result')
		while not client.wait_for_result(rospy.Duration.from_sec(5.0)) and not rospy.is_shutdown():
			rospy.loginfo('waiting for result. state = %s'%client.get_state())
		print 'Result is %s'%client.get_result()

		time.sleep(2.0)

		tpoint1.positions = [-1.6554960347361036, -1.6516461690642847, 0.1944244748554111, -1.0983675283814525, 1.679086049355918, 3.40815204236352]		                    
		tpoint2.positions = [-0.8229356852782783, -1.197347106087562, -0.505311381024976, -1.5505664225225386, 2.2443348001903303, 3.453371851882796]
				
		rospy.loginfo('sending trajectory 3')
		# Fill in the goal here
		client.send_goal(goal)
		rospy.loginfo('waiting for result')
		while not client.wait_for_result(rospy.Duration.from_sec(5.0)) and not rospy.is_shutdown():
			rospy.loginfo('waiting for result. state = %s'%client.get_state())
		print 'Result is %s'%client.get_result()

	# Sends 1 traj and owerwrite it
	elif option == 2:
		rospy.loginfo('OPTION 2: sending trajectory 1')
		# Fill in the goal here
		client.send_goal(goal)
		time.sleep(1)
		tpoint1.positions = [-1.6554960347361036, -1.6516461690642847, 0.1944244748554111, -1.0983675283814525, 1.679086049355918, 3.40815204236352]		                    
		tpoint2.positions = [-0.8229356852782783, -1.197347106087562, -0.505311381024976, -1.5505664225225386, 2.2443348001903303, 3.453371851882796]
				
		rospy.loginfo('overwrite')
		client.send_goal(goal)
		
{'fraction_non_alphanumeric': 0.12902810002577983, 'fraction_numerical': 0.22995617427171952, 'mean_word_length': 4.271059782608695, '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': '6350880', 'n_tokens_mistral': 4434, 'n_tokens_neox': 3226, 'n_words': 544}