Go to Post Billfred = genius - rsisk [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 Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-02-2009, 10:02
nadavsen2 nadavsen2 is offline
Registered User
FRC #2231
 
Join Date: Jan 2009
Location: israel
Posts: 31
nadavsen2 is an unknown quantity at this point
Still problem with classes...+img

I just can make that thing work....

image:


Reply With Quote
  #2   Spotlight this post!  
Unread 02-02-2009, 15:06
GGCO's Avatar
GGCO GGCO is offline
Registered User
AKA: Grant
FRC #3357
Team Role: Alumni
 
Join Date: Jan 2008
Rookie Year: 2004
Location: Michigan
Posts: 406
GGCO is a splendid one to beholdGGCO is a splendid one to beholdGGCO is a splendid one to beholdGGCO is a splendid one to beholdGGCO is a splendid one to beholdGGCO is a splendid one to beholdGGCO is a splendid one to beholdGGCO is a splendid one to behold
Send a message via AIM to GGCO
Re: Still problem with classes...+img

It looks like you are trying to create an object for the "Drive" class....right??

I think you were trying to write:

RobotDrive *bba;

??

Maybe I'm missing something? Please elaborate.
__________________
"Great spirits have always encountered violent opposition from mediocre minds" - Albert Einstein
The FIRST Alliance
COMETS Robotics
Website

Reply With Quote
  #3   Spotlight this post!  
Unread 02-02-2009, 17:53
nadavsen2 nadavsen2 is offline
Registered User
FRC #2231
 
Join Date: Jan 2009
Location: israel
Posts: 31
nadavsen2 is an unknown quantity at this point
Re: Still problem with classes...+img

Yes, im trying to creat a new object "Drive" (!!)

I defined a new object at the class "Drive" and i want to make a new
object in my code. Like "PWM" or "Jaguar" but from class that i created!

help
Reply With Quote
  #4   Spotlight this post!  
Unread 04-02-2009, 02:18
Redneck's Avatar
Redneck Redneck is offline
Hacker Hick
AKA: Jamie (2.0) Moran
FRC #0599 (Robodox)
Team Role: Engineer
 
Join Date: Aug 2004
Rookie Year: 2004
Location: California
Posts: 90
Redneck is just really niceRedneck is just really niceRedneck is just really niceRedneck is just really nice
Send a message via AIM to Redneck
Re: Still problem with classes...+img

Mind showing us more of that MyRobot.cpp file you're using? If you could post that, along with your Drive.cpp and Drive.h files, then it'll be easier to figure out than working from just a screenshot.
__________________


Which badges can you claim?
Reply With Quote
  #5   Spotlight this post!  
Unread 04-02-2009, 02:34
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,169
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Still problem with classes...+img

You want something like

RobotDrive *bba = new RobotDrive(1, 2);

There is no class Drive in the WPI libraries (I think).
Reply With Quote
  #6   Spotlight this post!  
Unread 04-02-2009, 03:31
nadavsen2 nadavsen2 is offline
Registered User
FRC #2231
 
Join Date: Jan 2009
Location: israel
Posts: 31
nadavsen2 is an unknown quantity at this point
Re: Still problem with classes...+img

Im trying to creat one....

I succeid to creat a new class but now when im trying to put the code
on the cRio the DS tells me "No Code".

why is that?

here is my code:


MainClass
PHP Code:
#include "WPILib.h"
#include "Functions.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.
 */ 
class RobotDemo : public SimpleRobot
{
    
RobotDrive myRobot// robot drive system
    
Joystick stick// only joystick
    

public:
    
RobotDemo(void):
        
myRobot(12),    // these must be initialized in the same order
        
stick(1)        // as they are declared above.
    
{
        
GetWatchdog().SetExpiration(100);
    }

    
/**
     * Drive left & right motors for 2 seconds then stop
     */
    
void Autonomous(void)
    {
        
GetWatchdog().SetEnabled(false);
        
myRobot.Drive(0.50.0);     // drive forwards half speed
        
Wait(2.0);                 //    for 2 seconds
        
myRobot.Drive(0.00.0);     // stop robot
    
}

    
/**
     * Runs the motors with arcade steering. 
     */
    
void OperatorControl(void)
    {
        
GetWatchdog().SetEnabled(true);
        
Functions r;
        
        
        
        
        while (
IsOperatorControl())
        {
            
GetWatchdog().Feed();
            
myRobot.ArcadeDrive(stick); // drive with arcade style (use right stick)
            
r.GetSomething();
        }
    }
};

START_ROBOT_CLASS(RobotDemo); 


Functions.h:
PHP Code:
#ifndef FUNCTIONS_H_
#define FUNCTIONS_H_
class Functions
{
public:
    
void GetSomething(void);
};
#endif 

Functions.cpp:

PHP Code:
#include "Functions.h"

void GetSomething(void)
{
    
    

Reply With Quote
  #7   Spotlight this post!  
Unread 04-02-2009, 06:44
wt200999's Avatar
wt200999 wt200999 is online now
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 323
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: Still problem with classes...+img

Quote:
PHP Code:
#include "Functions.h"

void GetSomething(void)
{
    
    

That should be:
Functions
PHP Code:
#include "Functions.h"

void Functions::GetSomething(void)
{
    
    

__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -
Reply With Quote
  #8   Spotlight this post!  
Unread 04-02-2009, 16:54
nadavsen2 nadavsen2 is offline
Registered User
FRC #2231
 
Join Date: Jan 2009
Location: israel
Posts: 31
nadavsen2 is an unknown quantity at this point
Re: Still problem with classes...+img

Still not working..
Reply With Quote
  #9   Spotlight this post!  
Unread 04-02-2009, 18:10
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,169
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Still problem with classes...+img

Does it compile? It looks like it should work (of course it does nothing).

Try downloading into RAM with the target console window up. Does it print any messages about undefined symbols? When you run it can you see the FRC_RobotTask running (type 'i' to see the running tasks).
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
[FTC]: Problem with Code or Problem with Bluetooth? VeedotJaydot FIRST Tech Challenge 3 27-01-2009 18:22
Help!!! Question With Robotics Classes At School..? Cactus_Robotics Robotics Education and Curriculum 11 22-02-2008 10:53
Help!!! Question With Robotics Classes At School..? Cactus_Robotics Robotics Education and Curriculum 1 19-02-2008 20:56
Houston, we still have a weight problem. Elgin Clock Chit-Chat 0 03-01-2003 15:57
What keeps you off a team but still with FIRST? Jessica Boucher General Forum 14 13-06-2001 21:37


All times are GMT -5. The time now is 12:41.

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