Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Selecting Autonomous with TI LaunchPad? (http://www.chiefdelphi.com/forums/showthread.php?t=148399)

team-4480 12-05-2016 19:30

Selecting Autonomous with TI LaunchPad?
 
Hi,

We are going to make a nice control box with random buttons and potentiometers using the TI MSP430 LaunchPad. We want to be able to select an autonomous mode with a dial using one of the potentiometers through the LaunchPad.

The problem is, how do I send what the choice is to the robot if the LaunchPad is seen as a gamepad?

Should I write a pygame script and use pynetworktables to send the choice from it? Or is there a much simpler way that I am overlooking? How do other teams do it?

Any help would greatly be appreciated!

RufflesRidge 12-05-2016 19:40

Re: Selecting Autonomous with TI LaunchPad?
 
Quote:

Originally Posted by team-4480 (Post 1586275)
Or is there a much simpler way that I am overlooking?

You can just read the value of the "joystick axis" that corresponds to the potentiometer analog input and use that to determine the choice.

asid61 12-05-2016 19:49

Re: Selecting Autonomous with TI LaunchPad?
 
Why not simply use a multiposition button? They look like potentiometers but have different settings you can snap to rather than an analog output.
Apart from that, reading it as a joystick or just running some kind of direct voltage reading would work.

jSchnitz 12-05-2016 19:53

Re: Selecting Autonomous with TI LaunchPad?
 
Quote:

Originally Posted by RufflesRidge (Post 1586276)
You can just read the value of the "joystick axis" that corresponds to the potentiometer analog input and use that to determine the choice.

It sounds like he is worried that the robot won't be able to read the joystick axis in autonomous since it is, well, autonomous. I don't actually know if this is the case or not.

NetworkTables would work just fine for sending the choice. Alternately your code could read the joystick axis in a periodic function, or in disabled, and then use the value from there in autonomous.

Thad House 12-05-2016 20:03

Re: Selecting Autonomous with TI LaunchPad?
 
At the beginning of autonomous, the FPGA latches the most recent joystick values received. So you can read joystick values in autonomous as long as you have set them properly before autonomous.

Christopher149 12-05-2016 20:06

Re: Selecting Autonomous with TI LaunchPad?
 
Quote:

Originally Posted by Thad House (Post 1586283)
At the beginning of autonomous, the FPGA latches the most recent joystick values received. So you can read joystick values in autonomous as long as you have set them properly before autonomous.

This. We have 5 rocker switches that we wired to buttons 1 through 5 on the Launchpad, and just read the button states at the beginning of autonomous like a boring old joystick. Easy and simple.

(our biggest problem has been with the physical construction of our wiring to the buttons coming undone - we should redo it)

team-4480 12-05-2016 20:22

Re: Selecting Autonomous with TI LaunchPad?
 
Quote:

Originally Posted by jSchnitz (Post 1586280)
It sounds like he is worried that the robot won't be able to read the joystick axis in autonomous since it is, well, autonomous. I don't actually know if this is the case or not.

NetworkTables would work just fine for sending the choice. Alternately your code could read the joystick axis in a periodic function, or in disabled, and then use the value from there in autonomous.

You hit the nail on the head. I just wasn't sure if I would be able to grab the latest value from the joystick, but it sounds like you can from the reponses. Thanks!

Alan Anderson 13-05-2016 00:10

Re: Selecting Autonomous with TI LaunchPad?
 
In the "old days" when the joystick values were all returned during autonomous as neutral with no buttons pressed, the typical tactic was for the user program to read and save the values while the robot was disabled before the match began, then use the saved values during autonomous. That is now done for you by the system.

sraque 13-05-2016 07:15

Re: Selecting Autonomous with TI LaunchPad?
 
Quote:

Originally Posted by Alan Anderson (Post 1586355)
In the "old days" when the joystick values were all returned during autonomous as neutral with no buttons pressed, the typical tactic was for the user program to read and save the values while the robot was disabled before the match began, then use the saved values during autonomous. That is now done for you by the system.

Is there a document somewhere that captures this, and similar, system design information?

messer5740 13-05-2016 09:06

Re: Selecting Autonomous with TI LaunchPad?
 
My team was considering doing this. Would the TI LaunchPad Evaluation kit work? Also, how would you make it work? Would you wire it to the RoboRio or to a different module?

Mark McLeod 13-05-2016 09:11

Re: Selecting Autonomous with TI LaunchPad?
 
Quote:

Originally Posted by messer5740 (Post 1586386)
My team was considering doing this. Would the TI LaunchPad Evaluation kit work? Also, how would you make it work? Would you wire it to the RoboRio or to a different module?

See this Launchpad thread to get started.

adciv 13-05-2016 10:27

Re: Selecting Autonomous with TI LaunchPad?
 
If you're open to an alternative method... We set our options this year by creating custom buttons/drop boxes on the dashboard. Our drive team would configure auto as required at the setup and network tables would sent the info to the robot. This can make things a tad simpler at times (we had at least three options to set this year).

team-4480 13-05-2016 10:37

Re: Selecting Autonomous with TI LaunchPad?
 
Quote:

Originally Posted by adciv (Post 1586400)
If you're open to an alternative method... We set our options this year by creating custom buttons/drop boxes on the dashboard. Our drive team would configure auto as required at the setup and network tables would sent the info to the robot. This can make things a tad simpler at times (we had at least three options to set this year).

Yea we did something similar using the SmartDashboard. Personally, I think having physical switches are awesome so we are going to give it a shot.

GreyingJay 13-05-2016 12:00

Re: Selecting Autonomous with TI LaunchPad?
 
We put a multiposition selector switch right on the robot. It's a 12-position dial (with a nice solid click-click-click action) and a built in LED that lights up which position is selected. Internally it is a resistor ladder so you read it as an analog input on the RoboRio. Worked very well for us. The drive team literally dials in which autonomous they want to run before each match.

team-4480 13-05-2016 14:18

Re: Selecting Autonomous with TI LaunchPad?
 
Quote:

Originally Posted by GreyingJay (Post 1586414)
We put a multiposition selector switch right on the robot. It's a 12-position dial (with a nice solid click-click-click action) and a built in LED that lights up which position is selected. Internally it is a resistor ladder so you read it as an analog input on the RoboRio. Worked very well for us. The drive team literally dials in which autonomous they want to run before each match.

Do you mind linking the one you used? That sounds better than using a normal potentiometer!

ILAMtitan 13-05-2016 14:27

Re: Selecting Autonomous with TI LaunchPad?
 
Quote:

Originally Posted by team-4480 (Post 1586445)
Do you mind linking the one you used? That sounds better than using a normal potentiometer!

Rotary switches are pretty cheep and easy to use. Here's a 12 position one that would emulate what GreyingJay did: http://www.digikey.com/product-detai...1NPF-ND/370270

In one of the Launchpad example control panels I wired up an 8 position one. You can see it here to get an idea of how to do it: http://processors.wiki.ti.com/index....nalog_Wire.JPG
The red and black wire on either end of the resistor chain are +3.3V and gnd, and the one in the middle is the signal out.

Aeglos 08-06-2016 02:20

Re: Selecting Autonomous with TI LaunchPad?
 
In response to using a TI LaunchPad-
It would be much simpler, at least in my opinion, to use a Raspberry Pi Zero, as it is so inexpensive and abundant. It can pretty easily pretend to be a joystick with as many buttons as you want, and will have a LOT more support from outside sources and forums due to its much larger user base than the TI LaunchPads.
Interesting and somewhat related side note- if I remember right from my tinkering with the Pi, the Driver Station pitches a fit if you have a joystick with more than 32 buttons/ axes/ pov's combined, so keep that in mind when constructing your interface regardless of controller. You might have to double up on microcontrollers if you want anything incredibly complex.

team-4480 08-06-2016 09:02

Re: Selecting Autonomous with TI LaunchPad?
 
Quote:

Originally Posted by Aeglos (Post 1591923)
In response to using a TI LaunchPad-
It would be much simpler, at least in my opinion, to use a Raspberry Pi Zero, as it is so inexpensive and abundant. It can pretty easily pretend to be a joystick with as many buttons as you want, and will have a LOT more support from outside sources and forums due to its much larger user base than the TI LaunchPads.
Interesting and somewhat related side note- if I remember right from my tinkering with the Pi, the Driver Station pitches a fit if you have a joystick with more than 32 buttons/ axes/ pov's combined, so keep that in mind when constructing your interface regardless of controller. You might have to double up on microcontrollers if you want anything incredibly complex.

Raspberry Pi runs Linux which means there is a significant boot time. If the usb cable were to come loose during a match, the last thing I want to be waiting for is the thing to boot up again.

Aeglos 08-06-2016 10:50

Re: Selecting Autonomous with TI LaunchPad?
 
Quote:

Originally Posted by team-4480 (Post 1591938)
Raspberry Pi runs Linux which means there is a significant boot time. If the usb cable were to come loose during a match, the last thing I want to be waiting for is the thing to boot up again.

That is quite a valid point...
However, it won't be on the robot and uses only micro-b type connectors, which are latching (not locking, however), so it can withstand some abuse, but if you think it'll be roughed around too much, then definitely pick the LaunchPad.

GreyingJay 14-06-2016 12:37

Re: Selecting Autonomous with TI LaunchPad?
 
Quote:

Originally Posted by team-4480 (Post 1586445)
Do you mind linking the one you used? That sounds better than using a normal potentiometer!

Sorry for the delay in responding, I sometimes disappear off Chief for a while especially right after the season is over :p

Here's the unit we used.

http://www.robotshop.com/ca/en/rotar...module-v1.html

We really like it. You plug it right into an analog input on the RoboRio and just read the input voltage. The resistor network (similar to ILAMtitan's second photo) is internal, and there's a nice blue LED for visual feedback too. Plus, it's cheap!

team-4480 09-08-2016 23:20

Re: Selecting Autonomous with TI LaunchPad?
 
Quote:

Originally Posted by GreyingJay (Post 1592794)
Sorry for the delay in responding, I sometimes disappear off Chief for a while especially right after the season is over :p

Here's the unit we used.

http://www.robotshop.com/ca/en/rotar...module-v1.html

We really like it. You plug it right into an analog input on the RoboRio and just read the input voltage. The resistor network (similar to ILAMtitan's second photo) is internal, and there's a nice blue LED for visual feedback too. Plus, it's cheap!

We ended up buying this exact one, but the problem is that there only seems to be a handful of values the NI Joystick Explorer sees which are .094, .1, .11, and .12. This is a problem because we really want to use all 12 parts of the switch. We are using the 3.3V rail. Is there something extra you have to do in order to make it so it reports very precise voltages? Thanks!

Max Boord 09-08-2016 23:41

Re: Selecting Autonomous with TI LaunchPad?
 
Quote:

Originally Posted by asid61 (Post 1586277)
Why not simply use a multiposition button? They look like potentiometers but have different settings you can snap to rather than an analog output.

This is how 1065 has selected auto modes for years now. 1 or 2 multi position dial and a toggle switch if needed. This year for instance we used the dial to select what we where driving over and position and then used a 3 position switch to determine if we would shoot high, low or do nothing once we got to the batter.


All times are GMT -5. The time now is 20:28.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi