|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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
Code:
import com.kauailabs.navx.frc.AHRS; |
|
#2
|
|||
|
|||
|
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
|
|||
|
|||
|
Re: navX MXP Import Issue
Quote:
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 |
|
#4
|
|||
|
|||
|
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
|
||||||
|
||||||
|
Re: navX MXP Import Issue
Please post the build.properties of the project
|
|
#6
|
||||
|
||||
|
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:
|
|
#7
|
||||
|
||||
|
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
|
|||
|
|||
|
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
|
|
#9
|
|||
|
|||
|
Re: navX MXP Import Issue
Quote:
|
|
#10
|
|||
|
|||
|
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
|
||||||
|
||||||
|
Re: navX MXP Import Issue
Quote:
|
|
#12
|
|||
|
|||
|
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
|
||||
|
||||
|
Re: navX MXP Import Issue
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|