diff --git a/frtos/motor/motor_direction.h b/frtos/motor/motor_direction.h index 00ad331..15f5d02 100644 --- a/frtos/motor/motor_direction.h +++ b/frtos/motor/motor_direction.h @@ -121,7 +121,8 @@ turn(uint32_t direction, updateDirection(pp_car_struct->p_direction); float initial_yaw = pp_car_struct->p_direction->yaw; - float target_yaw = adjust_yaw(initial_yaw + degree); + float target_yaw = (direction == DIRECTION_LEFT) ? initial_yaw - degree + : initial_yaw + degree; turn_to_yaw(direction, target_yaw, pwm_level, pp_car_struct); } diff --git a/frtos/motor/motor_pid.h b/frtos/motor/motor_pid.h index aa008fb..be80f5e 100644 --- a/frtos/motor/motor_pid.h +++ b/frtos/motor/motor_pid.h @@ -8,9 +8,6 @@ #ifndef MOTOR_PID_H #define MOTOR_PID_H -#include "magnetometer_init.h" -#include "magnetometer_direction.h" - /*! * @brief Compute the control signal using PID controller * @param integral The integral term of the PID controller