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?