|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Robot Main.vi
Perhaps the instructor is familiar with FTC where the FMS launches and aborts top level programs. For FRC, it doesn't do this. It is the team's job to start their own program and to pay attention to the control packets. To assist, the WPI libraries and sample code help to schedule code according to the packets.
It is not required to use RobotMain, and the elements for constructing it are in the palette as well. In reality, you don't even need to modify RobotMain, but instead need to modify the Team Code folder. For example, Begin.vi is where you init any I/O you will use and store the references. Teleop is where you use the references and input from joysticks and driver station I/O to update the motors and outputs. Autonomous Independent is what I'd recommend you start with since you don't need to worry about the protocol. The framework will start and stop the VI for you. Build dashboard data is where you can decide what to send to the dashoard. Finish is where you can release the I/O refnums. Greg McKaskle |
|
#2
|
|||
|
|||
|
Re: Robot Main.vi
I don't think you have to use Robot Main either but I would recommend you stick with the outline that is supplied unless you are EXTREMELY good at programming. If you start developing your own framework you have to make sure to do things like set up the watchdog and driver station properly. If you don't set up the watchdog properly you could run into problems with the robot not running or not stopping when you press the E-stop button. If you E-stop button doesn't work correctly I think you would be disqualified for safety reasons. My recommendation would be to clean up robot main and remove or empty out things that you are not using. For example if you are not using a camera I would disable it and remove it from all the Sub-VI's. I would then make a new dashboard that did not have a video patch thru.
|
|
#3
|
|||
|
|||
|
Re: Robot Main.vi
Quote:
|
|
#4
|
|||
|
|||
|
Re: Robot Main.vi
Quote:
The problem is as follows: Within RobotMain, the conditional terminal in the while loop is wired to the output of the case structure whose selector is the Robot Mode. It turns out this wire into the conditional terminal is undefined for all Robot Modes except "FINISH". I may be wrong, but it seems to me that unless RobotMain is modified to explicitly define the value on this wire for all Robot Modes, a robot may randomly stop. Our team made this change after the 3rd match, and we were able to complete the remainder of our matches successfully. I was very surprised we hadn't run into this problem in any of our pre-regional testing but I'm guessing that this undefined boolean wire value takes on a random memory value and again I'm guessing that most memory is zeroed out so this undefined wire value is probably FALSE most of the time so the while loop in RobotMain doesn't stop prematurely. Does it seem reasonable to others that RobotMain could randomly stop if it isn't modified to fix this issue? If this is an issue it would probably be good if NI could put out a new LabView release to fix this becaue I bet a lot of teams aren't fixing this. I checked one other team at the SD regional and they were running RobotMain unmodified. |
|
#5
|
|||||
|
|||||
|
Re: Robot Main.vi
Greg,
If you right click on the tunnel you refer to, you will see the "Use Default if Unwired" option is checked. The default value for the tunnel is False. Labview will not allow you to run code that has a tunnel that is not defined in all cases. If you uncheck the option I mentioned above, you will see the muddle of the tunnel turns white and the run arrow changes to broken. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Basic Robot Main vi | chinckley | NI LabVIEW | 7 | 03-03-2009 15:54 |
| Using Robot Main | LiLFiL | Programming | 1 | 14-02-2009 18:51 |
| Coordinating Robot Main VI with Autonomous VI | jjauss | Programming | 2 | 07-02-2009 09:26 |
| Dashboard and Robot main with Axis camera | Team2883 | General Forum | 9 | 10-01-2009 07:35 |
| main.c | 6600gt | Programming | 3 | 29-08-2006 02:19 |