Not connecting XRPlib reference

I went through the XRPlib repo readme, and I was not entirely clear on build.gradle changes. It seemed like if you have the 2024 alpha, which I do, you wouldn’t need to modify it. However, running that sim I am not connecting to the robot. I’ll take any help to get it to connect.

Here is the console output that just keeps going on.

PS C:\Users\Panther Robotics\Documents\GitHub\XRProbot>  ${env:HALSIM_EXTENSIONS}='C:\Users\Panther Robotics\Documents\GitHub\XRProbot\build\jni\release\halsim_gui.dll;C:\Users\Panther Robotics\Documents\GitHub\XRProbot\build\jni\release\halsim_ws_client.dll;C:\Users\Panther Robotics\Documents\GitHub\XRProbot\build\jni\release\halsim_ws_server.dll;'; ${env:PATH}='C:\Users\Panther Robotics\Documents\GitHub\XRProbot\build\jni\release;C:\Windows\system32\'; ${env:HALSIMWS_HOST}='192.168.42.1'; ${env:HALSIMWS_FILTERS}='AIO,DIO,DriverStation,Encoder,Gyro,XRPMotor,XRPServo'; & 'C:\Users\Public\wpilib\2024\jdk\bin\java.exe' '-agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=localhost:54249' '@C:\Users\PANTHE~1\AppData\Local\Temp\cp_60wki2skbcq1kby55ufl1svvt.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_ws_client
HALSim WS Client Extension Initializing
HALSimWS Initialized
WS Message Filters:* "Encoder"
* "Gyro"
* "AIO"
* "XRPServo"
* "XRPMotor"
* "DIO"
* "DriverStation"
Will attempt to connect to ws://192.168.42.1:3300/wpilibws
HALSim WS Client Extension Initialized
HAL Extensions: Successfully loaded extension
Connection Attempt 1
HAL Extensions: Attempting to load: halsim_ws_server
Websocket WS Server Initializing.
Listening at http://localhost:3300
WebSocket URI: /wpilibws
WS Message Filters:* "Encoder"
* "Gyro"
* "AIO"
* "XRPServo"
* "XRPMotor"
* "DIO"
* "DriverStation"
Websocket WS Server Initialized!
HAL Extensions: Successfully loaded extension
********** Robot program starting **********
NT: Listening on NT3 port 1735, NT4 port 5810
NT: Got a NT4 connection from 127.0.0.1 port 54262
NT: CONNECTED NT4 client 'shuffleboard@1' (from 127.0.0.1:54262)
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 **********
Connection Attempt 2
Connection Attempt 3

There is still a bit of a firmware and xrplib mismatch between the alpha version and 0.5.0 firmwares. So I reverted to 0.4.0 firmware and was able to make the reference code run.

Hi there!

To use the 2024 Alpha 1 release of WPILib with the XRP, please try out this example, which has a correctly configured build.gradle: GitHub - bb-frc-workshops/xrp-2024-alpha-example (Note, I believe you’ll need to change the IP address in line 64 of build.gradle to 192.168.42.1)

Also use v0.5.1 of the XRP firmware, v0.5.0 had a bug in it with the ultrasonic sensor: Release XRP-WPILib Firmware v0.5.1 · wpilibsuite/xrp-wpilib-firmware · GitHub

Please let us know how it goes, we’d love to hear any feedback you have!

Edit:

Use the new 2024 Beta 1 release of WPILib, it has an example project for the XRP. More info here:

This worked!

I didn’t test the sensors, but the drive/servo worked as expected.

1 Like

I’m running into the same problems (I think) that ngreen reported, but slightly different manifestation.

I was able to connect and run some software while using the v0.4.0 firmware without having to make any changes to the “build.gradle” file, but after upgrading to the v0.5.1 firmware, I stopped being able to connect to the XRP.

First, I made the changes to the build.gradle file that are outlined at here, but then the build reported that it couldn’t find matching versions of the WPILib or the WPIMath resources to download.

