Go to Post It is possible to live without the Big sponsors, it just takes a lot of fund raising and hard work. - Raumiester2010 [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 01-13-2009, 04:56 PM
KRibordy KRibordy is offline
Registered User
FRC #1000 (Cybearcats)
Team Role: Mentor
 
Join Date: Mar 2008
Rookie Year: 2006
Location: Valparaiso, IN
Posts: 36
KRibordy is an unknown quantity at this point
WindRiver "TankDrive"

I followed the guide as to how to set up a project and it seems much simpler than MPLab. I'd like to be able to set up the TankDrive function so that we can automatically adjust to half speed if the trigger on the joystick is pressed, among other things. I've been looking for where the "TankDrive" function is defined so I can edit it.

Is this what I should go about doing? If not, what should I do?
Reply With Quote
  #2   Spotlight this post!  
Unread 01-13-2009, 05:20 PM
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 321
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: WindRiver "TankDrive"

You have a couple ways on implementing it. I wouldn't suggest editing the WPILib, at least not yet as there will still be patches that may overwrite what you do. You could create your own class and inherit that. Or you could create your own Joystick class instead, inheriting the Joystick and adding the scaling to the GeyY() function (or if you assign a different axis for drive). There is also RobotDrive::TankDrive(float leftDrive, float rightDrive) that you could use when the trigger is pressed. The function is defined in RobotDrive.h
__________________
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
  #3   Spotlight this post!  
Unread 01-13-2009, 05:29 PM
KRibordy KRibordy is offline
Registered User
FRC #1000 (Cybearcats)
Team Role: Mentor
 
Join Date: Mar 2008
Rookie Year: 2006
Location: Valparaiso, IN
Posts: 36
KRibordy is an unknown quantity at this point
Re: WindRiver "TankDrive"

I think that TankDrive(float leftDrive, float rightDrive) is used in the original program.

But would this work?

within the code, making two variables, one leftHalf and another rightHalf. Then continually assigning each to leftJoystick/2 and rightJoystick/2 respectively?

And then having an
Code:
else if (triggerPressed==1) {
    myRobot->TankDrive(leftHalf, rightHalf);
}
after the if that determines whether to use arcade or tank driving?

Last edited by KRibordy : 01-13-2009 at 05:34 PM.
Reply With Quote
  #4   Spotlight this post!  
Unread 01-13-2009, 05:48 PM
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 321
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: WindRiver "TankDrive"

You could even simplify that instead of having the rightHalf variable:

Code:
else if (triggerPressed)
{
    myRobot->TankDrive(leftJoystick->GetY()/2,rightJoystick->GetY()/2);
}
Edit: May I suggest having a trigger on each side slow down that side's motor instead of one on one side slowing them both down?
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -

Last edited by wt200999 : 01-13-2009 at 06:06 PM.
Reply With Quote
  #5   Spotlight this post!  
Unread 01-13-2009, 06:13 PM
KRibordy KRibordy is offline
Registered User
FRC #1000 (Cybearcats)
Team Role: Mentor
 
Join Date: Mar 2008
Rookie Year: 2006
Location: Valparaiso, IN
Posts: 36
KRibordy is an unknown quantity at this point
Re: WindRiver "TankDrive"

That's what I was planning on doing. Thanks.
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
Championship Event - Where the "Random" Match Sorting Really "Shines" Travis Hoffman Championship Event 57 04-19-2007 08:06 AM
New NEMO White Papers! "Creating a Killer Packet" and "25 Ways to Sponsor" Jessica Boucher Team Organization 0 08-10-2005 10:55 AM
"Thunderbirds" Vs. "Team America" Which one will rule the box office? Elgin Clock Chit-Chat 3 09-07-2004 07:53 PM
Conflict between "Initialize_Tracker()" and "pwm13 & pwm15"? Kevin? gnormhurst Programming 3 02-22-2004 02:55 AM
how tall is the ramp when in "up" and "balanced" position??? archiver 2001 1 06-24-2002 12:54 AM


All times are GMT -5. The time now is 10:34 AM.

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