Trying to expand upon the Labview Motion Magic example provided by CTR. (Yes the example works).
Situation: Rear Talons have encoders attached. (Quad).
Trying to create a drive with the option of pushing a button to go a set distance using MotionMagic.
If button is pressed (MotionMagic snippet), the drive will go a set distance.
Reset encoder, repeat, no problems.
If xbox joystick if pushed, talons will switch to %VBus and drive fwd, bckwd.
(I am using a Global which is set according to whether we want MM or %VBus)
(False conditions are empty on both snippets.)
So far, so good.
Problem: after driving with joystick (%VBus), if the Motion Magic button is pressed again, it will enter the MM snippet, generally bumping the talons a small amount and stay in the while loop without further change to position.
Checking the RoboRio Web server, shows the Talons are in Mode 15 when this occurs. When original MM was run, Talons are in Mode 7.
I am able to stop the while loop with a button, and drive the talons again using the joystick. HOWERVER: the rear Talon’s (with encoders) do NOT respond. They are still in Mode 15.
In begin, I have broken the Talons out individually and also by the common “Drive”.
Not sure of best practices.
Suggestions and feedback welcome.
Thanks in advance for any help.
Snippets attached:
Drive and MM are both in teleop tied to xbox buttons and joystick.