Go to Post Programmer says autonomous will work 100% perfectly...Great way to clear the room of all mechanicals and all but the boldest electricals - EricH [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, 23:02
ExarKun666's Avatar
ExarKun666 ExarKun666 is offline
Ben Error/MC Ben/NC Ben
AKA: Ben Kellogg
FRC #2429 (LCEC)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2008
Location: La Caņada, CA
Posts: 208
ExarKun666 is an unknown quantity at this point
Send a message via AIM to ExarKun666 Send a message via MSN to ExarKun666 Send a message via Yahoo to ExarKun666
Control Mapping problems in WindRiver

Okay we have tried several things, and are trying to mutate these functions, but are unable to and we are unsure of how.

We are trying to get it to several things:
1) when we use Joystick to do the function GetX() it says GetX() hasn't been defined, and we tried Joystick.GetX() and it says you need a parent class or something b4 Joystick, so how do I declare GetX??
2) We are trying to use the log function also in this, but we can't find a way to convert float to a non double number or a double number for use by myRobot.*.* ect...
3) How do you do a state machine with a button?

This is confusing, and I have looked through the header files to try and understand what is going on, but the files just call a bunch more header files and it just looks all stubbed out, and it seems really hard to mutate, so any help would be very nice!
__________________
Ben Kellogg




Team Sites: [LCEC Site] [FRC/FLL Site] [LCEC Blog]
Reply With Quote
  #2   Spotlight this post!  
Unread 02-02-2009, 23:33
MattD's Avatar
MattD MattD is offline
Registered User
AKA: Matthew Douglas
FRC #0228 (GUS Robotics)
Team Role: Alumni
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Indianapolis, IN
Posts: 185
MattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to behold
Send a message via AIM to MattD
Re: Control Mapping problems in WindRiver

Quote:
Originally Posted by ExarKun666 View Post
1) when we use Joystick to do the function GetX() it says GetX() hasn't been defined, and we tried Joystick.GetX() and it says you need a parent class or something b4 Joystick, so how do I declare GetX??
You need to create an instance of the Joystick class. This should be done as a member variable in your robot class, outside of any of the functions in it.
Code:
Joystick stick(1); // USB joystick in port 1.
After you have your Joystick object created, you can use it like this:
Code:
float value = stick.GetX(); // Get the X value of the joystick.
You can read more about C++ classes here.

Quote:
Originally Posted by ExarKun666 View Post
2) We are trying to use the log function also in this, but we can't find a way to convert float to a non double number or a double number for use by myRobot.*.* ect...
I'm not quite sure what you're asking about, but the log() function should work just fine with floats. You just need to #include <math.h>.

Quote:
Originally Posted by ExarKun666 View Post
3) How do you do a state machine with a button?
Again, I'm not entirely sure what you want to do, but if you're talking about using a button to toggle something on/off that has been discussed here: http://www.chiefdelphi.com/forums/sh...ad.php?t=72749
__________________
GUS Robotics Team 228

2010 WPI Engineering Inspiration Award
2010 WPI Regional Champions (Thanks 230 & 20!)
2010 CT VEX Champions
2010 CT VEX Innovate Award
2009 QCC VEX Champions
2009 CT Motorola Quality Award
2007 CT J&J Sportsmanship Award
2006 CT Best Website Award
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
Windriver downloading code problems. HUmar104 C/C++ 4 25-01-2009 20:53
WindRiver WPILib problems Dr Nick C/C++ 5 13-01-2009 16:17
New Control System Problems ExarKun666 Technical Discussion 13 23-12-2008 16:29
Control Problems Inverted Programming 24 20-02-2006 04:27
Electronic Speed Control Problems DustinB_3 Electrical 9 09-11-2005 23:42


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

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