Replies: 1 comment
-
Here is an example of exactly what you are looking for https://github.com/orgs/pybricks/discussions/1621. Good luck! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We are using pybricks for FLL, and we often run into a situation where a motor is stuck, and can't run to the desired angle position, usually because the robot is at the wrong place on the mat. So we execute for example:
motor.run_target(200, 100)
or
motor.run_angle(200, 100)
but the motor is unable to complete the command because something prevents it from turning. At this point usually the entire robot is stuck and won't move, as the code stays in that command forever.
Is there a way to detect this condition, so that we can do something about it, for example move the robot a bit and try again..? For example I would want this command to automatically abort if the motor is stuck, and return a "failed" return value.
Notice that we are aware of the "run_until_stalled" command, but it's not what we need, as we do need the motor to run a specific number of degrees, unless stuck.
Beta Was this translation helpful? Give feedback.
All reactions