Camera angle correction using IMU should now work correctly
parent
6acc62c1a3
commit
b87488b1c1
|
@ -47,8 +47,8 @@ void DataSourceCameraConic :: readSensor(){
|
||||||
bAngle = (bAngle+360)%360;
|
bAngle = (bAngle+360)%360;
|
||||||
|
|
||||||
//Fixes with IMU
|
//Fixes with IMU
|
||||||
yAngleFix = ((int)(yAngle - compass->getValue()*0.35) + 360) % 360 ;
|
yAngleFix = ((int)(yAngle + compass->getValue()*0.8) + 360) % 360 ;
|
||||||
bAngleFix = ((int)(bAngle - compass->getValue()*0.35) + 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) );
|
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) );
|
bDist = sqrt( (true_yb-50)*(true_yb-50) + (50-true_xb)*(50-true_xb) );
|
||||||
|
|
|
@ -36,9 +36,9 @@ void Goalie::goalie(int plusang) {
|
||||||
ball->b = ball->dir;
|
ball->b = ball->dir;
|
||||||
|
|
||||||
storcimentoPorta();
|
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 {
|
else {
|
||||||
drive->prepareDrive(ball->dir, 150, 0);
|
drive->prepareDrive(ball->dir, 350, 0);
|
||||||
cstorc = 0;
|
cstorc = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue