|
Re: Autonomous Mode
What we usually do (and what I would recommend), is that you put any software that you intend to use in both teleop and auton in the periodic tasks VI. You can then pass data from auton and teleop to periodic tasks with global variables.
That may not make sense at first so I'll give an example.
Let's say you have a lifting mechanism to lift the totes. You decide that it would be ideal to command your lift to a height (using presets on buttons) and use a PID to control the lift to the commanded height. At the same time, it would make sense for autonomous to command the lift to a height and use a PID to control the lift to the commanded height.
Since both your autonomous strategy and your teleop strategy both rely on commanded heights and a PID, it would make sense to move your lift control code to periodic tasks so it can be shared by autonomous and teleop. You could then create a global variable called "LiftHeightCommand" that is the set point of the PID. In teleop, do your button processing to decide on the commanded lift height and assign the output of your logic to LiftHeightCommand. In autonomous, just set LiftHeightCommand directly.
__________________
-
An ounce of perception is worth a pound of obscure.
|