After changing these from 2024.424242.+ to 2024.0.0-alpha-1, the code is able to once again build, but when I try to run the simulator, I get errors indicating:

Could not determine the dependencies of task ':extractReleaseNative'.
> Could not resolve all files for configuration ':simulationRelease'.
   > Could not find edu.wpi.first.halsim:halsim_xrp:2024.0.0-alpha-1.
     Searched in the following locations:
       - file:/Users/healym/releases/maven/development/edu/wpi/first/halsim/halsim_xrp/2024.0.0-alpha-1/halsim_xrp-2024.0.0-alpha-1.pom
       - https://frcmaven.wpi.edu/artifactory/release/edu/wpi/first/halsim/halsim_xrp/2024.0.0-alpha-1/halsim_xrp-2024.0.0-alpha-1.pom
       - https://repo.maven.apache.org/maven2/edu/wpi/first/halsim/halsim_xrp/2024.0.0-alpha-1/halsim_xrp-2024.0.0-alpha-1.pom
     Required by:
         project :

And checking the web sites listed, it’s quite correct that neither has anything for halsim_xrp. So either the instructions are out of date (e.g., for both the library version specifications and for the specification of the simulator library), or else the resources are missing from the web sites where they should be hosted.

So… Any help here?

A couple of things to try.
1 - The first time you run the program stay connected to the internet instead of the XRP. There are files that will need to download to get everything setup with the alpha build. Once it gets to the point of the simulator running, then you can quit and run again connected to the XRP.
2 - The other option is to install the alpha build. The advantage there is that there are now sample files for the XRP in that build. That build should be moved to beta around October 16 for the new season.

I was using the alpha build fyi.

Also, I should report that the XRP doesn’t always seem to reconnect when stopping & restarting the simulation. It will connect again after turning the XRP off and on again. (edit: I guess I could try the reset? button to start code again on the XRP, but I didn’t try that)

There were some other disconnections but I thought maybe it was just other wifi issues.

Re: option 1

I’ve tried remaining connected to the Internet, since I figured that it would need to download various files for the simulator, just as it did for the WPILib and WPI math support. However, I still get errors:

*  Executing task: ./gradlew simulateExternalJavaRelease   -Dorg.gradle.java.home="/Users/healym/wpilib/2024/jdk" 


FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':extractReleaseNative'.
> Could not resolve all files for configuration ':simulationRelease'.
   > Could not find edu.wpi.first.halsim:halsim_xrp:2024.0.0-alpha-1.
     Searched in the following locations:
       - file:/Users/healym/releases/maven/development/edu/wpi/first/halsim/halsim_xrp/2024.0.0-alpha-1/halsim_xrp-2024.0.0-alpha-1.pom
       - https://frcmaven.wpi.edu/artifactory/release/edu/wpi/first/halsim/halsim_xrp/2024.0.0-alpha-1/halsim_xrp-2024.0.0-alpha-1.pom
       - https://repo.maven.apache.org/maven2/edu/wpi/first/halsim/halsim_xrp/2024.0.0-alpha-1/halsim_xrp-2024.0.0-alpha-1.pom
     Required by:
         project :

And when I go to look at the frcmaven.wpi.edu and repo.maven.apache.org sites, I find that the former doesn’t have a halsim_xrp directory per the path specification being reported in the error (link to parent) and the latter doesn’t have anything from first under the “edu/wpi” path (link) but instead has only a “rail” subpath there.

Hence my comment that this resource appears to be missing from the web sites where the Alpha build of the WPILib software appears to be looking for them.


Re: option 2

The Alpha release of the WPILib software from first is what I’m already using, as I indicated in my prior post, since the release notes for the WPILib firmware for the XRP indicate that this must be done as of 19Sep2023.

For what it’s worth, I also tried re-installing the Alpha build, just in case. This (unfortunately) did not resolve the problems I’m seeing with the failures to find the halsim_xrp libraries for use with simulation when I follow the steps outlined in the notes for the XRP firmware.


I’m more than happy to help debug this, but at this point I’m not sure what the next steps would be: the library for the simulator simply isn’t at any of the locations that the build process is looking.

If you can tell me where it is available, I can at least download it manually and create the local path that is being searched (i.e., "$HOME/releases/maven/development/...). But that’s obviously only a short-term fix, and doesn’t really solve the issue.

And if the new (beta) build will be available in about 10 days, maybe that explains why the resources aren’t being found? Have they been moved in preparation for that update, unfortunately breaking things for those of us trying to get an early start with the XRPs?

Hi there! Yep, version 0.5.0 and up of the XRP-WPILib firmware have a completely different communication protocol to adjust to the limitations of the Pico W vs a full blown Raspberry Pi. As such, there’s a new WPILib HAL extension that’s required (which was not bundled in with alpha 1). This new extension will be available in the upcoming beta release.

If you want to try using the new module now, the build.gradle file that @SparkFro linked to above should have the necessary incantations to grab the right bits. Do note that you will need the 2024-alpha-1 version of WPILib AND the updated build.gradle file. If you’re having problems getting it working with those, could you post a copy of the build or other errors here and I ca. try to help diagnose.

Otherwise, beta incoming in a few days, and that should allow everything to work out of the box

Interesting.

The file pointed at by SparkFro contains a number of changes that are different from those specified in the firmware docs. For example, the versions specified for wpilibVersion and wpimathVersion are 2024.+, which I assume will pull down the “latest and greatest” versions of these libraries. (Versus my version of the file, which was first modified based on the directions in the notes on the firmware download page, and then modified further to try to fix library version specifications as indicated in my first note on this thread.)

This assumption appears to be confirmed by the fact that when I drop that file in as a replacement for my build.gradle file, the code generated by creating the “XRP Reference” project no longer builds, since it sets up things like the Drivetrain and Arm class to be derived from Subsystem, which is now an interface, rather than a class. (And looking at the rest of the code in the repo that SparkFro points at, the subsystems there are being derived from SubsystemBase, rather than Subsystem, which would seem to confirm that there’s definitely some “target moving” going on here.)

There’s also other differences to the configuration in that build.gradle file, such as the HALSIMXRP_HOST setting, etc.

At the least, this suggests that:

  1. The notes on the firmware download page on the changes to make to the build.gradle file are heavily out of date, and have been since at least late September.
  2. The code being generated by the 2024 Alpha 1 version of the WPILib tooling is also out of date (e.g., using System instead of SystemBase as base classes, as outlined above).
  3. I should therefore either (a) just clone SparkFro’s whole project as a starting point (rather than trying to modify the build.gradle being generated from the “XRP Reference” example), or else (b) simply wait until the Beta drop is available, and hope that things will then just work out of the box.

At this point, I’m simply going to stop beating my head against the wall, give up, and pick option (b), since trying to get things working with an Alpha version that is going to be replaced in something like a week is pointless.

Ahh ok. Yes, the docs on the repo need to be updated. I mistakenly copied over the wrong gradle incantations. The build probably also fails because Alpha 1 was published with a PR that deprecated use of SubsytemBase, but a later commit un-reverted it. As such, all the examples generated from alpha 1 would not work without changing all the subsystems to extend from SubsystemBase instead.

The beta should just work out of the box, and all the examples + gradle files have been updated as well, so generating a new project from beta should “just work”.

FYI if you use the new 2024 Beta 1 release of WPILib, it has an example project for the XRP. More info here:

Yup. Saw that, and am looking forward to taking things for a spin. (The changes to the handling the IMU and the removal of the on-board I/O subsystem were a little surprising.)

Unfortunately, the XRP I ordered came with a bad motor for one side, which limits my ability to fully check things out. The replacement motor has (allegedly :slight_smile: ) been sent out to me, and I’m hoping that it arrives soon.