Go to Post Changing the world starts with changing yourself. - Jeremy_Mc [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 Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 02-02-2015, 13:28
igorjavaroni igorjavaroni is offline
Registered User
FRC #1382 (ETEP Team)
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Brazil
Posts: 20
igorjavaroni is an unknown quantity at this point
Using keyboard

Hi Guys, before i start, let's imagine if your team forget the joystick at school during an event, Is there anyway to control our robot using keyboard(WSAD) to move our robot? How to do that?
Reply With Quote
  #2   Spotlight this post!  
Unread 02-02-2015, 13:30
faust1706's Avatar
faust1706 faust1706 is offline
Registered User
FRC #1706 (Ratchet Rockers)
Team Role: College Student
 
Join Date: Apr 2012
Rookie Year: 2011
Location: St Louis
Posts: 498
faust1706 is infamous around these partsfaust1706 is infamous around these parts
Re: Using keyboard

It is very possible (but I don't have code at hand to show/give you).

Caution: you cannot toggle motor speeds and what not with a keyboard. It is either 1 or 0, so you'll either go full speed or not move. Just a warning.
__________________
"You're a gentleman," they used to say to him. "You shouldn't have gone murdering people with a hatchet; that's no occupation for a gentleman."
Reply With Quote
  #3   Spotlight this post!  
Unread 02-02-2015, 13:35
igorjavaroni igorjavaroni is offline
Registered User
FRC #1382 (ETEP Team)
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Brazil
Posts: 20
igorjavaroni is an unknown quantity at this point
Re: Using keyboard

Nice, but is there any library spicific to do that?
Reply With Quote
  #4   Spotlight this post!  
Unread 02-02-2015, 14:03
Ben Wolsieffer Ben Wolsieffer is online now
Dartmouth 2020
AKA: lopsided98
FRC #2084 (Robots by the C)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Manchester, MA (Hanover, NH)
Posts: 520
Ben Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud of
Re: Using keyboard

No, there is no way to do it directly through WPILib. I would use a program (maybe a SmartDashboard extension) on the DS to read the keyboard and send commands over NetworkTables. I would be very careful about accidentally creating a runaway robot.
__________________



2016 North Shore District - Semifinalists and Excellence in Engineering Award
2015 Northeastern University District - Semifinalists and Creativity Award
2014 Granite State District - Semifinalists and Innovation in Control Award
2012 Boston Regional - Finalists
Reply With Quote
  #5   Spotlight this post!  
Unread 02-02-2015, 15:23
Sperkowsky's Avatar
Sperkowsky Sperkowsky is online now
Professional Multitasker
AKA: Samuel Perkowsky
FRC #2869 (Regal Eagles)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2014
Location: Bethpage, NY
Posts: 1,905
Sperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond repute
Why would you want to? As a pc gamer I love wasd except for in driving games. First by nature is a driving game. A controller or joystick Is much better because it allows for more linear movements
Reply With Quote
  #6   Spotlight this post!  
Unread 02-02-2015, 15:45
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,659
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: Using keyboard

You could have WASD add/subtract a smaller fraction to the speed in that direction (perhaps 10%). If you go this route, you probably also want a button that goes to zero from whatever speed you are doing, so you might use WAZD for increment speed, and S for "stop".
Reply With Quote
  #7   Spotlight this post!  
Unread 03-02-2015, 18:52
orangeandblack5 orangeandblack5 is offline
Hates LabView - Uses It Anyway
AKA: Ian Stewart
FRC #5498 (Wired Devils)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Grosse Ile, MI
Posts: 15
orangeandblack5 will become famous soon enough
Re: Using keyboard

I would also like an answer to this.

I tried this for about 2 days to no avail (I've never used LabView before), and I would really like to know how to do this (mostly for testing purposes (such as being able to run the robot simulator without having to bring home a joystick)). If you want I can upload my unsuccessful code, but it didn't work right, so I won't right now.

Thanks in advance!
Reply With Quote
  #8   Spotlight this post!  
Unread 04-02-2015, 06:29
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Using keyboard

The VIs for reading the keyboard, like a video game does, are located in Connectivity>>Input Devices. Your dashboard will need to open the keyboard and in a loop, it will need to read the keyboard and update one or more "virtual joystick" SmartDashboard globals. I'd recommend doing a flush when setting them or it will only get transmitted to the robot at 100ms rate.

The other way to get the data to the robot is via UDP or TCP communications. You will need to make your own simple protocol, possibly just sending the keys via TCP is sufficient.

Greg McKaskle
Reply With Quote
  #9   Spotlight this post!  
Unread 09-04-2015, 19:22
orob's Avatar
orob orob is offline
rookie mentor
AKA: Rob O.
FRC #3206 (Royal T-wrecks)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Woodbury, MN
Posts: 5
orob is an unknown quantity at this point
Re: Using keyboard

I made a custom dashboard and put buttons on it and drove with the mouse rather than wasd, but labview's method of event capturing keystrokes isn't really going to work within the framework of the robotic code unless you make a keyboard driver VI that runs like the joystick driver runs. If you have a Wii, you can use one of those controllers via bluetooth... that might be worthwhile.
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 21:26.

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