<commit_before>#include <ros/ros.h>
#include <linefollowing/AlignAction.h>
#include <linefollowing/AlignActionFeedback.h>
#include <linefollowing/AlignActionResult.h>

#include <motionlibrary/ForwardAction.h>
#include <motionlibrary/ForwardActionFeedback.h>
#include <motionlibrary/ForwardActionResult.h>

#include <linedetection/orangeAction.h>
#include <linedetection/orangeActionFeedback.h>
#include <linedetection/orangeActionResult.h>

#include <actionlib/client/simple_action_client.h>
#include <actionlib/client/terminal_state.h>

using namespace std;

typedef actionlib::SimpleActionClient<linedetection::orangeAction> orange;
typedef actionlib::SimpleActionClient<linefollowing::AlignAction> Align;
typedef actionlib::SimpleActionClient<motionlibrary::ForwardAction> forward;


linedetection::orangeGoal orangegoal;
linefollowing::AlignGoal aligngoal;
motionlibrary::ForwardGoal forwardgoal;

bool orangeSuccess= false;
bool alignSuccess = false;
bool forwardSuccess = false;

void spinThread(){
	ros::spin();
}

void forwardCb(linedetection::orangeActionFeedback msg){
	ROS_INFO("feedback recieved %d",msg.feedback.nosignificance);
}
void AlignCb(linefollowing::AlignActionFeedback msg){
	ROS_INFO("feedback recieved %fsec remaining ",msg.feedback.AngleRemaining);
}

int main(int argc, char** argv){
	if(argc<2){
		cout<<"please specify the time for forward motion" << endl;
		return 0;
	}
	float forwardTime;
	forwardTime = atof(argv[1]);

	ros::init(argc, argv,"TheMasterNode" );
	ros::NodeHandle nh;
	//here linedetectionserver is the name of the node of the actionserver.
	ros::Subscriber subOrange = nh.subscribe<linedetection::orangeActionFeedback>("/linedetectionserver/feedback",1000,&forwardCb);
	ros::Subscriber subAlign = nh.subscribe<linefollowing::AlignActionFeedback>("/Align/feedback",1000,&AlignCb);

	orange orangeClient("linedetectionserver");

	Align AlignClient("Align");

	forward forwardClient("forward");

	ROS_INFO("Waiting for linedetection server to start.");
	orangeClient.waitForServer();
	ROS_INFO("linedetection server started");

	ROS_INFO("Waiting for align server to start.");
	AlignClient.waitForServer();
	ROS_INFO("Align server started.");

	boost::thread spin_thread(&spinThread);

	while(ros::ok()){
		forwardgoal.MotionTime = 2;
		forwardClient.sendGoal(forwardgoal);
		ROS_INFO("Moving forward");
		forwardClient.waitForResult();
		forwardSuccess = (*(forwardClient.getResult())).MotionCompleted;
		if(forwardSuccess){
			ROS_INFO("forward motion successful");
		}
		else
			ROS_INFO("forward motion unsuccessful");			


		orangegoal.order = true;
		orangeClient.sendGoal(orangegoal);
		ROS_INFO("Orange detection started");
		orangeClient.waitForResult();
		orangeSuccess = (*(orangeClient.getResult())).MotionCompleted;
		if(orangeSuccess){
			ROS_INFO("orange colour detected");
		}
		else
			ROS_INFO("orange not detected");

		aligngoal.StartDetection = true;
		AlignClient.sendGoal(aligngoal);
		ROS_INFO("Alignment started");
		AlignClient.waitForResult();
		alignSuccess = (*(orangeClient.getResult())).MotionCompleted;
		if(alignSuccess){
			ROS_INFO("alignment successful");
		}
		else
			ROS_INFO("alignment failed");
	}
	return 0;
}<commit_msg>moved forward motion below<commit_after>#include <ros/ros.h>
#include <linefollowing/AlignAction.h>
#include <linefollowing/AlignActionFeedback.h>
#include <linefollowing/AlignActionResult.h>

