diff --git a/main controller code/.vscode/settings.json b/main controller code/.vscode/settings.json index cc4668b..8c27341 100644 --- a/main controller code/.vscode/settings.json +++ b/main controller code/.vscode/settings.json @@ -6,6 +6,7 @@ "stdlib.h": "c", "stdint.h": "c", "gyro.h": "c", - "motors.h": "c" + "motors.h": "c", + "motion_control.h": "c" } } \ No newline at end of file diff --git a/main controller code/src/motion_control.c b/main controller code/src/motion_control.c index c0f1fd3..04e0e8a 100644 --- a/main controller code/src/motion_control.c +++ b/main controller code/src/motion_control.c @@ -13,7 +13,7 @@ void i2c_update_motion_control(void) // - we calculate the error of the targeted angle and the actual angle // - then we calculate motors speed from targeted speed, the error and the offset - float actual_angle = robot.gyro_data.x_angle; + float actual_angle = robot.gyro_data.x_angle - 45; // Substracte 45* because robot is not aligned with it's moving base float target_angle = (float)robot.motion_control_data.angle; float error = target_angle - actual_angle;