FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Default Robot code opening Gyro once, closing many times.

I was just working through the default template code and noticed that the gyro is openned in Begin.vi, but closed in teleop.vi when the stop condition is activated.

This looks like it may be a problem during testing when teleop can be executed several times in a row without a reset.

The Gyro will be closed multiple times, without a corrosponding Open each time.

I recommend moving this gyro close action into the finish.vi

note: I don't know whether the GyroClose does anything that will prevent the gyro from working or not, but the implication is that it will.

It does close the underlying analog input.

Phil.

Get a life? This IS my life!
0 Kudos
Message 1 of 4
(4,228 Views)

Hi Phil,

Good catch! You should go ahead and delete the Gyro Close VI from the Stop Case in the Teleop VI. This will invalidate the Gyro reference on successive calls to the Teleop VI during the same instance of Robot Main. It's not a problem in competition because you go from Autonomous to Teleop and your done, but I can see it being painful during testing.

The Gyro reference is already properly closed in the Finish VI, so all you need to do is delete the Gyro Close from the Teleop VI and you should be good to go.

Best Regards,

~Nate

0 Kudos
Message 2 of 4
(2,826 Views)

Will this fix be in the next LabVIEW update?

0 Kudos
Message 3 of 4
(2,826 Views)

Hi Sciencewhiz,

This specific problem may not warrent a full LabVIEW FRC update to be released, but if a further update is released, the fix for this issue will be included.

Best Regards,

~Nate

0 Kudos
Message 4 of 4
(2,826 Views)