100 likes | 304 Views
Mechanics of Wind River Workshop . January 10, 2009 Farmingdale State College SPBLI - FIRST. Mark McLeod Advisor Hauppauge Team 358 Northrop Grumman Corp. Mark.McLeod@ngc.com. Agenda. Setup the Environment Starting a Project Default Frameworks Downloading
E N D
Mechanics of Wind River Workshop January 10, 2009 Farmingdale State College SPBLI - FIRST Mark McLeod Advisor Hauppauge Team 358 Northrop Grumman Corp. Mark.McLeod@ngc.com
Agenda • Setup the Environment • Starting a Project • Default Frameworks • Downloading • Control System Session Download & Test
Setup the Environment • Setup the environment • C Programming Guide for FRC (C:\WindRiver\docs\extensions\FRC) • New Connection • Create a Project • Easier to start with these and get all the right options preset for you • SimpleRobotTemplate • IterativeRobotTemplate
Starting a Project • New • Example • VxWorks Downloadable Kernal Module Sample Project • FRC Default Program (Original factory image) • FRC Default Program (Current with imaging tool) • Other FRC-specific examples • Other generic Wind River examples
Default Frameworks • Simple Robot • Iterative Robot (not released yet) Code subdivided by modes (Init & Periodic) : • Disabled • Autonomous • Teleop
Basic C Program void Autonomous(void) { SetWatchdogEnabled(false); Drive(0.5, 0.0); Wait(2000); Drive(0.0, 0.0); } void OperatorControl(void) { SetWatchdogEnabled(true); while (IsOperatorControl()) { WatchdogFeed(); ArcadeDrive(JOYSTICK_PORT); } } START_ROBOT_CLASS(SimpleCRobot); #include "WPILib.h" #include "SimpleCRobot.h" #include "CRobotDrive.h" static const UINT32 LEFT_MOTOR_PORT = 1; static const UINT32 RIGHT_MOTOR_PORT = 2; static const UINT32 JOYSTICK_PORT = 1; void Initialize(void) { CreateRobotDrive(LEFT_MOTOR_PORT, RIGHT_MOTOR_PORT); SetWatchdogExpiration(100); }
Downloading vs. Debug • Download as a stand-alone application • Must reboot cRIO after Downloading for new code to take effect • Debug for temporary testing. It won’t last through rebooting • Sometimes rebooting is required to cleanup leftover extraneous code • Alternatively cleanup by deleting your cRIO .out task from Remote Systems window
Notes • Set the cRIO as a Wind River environment • Development is still underway, so expect the process and behavior to change somewhat • Installing only Wind River still requires some LabVIEW components to work • Printf - Right click the cRIO in the remote systems tab on the left, and in target tools, click on target console to view your printf statements.
Where to Find Further Information • C Programming Guide for FRC C:\WindRiver\docs\extensions\FRC • WPI Robotics Library Documentation http://users.wpi.edu/~bamiller/WPIRoboticsLibrary/ • Download WPILib Documentation: http://first.wpi.edu/Images/CMS/First/CProgrammingReference.chm Note: after download, right click on file for Properties & unblock to use • WPI Training Videos: http://first.wpi.edu/FRC/contro876.html • http://first.wpi.edu/Images/CMS/First/Tips_and_Tricks.pdf
Presentation slides at: Team358.org • Questions/Help please email Mark.McLeod@ngc.com