|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
CAN user code fails to load
When I use #include "../CANJaguar/CANJaguar.h" and try to use the CANJaguar class the code crashes:
Code:
task 0x1319f60 (wtxC5124tmp) deleted: errno=196709 (0x30065) status=45106 (0xb032) -> FPGA Hardware GUID: 0xAD9A5591CC64E4DF756D77D1B57A549E FPGA Software GUID: 0xAD9A5591CC64E4DF756D77D1B57A549E FPGA Hardware Version: 2010 FPGA Software Version: 2010 FPGA Hardware Revision: 1.3.0 FPGA Software Revision: 1.3.0 * Loading StartupDlls: FRC_BlackJagBridgePlugin FRC_BlackJagBridgePlugin was compiled from SVN revision 10 task 0x1d6ae78 (t2) deleted: errno=0 (0) status=0 (0) * Loading StartupDlls: FRC_UserProgram NI-VISA Server 4.5 started successfully. task 0xe416d0 (t1) deleted: errno=1835009 (0x1c0001) status=1 (0x1) Warning: module 0x131b170 (FRC_UserProgram.out) holds reference to undefined symbol _ ZN9CANJaguarD1Ev. Warning: module 0x131b170 (FRC_UserProgram.out) holds reference to undefined symbol _ ZN9CANJaguarC1EhNS_11ControlModeE. Warning: module 0x131b170 (FRC_UserProgram.out) holds reference to undefined symbol _ ZN9CANJaguar3SetEf. (unloading partially loaded module FRC_UserProgram.out) ...FRC_UserProgram failed to load. Welcome to LabVIEW Real-Time 8.6.1f2 |
|
#2
|
|||
|
|||
|
Re: CAN user code fails to load
It looks like the actual CANJaguar class isn't in your project. You added the cpp files to your project as well as the h files, right?
EDIT: Your problem is you put the CANJaguar code as a separate project. The actual code isn't being built with your user code. If you put a folder reference in your project the the CANJaguar folder it should work, or you could just copy the files directly into your project (that's what we do) Last edited by Radical Pi : 17-02-2010 at 23:18. |
|
#3
|
||||
|
||||
|
Re: CAN user code fails to load
I put the files in the project, and all of a sudden these errors popped up:
Code:
Build Started in Project 'Breakaway': 2010-02-17 20:35:30 Generation of makefiles started. Generation of makefiles finished (Elapsed Time: 00:00). Platform: Wind River VxWorks 6.3 Command: make --no-print-directory BUILD_SPEC=PPC603gnu DEBUG_MODE=1 TRACE=1 clean all Working Directory: D:/Eric/Documents/Projects/Robotics/workspace2/Breakaway/PPC603gnu make: removing targets and objects of D:/Eric/Documents/Projects/Robotics/workspace2/Breakaway/PPC603gnu if [ -d "Breakaway" ]; then cd "Breakaway"; rm -rf Debug; fi if [ -d "Breakaway_partialImage" ]; then cd "Breakaway_partialImage"; rm -rf Debug; fi if [ ! -d "`dirname "Breakaway_partialImage/Debug/Objects/Breakaway/CANJaguar.o"`" ]; then mkdir -p "`dirname "Breakaway_partialImage/Debug/Objects/Breakaway/CANJaguar.o"`"; fi;echo "building Breakaway_partialImage/Debug/Objects/Breakaway/CANJaguar.o"; ccppc -g -mcpu=603 -mstrict-align -mno-implicit-fp -mlongcall -ansi -Wall -MD -MP -mlongcall -IC:/WindRiver/vxworks-6.3/target/h -I../CANJaguar -IC:/WindRiver/vxworks-6.3/target/h/WPILib -IC:/WindRiver/vxworks-6.3/target/h/wrn/coreip -DCPU=PPC603 -DTOOL_FAMILY=gnu -DTOOL=gnu -D_WRS_KERNEL -o "Breakaway_partialImage/Debug/Objects/Breakaway/CANJaguar.o" -c "D:/Eric/Documents/Projects/Robotics/workspace2/Breakaway/CANJaguar.cpp" building Breakaway_partialImage/Debug/Objects/Breakaway/CANJaguar.o In file included from D:/Eric/Documents/Projects/Robotics/workspace2/Breakaway/CANJaguar.cpp:3: C:/WindRiver/vxworks-6.3/target/h/WPILib/ChipObject/NiRioStatus.h:13: error: `tNIRIO_i32' does not name a type C:/WindRiver/vxworks-6.3/target/h/WPILib/ChipObject/NiRioStatus.h:16: error: `tRioStatusCode' does not name a type C:/WindRiver/vxworks-6.3/target/h/WPILib/ChipObject/NiRioStatus.h:19: error: `tRioStatusCode' does not name a type ... There's a hundred similar lines... ... C:/WindRiver/vxworks-6.3/target/h/WPILib/ChipObject/NiRioStatus.h:287: error: `tRioStatusCode' does not name a type C:/WindRiver/vxworks-6.3/target/h/WPILib/ChipObject/NiRioStatus.h:293: error: expected `,' or `...' before "status" C:/WindRiver/vxworks-6.3/target/h/WPILib/ChipObject/NiRioStatus.h:294: error: ISO C++ forbids declaration of `tRioStatusCode' with no type C:/WindRiver/vxworks-6.3/target/h/WPILib/ChipObject/NiRioStatus.h: In function `bool rioStatusIsFatal(int)': C:/WindRiver/vxworks-6.3/target/h/WPILib/ChipObject/NiRioStatus.h:295: error: `status' undeclared (first use this function) C:/WindRiver/vxworks-6.3/target/h/WPILib/ChipObject/NiRioStatus.h:295: error: (Each undeclared identifier is reported only once for each function it appears in.) C:/WindRiver/vxworks-6.3/target/h/WPILib/ChipObject/NiRioStatus.h: At global scope: C:/WindRiver/vxworks-6.3/target/h/WPILib/ChipObject/NiRioStatus.h:298: error: expected `,' or `...' before "status" C:/WindRiver/vxworks-6.3/target/h/WPILib/ChipObject/NiRioStatus.h:299: error: ISO C++ forbids declaration of `tRioStatusCode' with no type C:/WindRiver/vxworks-6.3/target/h/WPILib/ChipObject/NiRioStatus.h: In function `bool rioStatusIsNotFatal(int)': C:/WindRiver/vxworks-6.3/target/h/WPILib/ChipObject/NiRioStatus.h:300: error: `status' undeclared (first use this function) C:/WindRiver/vxworks-6.3/target/h/WPILib/ChipObject/NiRioStatus.h: At global scope: C:/WindRiver/vxworks-6.3/target/h/WPILib/ChipObject/NiRioStatus.h:306: error: expected `,' or `...' before "newStatus" C:/WindRiver/vxworks-6.3/target/h/WPILib/ChipObject/NiRioStatus.h:307: error: ISO C++ forbids declaration of `tRioStatusCode' with no type C:/WindRiver/vxworks-6.3/target/h/WPILib/ChipObject/NiRioStatus.h: In function `T& rioSetStatus(T&, int)': C:/WindRiver/vxworks-6.3/target/h/WPILib/ChipObject/NiRioStatus.h:308: error: `newStatus' undeclared (first use this function) D:/Eric/Documents/Projects/Robotics/workspace2/Breakaway/CANJaguar.cpp: In member function `void CANJaguar::InitJaguar()': D:/Eric/Documents/Projects/Robotics/workspace2/Breakaway/CANJaguar.cpp:31: error: `kRIOStatusVersionMismatch' undeclared (first use this function) C:\WindRiver\vxworks-6.3\host\x86-win32\bin\make.exe: *** [Breakaway_partialImage/Debug/Objects/Breakaway/CANJaguar.o] Error 1 Build Failed in Project 'Breakaway' (Process Exit Value was 2): 2010-02-17 20:35:32 (Elapsed Time: 00:02) |
|
#4
|
||||
|
||||
|
Re: CAN user code fails to load
These are well known errors. You need to include the following line into your CANJaguar.cpp code just above the #include "ChipObject/NiRioStatus.h"
#include "ChipObject/NiRio.h" This will make the compile errors go away. HTH, Mike |
|
#5
|
||||
|
||||
|
Re: CAN user code fails to load
That worked, thanks.
The robot reports this runtime error via console: Code:
>>>>ERROR: status == -52010 (0xFFFF34D6) in sendMessage() in D:/Eric/Documents/Projects/Robotics/workspace2/Breakaway/CANJaguar.cpp at line 176 Code:
<Code>-52010 ERROR: status == -52010 (0xFFFF34D6) in sendMessage() in D:/Eric/Documents/Projects/Robotics/workspace2/Breakaway/CANJaguar.cpp at line 176 NI Platform Services: The requested resource must be initialized before use. Last edited by unobtainium-42 : 18-02-2010 at 19:49. |
|
#6
|
|||
|
|||
|
Re: CAN user code fails to load
You need something in your code similar to
CANJaguar* Motor = new CANJaguar(3,CANJaguar::kPercentVoltage); The 3 is the CANBus id, and the second arguement is a enum for the type of controls. Put this in your initialization. Of course change the name motor to the nameof your variables. If you have this, post snipets of your code. Also make sure you set CAN IDs to each jaguar. If any 2 share a ID, the bus gets confused. I know you said you set them, but I have had my jaguars reset their IDs for no apparent reason. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Robot code won't load | RevusHarkings | C/C++ | 3 | 18-02-2010 15:19 |
| Downloading Default Code Fails | 1951-44U | Java | 3 | 30-01-2010 11:55 |
| Code runs only once, fails on reset | roknjohn | Programming | 7 | 21-02-2005 20:24 |
| Code suddenly fails to initialize | miketwalker | Programming | 11 | 19-02-2005 15:23 |
| Can we load 2004 code? | colt527 | Programming | 5 | 15-02-2005 19:48 |