From 094928841dfea9a41182120a5919b7adceace98a Mon Sep 17 00:00:00 2001 From: Richie <2837357W@student.gla.ac.uk> Date: Mon, 20 Nov 2023 15:11:52 +0800 Subject: [PATCH] test+++++ --- frtos/motor/motor_direction.h | 3 ++- frtos/motor/motor_pid.h | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) 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