Compare commits
2 commits
b5c1a47f98
...
80e8811180
Author | SHA1 | Date | |
---|---|---|---|
80e8811180 | |||
|
2fe0c0a556 |
1 changed files with 2 additions and 2 deletions
|
@ -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))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue