Go to Post There really is nothing else that needs to be said. - billbo911 [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
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 06-02-2017, 23:20
3072Cap 3072Cap is offline
Registered User
FRC #3072
 
Join Date: Feb 2016
Location: Wytheville, Va
Posts: 28
3072Cap is an unknown quantity at this point
Using a button to make controls flip

I'm not really sure what to ask, so I'll try to explain what we want to do.

We went with mecanum drive this year. Basically, we want to be able to press a button, and it flip all of our drive controls. So, for instance, when button has not been pressed, controls would be Forwards/Back, Strafe Left/Right, Rotate Left/Right. After the button was pressed, it would be Back/Forwards, Strafe Right/Left, Rotate Right/Left.

I'm pretty sure we can achieve this with something alone the lines of a True/False case structure, but I wanted to be able to press a button to activate it, and press that button (or another, it doesn't matter) to deactivate it, and I'm not sure how to accomplish that.

Thanks in advance, please ask questions if I was unclear on what I was asking.
__________________
[*img]http://i.imgur.com/B28M0CX.jpg[/img*]
Reply With Quote
  #2   Spotlight this post!  
Unread 06-02-2017, 23:24
Hitchhiker 42's Avatar
Hitchhiker 42 Hitchhiker 42 is offline
Roboter
AKA: Mark Lavrentyev
FRC #4557 (FullMetal Falcons)
Team Role: Programmer
 
Join Date: Oct 2015
Rookie Year: 2015
Location: Cromwell, CT
Posts: 533
Hitchhiker 42 has a reputation beyond reputeHitchhiker 42 has a reputation beyond reputeHitchhiker 42 has a reputation beyond reputeHitchhiker 42 has a reputation beyond reputeHitchhiker 42 has a reputation beyond reputeHitchhiker 42 has a reputation beyond reputeHitchhiker 42 has a reputation beyond reputeHitchhiker 42 has a reputation beyond reputeHitchhiker 42 has a reputation beyond reputeHitchhiker 42 has a reputation beyond reputeHitchhiker 42 has a reputation beyond repute
Re: Using a button to make controls flip

See here: https://www.chiefdelphi.com/forums/s...ghlight=toggle
__________________



2016 - NE District Championship Entrepreneurship Award
2016 - Hartford District Industrial Design Award
2016 - Waterbury District Engineering Inspiration Award
Reply With Quote
  #3   Spotlight this post!  
Unread 07-02-2017, 15:44
VaneRaklan VaneRaklan is offline
Registered User
FRC #2557 (The SOTABots)
Team Role: Programmer
 
Join Date: Feb 2015
Rookie Year: 2014
Location: Tacoma, WA
Posts: 19
VaneRaklan is an unknown quantity at this point
Re: Using a button to make controls flip

What language are you coding in? Cause that'll affect some things. Regardless the boolean toggle would be the way to go. The way that I coded our Gemini Drive (that's what I've been calling it) is by having the code look at both controllers constantly. For us, if Start and Select are active at the same time then the boolean changes to true thus running drive code altered for one direction and vice versa for the other controller.

So have two sets of drive code that change based on the state of a boolean, and tie thaat boolean to button combinations on the controllers or to some other button.

Here is the link to our code: https://github.com/FIRST-Team-2557-T...team2557/robot
The two files to look at would be ArcadeDrive_cmd and Chassis in the command and subsystem folders respectively. Just in case you'd like to see how we did it. Hope this helps!
Reply With Quote
  #4   Spotlight this post!  
Unread 07-02-2017, 15:54
Poseidon5817's Avatar
Poseidon5817 Poseidon5817 is offline
Founder and CEO, DeadMemes Studios
AKA: Mitchel Stokes
FRC #5817 (Uni-Rex)
Team Role: Mentor
 
Join Date: Aug 2013
Rookie Year: 2014
Location: Clovis, CA
Posts: 419
Poseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud of
Re: Using a button to make controls flip

I assume that the reason you want to know this is so that you can drive easier when you are turned around. Alternatively, you could use WPI's built in field-oriented mecanum functionality, so that forward is always down the field, down is towards you, left is your left, etc. relative to the driver, not the robot.
__________________
My FRC History:

2014 - Team 1671: Central Valley Regional Finalist and Chairman's Award Winner, Sacramento Regional Finalist, Archimedes Quarterfinalist
2015 - Team 1671: Central Valley Regional Semifinalist, Sacramento Regional Semifinalist and Chairman's Award Winner, Newton Winner, Einstein Winner
2016 - Team 5817: Central Valley Regional Finalist and Rookie All-Star, Orange County Regional Quarterfinalist and Rookie All-Star, Newton Division
2017 - Team 5817: Return of the bench grinder


Reply With Quote
  #5   Spotlight this post!  
Unread 08-02-2017, 21:20
3072Cap 3072Cap is offline
Registered User
FRC #3072
 
Join Date: Feb 2016
Location: Wytheville, Va
Posts: 28
3072Cap is an unknown quantity at this point
Re: Using a button to make controls flip

Quote:
Originally Posted by Hitchhiker 42 View Post
Thank you! Works perfectly
__________________
[*img]http://i.imgur.com/B28M0CX.jpg[/img*]
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


All times are GMT -5. The time now is 19:49.

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