Romain Ame / Mbed 2 deprecated Stressed

Dependencies:   RoboClaw mbed

Fork of Robot2016_2-0 by ARES

Map/Objectif/objectif.cpp

Committer:
IceTeam
Date:
2016-05-05
Revision:
75:195dd2bb13a3
Parent:
70:d70a6db1f635

File content as of revision 75:195dd2bb13a3:

#include "objectif.h"

/* Dernier Changement : Romain 0h20 */

objectif::objectif (int ntype, float nx_obj, float ny_obj, float nthet_obj, Odometry * nCodo, AX12 * np, ControlleurPince * npince, float arr) {
	Parasol = np;
	pince = npince;
	type = ntype;
	x_objectif = nx_obj;
	y_objectif = ny_obj;
	thet_objectif = nthet_obj;
	Codo = nCodo;
	marche_arriere = arr;
}

bool objectif::Action () {
	switch(type) {
		case OBJ_BLOC_PRISE:
			return obj_bloc_action();
		case OBJ_BLOC_LACHE:
			return obj_para_lache_action();
		case OBJ_PARA:
			return obj_para_action();
		default:
			return true;
	}

	if (marche_arriere != 0) {
		Codo->GotoDist(-marche_arriere);
	}
}

bool objectif::obj_bloc_action () {
	front_Sharp_activated = false;
	return true;
}

bool objectif::obj_para_action() {
	return true;
}

bool objectif::obj_para_lache_action() {
	Codo->GotoDist(-80);
	front_Sharp_activated = true;
	return true;
}