Go to Post FRC: more like the real world than we could ever want. - efoote868 [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

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 14-09-2016, 17:00
AlexNeedsAName's Avatar
AlexNeedsAName AlexNeedsAName is offline
Registered User
AKA: Alexander
FRC #3641 (The Flying Toasters)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2015
Location: South Lyon, MI
Posts: 11
AlexNeedsAName is an unknown quantity at this point
Controller help with the HERO?

Our team recently bought a couple CTR HEROs, and we've been working on programing them. However, I haven't been able to successfully connect a PS4 controller in code. I'm connecting to the USB-A port on the HERO; I've tried starting the code with the controller plugged in, out, and cycling while its on.

Here is the code:


Do I need a different controller? Is my code wrong? Also, if the PS4 controller is compatible, is there any way to use it wirelessly with a bluetooth dongle or something?

Any help is greatly appreciated, thanks!
Reply With Quote
  #2   Spotlight this post!  
Unread 14-09-2016, 17:25
EmileH's Avatar
EmileH EmileH is offline
it's not a water game, ok?
AKA: Emile Hamwey
FRC #1058 (PVC Pirates) & SLFF (NE Way You Want It)
Team Role: Programmer
 
Join Date: Dec 2014
Rookie Year: 2011
Location: New England
Posts: 532
EmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant future
Re: Controller help with the HERO?

I know that for using a PS3/4 Controller on Windows, you need to use some special software from either Motioninjoy or ScpToolkit in order for the gamepad to be recognized by your computer. This is because the PS4 gamepads do not send their control outputs over a universally-recognizable format, like that of the Logitech F310 or Rock Candy Xbox 360 controller. These controllers use a control format called Xinput (some DirectInput as well) which is easily recognized by PC, and likely, your HERO board. I would recommend picking up a Logitech F310 at GameStop or Walmart, they are super cheap and work great.

EDIT: After reading through CTRE's User Guide for the HERO, it is recommended to use an F310 in DirectInput mode to control your robot as this sends generic HID commands to your computer/HERO. As I assumed, the Rock Candy gamepad or any PS3/4 controllers use special drivers and inputs to send their control inputs to the computer, so they presumably wouldn't work with your HERO.
__________________
2016-present: High School Student, FRC 1058 PVC Pirates
2016: RiverRage 20 Champions, Battle of the Bay 3 Champions

2013-2015: Middle School Student, FRC 3467 Windham Windup

Last edited by EmileH : 14-09-2016 at 17:29.
Reply With Quote
  #3   Spotlight this post!  
Unread 14-09-2016, 17:30
ozrien's Avatar
ozrien ozrien is online now
Omar Zrien
AKA: Omar
no team
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2003
Location: Sterling Heights, MI
Posts: 521
ozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant future
Re: Controller help with the HERO?

Hey Alex, ATM the HERO supports basic HID USB gamepads (like the F310 or F710 USB Logitech gamepads). The ps4 controller seems to require a special driver. If I have time I'll take a look to see if it's easy to add to HERO, but in the meantime I'd recommend one of the suggested gamepads in our manual (or any basic HID device).
Reply With Quote
  #4   Spotlight this post!  
Unread 15-09-2016, 12:54
Gravity's Avatar
Gravity Gravity is offline
changed his status to single.
AKA: Alex Lederman
FRC #5940 (B.R.E.A.D.)
Team Role: Mechanical
 
Join Date: Jan 2016
Rookie Year: 2016
Location: Burlingame, CA
Posts: 103
Gravity is just really niceGravity is just really niceGravity is just really niceGravity is just really nice
Re: Controller help with the HERO?

Quote:
Originally Posted by EmileH View Post
I know that for using a PS3/4 Controller on Windows, you need to use some special software from either Motioninjoy or ScpToolkit in order for the gamepad to be recognized by your computer. This is because the PS4 gamepads do not send their control outputs over a universally-recognizable format, like that of the Logitech F310 or Rock Candy Xbox 360 controller. These controllers use a control format called Xinput (some DirectInput as well) which is easily recognized by PC, and likely, your HERO board. I would recommend picking up a Logitech F310 at GameStop or Walmart, they are super cheap and work great.

EDIT: After reading through CTRE's User Guide for the HERO, it is recommended to use an F310 in DirectInput mode to control your robot as this sends generic HID commands to your computer/HERO. As I assumed, the Rock Candy gamepad or any PS3/4 controllers use special drivers and inputs to send their control inputs to the computer, so they presumably wouldn't work with your HERO.
MotionInJoy is a hassle to get working correctly, and you have to be online to get most things to work. That being said, there is a patch to use it offline that I recommend here.
__________________

» 2016 Silicon Valley Regional Rookie All Star «
Reply With Quote
  #5   Spotlight this post!  
Unread 15-09-2016, 16:24
marshall's Avatar
marshall marshall is offline
My pants are louder than yours.
FRC #0900 (The Zebracorns)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2003
Location: North Carolina
Posts: 1,256
marshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond repute
Re: Controller help with the HERO?

Quote:
Originally Posted by ozrien View Post
Hey Alex, ATM the HERO supports basic HID USB gamepads (like the F310 or F710 USB Logitech gamepads). The ps4 controller seems to require a special driver. If I have time I'll take a look to see if it's easy to add to HERO, but in the meantime I'd recommend one of the suggested gamepads in our manual (or any basic HID device).
Yeah, PS4 controllers don't show up as standard HID controllers that I'm aware of... maybe there is a way to do it but I haven't found it.

The HERO's libraries need standard HID devices (like ATM machines and NIC cards).
__________________
"La mejor salsa del mundo es la hambre" - Miguel de Cervantes
"The future is unwritten" - Joe Strummer
"Simplify, then add lightness" - Colin Chapman
Reply With Quote
  #6   Spotlight this post!  
Unread 16-09-2016, 16:46
AlexNeedsAName's Avatar
AlexNeedsAName AlexNeedsAName is offline
Registered User
AKA: Alexander
FRC #3641 (The Flying Toasters)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2015
Location: South Lyon, MI
Posts: 11
AlexNeedsAName is an unknown quantity at this point
Re: Controller help with the HERO?

OK, thank you everyone for your help!
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 23:05.

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