|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
||||
|
||||
|
Compressor Code causes No Robot Code Error
I've just tried to add the Compressor class code to my C++ Iterative Robot code and when I load it to the robot it causes a no robot code error. Has anyone else run into this problem and do you have a solution on how you fixed it.
The code I used was: Code:
public:
/**
* Constructor for this "IterativeRobotDemo" Class.
* Create an instance of a RobotDrive with left and right motors plugged into PWM
* ports 0 and 1 on the first digital module.
*/
IterativeDemo(void) {
cout << "IterativeDemo Constructor Started\n";
// Create a robot using standard right/left robot drive on PWMS 1, 2, 3, and #4
myRobot = new RobotDrive(1, 3, 2, 4);
// Define joysticks being used at USB port #1 and USB port #2 on the Drivers Station
rightStick = new Joystick(2);
leftStick = new Joystick(1);
// Acquire the Driver Station object
ds = DriverStation::GetInstance();
dsLCD = DriverStationLCD::GetInstance();
// Counters to record the number of loops completed in autonomous and teleop modes
auto_periodic_loops = 0;
disabled_periodic_loops = 0;
tele_periodic_loops = 0;
//Compressor Instance
Compressor *cpressor = new Compressor(1,1); //Input DIO Port 1, Relay 1
cpressor->Start(); //Start compressor
The robot works fine without the compressor code, its just when I uncomments the line above. Any ideas? Help. |
|
#2
|
|||
|
|||
|
Re: Compressor Code causes No Robot Code Error
Are you getting any errors in the diagnostics tab of the driver station? Is your robot program crashing?
|
|
#3
|
||||
|
||||
|
Re: Compressor Code causes No Robot Code Error
I didn't realize we got error messages on the driver station. I will check that and get back to you.
|
|
#4
|
||||
|
||||
|
Re: Compressor Code causes No Robot Code Error
All right, I do get an error message on the computer. Here is what it says:
No change to network configuration "Local Network Connection" I/O Unit not detected or not installed correctly I thought this might have meant that I had a wire crossed or a bad PWM cable, but I have completely replaced the PWM cable and checked it to make sure it didn't have a short. The robot works perfectly fine if I don't call the Compressor code. I am running the switch to the white and black cables in the PWM bundle just like last year. I am installing it in the digitial input on my digital sidecar, in address 1. For the Spike I am running it to Relay 1 on the digital sidecar. I believe I got it all wired right, but yet I still get the No Robot Code error and it appears it is "crashing". Help please, I don't have the slightest clue what's going on here. |
|
#5
|
|||
|
|||
|
Re: Compressor Code causes No Robot Code Error
Can you post a console log of the crash?
|
|
#6
|
||||
|
||||
|
Re: Compressor Code causes No Robot Code Error
I will look up how to do this and see if I can't get a console log tomorrow evening. Does someone have a cliff notes version of how to get that console log?
I did some searching this morning and found the NetConsole thing which I will try first, but since everything I try this year has been an abject failure from the beginning I also want to have the serial cable console procedure on hand as a backup. The problem is that I can't find directions for it. I've searched Chief Delphi and found some stuff about last years documents with instructions, but that link to last year's control system documentation has been convienently broken by FIRST. I do know I need a null-modem adapter which I will pick up on the way to the school and to use HyperTerminal but I don't know much more about how to setup the program to chat with the cRio. I looked in all the documents for this year with no luck. Could someone point me to the Hyperterminal instructions for the cRIO and also let me know if you've had any trouble with NetConsole I should be aware of. I really want to solve this problem soon, so I want to have every tool at my disposal tonight when I try to get this error message from the console so I can get some help. Last edited by sircedric4 : 26-01-2010 at 07:30. Reason: searched, still need help |
|
#7
|
||||
|
||||
|
Re: Compressor Code causes No Robot Code Error
Ok, you've got my code up above and we got NetConsole to work right off the bat today which was a pleasant surprise. We did have an interesting glitch today. When we turned on the robot we got the same No Robot Code as usual with the new code, but after the computer went to standby and we tried it a little later it started to run. It did not give me encoder data, but it got past the crash. We tried it a little later and it was back to No Code. I don't like intermittent stuff.
Here's the error stuff from our console: I couldn't find a way to actually cut and paste the actual text so had to take screenshots. It is in the attachment. Hopefully this is enough info to help us, we are spinning our wheels here. |
|
#8
|
|||||
|
|||||
|
Re: Compressor Code causes No Robot Code Error
See this thread and look for the information on using mlongcall.
|
|
#9
|
|||
|
|||
|
Re: Compressor Code causes No Robot Code Error
Quote:
![]() Quote:
And like Alan said... you need to build with the mlongcall option. Any project you create from the examples should already have this option set for you. Did you create a new project from scratch or based on an example? If an example, which one... I'd like to fix the example if one is not configured to use mlongcall. -Joe |
|
#10
|
||||
|
||||
|
Re: Compressor Code causes No Robot Code Error
Quote:
I swear I am starting to feel like a caveman looking at magic. Any sufficiently advance technology being indistiguishable from magic. I feel like I am learning a specific chant to get specific outcomes. I'm glad we got wizards here that I can at least get answers on which magic chant to do for any given outcome. Thanks guys. I'll setup the project like outlined above and let you know if that solves our problems. |
|
#11
|
||||
|
||||
|
Re: Compressor Code causes No Robot Code Error
Quote:
I'm pretty sure I created that same sample project and, with no tinkering or mucking around, there was no -mlongcall in the compiler switches. Easy enough to create a new one, you can create as many projects as you want from the samples, and have a look. Why did you create new build targets? Just curious. |
|
#12
|
||||
|
||||
|
Re: Compressor Code causes No Robot Code Error
Quote:
So now we copy the project, and then remove the build target and build a new target and the code always links and runs correctly. I guess I could just move the appropriate .cpp files over to a new created template project each time but the procedure I highlighted seemed easier. I wasn't sure that it might not be causing the mlongcall problem which is why I mentioned it. Hopefully we'll be up and running again tonight when I get the mlongcall in. |
|
#13
|
|||
|
|||
|
Re: Compressor Code causes No Robot Code Error
Just to be clear, you are referring to the "FRC Default Program" (as listed in the examples) aka "BuiltinDefaultCode" (as listed in the Project Explorer)? I double checked this project and it definitely includes the -mlongcall option.
Quote:
Quote:
-Joe |
|
#14
|
||||
|
||||
|
Re: Compressor Code causes No Robot Code Error
Quote:
I actually did a dump of the relocation data from the elf file after building it and there were a bunch of RELOC_24 in it. After I added -mlongcall and rebuilt, they were gone -- replaced by pairs of RELOC_16 as you would expect. The only thing I'm not 100% certain is what sample project I used. I'll have to check my 'robotics' computer when I get a chance and see which sample it was. |
|
#15
|
|||
|
|||
|
Re: Compressor Code causes No Robot Code Error
Quote:
-Joe |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| User code won't download/run-possible causes? | nathanww | C/C++ | 3 | 21-01-2009 11:00 |
| Code error causing robot to go into programming mode. | MJD | Programming | 14 | 30-10-2007 14:21 |
| Error in code light on, trouble finding error | Bryan Herbst | Programming | 16 | 12-10-2007 21:59 |
| Code error on RC after downloading "bells and whistles" version of Kevins camera code | DanDon | Programming | 6 | 10-01-2006 18:07 |
| Compressor Code | gacp | Programming | 2 | 19-02-2005 16:18 |