Go to Post If students and mentors own their role and are proud of it, the team is stronger as a consequence. - Madison [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 22-12-2008, 21:14
Straberrie's Avatar
Straberrie Straberrie is offline
The Plague
AKA: Rebecca
FRC #0375 (Robotic Plague)
Team Role: Programmer
 
Join Date: Feb 2008
Rookie Year: 2007
Location: New York
Posts: 59
Straberrie will become famous soon enough
Axis Camera in C++; code error??

Hi! Currently, I am trying to program the camera and the bot so that when it detects green, it aligns itself with the traget, but since i epicly phailed at that, I decided to do something simpler and just make the bot go forward when it detects green! I made this code *well, technically I used the guide and didnt really MAKE it* and i am getting 2 errors.... And i cant figure out whats wrong! help would be appreciated! THANKS!


So here are the headers I used:

#include "WPILib.h"
#include "AxisCamera.h"
#include "Servo.h"
#include "SimpleRobot.h"
#include "SensorBase.h"
#include "Error.h"
#include "ErrorBase.h"
#include "FrcError.h"

This is the rest of the defining and stuff!

class RobotDemo : public SimpleRobot
{
RobotDrive *Bot; // robot drive system
Joystick *stickRight;
Joystick *stickLeft;
DriverStation *ds; // driver station


public:
RobotDemo(void)
{
if (StartCameraTask ()== -1) {
printf( "Failed to spawn camera task; Error code %s",
GetErrorText (GetLastError()) };

ds = DriverStation::GetInstance();
Bot = new RobotDrive(1, 2); // create robot drive base
stickRight = new Joystick(1);
stickLeft = new Joystick(2);
Range greenHue, greenSat, greenLum;
greenHue.minValue = 65; greenHue.maxValue = 80;
greenSat.minValue =100; greenSat.maxValue = 255;
greenLum.minValue = 100; greenLum.maxValue = 255;
GetWatchdog().SetExpiration(100);
}


and here is the autonomous:

void Autonomous(void)
{
GetWatchdog().SetEnabled(false);

while(IsAutonomous())
{
if( FindColor(IMAQ_HSL, &greenHue, &greenSat, &greenLum, &par)
&& par.particleToImagePercent < MAX_PARTICLE_TO_IMAGE_PERCENT
&& par.particleToImagePercent > MIN_PARTICLE_TO_IMAGE_PERCENT )

{Bot->Drive(1.0, (float)par.center_mass_x_normalized);}

else
Bot->Drive(0.0, 0.0);
Wait(50);
}

Bot->Drive(0.0, 0.0); // stop robot
}


and the very end line of the code:

START_ROBOT_CLASS(RobotDemo);


I highlighted the lines where i get an error; basically on the get error one, they say the function was not defined.... and it also highlights the Start Robot Class thing as wrong. And is camera initiated/used right? Because in the guide, there are different things on different pages and I did not know what to use... Sorry for the lengthy question.
__________________
Team 375: The Robotic Plague
Current Robot: I-Chihuahua
Last Event: Big Apple Breakaway
 


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
Program Axis Camera in c++ excel2474 Programming 5 22-12-2008 17:14
Axis Camera Testing help koo_04 Programming 7 20-12-2008 13:55
axis camera - problem s0crates FRC Control System 11 16-12-2008 09:34
Error in Compiling the Camera Code (B&W Version) VetteSlick Programming 7 20-01-2006 20:50
Code error on RC after downloading "bells and whistles" version of Kevins camera code DanDon Programming 6 10-01-2006 18:07


All times are GMT -5. The time now is 18:26.

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