FIRST Robotics Competition Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

Sensor Fusion

In this tutorial, you will learn how to integrate multiple sensor measurements and use those measurements to make a decision and complete a task. This tutorial builds upon material presented in previous tutorials. It is highly recommended that you complete the following tutorials before beginning the sensor fusion tutorial:

Best Practices for Using the FRC cRIO Project Frameworks

Getting Started with Sensors

Contents

1.1   Introduction
1.2   Creating a state machine
1.3   The Rotate, Stop, and Go cases
1.4   Extending our code to complete a course
1.5   Conclusion

Video Part 1

<embed src="http://blip.tv/play/gshO7b0wjoM5" type="application/x-shockwave-flash" width="640" height="480" allowscriptaccess="always" allowfullscreen="true"></embed>

Video Part 2

<embed src="http://blip.tv/play/gshO7b0ijoM5" type="application/x-shockwave-flash" width="640" height="480" allowscriptaccess="always" allowfullscreen="true"></embed>

Mark
NI App Software R&D
Comments
LVB
Active Participant
Active Participant
on

I would suggest addding an autonomous info data cluster passed through a shift register to this architecture.  Using the bundle and unbundle items by name functions, the programmer can pass data between iterations.

CLA, CTA
ctrostad
Member
Member
on

I followed the directions and compiled the code without errors.  When I send it to the CRIOS it does not work.  Any hints as to why it does not work in autonomous mode?  When I move the toggle for enabled it goes to enabled for a second and then it goes immediately into disabled mode.  If it would help I can e-mail you my code.  My address is ctrostad@crookston.k12.mn.us

MarkBlack
Active Participant
Active Participant
on

Can you give us more details on what you mean by "does not work."   If the Driver Station is going into the disabled state that is not due to this code.

Mark
NI App Software R&D
ctrostad
Member
Member
on

When we compile our program (running from the laptop) we can run our robot in teleop mode just fine.  When we try to run the autonomous code it does not work.  Question #1:  Our Jaguars are blinking in autonomous mode?  I assume this shouldn't be the case.  Question #2:  Because we are trying to run the program (rotate & ticks) from the laptop will it not work because we need to go to file and select send to target instead of running it from the laptop?  We are extremely new to this.  I appreciate your patients.  Question #3:  It seems as though we are sending individual pieces of code by selecting the play button and running it from the laptop.  Do we need to simply run it from the CRIOS instead of the laptop?  Thanks for your help!

Chris Trostad

Philbot
Active Participant
Active Participant
on

OK,  I see a major problem here.

Whenever you download and run your program (by hitting the Run button), you MUST do it from the RobotMain.vi

If you do it from any other VI, you are just running that small piece of your program, your chances of sucess are almost NIL, and it expalins why it doesn't stay enabled..

So, make your changes, then pull up the RobotMain.vi and click on its Run button.

You should see lots of vis being downloaded and then the program will run.

Before you actually download, make sure the Driver Station dongle is set to Disabled (either telop or autonomous).

Once the download is complete, wait until the Driver station is displaying your Battery voltage.

This way you know that the downloaded program is fully operational (it takes several seconds from the end of the download for the program to actually start running).

Note: A good Battery Voltage is your BEST indicator that you are ready to run (in the lab or on the field)

Then, with the battery voltage displayed, set the appropriate mode (Auto) and THEN switch the robot to "Enabled".

At that point the robot will switch to Autonomous-Enabled mode, and if you are using AutonomousIndependat.VI that VI will run.

You should see your auto code run.  Remeber that your auto code MUST also feed the watchdog timer.

Phil

Get a life? This IS my life!
ChrisTrostad
Member
Member
on

How do I replace our robot main with another file that we have built?  We downloaded a file to get the joystick buttons to work and we updated the file to make our motors work in tank drive.  What do I do to get our button program to replace the basic robot main?

Thanks,

Chris Trostad

ChrisTrostad
Member
Member
on

When we go to deploy all I get an error saying I need to build something before I can deploy all the files.  What do I need to do to do this?

Contributors