Quote:
Originally Posted by Tom Line
So, if we were to put a motor set-speed in periodic tasks, we could update the motor speed far more quickly and control that motor more precisely, correct?
|
I'm not sure I follow you, Tom: more quickly and more precisely compared to what?
Quote:
|
Or are the motor set-speeds tied to the control station packets somehow?
|
TeleOp is not strictly speaking periodic; it's event-driven: It runs whenever data packets are sent, which occurs about every 20ms. You can then read that new data within TeleOp and act on it immediately within TeleOp, as long as you can do so well within 20ms. If your TeleOp code takes longer than 20ms to execute, you'll miss the next data packet.
Reading joystick values in a 10ms periodic task doesn't get new joystick data any faster.
Reading sensors on your robot faster than 20ms gets new sensor data that can be used to alter motor commands if you think you need to do that.