Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Robot Mode Global Variable in LabView (http://www.chiefdelphi.com/forums/showthread.php?t=127467)

tolefanjh 04-03-2014 10:00

Robot Mode Global Variable in LabView
 
I'm curious as to what other teams are setting this variable to in the Begin.vi? We have seen a few cases were our robot has done strange things (motors running and such) when first enabled in Teleop mode. We tried different settings for this variable and haven't figured out what is really causing the problem, though I highly suspect it has something to do with this, just trying to work through why it is doing it.

Greg McKaskle 04-03-2014 10:41

Re: Robot Mode Global Variable in LabView
 
If you right click on the global and choose Find>>Global References, you'll find that it is assigned in two places and never read. The global is there so that periodic code, vision code, etc. can have an easy way to make code conditional. You don't really need to set the global. If none of your code is reading it, it won't have any affect. If you are reading it, do you want the value set by the DS in Robot Main, or your value?

You jerking when teleop begins likely has to do with the values that the motors are set to while the robot is disabled. When enabled, those values are "live". Shortly after that, your teleop probably reads joysticks and buttons and sets things to zero.

It is a reasonably good idea to set your motors to zero in the disabled function, but be sure that you aren't getting into a race with Periodic tasks.

Greg McKaskle

tolefanjh 09-03-2014 18:01

Re: Robot Mode Global Variable in LabView
 
The problem seems to be more than just a quick 'twitching' of the motors and such. It seems that some motors try to run a sequence, turning on for a couple of seconds, off for a bit and so forth.

Still working to figure out what is going on, but it is almost like the autonomous code is running, but not our code or only parts of it.

Chris.

Greg McKaskle 10-03-2014 08:42

Re: Robot Mode Global Variable in LabView
 
If you run interactively, hit the run button or Robot Main, you can open panels and see what is running. Also, the charts tab and log file will show you if the auto code is running. It shows up on the graph as a green line, or actually as tightly spaced green dots.

Greg McKaskle


All times are GMT -5. The time now is 08:46.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi