Quote:
Originally Posted by kylelanman
That code looks familiar
There is one addition on the end that is likely causing you problems.
In general everything works. If your commanded angle happens to be 0 then regardless of what your current angle is you skip the optimization. In the case of being optimized at 180 and then getting a 0 angle no rotation is required but due to the additional check it thinks a 180 degree rotation is required so it spins 180.
What problem were you trying to solve by adding the additional check?
|
Hey again, thanks again for all your help. Your suggestion didn't seem to work, we just removed it and we got a new problem which i'm fairly certain the additional check was meant to fix: sometimes when the set angle is 0, it notices 180 is more efficient and moves there. But now when we set it to 90, 270, or something similar, the two problematic modules start flickering between efficient and not-efficient movement creating a sporadic movement, along with the aforementioned problem. The strangest thing about this to me is that it only occurs in the front left and rear right modules. Sorry if we're late, but any help is still appreciated.