|
Re: Ramping Motors?
In execute, try something along the lines of:
if (currentVoltage < targetVoltage)
currentVoltage += 0.01
else if (currentVoltage > targetVoltage)
currentVoltage -= 0.01
This will bump your voltage closer to your target voltage each iterative loop.
Of course you'll want to clean it up, but this should give you a general idea.
Do not use loops inside your command executes. They are already looped for you each during iteration. Unlike the SimpleRobot template, you cannot loop inside your command executes for a long period of time. Your execute methods need to run as quickly as possible, so any other parallel commands can be run immediately after. If you loop, you will stall the rest of your code, thus losing the ability to run things asynchronously.
__________________
In life, what you give, you keep. What you fail to give, you lose forever...
|