Prototyp V2
Dependencies: PM2_Libary
Diff: main.cpp
- Branch:
- michi
- Revision:
- 44:c2d4bc4be5f2
- Parent:
- 43:7964411b4a6b
- Child:
- 45:8050724fe19b
--- a/main.cpp Mon Apr 18 12:51:13 2022 +0200 +++ b/main.cpp Mon Apr 18 12:54:10 2022 +0200 @@ -108,9 +108,10 @@ // calculatioin of acctual distance with wheels is needed int drive_straight(float distance) { -positionController_M_right.setDesiredRotation(distance,max_speed_rps); -positionController_M_left.setDesiredRotation(distance,max_speed_rps); -return 0; + int deg_to_turn = wheel_dist_to_deg(distance); + positionController_M_right.setDesiredRotation(deg_to_turn,max_speed_rps); + positionController_M_left.setDesiredRotation(deg_to_turn,max_speed_rps); + return 0; } //only turns the arm until the robot is on the next step