Merge pull request 'Anpassung fahre_gerade_aus für negative Strecken' (#14) from treffen-291123 into main
Reviewed-on: #14
This commit is contained in:
commit
80e8811180
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