Integrating navx MXP into past Robot Project

Hey guys,

I was wondering if anyone has had any experience in integrating the navx into an old robot project. I’ve downloaded the setup tools for the library, installed them, and imported the examples into my project explorer of eclipse. Looking at the Robot.cpp file of the examples, i can see that that the code is not written in the Sample robot template, which is what I happen to be using at the time. The only difference that I see with the example and my old robot project is the inclusion of the AHRS.h library, which seems to handle the transfer of sensor data over whatever communication protocol of serial you choose. When trying to include that library in the old code, it obviously doesn’t find the library and tosses me some red flags. I know that I need to mess with properties to link that library to the project but I have exactly no idea how I would go about doing that. Any help is appreciated, and sorry if I don’t understand some things in advance!

-Ethan

After you run the setup program in the latest build .zip file, the navx_frc_cpp library is at <HomeDirectory>
avx-mxp\c++\lib (e.g., if your user name is Robot, the directory name will be C:\Users\Robot
avx-mxp\c++\lib).

The navx_frc_cpp library is dependent upon the wpi library, so the navx_frc_cpp library must be listed before the wpi library in the list in your project libraries tab.

You can add the navx_frc_cpp library and set the library order (in Eclipse) by bringing up the project properties, and then within the properties dialog selecting C/C++ General -> Paths and Symbols in the tree on the left. Next, within the Paths and Symbols pane, click on the libraries tab. You will need to have both the “navx_frc_cpp” and then the “wpi” libraries listed. After that rebuild.

Alright, I tried just adding the navx_frc_cpp to the paths and symbols tree, but that didn’t work when I went to try and build. Do I need to specify the path to the library under library paths too? Also, am I referencing the right library in the code itself (#include “AHRS.h”)







You will need to add the location of the library to the library paths.

I can’t quite read the error you are getting, can you please post that detail?

I’ve got the path to the library added as well, but that location doesn’t actually contain the AHRS.h file (that’s under the include folder). Here’s another screenshot.







Yes, as you found the Eclipse include path needs to be also modified to add the location of the AHRS.h file. Any time you link with a C++ library, you will need to provide both the library name and path as well as the include path for the header files which declare the interface to that library.

The navX-MXP FRC C++ Getting Started Page has been updated to include directions on how to do this, please review that and let me know if you have any more questions.

Silbert,

Thank you so much! I’ll for sure let you know if anything else puzzles me. You’ve already been a great help though :slight_smile: .

Obviously you just put the thing in the thing Ethan. And if that doesn’t work, add duct tape!