ut-robotics / picr21-team-sauna-madis

0 stars 0 forks source link

Error prone manual control checking logic #46

Closed Akustav closed 2 years ago

Akustav commented 2 years ago

Currently how states are handled is that every state blocks until it finishes a set goal. This creates the need to check for manual/automatic driving logic inside every state. When a new state is added it can not be forgotten, else it is impossible to enter manual mode inside that state.

This is very error prone. Why not just change the state when a state goal was not reached? This way you need to define the manual/auto check as the first thing in the main loop: https://github.com/ut-robotics/picr21-team-sauna-madis/blob/4fb64b509e46eff53c771e944f97920e92c6cfa2/saun/main.py#L181-L185

Examples of blocking definitions

https://github.com/ut-robotics/picr21-team-sauna-madis/blob/4fb64b509e46eff53c771e944f97920e92c6cfa2/saun/main.py#L95-L97

https://github.com/ut-robotics/picr21-team-sauna-madis/blob/4fb64b509e46eff53c771e944f97920e92c6cfa2/saun/main.py#L107-L109

https://github.com/ut-robotics/picr21-team-sauna-madis/blob/4fb64b509e46eff53c771e944f97920e92c6cfa2/saun/main.py#L123-L124

uschults commented 2 years ago

done