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.
If it were tank drive, you’d need to switch the sides and the direction of the joystick axis.
Something like this:
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?
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.
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:
- Save the image I posted to your desktop,
- drag the image onto blank space in a block diagram
- 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
Thank you all for your help with this. I will post back with results and more questions
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.