#include <motionlibrary/ForwardAction.h>
#include <motionlibrary/ForwardActionFeedback.h>
#include <motionlibrary/ForwardActionResult.h>

#include <linedetection/orangeAction.h>
#include <linedetection/orangeActionFeedback.h>
#include <linedetection/orangeActionResult.h>

#include <actionlib/client/simple_action_client.h>
#include <actionlib/client/terminal_state.h>

using namespace std;

typedef actionlib::SimpleActionClient<linedetection::orangeAction> orange;
typedef actionlib::SimpleActionClient<linefollowing::AlignAction> Align;
typedef actionlib::SimpleActionClient<motionlibrary::ForwardAction> forward;


linedetection::orangeGoal orangegoal;
linefollowing::AlignGoal aligngoal;
motionlibrary::ForwardGoal forwardgoal;

bool orangeSuccess= false;
bool alignSuccess = false;
bool forwardSuccess = false;

void spinThread(){
	ros::spin();
}

void forwardCb(linedetection::orangeActionFeedback msg){
	ROS_INFO("feedback recieved %d",msg.feedback.nosignificance);
}
void AlignCb(linefollowing::AlignActionFeedback msg){
	ROS_INFO("feedback recieved %fsec remaining ",msg.feedback.AngleRemaining);
}

int main(int argc, char** argv){
	if(argc<2){
		cout<<"please specify the time for forward motion" << endl;
		return 0;
	}
	float forwardTime;
	forwardTime = atof(argv[1]);

	ros::init(argc, argv,"TheMasterNode" );
	ros::NodeHandle nh;
	//here linedetectionserver is the name of the node of the actionserver.
	ros::Subscriber subOrange = nh.subscribe<linedetection::orangeActionFeedback>("/linedetectionserver/feedback",1000,&forwardCb);
	ros::Subscriber subAlign = nh.subscribe<linefollowing::AlignActionFeedback>("/Align/feedback",1000,&AlignCb);

	orange orangeClient("linedetectionserver");

	Align AlignClient("Align");

	forward forwardClient("forward");

	ROS_INFO("Waiting for linedetection server to start.");
	orangeClient.waitForServer();
	ROS_INFO("linedetection server started");

	ROS_INFO("Waiting for align server to start.");
	AlignClient.waitForServer();
	ROS_INFO("Align server started.");

	boost::thread spin_thread(&spinThread);

	while(ros::ok()){
		orangegoal.order = true;
		orangeClient.sendGoal(orangegoal);
		ROS_INFO("Orange detection started");
		orangeClient.waitForResult();
		orangeSuccess = (*(orangeClient.getResult())).MotionCompleted;
		if(orangeSuccess){
			ROS_INFO("orange colour detected");
		}
		else
			ROS_INFO("orange not detected");

		aligngoal.StartDetection = true;
		AlignClient.sendGoal(aligngoal);
		ROS_INFO("Alignment started");
		AlignClient.waitForResult();
		alignSuccess = (*(orangeClient.getResult())).MotionCompleted;
		if(alignSuccess){
			ROS_INFO("alignment successful");
		}
		else
			ROS_INFO("alignment failed");
		forwardgoal.MotionTime = forwardTime;
		forwardClient.sendGoal(forwardgoal);
		ROS_INFO("Moving forward");
		forwardClient.waitForResult();
		forwardSuccess = (*(forwardClient.getResult())).MotionCompleted;
		if(forwardSuccess){
			ROS_INFO("forward motion successful");
		}
		else
			ROS_INFO("forward motion unsuccessful");			

	}
	return 0;
}
{'fraction_non_alphanumeric': 0.1252330640149161, 'fraction_numerical': 0.003884400248601616, 'mean_word_length': 7.284427284427284, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 37, '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': '6924744', 'n_tokens_mistral': 2172, 'n_tokens_neox': 1917, 'n_words': 377}