Go to Post In FIRST, you can either have comfortable safety margins or you can have a competitive robot, you can't have both. - Joe Johnson [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 19-01-2016, 21:15
ejscribner ejscribner is offline
Drive Team & Coach
FRC #2972
 
Join Date: Jan 2016
Rookie Year: 2013
Location: Boulder, CO
Posts: 15
ejscribner is an unknown quantity at this point
navX MXP Import Issue

I'm working on setting up the navX on Java with our roboRIO. I've followed the steps listed in this tutorial http://www.pdocs.kauailabs.com/navx-...ibraries/java/ and I'm still getting an error with the import. Here's what the error is saying:
Code:
Buildfile: C:\Users\Developer\Documents\GitHub\DeltaBot\build.xml
Trying to override old definition of task classloader
clean:
   [delete] Deleting directory C:\Users\Developer\Documents\GitHub\DeltaBot\build
compile:
    [mkdir] Created dir: C:\Users\Developer\Documents\GitHub\DeltaBot\build
     [echo] [athena-compile] Compiling src with classpath=C:\Users\Developer/wpilib/java/current/lib/WPILib.jar:C:\Users\Developer/wpilib/java/current/lib/NetworkTables.jar to build
    [javac] Compiling 1 source file to C:\Users\Developer\Documents\GitHub\DeltaBot\build
    [javac] C:\Users\Developer\Documents\GitHub\DeltaBot\src\org\usfirst\frc\team2972\robot\Robot.java:22: error: package com.kauailabs.navx.frc does not exist
    [javac] import com.kauailabs.navx.frc.AHRS;
    [javac]                              ^
    [javac] C:\Users\Developer\Documents\GitHub\DeltaBot\src\org\usfirst\frc\team2972\robot\Robot.java:33: error: cannot find symbol
    [javac]     AHRS ahrs;
    [javac]     ^
    [javac]   symbol:   class AHRS
    [javac]   location: class Robot
    [javac] C:\Users\Developer\Documents\GitHub\DeltaBot\src\org\usfirst\frc\team2972\robot\Robot.java:54: error: cannot find symbol
    [javac] 	           ahrs = new AHRS(SPI.Port.kMXP);  
    [javac] 	                      ^
    [javac]   symbol:   class AHRS
    [javac]   location: class Robot
    [javac] C:\Users\Developer\Documents\GitHub\DeltaBot\src\org\usfirst\frc\team2972\robot\Robot.java:169: error: package AHRS does not exist
    [javac] 	          AHRS.BoardYawAxis yaw_axis = ahrs.getBoardYawAxis(); 
    [javac] 	              ^
    [javac] 4 errors

BUILD FAILED
C:\Users\Developer\wpilib\java\current\ant\build.xml:69: Compile failed; see the compiler error output for details.

Total time: 3 seconds
And my import line looks like this:
Code:
import com.kauailabs.navx.frc.AHRS;
Any ideas as to what may be causing this error?
  #2   Spotlight this post!  
Unread 19-01-2016, 21:21
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: 359
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: navX MXP Import Issue

I believe a step or two in the java library configuration instructions was missed, specifically these one:

1) Add a Java Build Variable for the navX-MXP Java Library. To set the build variable, from the Eclipse menu select Window->Preferences->Java->Build Path->Classpath Variables, then click on the “New…” button. Then, in the “New Variable Entry” dialog, set the name to “navx-mxp” and set the Path to <HomeDirectory>\navx-mxp\java\lib\navx_frc.jar. Hit OK to save this change.

and...

2) Ensure that your project’s library paths include the navx-mxp variable, as well as WPI library path variables (networktables and wpilib). If any are missing, you can add them by clicking on the “Add Variable…” button.

If either the "navx-mxp" build variable is not present in the Eclipse Java ClassPath Variables settings - or if your project's library paths do not include this "navx-mxp" variable, the error message you have reported is the very likely result.
  #3   Spotlight this post!  
Unread 19-01-2016, 21:31
ejscribner ejscribner is offline
Drive Team & Coach
FRC #2972
 
Join Date: Jan 2016
Rookie Year: 2013
Location: Boulder, CO
Posts: 15
ejscribner is an unknown quantity at this point
Re: navX MXP Import Issue

Quote:
Originally Posted by slibert View Post
I believe a step or two in the java library configuration instructions was missed, specifically these one:

1) Add a Java Build Variable for the navX-MXP Java Library. To set the build variable, from the Eclipse menu select Window->Preferences->Java->Build Path->Classpath Variables, then click on the “New…” button. Then, in the “New Variable Entry” dialog, set the name to “navx-mxp” and set the Path to <HomeDirectory>\navx-mxp\java\lib\navx_frc.jar. Hit OK to save this change.

and...

2) Ensure that your project’s library paths include the navx-mxp variable, as well as WPI library path variables (networktables and wpilib). If any are missing, you can add them by clicking on the “Add Variable…” button.

