Skip to content

Commit

Permalink
Merge branch 'master' of github.com:DarkaMaul/osrobot
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkaMaul committed Jan 23, 2017
2 parents c186831 + a3861bc commit 2d0f8aa
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion includes/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
//Grabing constants
#define GRAB_POSITION 23
#define MAX_GRABBING_SPEED 550
#define RELEASING_SPEED 400
#define RELEASING_SPEED 1050
#define INIT_GRAB_POSITION -15


Expand Down
5 changes: 5 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ int main(int argc, char *argv[])
s->sock = -1;
game_wrapper(s, p);
break;
case 7:
init_robot(s);
grab(s, MAX_GRABBING_SPEED);
getchar();
release(s, RELEASING_SPEED);
}
}
//Close external ressources
Expand Down
4 changes: 3 additions & 1 deletion src/motors.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,15 @@ int release(state *s, int speed)
log_this(s, "[%s:release] Releasing failed already in release position\n", __FILE__);
return -1;
}
sleep(5);
ev3_set_speed_sp(s->grabmotor, speed);
ev3_set_ramp_up_sp(s->grabmotor, 7000);
ev3_set_ramp_up_sp(s->grabmotor, 5500);
ev3_set_position_sp(s->grabmotor, -7);
ev3_command_motor_by_name(s->grabmotor, "run-to-abs-pos");
while (ev3_motor_state(s->grabmotor) & MOTOR_RUNNING);
//log_this(s, "Motor %d on port %c opened, assigned and reseted\n", motor->motor_nr, motor->port);
ev3_set_ramp_up_sp(s->grabmotor, 0);
sleep(4);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/utilspositions.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ void init_main_positions(state *s, mainpos *p){
//printf("%d\n",side);
position s_fr_init={.x = (S_FR_S_0_X + S_FR_S_2_X)/2,.y = (S_FR_S_0_Y + S_FR_S_2_Y )/2 };
position s_fr_ballareaposition = {.x = S_BA_3_X, .y = S_BA_3_Y};
position s_fr_endingposition = {.x = (S_FR_E_0_X + S_FR_E_2_X)/2 - ROBOT_WIDTH,.y = (S_FR_E_0_Y + S_FR_E_2_Y )/2 };
position s_fr_endingposition = {.x = (S_FR_E_0_X + S_FR_E_2_X)/2 ,.y = (S_FR_E_0_Y + S_FR_E_2_Y )/2 };

position l_fr_init = {.x = side*(L_FR_S_0_X + L_FR_S_2_X)/2, .y = (L_FR_S_0_Y + L_FR_S_2_Y)/2};
position l_fr_dodgefirst = {.x = side*(L_O1_2_X + BIG_ARENA_MAX_X + ROBOT_WIDTH*1.5)/2, .y = L_O1_2_Y + L_FR_S_0_Y};
Expand Down

0 comments on commit 2d0f8aa

Please sign in to comment.