|
Switching CAN Jaguar Control Modes
We've got our Jaguar connected via CAN, and we have an encoder and limit switches hooked up to it. We can read the encoder inputs from it (woo!), and the limit switches work correctly too.
We were trying to get the kPosition mode to work correctly, but it doesn't seem to work at the moment quite yet. We were already planning to implement a manual override for our arm, so that works perfectly fine. However, once we switch to kPosition mode, it seems to indicate that it did the switch, but when we switch back to the kPercentVbus mode the motor control doesn't seem to work anymore.
I'm probably going to make a simpler mockup tomorrow morning and try it, but I was wondering if anyone has tried doing this sort of thing before (switching back and forth between different control modes), and if there were any tricks to getting it to work.
Any thoughts? We're using C++/python, but I feel this is probably a language agnostic thing. Thanks!
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/ pynetworktables2js (NetworkTables for Python & Javascript)
2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award
Resources: FIRSTWiki (relaunched!) | My Software Stuff
|