|Jerkyness when multitasking
|Page 1 of 1|
|Author:||nolvad [ Mon May 11, 2015 2:45 am ]|
|Post subject:||Jerkyness when multitasking|
I've been trying to control the motors that are drive a robot in one task and the sequence for triggering some solenoids in another but the multitasking has made the wheel motors all jumpy.
Also as a interesting note, when I watch the motor debugging window it tends to favor powering the front motors and is only really jumpy when going straight forwards
Any ideas on how to correct that without making the robot stop every times I trigger the solenoids?
|Author:||JohnWatson [ Mon May 11, 2015 9:22 am ]|
|Post subject:||Re: Jerkyness when multitasking|
My guess is that the issue you are running into is in the code above. If the first 'if' statement's condition is true, the motors get turned on, but then the code immediately checks the second 'if' statement and, if it is false, turns the motors back off. This is what is most likely causing the shaking that you are experiencing.
To solve this, simply change the second 'if' statement to an 'else if' statement; that way only one of the three drive control codes will execute on each pass of the loop.
|Page 1 of 1||All times are UTC - 5 hours [ DST ]|
|Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group