Camera angle correction using IMU should now work correctly

pull/1/head
EmaMaker 2020-02-03 10:30:00 +01:00
parent 6acc62c1a3
commit b87488b1c1
2 changed files with 4 additions and 4 deletions

View File

@ -47,8 +47,8 @@ void DataSourceCameraConic :: readSensor(){
bAngle = (bAngle+360)%360;
//Fixes with IMU
yAngleFix = ((int)(yAngle - compass->getValue()*0.35) + 360) % 360 ;
bAngleFix = ((int)(bAngle - compass->getValue()*0.35) + 360) % 360 ;
yAngleFix = ((int)(yAngle + compass->getValue()*0.8) + 360) % 360 ;
bAngleFix = ((int)(bAngle + compass->getValue()*0.8) + 360) % 360 ;
yDist = sqrt( (true_yy-50)*(true_yy-50) + (50-true_xy)*(50-true_xy) );
bDist = sqrt( (true_yb-50)*(true_yb-50) + (50-true_xb)*(50-true_xb) );

View File

@ -36,9 +36,9 @@ void Goalie::goalie(int plusang) {
ball->b = ball->dir;
storcimentoPorta();
if(ball->distance > 200 && (ball->angle > 340 || ball->angle < 20)) drive->prepareDrive(ball->dir, 150, cstorc);
if(ball->distance > 200 && (ball->angle > 340 || ball->angle < 20)) drive->prepareDrive(ball->dir, 350, cstorc);
else {
drive->prepareDrive(ball->dir, 150, 0);
drive->prepareDrive(ball->dir, 350, 0);
cstorc = 0;
}
}