test+++++

This commit is contained in:
Richie 2023-11-20 15:11:52 +08:00
parent d1f99ab781
commit 094928841d
2 changed files with 2 additions and 4 deletions

View File

@ -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);
}

View File

@ -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