NTUYWANG103 / APEX_AIMBOT

This is a YOLOV7 based APEX and CSGO Aimbot
GNU General Public License v3.0
583 stars 98 forks source link

Why PID is used like this in this project? #100

Open robotsmaker opened 9 months ago

robotsmaker commented 9 months ago

I am confused about the pid controller code here. Why write it like this instead of using dx and dy directly?

move_rel_x = self.pidx(atan2(-move_rel_x, self.detect_length) self.detect_length) move_rel_y = self.pidy(atan2(-move_rel_y, self.detect_length) self.detect_length)

PlutoNameless commented 9 months ago

Using dx and dy directly might not capture the relationship with self.detect_length, or might introduce noise or sensitivity that is undesirable in the control system.

robotsmaker commented 9 months ago

Using dx and dy directly might not capture the relationship with self.detect_length, or might introduce noise or sensitivity that is undesirable in the control system.

Thank you, I understand. It's very clever. There is another question, why is there "self. pidx (0),self. pidy (0)" in the function "lock_target", and in the parameter file, d is three times p? So it looks like p+d becomes the true p?