21022024 #20

Merged
viernst merged 53 commits from 21022024 into energybrickies 2024-02-21 17:05:35 +00:00
Showing only changes of commit 80e8811180 - Show all commits

View file

@ -128,8 +128,8 @@ class IQRobot:
versatz = self.bewegungsSensor.get_yaw_angle() versatz = self.bewegungsSensor.get_yaw_angle()
sum_versatz = sum_versatz + versatz sum_versatz = sum_versatz + versatz
abweichung = (kp * versatz + ki * sum_versatz) / 100 abweichung = (kp * versatz + ki * sum_versatz) / 100
linker_speed = speed * (1 - abweichung) linker_speed = speed * richtung * (1 - abweichung)
rechter_speed = speed * (1 + abweichung) rechter_speed = speed * richtung * (1 + abweichung)
self.antrieb.start_tank_at_power(int(linker_speed), int(rechter_speed)) self.antrieb.start_tank_at_power(int(linker_speed), int(rechter_speed))
#print("Versatz: " + str(versatz) + " , linker Speed: " + str(linker_speed) + ", rechter Speed: " + str(rechter_speed) + ", strecke: " + str(sum_cm)) #print("Versatz: " + str(versatz) + " , linker Speed: " + str(linker_speed) + ", rechter Speed: " + str(rechter_speed) + ", strecke: " + str(sum_cm))