Summer 2024 Robotics Course Preparation for XRP Robot

prepping for engr 197 297 summer robotics n.w
1 / 14
Embed
Share

Dive into the summer 2024 robotics course designed for the XRP robot connected via wifi. Get hands-on with assembling the robot, configuring the Raspberry Pi Pico, and setting up the robot's wifi network. Follow the step-by-step instructions to ensure your robot is ready for an exciting learning experience in robotics.

  • Robotics
  • XRP Robot
  • Summer 2024
  • Engineering
  • Wi-Fi

Uploaded on | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Prepping for ENGR 197/297 Summer Robotics Summer 2024 Prepared by Amy Pritchett The course plans are designed for the XRP robot running wpilib, connected through wifi (after initial imaging via a Micro- USB data cable) There are many ways to configure the robot, but please use the configuration specified here so that we re all on the same page

  2. Assemble Your Robot https://xrpusersguide.readthedocs.io/en/latest/cours e/building.html Assemble up to the point of mounting the arm to the servo. If you want to test your physical hardware, you can follow through all the remaining steps on the website/video. You ll need a MicroUSB cable not just any cable, but one that can handle DATA You ll be using the web-based IDE with Blockly or Python which will not be our default in the rest of the course

  3. Get the Right Image on the Raspberry Pi Pico (1/2) To program the robot using wpilib, it needs a different image on its processor than the default Step through the instructions for Imaging your XRP , copied here: Download: XRP-WPILib Firmware -> you should end up with .uf2 file in your downloads, or a zipfile from which you can extract the .uf2 REFERENCE: https://docs.wpilib.org/en/stable/docs/xrp- robot/hardware-and-imaging.html

  4. Get the Right Image on the Raspberry Pi Pico (2/2) Plug the XRP into your computer with a Micro-USB cable. You should see a red power LED that lights up. While holding the BOOTSEL button (the white button on the green Pico W, near the USB connector), quickly press the reset button (circled), and then release the BOOTSEL button. The board will temporarily disconnect from your computer, and then reconnect as a USB storage device named RPI-RP2. Drag the .uf2 firmware file into the RPI-RP2 drive, and it will automatically update the firmware. Once complete, the RPI-RP2 USB storage device will disconnect. At this point, you can disconnect the Micro-USB cable to run on battery power and connect via wifi (next 2 slides) BOOTSEL

  5. Configuring the XRPs Wifi SSID (1/2) Power on the XRP s board with the power switch On any computer near it geographically, look for its wifi, broadcasting with an SSID something like XRP- <something-something> -- and connect to that wifi (may have password xrp-wpilib ) This first time, until you set the SSID to something you recognize, do this far from other XRPs that are turned on so that you re sure you re connecting to your robot! Once on that network, put this url in the computer s browser: http://192.168.42.1:5000

  6. Configuring the XRPs Wifi SSID (2/2) If all is well, this url should bring up this page -> For operations within the classroom: Keep the mode on AP Rename your defaultAP SSID to something like XRP-<your name or initials> like I did Feel free to change the AP network password Outside the classroom, you can connect it to your home network if you want by changing the mode to STA and putting in networks in the networkList, etc. Definitive reference: https://docs.wpilib.org/en/stable/docs /xrp-robot/web-ui.html

  7. Prepping Your Laptop We will be programming in Java, using the only-slightly-modified-for-XRP-version of wpilib. Will look familiar to anyone who s programmed FRC Uses these classes instead of the FRC defaults: XRPGyro; XRPMotor; XRPServo; XRPOnBoardIO If you have a laptop you can bring to class, great! Anything you can do ahead of time to prep will be very helpful If you don t have a laptop you can bring to class, just let us know we ll try to scrounge up some things If you don t have a laptop but have a computer at home, you can follow the installation instructions so that you can program at home, if you want

  8. Installing the Software We will be programming in Java, using the only-slightly-modified-for-XRP-version of wpilib. Will look familiar to anyone who s programmed FRC Uses these classes instead of the FRC defaults: XRPGyro; XRPMotor; XRPServo; XRPOnBoardIO For this, we go to the Zero to Robot installation instructions for FRC, focusing on the following steps: <ignore anything referring to LabView, Python or C/C++ in the FRC documentation> <recall that you ll need to disconnect your computer s wifi from your robot back to internet to download the things below> Download the version of WPILib appropriate to your computer s operating system 2+GB! https://github.com/wpilibsuite/allwpilib/releases/tag/v2024.3.2 Step through the installation instructions appropriate to your computer s operating system: https://docs.wpilib.org/en/latest/docs/zero-to-robot/step-2/wpilib-setup.html The installer may ask you questions (depending on your OS): Install everything (not Tools Only ) Install for this User (Unless multiple people have separate accounts that they want to separately log into the same computer and program from and you have administrator privileges on the machine) Download for this computer only MacOS MacOS looks like there s some follow looks like there s some follow- -on instructions post on instructions post- -installation when you first open visual studio above above installation when you first open visual studio see the setup see the setup url url Once installed, you should see the WPILib VS Code desktop icon double click it and you re ready to program! The app should come up, looking like the next slide

  9. Creating a New WPILib XRP Project (1/4) Every different robot program we create can be a different project A project needs to cover the entire run of the robot If you want your robot to do something different in different runs, then make different projects Bring up the Visual Studio Code command palette with Ctrl+Shift+P, and type New project into the prompt. Select the Create a new project command:

  10. Creating a New WPILib XRP Project (2/4) This will bring up the New Project Creator Window . From here, click on Select a project type (Example or Template) , and pick Example from the prompt that appears and if it asks for the programming language, click Java : Next, a list of examples will appear. Scroll down to near the bottom of the list to find the XRP Reference example:

  11. Creating a New WPILib XRP Project (3/4) Fill out the rest of the fields in the New Project Creator whatever you want team number 1 ( we re number 1! ) Click Generate Project to create the new robot project.

  12. Creating a New WPILib XRP Project (4/4) And your project is there! See the file listing on the left these files are where we will be coding!

  13. Running an XRP Program on the Robot Once the robot project is generated, it is essentially ready to run. One aspect where an XRP project differs from a regular FRC robot project is that the code is not deployed directly to the XRP. Instead, an XRP project runs on your development computer and leverages the WPILib simulation framework to communicate with the XRP. To run an XRP program, first, ensure that your XRP is powered on. Next, connect to XRP-<IDENT> WiFi network broadcast by the XRP. Now to start your XRP robot code, open the WPILib Command Palette (type Ctrl+Shift+P) and select Simulate Robot Code , or press F5. If all goes well, you should see the simulation GUI pop up and see the gyro and accelerometer values updating. Your XRP code is now running! Doesn t do much yet, but we ll work on that

More Related Content