No announcement yet.

Strange linear op behavior

  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Here's an interesting tidbit. We wrote a simple linear op mode that just sent telemetry. No motors, etc. We had a while loop that incremented a variable (+1) 1000 times and send the value to the driver station. It took about 3.5 seconds to reach 1000. We then inserted a "WaitOneFullHardwareCycle" into the loop and it now takes about 18 seconds. Just an FYI.


    • #17
      Originally posted by tvsknights View Post
      Hi Tom
      Thanks for looking in. We are using all new Modern Robotics equipment. We have wondered what WaitOneFullHardwareCycle does, and we stuck it in various places. It didn't help. Of course, it's possible that we didn't put it in the right place.
      We set the motors to zero and put those commands in a loop that runs a thousand time.
      Here's a link to the aia file:
      Hi tvsknights,

      I downloaded your op mode, and put WaitOneFullHardwareCycle statements in and it worked reliably.

      I think the weird behavior might be occurring because without the WaitOneFullHardwareCycle statements, your op mode is not interruptible.

      I think it would work more reliably if you put the wait statements at the end of every loop in your RunOpMode event block. Without the statements, running the program a second time seemed problematic for me too.

      Also, I would put a wait one full hardware cycle statement after you switch the mode of the motors to run using encoders mode (to give the system a chance to write the commands to the motor controllers).

      I hope this helps. Please let me know if you have additional questions.


      • #18
        Thanks, Tom. That seems to have fixed our problem.