PID CAN setup fix
This commit is contained in:
parent
013768ad1c
commit
5fa3db6e6c
4 changed files with 37 additions and 23 deletions
|
@ -129,23 +129,24 @@ void setup_angle(float target_angle) {
|
|||
motor.move(target_angle);
|
||||
}
|
||||
|
||||
void setup_pid_angle(uint8_t param_pid, float data){
|
||||
switch (param_pid) {
|
||||
case pid_p:
|
||||
motor.P_angle.P = data;
|
||||
break;
|
||||
case pid_i:
|
||||
motor.P_angle.I = data;
|
||||
break;
|
||||
case pid_d:
|
||||
motor.P_angle.D = data;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// void setup_pid_angle(uint8_t param_pid, uint32_t data){
|
||||
// conv_float_to_int.f = data;
|
||||
// switch (param_pid) {
|
||||
// case pid_p:
|
||||
// motor.P_angle.P = conv_float_to_int.f;
|
||||
// break;
|
||||
// case pid_i:
|
||||
// motor.P_angle.I = conv_float_to_int.f;
|
||||
// break;
|
||||
// case pid_d:
|
||||
// motor.P_angle.D = conv_float_to_int.f;
|
||||
// break;
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
|
||||
write_param(param_pid,data);
|
||||
}
|
||||
// write_param(param_pid,data);
|
||||
// }
|
||||
|
||||
|
||||
void listen_can(const CAN_message_t &msg) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue