Unsatisfied Link Error when referencing REV 2 meter distance sensor

Hi all, my team has just moved up from FTC this year and is trying to use our old REV 2 meter distance sensors on the i2c ports on the roboRio. Thing is, when ever the program is deployed with the reference to the port on the board (distOnboard = new Rev2mDistanceSensor(Port.kOnboard0; ) we get an unsatisfied link error.


This is my first time seeing this error and I am not quite sure how to deal with it. Any help would be appreciated.

1 Like

How did you add the library to your project? E.g. did you follow the installation instructions to add it via VS Code’s Manage Vendor Libraries feature?

We have had this exact same error as well when using the sensor on certain projects but not others. I actually backlogged getting it working reliably because I was getting frustrated. For reference, I did follow the installation instructions that @Peter_Johnson linked.

The only way we can reproduce that exact issue is if the shared library file is not correctly deployed to the roboRIO. We are unable to replicate a case where the shared library does not deploy correctly, even if we ssh into the roboRIO and manually delete the library and re-deploy. Our test results are also the same if we do debug or deploy. Can you confirm that you extracted the entire .zip file?

You can manually check if the shared library is deployed if you can run ssh into the roboRIO the library is installed to /usr/local/frc/third-party/lib, if you run:

ls /usr/local/frc/third-party/lib

The output should contain libDistanceSensorDriver.so

If it’s not there, something is going wrong in the deploy step, if you can run gradle deploy with the --debug flag set and send us the output that would be helpful.

Thanks for the response! Now this just got super weird, after re-adding the library based off of the installation specified on the Rev github the actual rev example code managed to deploy to the robot and give us correct values but after trying to add in the same code to our own robot class, the error continued to persist. After this testing happened we went back to the rev example code and the error was back! I ssh-ed into the Rio and the libDistanceSensorDriver.so is there. So I’m not exactly sure what is causing the issue now.

here is a picture of the most recent error:

1 Like

I ran into a similar issue with the libDistanceSensorDriver.so not getting deployed to the RIO. I found the file did exist in the maven folder after I merged the SDK contents like the instructions said. What I found was in looking at the related Rev2mDistanceSensor.json file in the VendorDeps folder, there was a setting that I was suspicious of. In the cppDependencies section, the setting “SharedLibrary” was set to true. I changed it to false, saved and redeployed the code to the RIO. Now I have functioning robot code.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.