Skip to content

Commit

Permalink
Petites modifications d'ordre esthétique
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas committed Dec 20, 2016
1 parent 602569d commit 2a1856f
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,16 @@ NAMESPACE_INIT(ctrlGr18);
void calibration(CtrlStruct *cvs)
{
// variables declaration
int team_id;
double t;

CtrlIn *inputs;
CtrlIn *inputs;
RobotCalibration *calib;
RobotPosition *rob_pos;

double t;
int team_id;

// variables initialization
inputs = cvs->inputs;
calib = cvs->calib;

rob_pos = cvs->rob_pos;

t = inputs->t;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ void kalman(CtrlStruct *cvs)
KalmanStruct *pos_kalman;

// variables initialization
inputs = cvs->inputs;
rob_pos = cvs->rob_pos;
pos_tri = cvs->triang_pos;
pos_kalman = cvs->kalman_pos;
inputs = cvs->inputs;

// variables temporaires
int i;
Expand Down
6 changes: 3 additions & 3 deletions userFiles/ctrl/groups_ctrl/gr18/localization/odometry_gr18.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ NAMESPACE_INIT(ctrlGr18);
void update_odometry(CtrlStruct *cvs)
{
// variables declaration
double r_sp, l_sp;
double dt;

RobotPosition *rob_pos;
CtrlIn *inputs;

double r_sp, l_sp;
double dt;

// variables initialization
inputs = cvs->inputs;
Expand Down
5 changes: 3 additions & 2 deletions userFiles/ctrl/groups_ctrl/gr18/localization/opp_pos_gr18.cc
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,10 @@ int single_opp_tower(CtrlStruct *cvs, double last_rise, double last_fall, double
*/
void check_opp_front(CtrlStruct *cvs)
{
// variables declaratio
// variables declaration
CtrlIn *inputs;
OpponentsPosition *opp_pos;
RobotPosition *rob_pos;
OpponentsPosition *opp_pos;

int i, nb_opp;
int rise_index[2], fall_index[2];
Expand All @@ -228,6 +228,7 @@ void check_opp_front(CtrlStruct *cvs)
inputs = cvs->inputs;
rob_pos = cvs->rob_pos;
opp_pos = cvs->opp_pos;

nb_opp = opp_pos->nb_opp;

// no opponent
Expand Down
5 changes: 3 additions & 2 deletions userFiles/ctrl/groups_ctrl/gr18/main/CtrlStruct_gr18.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ NAMESPACE_INIT(ctrlGr18);
CtrlStruct* init_CtrlStruct(CtrlIn *inputs, CtrlOut *outputs)
{
// variables initialization
int i;
CtrlStruct *cvs;

int i;

// memory allocation
cvs = (CtrlStruct*) malloc(sizeof(CtrlStruct));
Expand Down Expand Up @@ -139,7 +140,7 @@ CtrlStruct* init_CtrlStruct(CtrlIn *inputs, CtrlOut *outputs)
* \param[in] cvs controller main structure
*/
void free_CtrlStruct(CtrlStruct *cvs)
{
{
free_path_planning(cvs->path);
free_strategy(cvs->strat);

Expand Down
9 changes: 6 additions & 3 deletions userFiles/ctrl/groups_ctrl/gr18/main/ctrl_main_gr18.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ NAMESPACE_INIT(ctrlGr18);
void controller_init(CtrlStruct *cvs)
{
// variables declaration
double t;
CtrlIn *inputs;


double t;

// variables initialization
inputs = cvs->inputs;

t = inputs->t;

// robot ID
Expand Down Expand Up @@ -80,7 +83,7 @@ void controller_loop(CtrlStruct *cvs)
CtrlOut *outputs;

double t;

// variables initialization
inputs = cvs->inputs;
outputs = cvs->outputs;
Expand Down
13 changes: 8 additions & 5 deletions userFiles/ctrl/groups_ctrl/gr18/path/path_planning_gr18.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ NAMESPACE_INIT(ctrlGr18);
*/
PathPlanning* init_path_planning()
{
//variable declaration
//variables declaration
PathPlanning *path;

int i, j;

// memory allocation
Expand Down Expand Up @@ -96,7 +97,7 @@ PathPlanning* init_path_planning()
*/
void free_path_planning(PathPlanning *path)
{
// variable declaration
// variables declaration
int i;

// ----- path-planning memory release start ----- //
Expand Down Expand Up @@ -236,6 +237,7 @@ void create_map(CtrlStruct *cvs)
{
// variables declaration
PathPlanning *path;

int i, j;

// variables initialization
Expand Down Expand Up @@ -423,14 +425,14 @@ void create_map(CtrlStruct *cvs)
return;
}


// Mets une valeur haute aux cases occupés par le robot adverse
void manage_opp(CtrlStruct *cvs, int delta)
{
// variable declaration
PathPlanning *path;
OpponentsPosition *opp_pos;
RobotPosition *rob_pos;

int i, j, k;
int i_start, i_end, j_start, j_end;

Expand Down Expand Up @@ -495,15 +497,16 @@ void assign_numbers(CtrlStruct *cvs)
{
// variables declaration
PathPlanning *path;

int i, j, value, cases_ni;

// variables initialization
path = cvs->path;

value = 0;
cases_ni = 0;

path->map[path->goal_XY->X][path->goal_XY->Y] = 0;


//Compte le nombre de cases a assigner
for (i = 0; i < CELL_X; i++)
Expand All @@ -516,7 +519,6 @@ void assign_numbers(CtrlStruct *cvs)
}
}
}


//Assigne les cases avec l'algorythme d'exmpension jusqu'a ateindre le robot
while ((cases_ni > 0) && (path->map[path->rob_pos_XY->X][path->rob_pos_XY->Y] > 90)) // tant qu'on n'a pas enregistré toute les cases
Expand Down Expand Up @@ -583,6 +585,7 @@ void find_path(CtrlStruct *cvs)
{
// variable declaration
PathPlanning *path;

int i, j, i_line, j_line, i_diag, j_diag, k, l, c;
float avg_temp, avg_line, avg_diag;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ NAMESPACE_INIT(ctrlGr18);
*/
void follow_path(CtrlStruct *cvs, double goal_x, double goal_y)
{
//variable declaration
//variables declaration
PosRegulation *pos_reg;
Strategy *strat;
OpponentsPosition *opp_pos;
PathPlanning *path;
CtrlIn *inputs;

int team_id;

// variables initialization
pos_reg = cvs->pos_reg;
strat = cvs->strat;
opp_pos = cvs->opp_pos;
path = cvs->path;
inputs = cvs->inputs;

team_id = cvs->team_id;

switch (pos_reg->path_state)
Expand Down Expand Up @@ -194,8 +194,8 @@ void run(CtrlStruct *cvs, double x_ref, double y_ref, double theta_ref, float ep
int turn(CtrlStruct *cvs, double theta_ref, int sens)
{
// variables declaration
CtrlIn *inputs;
RobotPosition *rob_pos;
CtrlIn *inputs;
PosRegulation *pos_reg;

double dt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ NAMESPACE_INIT(ctrlGr18);
*/
void speed_regulation(CtrlStruct *cvs, double r_sp_ref, double l_sp_ref)
{
double r_sp, l_sp;
double dt;

// variables declaration
CtrlIn *inputs;
CtrlOut *outputs;
SpeedRegulation *sp_reg;

double r_sp, l_sp;
double dt;

// variables initialization
inputs = cvs->inputs;
Expand Down
Loading

0 comments on commit 2a1856f

Please sign in to comment.