Go to Post This thread is a reminder to myself that I have 29 more days to sleep. :) - Seth Mallory [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 05-02-2017, 22:46
Kage2416 Kage2416 is offline
Registered User
FRC #1546
 
Join Date: Feb 2017
Location: Baldwin, NY
Posts: 3
Kage2416 is an unknown quantity at this point
Need help with coding issue

My team's robot has two different ways of scoring, one on one side, "the front", and one on the other side, "the back." The reason I put those in quotation marks is due to the fact that both sides may be considered the front of the robot. Our question is, how can we flip the coding of the robot so we can easily switch from one side of the robot being controlled by moving forward on the remote, to the other side being controlled like that. It's mainly so the drive team has an easier way of controlling the robot in the case that we cannot use one way to score. Any help would be appreciated.
Reply With Quote
  #2   Spotlight this post!  
Unread 05-02-2017, 22:51
Bkeeneykid's Avatar
Bkeeneykid Bkeeneykid is offline
#wheatcoastneatcoast
AKA: Devin Keeney
FRC #1982 (Cougar Robotics); Season Long Fantasy FIRST (F3)
Team Role: Leadership
 
Join Date: Feb 2015
Rookie Year: 2015
Location: Lenexa, Kansas
Posts: 369
Bkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud of
Re: Need help with coding issue

Quote:
Originally Posted by Kage2416 View Post
My team's robot has two different ways of scoring, one on one side, "the front", and one on the other side, "the back." The reason I put those in quotation marks is due to the fact that both sides may be considered the front of the robot. Our question is, how can we flip the coding of the robot so we can easily switch from one side of the robot being controlled by moving forward on the remote, to the other side being controlled like that. It's mainly so the drive team has an easier way of controlling the robot in the case that we cannot use one way to score. Any help would be appreciated.
You can simply have a command that just outputs a variable that switches between the straight output of your joystick or the reversed axis of your joystick that you want to oppose. Then plug this variable into your drive class.
__________________

F4 Network Website Designer

2010-2012: A Whole Buncha FLL Teams; Team Spirit, Gracious Professionalism Award winner
2015-Current: FRC 1982, Captain, Electrical Lead
Beginning FIRST Volunteer

Moderator on the FIRSTwiki
Reply With Quote
  #3   Spotlight this post!  
Unread 05-02-2017, 23:15
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,945
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Need help with coding issue

If it were tank drive, you'd need to switch the sides and the direction of the joystick axis.
Something like this:
Attached Thumbnails
Click image for larger version

Name:	ReverseRobotFront.png
Views:	32
Size:	33.6 KB
ID:	21721  
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #4   Spotlight this post!  
Unread 06-02-2017, 07:37
Kage2416 Kage2416 is offline
Registered User
FRC #1546
 
Join Date: Feb 2017
Location: Baldwin, NY
Posts: 3
Kage2416 is an unknown quantity at this point
Re: Need help with coding issue

U/Mark McLeod sorry I don't know how to quote texts but is there any chance you could post the false version of the box in the code?
Reply With Quote
  #5   Spotlight this post!  
Unread 06-02-2017, 08:22
mshafer1 mshafer1 is offline
Programming Mentor
AKA: Matthew Shafer
FRC #3937 (Breakaway)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2008
Location: Texas
Posts: 64
mshafer1 is an unknown quantity at this point
Re: Need help with coding issue

It should just be a pass through (without criss-crossing the lines). Because he posted a snippet, you should be able to download it and drop it back in LabVIEW and have it turn back into code.
Attached Thumbnails
Click image for larger version

Name:	OtherSideOfReverseRobotFront.png
Views:	15
Size:	36.6 KB
ID:	21722  

Last edited by mshafer1 : 06-02-2017 at 08:31. Reason: adding snippet
Reply With Quote
  #6   Spotlight this post!  
Unread 06-02-2017, 09:25
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,945
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Need help with coding issue

Quote:
Originally Posted by Kage2416 View Post
U/Mark McLeod sorry I don't know how to quote texts but is there any chance you could post the false version of the box in the code?
That image is an actual code snippet.
Matthew took it and showed you the False case side.
It uncrosses the lines and are straight through otherwise.

To convert the image to code:
1) Save the image I posted to your desktop,
2) drag the image onto blank space in a block diagram
3) instant code and you can look at the False case directly.

To make your own snippets, highlight just the code you want, and choose Edit->Create VI Snippet from Selection
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 06-02-2017 at 10:57.
Reply With Quote
  #7   Spotlight this post!  
Unread 07-02-2017, 07:56
Kage2416 Kage2416 is offline
Registered User
FRC #1546
 
Join Date: Feb 2017
Location: Baldwin, NY
Posts: 3
Kage2416 is an unknown quantity at this point
Re: Need help with coding issue

Thank you all for your help with this. I will post back with results and more questions
Quote:
Originally Posted by Mark McLeod View Post
That image is an actual code snippet.
Matthew took it and showed you the False case side.
It uncrosses the lines and are straight through otherwise.

To convert the image to code:
1) Save the image I posted to your desktop,
2) drag the image onto blank space in a block diagram
3) instant code and you can look at the False case directly.

To make your own snippets, highlight just the code you want, and choose Edit->Create VI Snippet from Selection
Reply With Quote
  #8   Spotlight this post!  
Unread 08-02-2017, 10:45
JeffB JeffB is offline
Registered User
FRC #5052 (RoboLobos)
Team Role: Mentor
 
Join Date: Apr 2015
Rookie Year: 2014
Location: Austin
Posts: 67
JeffB is a splendid one to beholdJeffB is a splendid one to beholdJeffB is a splendid one to beholdJeffB is a splendid one to beholdJeffB is a splendid one to beholdJeffB is a splendid one to beholdJeffB is a splendid one to behold
Re: Need help with coding issue

As a fun snippet sidenote, I'm not sure if this is something related to me using Chrome or intended use. I don't need to save it. I just drag from Chrome over to my Block Diagram and it puts the code in place for me.

For completeness, you can tell the difference between a snippet and a screenshot by taking a look at the upper left corner. The awkward hand is shown to drag the code to your LabVIEW by the arrow. If you see that, it's a snippet.
__________________
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:50.

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