×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

Joystick

  • Posts: 5
  • Thank you received: 0

Replied by Tom on topic Joystick

I am using PlayStation PS4 as my joystick on a remote Raspi. Under linux (jstest) the left joystick is #1, right joystick is #2, and the left digital joystick is #3.

Under INDI Control Panel Monitor the left joystick works fine. Manipulating the right joystick give garbled results showing up under #2 and #3. And the left digital joystick doesn't show up under #3. Note, all the Axes values shown in Monitor are correct though. And the buttons are correct. So I figure the algorithm for calculating the Joystick values from the Axis values has a bug somewhere.

Thinking perhaps I am running old joystick driver on Raspi, I did a git pull from master for the latest everything. Same results.

Looking at the source code it seems to me that the joystick algorithms perhaps assumes 2-axis joysticks, where the game controllers are 3-axis joysticks. X-Y-Trigger.

So I added some work around based on reading the "name" given at onConnect. In this case the name is "Sony Interactive Entertainment Wireless Controller".
I assume all PS3 and PS4 controllers return a name with "Controller" in it. Not knowing if XBOX sends something similar. Does anybody know what XBOX returns?
Hoping they return something with Controller in it... So I am looking for the word "Controller" in the name. If it is, I set a boolean PS3=true. Then in the rest of the driver code if PS3 is true I skip the current code and substitute the new code. Testing now. I will push this up to github. I am looking for someone with a XBOX controller so I can make that work too.
4 years 7 months ago #43550

Please Log in or Create an account to join the conversation.

  • Posts: 5
  • Thank you received: 0

Replied by Tom on topic Joystick

I just obtained a X-BOX game controller and it responds with name "Microsoft X-Box One S pad". So looking just for "Controller won't work.
Also, the position order of the buttons for 3 and 4 is flipped
PS4 button #
X-Box button #
X(Cross) #1 - Bottom of Diamond pattern - A #1
Circle #2 - Right of Diamond pattern - B #2
Triangle #3 - Top of Diamond pattern - Y #4
Square #4- Left of Diamond pattern - X #3

Not sure how people would prefer the button orders, but under PMC8 the STOP is #1 (Cross or A); Park is #2 (Circle or B); Un-park is #3 (Triangle or X).

For now I am just testing name for presence of either "Controller" or "X-Box and assigning a boolean PS1 to true.
4 years 7 months ago #43573

Please Log in or Create an account to join the conversation.

  • Posts: 5
  • Thank you received: 0

Replied by Tom on topic Joystick

Ahh! Setting boolean PS3 to true, Not PS1.
4 years 7 months ago #43581

Please Log in or Create an account to join the conversation.

  • Posts: 28
  • Thank you received: 2

Replied by Francisco Labrador on topic Joystick

Hi,

After a long time "disconnected" due to work issues, I am now here again!

A simple question related to Joystick:

I already have a PS3 wireless control and I wonder if it is possible to connect it to my RPI/Stellarmate wirelessly. I understand that is it possible by cable (following your instructions) but I don't know whether I can use it without cable. As per your comments with yours (Thustmaster wireless) it seems to be possible, but please let me know how to do it.

Thanks!
SkyWatcher AZEQ6-Pro
Meade SC8 UHTC
TMB 80/480 LZOS APO
Orion ShortTube 80/400
APM 50 sight & find
Meade ETX70-AT
QHY183M
ZWO ASI290MC
StarlightXpress Filter Wheel
SestoSenso Focuser
Pegasus Pocket Power Box
... More coming...
4 years 2 weeks ago #51879

Please Log in or Create an account to join the conversation.

  • Posts: 28
  • Thank you received: 1

Replied by Paul Mogg on topic Joystick

Hi there Jasem,
I just wanted to ask whether or not Joystick support has been implemented yet on the Mac? I just found this thread. I'm on OSX 10.15.7 Catalina on a Macbook Pro.

I checked that the Xbox One controller I just got does work on the Mac. There is a system extension called "Xbox 360 Controllers" you can use it with to do so. Perhaps you know of some way to use it with that extension?

