Good morning everyone.
I was able to control the XRP robot with a USB joystick using the latest firmware (v0.5.1) on the controller board and the latest WPILib (2024.1.1 Beta). I used the provided example | java | XRP reference project from WPILib.
Note: I ran the “XRP-2024-alpha example main” example and it provided similar errors in Nelson’s posting.
Great job to ZeeQueue and team. Thank you.
I hope that the following instructions are helpful.
How to build the latest WPI Lib Environment for the XRP Robot?
How to update the firmware on the XRP robot
-
Download the latest wpilib firmware: Release XRP-WPILib Firmware v0.5.1 · wpilibsuite/xrp-wpilib-firmware · GitHub
-
Plug the micro USB cable from the XRP robot to the computer
-
Press and hold the BootSEL button and press and release the Reset button on the controller board.
-
RPI RP2 folder will appear as a drive on your computer.
-
Drag the xrp-wpilib-firmware-0.5.1.uf2 file to the RPI RP2 drive.
-
Wait a minute or two.
-
The XRP robot will act as an access point. In your internet connections, you will see a SSID network of XRP-xxxx-xxxx.
-
Disconnect the micro USB cable from the XRP robot.
How to install the latest WPI Lib Environment?
-
Download the latest WPILib environment: Release WPILib 2024.1.1 Beta 1 Release · wpilibsuite/allwpilib · GitHub
-
Right click the WPILib_Windows-2024.1.1-beta-1.iso file and select
Mount. Press Open. -
Double click onto the WPILibInstaller.exe file.
-
Press Start
-
Select Everything and press Install for this User
Note:
Tools Only installs just the WPILib tools (Pathweaver, Shuffleboard, RobotBuilder, SysID, Glass, and OutlineViewer) and JDK.
Everything installs the full development environment (VS Code, extensions, all dependencies), WPILib tools, and JDK.
- Press Download for this computer only (fastest).
This will begin the download process and can take a bit depending on internet connectivity (it’s ~100MB). Once the download is done, press Next. You should be presented with a screen that looks similar to the one below.
- After installation is complete, you will be presented with the finished screen. Press Finish.
How to use a joystick to teleoperate (human driver) the XRP robot?
-
Connect to your Wi-Fi network with Internet access.
-
Place the 4 AA batteries into the XRP robot and turn the power switch to on
-
Run the 2024 WPILib VS Code by double clicking onto the icon.
-
Press Ctrl + Shift + P, type WPILib: Create a new project.
-
Select example, java and XRP Reference and fill in the remaining information (e.g., base folder, project name, team number). Press Generate Project. Select Open project in new window.
-
Connect the USB joystick to your computer.
-
Press F5 to build the project and download any required packages and libraries as required.
PS C:\FRCXRP\2024beta_example_java_xrp_reference> c:; cd ‘c:\FRCXRP\2024beta_example_java_xrp_reference’; ${env:HALSIM_EXTENSIONS}=‘C:\FRCXRP\2024beta_example_java_xrp_reference\build\jni\release\halsim_gui.dll;C:\FRCXRP\2024beta_example_java_xrp_reference\build\jni\release\halsim_xrp.dll;’; ${env:PATH}='C:\FRCXRP\2024beta_example_java_xrp_reference\build\jni\release;C:\WINDOWS\system32'; ${env:HALSIMXRP_HOST}=‘192.168.42.1’; & ‘C:\Users\Public\wpilib\2024\jdk\bin\java.exe’ ‘-agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=localhost:50692’ ‘@C:\Users\sfong\AppData\Local\Temp\cp_7f5j6bw2u7b3xe0u8wf0bas0k.argfile’ ‘frc.robot.Main’
HAL Extensions: Attempting to load: halsim_gui
Simulator GUI Initializing.
Simulator GUI Initialized!
HAL Extensions: Successfully loaded extension
HAL Extensions: Attempting to load: halsim_xrp
HALSim XRP Extension Initializing
HALSimXRP Initialized
HALSim XRP Extention Initialized
HAL Extensions: Successfully loaded extension
********** Robot program starting **********
NT: Listening on NT3 port 1735, NT4 port 5810
Warning at edu.wpi.first.wpilibj.DriverStation.reportJoystickUnpluggedWarning(DriverStation.java:1343): Joystick Button 1 on port 0 not available, check if controller is plugged in
********** Robot program startup complete **********
- In the Simulator, drag joystick 0 (wireless controller) from the System Joysticks window to the Joystick[0] position in the Joysticks window. Move the joysticks to confirm that the values change in the axis.
Note : Uncheck mark the Map gamepad option**.**
-
Close the Simulator
-
Turn on the XRP robot.
-
Connect to the XRP robot’s network. Please use the following information.
Chip ID: xxxx-xxxx
Wi-Fi Mode: AP
AP SSID: XRP-xxxx-xxxx
AP PASS: xrp-wpilib
IP Address: 192.168.42.1
Press F5 to build the project.
-
Select the Teleoperated mode in the top left window.
-
Start driving the XRP robot using your USB joystick. Enjoy!
Note : In the DIO window, 0 is set to low – In[0] and 1 is set to high – Out[1].
Steven