Replies: 4 comments 1 reply
-
I agree that this feature would be useful! We used this approach (driving straight with a target heading angle) with EV3 some years ago, and it gave us better results than simply driving straight based on the last turn's end angle. It could correct turn deviations early in the straight movement. We didn't find a way to implement this last season, though the robot did pretty well with the current system (turning relative to the start angle and just driving straight). I hope they consider adding it for this season! |
Beta Was this translation helpful? Give feedback.
-
Yes, I also fully support this idea. Avoids cumulated errors a lot. |
Beta Was this translation helpful? Give feedback.
-
So I think this was already discussed in #1719. If I understand correctly, by using |
Beta Was this translation helpful? Give feedback.
-
Thanks for asking!
I agree as well, and that's why we made this the default behavior out of the box 😄 I see you've already found it, but I'll just add some more detail when others read this later. When you use the default So you can use Additionally, if you want to change to a new absolute heading before doing your movement, you can do: my_target = 90
remaining_angle_to_turn = my_target - hub.imu.heading()
drivebase.turn(remaining_angle_to_turn) Or in one line: drivebase.turn(90 - hub.imu.heading()) |
Beta Was this translation helpful? Give feedback.
-
I am a FLL "coach" for my kids and we are trying pybricks for the upcoming Submerged season. It has been awesome so far and the kids really like the simplicity and built-in functions. One thing we are trying to do now is to use a global coordinate system so that every move is based on a global angle to the gyro direction when we start the robot. We can reduce the cumulated errors a lot by doing this from our previous experiences. This can improve the robustness significantly.
One thing we are proposing is something like straight(distance, degree) which means moving a distance on a line with an angle=degree to last gyro reset() position.
This can ensure our long straight() can keep towards a direction very accurately even when previous actions like turn() may bear some errors. The robot can adjust it back to the right direction during the long move.
Since we are new to pybricks, is there a way of doing this?
Beta Was this translation helpful? Give feedback.
All reactions