Go to Post Woah, boulders fired. - FrisbeeFunTime [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 03-03-2015, 22:56
majesticfish majesticfish is offline
Registered User
AKA: Sean Yu
FRC #0948 (NRG)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Bellevue
Posts: 5
majesticfish is an unknown quantity at this point
Arduino Leonardo ++ Driver Station Output

Hi.
My team is planning to make a driver station with 5 LED lights that correspond to certain positions on a robot. We want to use an arduino to control these lights, but we are unsure on how to do this.
When looking up how to communicate with the robot, the most common result was using serial on the Roborio itself. This is impossible in this situation as the arduino will be connected to our driver station laptop. Is this any way to send output to the arduino from the driver station?

Sean
  #2   Spotlight this post!  
Unread 03-03-2015, 23:38
ILAMtitan ILAMtitan is offline
Texas Instruments
AKA: Bart Basile
FRC #3005 (RoboChargers)
Team Role: Mentor
 
Join Date: Nov 2013
Rookie Year: 2013
Location: Dallas
Posts: 72
ILAMtitan will become famous soon enoughILAMtitan will become famous soon enough
Re: Arduino Leonardo ++ Driver Station Output

If you check out your KoPs you'll find a small box from Texas Instruments containing an MSP430F5529 LaunchPad. We got these into every KoP for making awesome operator interfaces just like you want!

There is a utility that comes with the NI Update called "Gamepad Tool" which will program the LaunchPad to act as a USB HID gamepad. Add a few buttons, and the IO pins on the LaunchPad map directly to the gamepad functions. We also extended the USB HID interface to include indicator lights, and NI even added the functionality to the robot code so you can access them directly!

For more info on how to use the LaunchPad as a gamepad, check out the wiki page we set up here: http://processors.wiki.ti.com/index....cs_Competition

If you have any questions, feel free to PM me, or email the support line on the wiki (it goes to me and a few other TI engineers) and we'll be happy to help.

Good luck!
  #3   Spotlight this post!  
Unread 04-03-2015, 10:16
jman4747's Avatar
jman4747 jman4747 is offline
Just building robots
AKA: Josh
FRC #4080 (Team Reboot)
Team Role: CAD
 
Join Date: Apr 2013
Rookie Year: 2011
Location: Atlanta GA
Posts: 422
jman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond repute
Re: Arduino Leonardo ++ Driver Station Output

I think the issue is there really isn't an obvious way to have the robot talk to a device connected to the computer.

I wonder if NI VISA would recognize a USB to RS-232 converter as a com port. If it did you could send strings to the device using the smart dash based on values you get of the from the robot.
__________________
---------------------
Alumni, CAD Designer, machinist, and Mentor: FRC Team #4080

Mentor: Rookie FTC Team "EVE" #10458, FRC Team "Drewbotics" #5812

#banthebag
#RIBMEATS
#1620
  #4   Spotlight this post!  
Unread 04-03-2015, 10:51
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: 325
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: Arduino Leonardo ++ Driver Station Output

Quote:
Originally Posted by jman4747 View Post
I think the issue is there really isn't an obvious way to have the robot talk to a device connected to the computer.
The intent with the new driverstation is to support HID gamepads as the 'obvious' way to communicate from the robot to the driver station, and a HID compatible microcontroller or a gamepad can be used to get custom input/output. This year's WPILib API has functions to set outputs to the driver station which is communicated directly to the joystick.

The HID compatible Arduinos, like the Leonardo++, will work for inputs by default, however the libraries do not have support for HID outputs, meaning out of the box you would not be able to set indicator LEDs. The underlying software would need to be modified to add this support.

The LaunchPad in the kit can be loaded with prebuilt binaries to support input and outputs out of the box. So you can connect it to the driver station and hook both buttons and indicator LEDs to the board, and use the WPILib API to turn on/off the LEDs. The only downside is that if you want to edit the code the only option is the full eclipse based Code Composer. The Arduino forked environment for the LaunchPad (Energia) doesn't work for HID.

Quote:
Originally Posted by jman4747 View Post
I wonder if NI VISA would recognize a USB to RS-232 converter as a com port. If it did you could send strings to the device using the smart dash based on values you get of the from the robot.
VISA will recognize the USB to RS-232 converter properly so this approach would work. You just need to be careful with enumerating the correct port (and make sure the Smart Dashboard ports aren't blocked at the event).
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -
  #5   Spotlight this post!  
Unread 04-03-2015, 11:46
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Arduino Leonardo ++ Driver Station Output

Quote:
Originally Posted by majesticfish View Post
My team is planning to make a driver station with 5 LED lights that correspond to certain positions on a robot.
Would you be satisfied with five indicators on the Dashboard screen instead of physical LEDs? Doing that is trivial, and in fact there are already eight of them on the default Dashboard that your robot can control with very simple code.
  #6   Spotlight this post!  
Unread 04-03-2015, 12:10
billbo911's Avatar
billbo911 billbo911 is online now
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,381
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: Arduino Leonardo ++ Driver Station Output

Quote:
Originally Posted by wt200999 View Post
The intent with the new driverstation is to support HID gamepads as the 'obvious' way to communicate from the robot to the driver station, and a HID compatible microcontroller or a gamepad can be used to get custom input/output. This year's WPILib API has functions to set outputs to the driver station which is communicated directly to the joystick.

The HID compatible Arduinos, like the Leonardo++, will work for inputs by default, however the libraries do not have support for HID outputs, meaning out of the box you would not be able to set indicator LEDs. The underlying software would need to be modified to add this support.

The LaunchPad in the kit can be loaded with prebuilt binaries to support input and outputs out of the box. So you can connect it to the driver station and hook both buttons and indicator LEDs to the board, and use the WPILib API to turn on/off the LEDs. The only downside is that if you want to edit the code the only option is the full eclipse based Code Composer. The Arduino forked environment for the LaunchPad (Energia) doesn't work for HID. ....

I set the text to bold that I wanted to make sure wasn't missed.

This is how we created our drives station "Button Box" this year.
The Launchpad has 3 different possible configurations right from the KOP.
The differences in the 3 configurations are based on how many inputs vs. outputs that are available. The combinations of I/O are: 11/11, 16/6, 20/2.
All 3 combinations also have 8 analog inputs.

As an example, we started out needing 18 inputs (later refined to only 14) from our button box. So, the configuration we chose was 20/2.
We the used the 2 outputs to interface to a Arduino Nano inside the button box to control a string of 60 WS2812 LEDs.

While the robot is disabled, output 1 and 2 remain low. This tells the Adruino to run a demo loop that just cycles through a variety of lighting patterns.
Once the robot goes enabled, output 1 goes high. The Arduino then looks at output 2 to determine which pattern to display. Output 2 HIGH means Red Alliance, LOW means Blue Alliance. The LEDs then just display the Alliance color.

This is a very simple use of the outputs to drive LEDs. Discrete LEDs can also be driven directly by the Launchpad, but care must be taken to not exceed the current ratings of the board.

Here is a very helpful web page to help you figure out how to use your Launchpad.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
  #7   Spotlight this post!  
Unread 04-03-2015, 20:11
reuven reuven is offline
Registered User
FRC #3211 (The Y team)
Team Role: Mentor
 
Join Date: Nov 2010
Rookie Year: 2009
Location: yeruham Israel
Posts: 38
reuven will become famous soon enough
Re: Arduino Leonardo ++ Driver Station Output

my team made a control box using the Labview LVH-LINX library (you can see more about them in this link )
we planted the code to read the data from the arduino (we used the UNO ) in our dashboard, sanding the data to the robot using the SmartDashbord VI's
i think that the same method will allow you to set outputs to an arduino...
__________________
בנגב יבחן העם בישראל" דוד בן גוריון"
"In the Negev the people of israel would be tested"-David Ben Gurion
  #8   Spotlight this post!  
Unread 05-03-2015, 01:11
majesticfish majesticfish is offline
Registered User
AKA: Sean Yu
FRC #0948 (NRG)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Bellevue
Posts: 5
majesticfish is an unknown quantity at this point
Re: Arduino Leonardo ++ Driver Station Output

Hi Everyone,
Thanks for all your responses. My team has switched to the launch pad for our driver station, so we should be fine.
However i'm a little curious about this:

Quote:
Originally Posted by jman4747 View Post
If it did you could send strings to the device using the smart dash based on values you get of the from the robot.
How specifically would I be able to send information using smart dashboard to the serial on the arduino?
  #9   Spotlight this post!  
Unread 05-03-2015, 11:43
fovea1959's Avatar
fovea1959 fovea1959 is offline
Herder of programmers
AKA: Doug Wegscheid
FRC #3620 (The Average Joes)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2011
Location: St Joseph
Posts: 336
fovea1959 will become famous soon enough
Re: Arduino Leonardo ++ Driver Station Output

wt200999: what's the wpilib class and method to manipulate HID leds on the driver station?
  #10   Spotlight this post!  
Unread 05-03-2015, 11:52
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: 325
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: Arduino Leonardo ++ Driver Station Output

Quote:
Originally Posted by majesticfish View Post
How specifically would I be able to send information using smart dashboard to the serial on the arduino?
Assuming you've used or know how to use smart dashboard, you need a way to communicate through serial to the arduino in LabVIEW. Two good methods I can think of to use for this.

The first one is what reuven mentioned in the post above. The LVH-LINX library is a neat library which puts a generic firmware image on the arduino, and uses the serial port to access the pariphrials on the device. It is not as fast as writing code directly on the arduino, but it makes the interface easier. Before the season started I had LINX working on the LaunchPad as well, and the timing between commands was close to ~5ms. So its great for low speed tasks. I'm also not sure that you would be able to use this AND the HID protocol with the driver station.

The second method would be to do all the programming on the ardunio/LaunchPad and send data back data through the serial port using the standard 'Serial.Print()' commands. On the LabVIEW side you can use the built in serial port functions found at Instrument I/O --> Serial. From here you just need to interpret the data you sent from the arduino and convert it to send over the smartdashboard. I don't know if you can do both this AND the HID protocol on the arduino, however the LaunchPad has a built in USB hub which allows it to use the serial port AND the HID at the same time.

Quote:
Originally Posted by fovea1959 View Post
wt200999: what's the wpilib class and method to manipulate HID leds on the driver station?
For both C++ and Java the Joystick class has:

Joystick.setOutput(uint8_t outputNumber, bool value)
Set a single HID output value for the joystick.

Parameters
outputNumber The index of the output to set (1-32)
value The value to set the output to

and

Joystick.setOutputs(uint32_t value)
Set all HID output values for the joystick.

Parameters
value The 32 bit output value (1 bit for each output)

More details here

In LabVIEW its under WPI Robotics Library --> Joystick --> Set Outputs which gives an array of booleans as the input.

You can test this by setting the first two outputs to true, and you should see two indicator lights on the LaunchPad itself light up.
__________________
Programming in LabVIEW? Try VI Snippets!

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


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 21:02.

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