If either the "navx-mxp" build variable is not present in the Eclipse Java ClassPath Variables settings - or if your project's library paths do not include this "navx-mxp" variable, the error message you have reported is the very likely result.
Thanks for your response! I've followed those steps and its still throwing that error. My thought is that there might be an issue with the classpath in the usage of slashes. Does it matter if they are forward or backslashes? It only seems to let me input forward slashes when I'm adding the classpath (it changes backslashes to forward slashes when I save it) but the error output seems all squirly with half forward and half backslashes as follows:

Code:
     [echo] [athena-compile] Compiling src with classpath=C:\Users\Developer/wpilib/java/current/lib/WPILib.jar:C:\Users\Developer/wpilib/java/current/lib/NetworkTables.jar to build
Do you think this may be a factor in the error?
  #4   Spotlight this post!  
Unread 19-01-2016, 22:24
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: 359
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: navX MXP Import Issue

I don't believe the forward slashes is where the problem lies.

The navx-mxp.jar file should be in the classpath. However, I don't see it listed in the classpath in your latest message (although I do see the WPI library .jar and I do see Networktables.jar). So I think the problem is that when eclipse builds your project, it can't find navx-mxp.jar. And that is confirmed by the complaint that it can't locate the AHRS class, which is contained within the navx-mxp.jar library.
  #5   Spotlight this post!  
Unread 19-01-2016, 22:37
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,600
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: navX MXP Import Issue

Please post the build.properties of the project
  #6   Spotlight this post!  
Unread 20-01-2016, 12:20
fovea1959's Avatar
fovea1959 fovea1959 is offline
Herder of programmers
AKA: Doug Wegscheid
FRC #3620 (The Average Joes)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2011
Location: St Joseph
Posts: 336
fovea1959 will become famous soon enough
Re: navX MXP Import Issue

since the navx jar is not showing up in the classpath, it looks like the build.properties is not set up correctly.

Quote:
[echo] [athena-compile] Compiling src with classpath=C:\Users\Developer/wpilib/java/current/lib/WPILib.jar:C:\Users\Developer/wpilib/java/current/lib/NetworkTables.jar to build
  #7   Spotlight this post!  
Unread 20-01-2016, 12:34
Joey1939's Avatar
Joey1939 Joey1939 is offline
Registered User
AKA: Joey Holliday
FRC #1939 (Kuhnigits)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Kansas City, Missouri
Posts: 144
Joey1939 has a spectacular aura aboutJoey1939 has a spectacular aura aboutJoey1939 has a spectacular aura about
Re: navX MXP Import Issue

I believe the issue is that WPILib doesn't know where to find the navx jar file. You must configure the build.properties as shown here.
__________________


  #8   Spotlight this post!  
Unread 20-01-2016, 17:10
ejscribner ejscribner is offline
Drive Team & Coach
FRC #2972
 
Join Date: Jan 2016
Rookie Year: 2013
Location: Boulder, CO
Posts: 15
ejscribner is an unknown quantity at this point
Re: navX MXP Import Issue

The build.properties seems to be setup correctly according to the FRC tutorial on adding 3rd party libraries:
Code:
# Project specific information
package=org.usfirst.frc.team2972.robot
robot.class=${package}.Robot
simulation.world.file=/usr/share/frcsim/worlds/GearsBotDemo.world
userLibs=${user.home}/navx-mxp/java/lib/navx_frc.jar
Is there another issue that could potentially be affecting the classpath?
  #9   Spotlight this post!  
Unread 20-01-2016, 18:25
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: 359
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: navX MXP Import Issue

Quote:
Originally Posted by ejscribner View Post
The build.properties seems to be setup correctly according to the FRC tutorial on adding 3rd party libraries:
Code:
# Project specific information
package=org.usfirst.frc.team2972.robot
robot.class=${package}.Robot
simulation.world.file=/usr/share/frcsim/worlds/GearsBotDemo.world
userLibs=${user.home}/navx-mxp/java/lib/navx_frc.jar
Is there another issue that could potentially be affecting the classpath?
Are you sure you have installed the latest, released version of the WPI Libraries (installed by updating to the latest WPI plugins in eclipse)? The 2015 WPI library, and the 2016 betas, did not include the userLibs parameter. But the 2016 release version does. So I'd recommend you check your versions.
  #10   Spotlight this post!  
Unread 20-01-2016, 18:59
ejscribner ejscribner is offline
Drive Team & Coach
FRC #2972
 
Join Date: Jan 2016
Rookie Year: 2013
Location: Boulder, CO
Posts: 15
ejscribner is an unknown quantity at this point
Re: navX MXP Import Issue

I checked Eclipse and found that someone had turned off automatic updates, and so I did have an older version of the WPI Libraries, however after updating I am still confronted with the same error messages. Is it possible Eclipse did not update to the true current version?
  #11   Spotlight this post!  
