Changes between Version 3 and Version 4 of ControlSystems/SoftwareTeam/Training/GettingStarted/IntroRobotJava


Ignore:
Timestamp:
Oct 7, 2019, 10:05:32 PM (6 years ago)
Author:
David Albert
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ControlSystems/SoftwareTeam/Training/GettingStarted/IntroRobotJava

    v3 v4  
    3737Your program should look like [wiki://ControlSystems/IntroRobotJava/XboxExample this]
    3838
    39 Use the WPILib icon to build your new program: W->Build Robot Code
     39* Use the WPILib icon to build your new program: W->Build Robot Code
     40* Connect to the Peanut WiFi Hotspot
     41* Use the WPILib icon to deploy your program to the robot: W->Deploy Robot Code
     42* Launch the FRC Driver Station on your laptop.  Two windows should open: FRC Driver Station and FRC PC Dashboard.
     43* Plug in an x-box controller and make sure it is detected
     44* Make sure the Communications, Robot Code, and Joysticks LED icons are all green
     45* In the FRC PC Dashboard, select the Variables tab and scroll down to Smart Dashboard->Left Joystick X (that's the variable you created!)
     46* Move the left X-box joystick right and left and watch the value shown for Left Joystick X change!
    4047
    41 
    42 == Start with an example
    43 The best way to learn about robot programming a robot is to start with a simple example program, run it, study what it does, and incrementally expand its functionality.  The WPILib software you installed includes example programs that you can compile and run on a RoboRIO.  Review [https://wpilib.screenstepslive.com/s/currentCS/m/79833/l/941601-vs-code-basics-and-wpilib-in-vs-code how to use VSCode] and then try [https://wpilib.screenstepslive.com/s/currentCS/m/79833/l/932465-creating-a-new-wpilib-project-in-vs-code creating a new robot project].
     48You can even debug your program on the robot using the VSCode debugger just as you did with Java programs running on your laptop:
     49* Set a breakpoint on the line: xbox = new XboxController(0);
     50* Use the WPILib icon to start debugging: W->Debug Robot Code
     51* The program will run until it gets to that line and then stop.  Press the continue button to continue running.
     52* Even though the program is running on the robot, you can set breakpoints, step through code, examine and change variables, etc. from your laptop.
     53 
     54== Study some examples
     55Learn more about robot programming by studying some simple example programs.  Run them, study what they do, and incrementally expand their functionality.  The WPILib software you installed includes example programs that you can compile and run on a RoboRIO.  Review [https://wpilib.screenstepslive.com/s/currentCS/m/79833/l/941601-vs-code-basics-and-wpilib-in-vs-code how to use VSCode] and then try [https://wpilib.screenstepslive.com/s/currentCS/m/79833/l/932465-creating-a-new-wpilib-project-in-vs-code creating a new robot project].
    4456
    4557* WPILib provides [https://wpilib.screenstepslive.com/s/currentCS/m/java/l/599697-choosing-a-base-class 3 frameworks] for building robot programs.  Build your first program using the !TimedRobot (previously had been !IterativeRobot) framework as described [https://wpilib.screenstepslive.com/s/currentCS/m/java/l/145307-creating-your-benchtop-test-program here].
    4658
    47    * Connect your laptop to the RoboRIO USB port
     59   * Connect your laptop to the RoboRIO USB port or WiFi
    4860   * Connect your joystick or xbox controller to another USB port on your laptop
    4961   * Launch the NI Driver Station Software.  For details see [https://wpilib.screenstepslive.com/s/4485/m/24192/l/144976-frc-driver-station-powered-by-ni-labview here]
     
    5163   * Use Microsoft Internet Explorer (not Chrome or Firefox) to connect to the RoboRIO's web interface (usually at http://172.22.11.2) and confirm that you have connectivity with the RobORIO
    5264   * Create a test project and follow [https://wpilib.screenstepslive.com/s/currentCS/m/79833/l/932465-creating-a-new-wpilib-project-in-vs-code these instructions] to build, load, and run it on your RoboRIO/Robot
    53 
    54 **Congratulations**, you've just built and run your first robot program.
    5565
    5666* Create another WPILib project based on the !TimedRobot framework
     
    6373   * Copy the program below over the default Robot.java created by the framework
    6474   * Use the WPILib->Manage Vendor Libraries->Install New Libraries Offline->select the CTRE Framework
    65 * Sample code for Hazelnut (peanut robot) is [wiki:ControlSystems/SampleCode/Hazelnut here]
     75
     76* More sample code for Hazelnut (peanut robot) is [wiki:ControlSystems/SampleCode/Hazelnut here]
    6677* A sample program to use ultrasonic sensors is [wiki:ControlSystems/SampleCode/Ultrasonic here]
    6778* A sample program to use xbox controllers is [wiki:ControlSystems/SampleCode/XboxController here]