Go to Post Brandon, it's not an issue... but the fortune cookie thing that you get when you give someone rep is a little creepy... - Beth Sweet [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 13-07-2011, 15:41
Cehpelagod Cehpelagod is offline
Registered User
FRC #2990
 
Join Date: Jan 2011
Location: Aumsville
Posts: 4
Cehpelagod is an unknown quantity at this point
Angry Little Bracket...

Ok, so my team is making a t shirt launcher. For publicity's sake, of course; we hope to use it for assemblies and such to interest some underclassmen in joining the team, and if someone wants a video interview, we'll have a t shirt launcher to show off. Now, up until now, windriver hasn't been complaining, and everything has been acting nicely. We have a weird issue where, when code does anything to the motors or anything, the aforementioned part acts as it's supposed to for a split second, then cuts out. It's like we set the time for .05 or something. This was overcome by using while loops throughout the code, and a timer, so that's why the entirety of our code is in while loops. Now.

Where the code says


{
GetWatchdog().SetExpiration(0.1);
}
We get an error under the first bracket saying:

C:/windriver/workspace/SimpleTemplate/MyRobot.cpp: In constructor `RobotDemo::RobotDemo()':
C:/windriver/workspace/SimpleTemplate/MyRobot.cpp:43: error: no matching function for call to `Compressor::Compressor(int)'
C:/WindRiver/vxworks-6.3/target/h/WPILib/Compressor.h:26: note: candidates are: Compressor::Compressor(const Compressor&)
C:/WindRiver/vxworks-6.3/target/h/WPILib/Compressor.h:30: note: Compressor::Compressor(UINT32, UINT32, UINT32, UINT32)
C:/WindRiver/vxworks-6.3/target/h/WPILib/Compressor.h:28: note: Compressor::Compressor(UINT32, UINT32)
C:/windriver/workspace/SimpleTemplate/MyRobot.cpp:43: error: no matching function for call to `Compressor::Compressor(int)'
C:/WindRiver/vxworks-6.3/target/h/WPILib/Compressor.h:26: note: candidates are: Compressor::Compressor(const Compressor&)
C:/WindRiver/vxworks-6.3/target/h/WPILib/Compressor.h:30: note: Compressor::Compressor(UINT32, UINT32, UINT32, UINT32)
C:/WindRiver/vxworks-6.3/target/h/WPILib/Compressor.h:28: note: Compressor::Compressor(UINT32, UINT32)
C:/windriver/workspace/SimpleTemplate/MyRobot.cpp:43: error: no matching function for call to `Compressor::Compressor(int)'
C:/WindRiver/vxworks-6.3/target/h/WPILib/Compressor.h:26: note: candidates are: Compressor::Compressor(const Compressor&)
C:/WindRiver/vxworks-6.3/target/h/WPILib/Compressor.h:30: note: Compressor::Compressor(UINT32, UINT32, UINT32, UINT32)
C:/WindRiver/vxworks-6.3/target/h/WPILib/Compressor.h:28: note: Compressor::Compressor(UINT32, UINT32)
C:\WindRiver\vxworks-6.3\host\x86-win32\bin\make.exe: *** [SimpleTemplate_partialImage/Debug/Objects/SimpleTemplate/MyRobot.o] Error 1
Build Failed in Project 'SimpleTemplate' (Process Exit Value was 2): 2011-07-13 12:31:05 (Elapsed Time: 00:01)


Unless I remove the spikes AND the compressors, the error won't go away. if I remove the compressors, it changes every instance of compressor in the error message to "Relay'.


the entirety of the code is as follows. I'm currently testing ports, so the autonomous is all that matters. It's not supposed to be spectacular, just testing stuff.
Code:

#include "WPILib.h"
#include "Gamepad.h"
#include "Vision/AxisCamera.h"

/**
* This is a demo program showing the use of the RobotBase class.
* The SimpleRobot class is the base of a robot application that will automatically call your
* Autonomous and OperatorControl methods at the right time as controlled by the switches on
* the driver station or the field controls. Haha, Silly descriptions. They're so discriptive.
*/
class RobotDemo : public SimpleRobot
{
RobotDrive myRobot; // robot drive system
Gamepad controller;
Victor fLeft;
Victor fRight;
Victor rLeft;
Victor rRight;
Timer timer;
Relay spike1;
Relay spike2;
Relay spike3;
Compressor comp1;
Compressor comp2;
Compressor comp3;

public:
RobotDemo(void):
myRobot(1,2,3,4), // these must be initialized in the same order
controller(1),
fLeft(1),
fRight(3),
rLeft(2),
rRight(4),
spike1(1),
spike2(2),
spike3(3),
comp1(1),
comp2(2),
comp3(3)


{
GetWatchdog().SetExpiration(0.1);
}

void Autonomous(void)
{
GetWatchdog().SetEnabled(false);
timer.Reset();
double time;
timer.Start();

while (time = timer.Get() <= 1)
{
fLeft.Set(.5);
}
timer.Reset();
while (time = timer.Get() <= 1)
{
fLeft.Set(0);
}
timer.Reset();
while (time = timer.Get() <= 1)
{
fRight.Set(.5);
}
timer.Reset();
while (time = timer.Get() <= 1)
{
fRight.Set(0);
}
timer.Reset();
while (time = timer.Get()<= 1)
{
rLeft.Set(.5);
}
timer.Reset();
while (time = timer.Get()<= 1)
{
rLeft.Set(0);
}
timer.Reset();
while (time = timer.Get()<=1)
{
rRight.Set(.5);
}
timer.Reset();
while(time=timer.Get()<=1)
{
rRight.Set(0);
}

while (time = timer.Get() < 5)
{
comp1.Start();
}
timer.Reset();
while (time = timer.Get() <1)
{
comp1.Stop();
}
timer.Reset();
while (time = timer.Get() <5)
{
comp2.Start();
}
timer.Reset();
while (time = timer.Get() <1)
{
comp2.Stop();
}
timer.Reset();
while(time = timer.Get() <5)
{
comp3.Start();
}
timer.Reset();
while (time = timer.Get() <1)
{
comp3.Stop();
}
timer.Reset();
}


void OperatorControl(void)
{

GetWatchdog().SetEnabled(true);



while (IsOperatorControl())
{
GetWatchdog().Feed();

myRobot.TankDrive(-controller.GetLeftY(), controller.GetRightY()); // Run each drive train with one of the analogue sticks


Wait(0.005); // wait for a motor update time
}
}
};

START_ROBOT_CLASS(RobotDemo);




Anybody able to help? Or at least point me in a general direction?
Reply With Quote
  #2   Spotlight this post!  
Unread 13-07-2011, 15:56
Cehpelagod Cehpelagod is offline
Registered User
FRC #2990
 
Join Date: Jan 2011
Location: Aumsville
Posts: 4
Cehpelagod is an unknown quantity at this point
Re: Angry Little Bracket...

Incidentally,it would be AWESOME if someone could reply with an answer before tonight. I'm trying to finish all the testing and actually get to the coding before my mentor gets home. Before you ask why I don't just ask him, its because he's just as stumped as I.
Reply With Quote
  #3   Spotlight this post!  
Unread 13-07-2011, 17:38
PAR_WIG1350's Avatar
PAR_WIG1350 PAR_WIG1350 is offline
Registered User
AKA: Alan Wells
FRC #1350 (Rambots)
Team Role: Alumni
 
Join Date: Dec 2009
Rookie Year: 2009
Location: Rhode Island
Posts: 1,188
PAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond repute
Re: Angry Little Bracket...

I'm not entirely sure, but aren't compressor objects initialized with 2 arguments, one being the compressor relay channel address and the other being the pressure switch dio address?
__________________
Reply With Quote
  #4   Spotlight this post!  
Unread 14-07-2011, 17:52
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Angry Little Bracket...

Quote:
Originally Posted by Cehpelagod View Post
no matching function for call to
Compressor::Compressor(int)
candidates (Valid function calls) are:
Compressor::Compressor(const Compressor&)
Compressor::Compressor(UINT32, UINT32, UINT32, UINT32)
Compressor::Compressor(UINT32, UINT32)
is the error message cleaned up
If you notice, the valid functions have two ints, four ints, or another compressor. You have only one int. The signature you want is:
CompressorName(RelayPortForCompressor, DIOPortForPressureSwitch)

C++ compiler messages are often confusing; it can take a while to figure them out sometimes. It helps to try to clean them up sometimes.
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
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


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

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