Go to Post CD threads are supposed to be about something? - Tim Baird [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 28-11-2015, 11:40
Cinnamon Toast's Avatar
Cinnamon Toast Cinnamon Toast is offline
Registered User
FRC #3641 (The Flying Toasters)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Michigan
Posts: 32
Cinnamon Toast is an unknown quantity at this point
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
Reply With Quote
  #2   Spotlight this post!  
Unread 28-11-2015, 20:46
slibert slibert is offline
Software Mentor
AKA: Scott Libert
FRC #2465 (Kauaibots)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2005
Location: Kauai, Hawaii
Posts: 343
slibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud of
Re: Integrating navx MXP into past Robot Project

Quote:
Originally Posted by Cinnamon Toast View Post
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>\navx-mxp\c++\lib (e.g., if your user name is Robot, the directory name will be C:\Users\Robot\navx-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.
Reply With Quote
  #3   Spotlight this post!  
Unread 30-11-2015, 11:21
Cinnamon Toast's Avatar
Cinnamon Toast Cinnamon Toast is offline
Registered User
FRC #3641 (The Flying Toasters)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Michigan
Posts: 32
Cinnamon Toast is an unknown quantity at this point
Re: Integrating navx MXP into past Robot Project

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")Click image for larger version

Name:	IDE.png
Views:	17
Size:	308.0 KB
ID:	19511
Reply With Quote
  #4   Spotlight this post!  
Unread 30-11-2015, 12:55
slibert slibert is offline
Software Mentor
AKA: Scott Libert
FRC #2465 (Kauaibots)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2005
Location: Kauai, Hawaii
Posts: 343
slibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud of
Re: Integrating navx MXP into past Robot Project

Quote:
Originally Posted by Cinnamon Toast View Post
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")Attachment 19511
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?

Last edited by slibert : 30-11-2015 at 13:01.
Reply With Quote
  #5   Spotlight this post!  
Unread 30-11-2015, 14:55
Cinnamon Toast's Avatar
Cinnamon Toast Cinnamon Toast is offline
Registered User
FRC #3641 (The Flying Toasters)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Michigan
Posts: 32
Cinnamon Toast is an unknown quantity at this point
Re: Integrating navx MXP into past Robot Project

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.Click image for larger version

Name:	Library Path.png
Views:	14
Size:	349.7 KB
ID:	19512
Reply With Quote
  #6   Spotlight this post!  
Unread 30-11-2015, 22:39
slibert slibert is offline
Software Mentor
AKA: Scott Libert
FRC #2465 (Kauaibots)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2005
Location: Kauai, Hawaii
Posts: 343
slibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud of
Re: Integrating navx MXP into past Robot Project

Quote:
Originally Posted by Cinnamon Toast View Post
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.Attachment 19512
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.
Reply With Quote
  #7   Spotlight this post!  
Unread 04-12-2015, 17:48
Cinnamon Toast's Avatar
Cinnamon Toast Cinnamon Toast is offline
Registered User
FRC #3641 (The Flying Toasters)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Michigan
Posts: 32
Cinnamon Toast is an unknown quantity at this point
Re: Integrating navx MXP into past Robot Project

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 .
Reply With Quote
  #8   Spotlight this post!  
Unread 06-12-2015, 12:20
BenGuy's Avatar
BenGuy BenGuy is offline
Co-Driver - 3641 - Flying Toasters
AKA: Ben
FRC #3641 (The Flying Toasters)
Team Role: Operator
 
Join Date: May 2014
Rookie Year: 2014
Location: South Lyon, Michigan
Posts: 218
BenGuy is a glorious beacon of lightBenGuy is a glorious beacon of lightBenGuy is a glorious beacon of lightBenGuy is a glorious beacon of lightBenGuy is a glorious beacon of lightBenGuy is a glorious beacon of light
Re: Integrating navx MXP into past Robot Project

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



Ben Wolak
The Flying Toasters Website

Team YouTube
Team Twitter

The real problem with computers is that they do what you tell them to do, not what you want them to do.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 14:04.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi