Go to Post It's rather simple: you start with a block of solid and remove material until you just have the robot left. Kind of like making a sandcastle. Only harder. - petek [more]
Home
Go Back   Chief Delphi > Technical > Electrical > CAN
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 17-02-2010, 22:43
unobtainium-42's Avatar
unobtainium-42 unobtainium-42 is offline
Team President
AKA: Eric Eaton
FRC #0670 (Homestead Robotics Team)
Team Role: Engineer
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Sunnyvale, CA
Posts: 24
unobtainium-42 is an unknown quantity at this point
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
The code compiles with no warnings or errors. I am not using 2CAN, I am using a custom serial connector to the Black jaguar. BDC-COMM works. I updated the firmware and set their board IDs.
Reply With Quote
  #2   Spotlight this post!  
Unread 17-02-2010, 23:14
Radical Pi Radical Pi is offline
Putting the Jumper in the Bumper
AKA: Ian Thompson
FRC #0639 (Code Red Robotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York
Posts: 655
Radical Pi has a spectacular aura aboutRadical Pi has a spectacular aura aboutRadical Pi has a spectacular aura about
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)
__________________

"To have no errors would be life without meaning. No strugle, no joy"
"A network is only as strong as it's weakest linksys"

Last edited by Radical Pi : 17-02-2010 at 23:18.
Reply With Quote
  #3   Spotlight this post!  
Unread 17-02-2010, 23:37
unobtainium-42's Avatar
unobtainium-42 unobtainium-42 is offline
Team President
AKA: Eric Eaton
FRC #0670 (Homestead Robotics Team)
Team Role: Engineer
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Sunnyvale, CA
Posts: 24
unobtainium-42 is an unknown quantity at this point
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)
Did I forget to include something? More importantly, why didn't this happen before?
Reply With Quote
  #4   Spotlight this post!  
Unread 18-02-2010, 17:47
taichichuan's Avatar
taichichuan taichichuan is offline
Software Mentor
AKA: Mike Anderson
FRC #0116 (Epsilon Delta)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Herndon, VA
Posts: 328
taichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud of
Send a message via AIM to taichichuan
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
Reply With Quote
  #5   Spotlight this post!  
Unread 18-02-2010, 19:40
unobtainium-42's Avatar
unobtainium-42 unobtainium-42 is offline
Team President
AKA: Eric Eaton
FRC #0670 (Homestead Robotics Team)
Team Role: Engineer
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Sunnyvale, CA
Posts: 24
unobtainium-42 is an unknown quantity at this point
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
And via DS:

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.
All I do is instantiate CANJaguar objects, like the example. Is there any document I should be reading while doing this? If the error's well known, how was I supposed to find out?

Last edited by unobtainium-42 : 18-02-2010 at 19:49.
Reply With Quote
  #6   Spotlight this post!  
Unread 19-02-2010, 00:28
simpsonboy77 simpsonboy77 is offline
Registered User
AKA: Garrett Dicken
FRC #0041 (RoboWarriors)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2005
Location: New Jersey
Posts: 87
simpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond repute
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.
__________________
2013 - Present MAR Control System Adviser and FTAA
2009 - Present Programming an Electrical Mentor Team 41
2005 - 2008 Team 41 Programmer
2008 NYC Regional Winner
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

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


All times are GMT -5. The time now is 02:44.

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