Unread 20-01-2016, 20:58
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,600
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: navX MXP Import Issue

Quote:
Originally Posted by ejscribner View Post
I checked Eclipse and found that someone had turned off automatic updates, and so I did have an older version of the WPI Libraries, however after updating I am still confronted with the same error messages. Is it possible Eclipse did not update to the true current version?
Does it match the version listed here: http://wpilib.screenstepslive.com/s/...ware-revisions
  #12   Spotlight this post!  
Unread 21-01-2016, 17:58
ejscribner ejscribner is offline
Drive Team & Coach
FRC #2972
 
Join Date: Jan 2016
Rookie Year: 2013
Location: Boulder, CO
Posts: 15
ejscribner is an unknown quantity at this point
Re: navX MXP Import Issue

Our Java plugin version is (0.1.0.201601151923) which is listed as the latest version, but the kickoff version seems to be more recent (0.1.0.201601072029). When press the update button in eclipse it says that no updates were found, but if ours is the ...23 version and there is a newer ...29 version, shouldn't it find that version and update or am I missing something? Is ...23 more recent than ...29?
  #13   Spotlight this post!  
Unread 21-01-2016, 18:16
Thad House Thad House is offline
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,107
Thad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond repute
Re: navX MXP Import Issue

Quote:
Originally Posted by ejscribner View Post
Our Java plugin version is (0.1.0.201601151923) which is listed as the latest version, but the kickoff version seems to be more recent (0.1.0.201601072029). When press the update button in eclipse it says that no updates were found, but if ours is the ...23 version and there is a newer ...29 version, shouldn't it find that version and update or am I missing something? Is ...23 more recent than ...29?
The whole last number is a date string, so 201601072029 was built on January 7th, whereas 201601151923 was built on January 15th. So you do have the newest version.
__________________
All statements made are my own and not the feelings of any of my affiliated teams.
Teams 1510 and 2898 - Student 2010-2012
Team 4488 - Mentor 2013-2016
Co-developer of RobotDotNet, a .NET port of the WPILib.
  #14   Spotlight this post!  
Unread 21-01-2016, 18:36
ejscribner ejscribner is offline
Drive Team & Coach
FRC #2972
 
Join Date: Jan 2016
Rookie Year: 2013
Location: Boulder, CO
Posts: 15
ejscribner is an unknown quantity at this point
Re: navX MXP Import Issue

Okay so we know the eclipse plugins are up to date. My error message has changed slightly to reflect that it is finding some sort of navX library, or at least its looking for one, as you can see below:

Code:
     [echo] [athena-compile] Compiling src with classpath=C:\Users\Developer/wpilib/java/current/lib/WPILib.jar:C:\Users\Developer/wpilib/java/current/lib/NetworkTables.jar:C:\Users\Developer
     [echo] avx-mxpjavalib
     [echo] avx_frc.jar to build
So now its looking for something in C:\Users\Developer\avx-mxpjavalib or \avx_frc.jar so I can clearly see that something is misspelled due to the "avx" instead of "navx" but I cant seem to find where it is misspelled. Where do I edit the filepath for this so that it is correct?
  #15   Spotlight this post!  
Unread 21-01-2016, 18:47
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: 359
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: navX MXP Import Issue

Quote:
Originally Posted by ejscribner View Post
Okay so we know the eclipse plugins are up to date. My error message has changed slightly to reflect that it is finding some sort of navX library, or at least its looking for one, as you can see below:

Code:
     [echo] [athena-compile] Compiling src with classpath=C:\Users\Developer/wpilib/java/current/lib/WPILib.jar:C:\Users\Developer/wpilib/java/current/lib/NetworkTables.jar:C:\Users\Developer
     [echo] avx-mxpjavalib
     [echo] avx_frc.jar to build
So now its looking for something in C:\Users\Developer\avx-mxpjavalib or \avx_frc.jar so I can clearly see that something is misspelled due to the "avx" instead of "navx" but I cant seem to find where it is misspelled. Where do I edit the filepath for this so that it is correct?
OK, we're making progress - now that you've got the correct WPI library version, the build is attempting to link to the navx library. But it appears that the path is wrong:

Here's what you entered in your build.properties:

userLibs=${user.home}/navx-mxp/java/lib/navx_frc.jar

But it appears that when eclipse is building, each time the "/n" characters are encountered, those characters are being treated as a new-line character.

It's interesting to note that the \n sequence (where \ is an 'escape' character) translates to an ascii new-line character, which is what eclipse appear to be outputting.

This is likely a system-specific configuration issue, and I'm going to recommend trying it on another system - or else identifying what it is in your system that is interpreting "/n" in file system paths as a new line character. I've see this kind of thing happen sometimes if a package like Cygwin is installed, although I can't remember the details off of the top of my head.
Closed Thread


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 03:18.

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