From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Autonomous Help!

Solved!
Go to solution

I don't understand the autonomous code at all this year.  Can someone please help me understand it?  How can we add a motor and a solenoid to work during autonomus? Help please and thank you.

Rickover Naval Academy Seabots

Team 3110

GO NAVY!!

0 Kudos
Message 1 of 4
(6,934 Views)
Solution
Accepted by topic author Alex3110

Hi Alex,

From the LabVIEW Getting Started Window there are some great tutorials that may help.  Specifically Tutorial 5 - Editing Team Code VIs.  To add Here's its description of the Autonomous Independent VI:

The Autonomous Independent VI runs while the robot is in the Autonomous mode. You do not need to program the Autonomous Independent VI to stop after a certain time because the Robot Main VI terminates this VI when the mode changes to Teleop.

By default, the block diagram of the Autonomous Independent VI contains a Diagram Disable structure. The Diagram Disable structure contains default autonomous code for the robot. By default, this code is disabled. You can enable this code by right-clicking the edge of the structure and selecting Remove Diagram Disable Structure or Enable This Subdiagram. You also can delete the default autonomous code and use the WPI Robotics Library VIs or other LabVIEW VIs to specify the program you want to run while the robot is in the Autonomous mode.

All you need to do is initialize and close the references to your motor and solenoid accordingly within the other Robot Main subVIs, and then you can use the WPI Robotics Library VIs to add the programmatic control within your Autonomous Intependent VI.  This tutorial may also be helpful, which I found on the NI FIRST Robotics Competition Community.

I hope this helps!

- Greg J

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

Besides the things that Greg pointed you to, you should watch the videos on FRCMastery.com

Message 3 of 4
(3,048 Views)

IF you are talking about the LV code example that comes in when you create a project with code, then there is a accompaining paper that goes through the set up and basic assumutions that code is based on. Our team found this code to be rather complex for the task at hand and after about 8 hours of trying to figure it out and make it work, we scrapped that idea, and wrote our own. You can do the same thing!

In about 3 hours of testing we had working code for the line follow down.

You need to think about sensor position, you need to think about how many states you have when you have 3 digital inputs that can be on or off, and think about what motors need to do in each of these states, and you need to test your code so you never, never, never fall off the line.

At least that is how we did it.

Our line following was 18 for 18 at Kettering, and got us a Blue Banner. Altough we were only 17/18 on scoring for autonomus, due to no air pressure in the final, final match... but that's another story.

Also, if you have yonger kids on the team that came up through FLL, ask them, they typically can follow a line by the 2nd or 3rd year of FLL, or ask you local FLL team for some help if they have done line following, their season is over, and I sure they would love to help a big brother team, and you would expose them to your team... which you will want those FLL kids in a year or two.. truste me

Scott

Mentor TORC #2137

Message 4 of 4
(3,048 Views)