Unfortunately under Kstars I always get the same message "Driver indi_joystick was not found on the system. Please make sure the package that provides the "indi_joystick" binary is installed." ...when following the instructions on how to install a joystick from the INDI website.

Anyway, any update would be gratefully appreciated.

Thank you,

p.s. I'd also just like to say how wonderful I think Kstars / EKOS is! I'm very new to Astronomy / Astrophotography, and very much appreciate this amazing suite of tools. It makes our lives so much easier as beginners on the Mac.
3 years 3 months ago #65659

Please Log in or Create an account to join the conversation.

Replied by Jasem Mutlaq on topic Joystick

Unfortunately, it's not implemented on Mac. Not sure what is involved exactly to add support to the driver as it currently written for Linux.
3 years 3 months ago #65759

Please Log in or Create an account to join the conversation.

  • Posts: 216
  • Thank you received: 120

Replied by Rick Bassham on topic Joystick

Might be able to use libsdl to interface with a joystick cross-platform. But that would require reworking the existing driver, or adding a new one in indi-3rdparty.

wiki.libsdl.org/CategoryGameController
3 years 3 months ago #65790

Please Log in or Create an account to join the conversation.

  • Posts: 216
  • Thank you received: 120

Replied by Rick Bassham on topic Joystick

If anyone wants to try out a gamepad driver for Mac, here you go: github.com/rickbassham/indi_gamepad

For some reason, I can't get KStars to connect to it when selecting it in the Aux list and running, but if I run indiserver manually on the mac with this driver, it works fine.

It works in linux as well.
The following user(s) said Thank You: Jasem Mutlaq
3 years 3 months ago #65846

Please Log in or Create an account to join the conversation.

Replied by Jasem Mutlaq on topic Joystick

You need to change the function getDefaultName() to "GamePad" same as the one in the XML file. Btw, this would a great addition to the *default* INDI installation. Though I'm not thrilled about adding a new dependency, so it could be optional and the MacOS release can enable it.
3 years 3 months ago #65854

Please Log in or Create an account to join the conversation.

  • Posts: 216
  • Thank you received: 120

Replied by Rick Bassham on topic Joystick

Unfortunately, the Controller class in indicontroller.h requires the joystick to be named "Joystick". I didn't want to introduce breaking changes with this. Also agree that adding a dependency on SDL for main indi would be overkill for this.
3 years 3 months ago #65856

Please Log in or Create an account to join the conversation.

  • Posts: 216
  • Thank you received: 120

Replied by Rick Bassham on topic Joystick

I could add a new Snoop Device field to Controller to allow the user to specify the device to snoop on, and have it default to Joystick.

Edit:
github.com/indilib/indi/pull/1321
Last edit: 3 years 3 months ago by Rick Bassham.
3 years 3 months ago #65857

Please Log in or Create an account to join the conversation.

  • Posts: 28
  • Thank you received: 1

Replied by Paul Mogg on topic Joystick

FYI, As I couldn't get my Xbox controller working under Kstars I tried setting up INDIGO Server with my mount ( pmc8 ) and joystick, but couldn't get it to work there either. Their joystick driver HID Joystick did seem to see my controlller and read its serial number, and their mount driver does have a "snoop device" field. So I tried entering in that field the name of the driver and also tried the name of my device that the driver presented, but unfortunately no luck. No idea if it's something I'm doing wrong or something in their system, but thought I'd let you know. The INDIGO Server seems to work fine under Kstars / EKOS and one advantage to me is that it DOES recognize my SSAG guide camera, whereas the Kstars internal driver currently does not unfortunately.

If anyone manages to get joystick / gamepad functionality working under Kstars / EKOS on the Mac I'd appreciate if they'd post beginner level instructions on what to enter in what fields to get it working, Thank you, and thanks again for all your efforts in programming this stuff for us!
3 years 3 months ago #65877

Please Log in or Create an account to join the conversation.

Time to create page: 1.044 seconds