×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Controlling with a gamepad more than my telescope

  • Posts: 35
  • Thank you received: 1
Hey,
I'm not new to programming, but after all couldn't actually say that I'm pretty experienced.

INDIlib running with my LX200 GPS works pretty good, also with the gamepad. I'm using a Logitech Inc. WingMan Gamepad. Version 131328. Kinda pretty old, I think from 2000. However it works fluently.
The gamepad has 2 axes and 11 buttons. I pretty much enjoy it to use it with the telescope via kstars (or from console) + indilib.
The lx200 driver offers the possibility to use 3 buttons for different slewing speed, 1 for parking, 1 to abort any movement and the 2 axes for slewing.
Leaving me, in this case, 6 unused buttons.

I know this question might be too general, but actually i don't really know how to attack this problem/question, so... I more or less just need a base to work upon, some ideas. :-D
How could I possibly set a buttons function to, for example, make a picture, maybe a fits, using my Canon EOS 6D?

Do i have to write a new driver with the enable joystick option implemented as in lx200generic.cpp or can I somehow implement it in a already existing driver or just writing myself a new client, who is doing this task?
Best solution for me would be, to just have maybe a driver more to start with kstars, enable for both the joystick option and GO (, which would mean to write a new driver). Kinda just like now with the telescope.

Thanks for replying ahead.

Greetings
Erik
Last edit: 8 years 2 months ago by erik.
8 years 2 months ago #6593

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

You can add support to joystick to INDI GPhoto driver much like the way it is done in lx200generi. Just add the relevant functions calls in the INDI GPhoto driver and you could map more commands, at least in principle since I never tried it with two drivers.
The following user(s) said Thank You: erik
8 years 2 months ago #6623

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

  • Posts: 35
  • Thank you received: 1
I'll report.

Greetings
Erik
Last edit: 8 years 2 months ago by erik.
8 years 2 months ago #6638

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

  • Posts: 35
  • Thank you received: 1
Having a problem compiling the gphoto code, after putting the function calls from lx200generic into gphoto for joystick usage.
:~/indilib/libindi_3rdparty-test/libindi_3rdparty-1.0.0$ make
[ 25%] Building CXX object indi-gphoto/CMakeFiles/indi_gphoto_ccd.dir/gphoto_ccd.o
In file included from /home/erik/indilib/libindi_3rdparty-test/libindi_3rdparty-1.0.0/indi-gphoto/gphoto_ccd.h:28:0,
                 from /home/erik/indilib/libindi_3rdparty-test/libindi_3rdparty-1.0.0/indi-gphoto/gphoto_ccd.cpp:40:
/usr/include/libindi/indicontroller.h:76:18: error: ‘function’ in namespace ‘std’ does not name a template type
     typedef std::function<void (const char * joystick_n, double mag, double angle, void *context)> joystickFunc;
                  ^
/usr/include/libindi/indicontroller.h:81:18: error: ‘function’ in namespace ‘std’ does not name a template type
     typedef std::function<void (const char * axis_n, double value, void *context)> axisFunc;
                  ^
/usr/include/libindi/indicontroller.h:86:18: error: ‘function’ in namespace ‘std’ does not name a template type
     typedef std::function<void (const char * button_n, ISState state, void *context)> buttonFunc;
                  ^
/usr/include/libindi/indicontroller.h:121:30: error: ‘joystickFunc’ has not been declared
     void setJoystickCallback(joystickFunc joystickCallback);
                              ^
/usr/include/libindi/indicontroller.h:127:26: error: ‘axisFunc’ has not been declared
     void setAxisCallback(axisFunc axisCallback);
                          ^
/usr/include/libindi/indicontroller.h:133:28: error: ‘buttonFunc’ has not been declared
     void setButtonCallback(buttonFunc buttonCallback);
                            ^
/usr/include/libindi/indicontroller.h:148:5: error: ‘joystickFunc’ does not name a type
     joystickFunc joystickCallbackFunc;
     ^
/usr/include/libindi/indicontroller.h:149:5: error: ‘buttonFunc’ does not name a type
     buttonFunc buttonCallbackFunc;
     ^
/usr/include/libindi/indicontroller.h:150:5: error: ‘axisFunc’ does not name a type
     axisFunc axisCallbackFunc;
     ^
/home/erik/indilib/libindi_3rdparty-test/libindi_3rdparty-1.0.0/indi-gphoto/gphoto_ccd.cpp: In constructor ‘GPhotoCCD::GPhotoCCD()’:
/home/erik/indilib/libindi_3rdparty-test/libindi_3rdparty-1.0.0/indi-gphoto/gphoto_ccd.cpp:167:47: error: invalid conversion from ‘void (*)(const char*, ISState, void*)’ to ‘int’ [-fpermissive]
     controller->setButtonCallback(buttonHelper);
                                               ^
In file included from /home/erik/indilib/libindi_3rdparty-test/libindi_3rdparty-1.0.0/indi-gphoto/gphoto_ccd.h:28:0,
                 from /home/erik/indilib/libindi_3rdparty-test/libindi_3rdparty-1.0.0/indi-gphoto/gphoto_ccd.cpp:40:
/usr/include/libindi/indicontroller.h:133:10: note: initializing argument 1 of ‘void INDI::Controller::setButtonCallback(int)’
     void setButtonCallback(buttonFunc buttonCallback);
          ^
/home/erik/indilib/libindi_3rdparty-test/libindi_3rdparty-1.0.0/indi-gphoto/gphoto_ccd.cpp: In member function ‘virtual void GPhotoCCD::processButton(const char*, ISState)’:       
/home/erik/indilib/libindi_3rdparty-test/libindi_3rdparty-1.0.0/indi-gphoto/gphoto_ccd.cpp:1335:22: error: return-statement with a value, in function returning 'void' [-fpermissive]
      if (rv) {return true;}                                                                                                                                                        
                      ^                                                                                                                                                             
/home/erik/indilib/libindi_3rdparty-test/libindi_3rdparty-1.0.0/indi-gphoto/gphoto_ccd.cpp:1341:13: error: return-statement with a value, in function returning 'void' [-fpermissive]
      return true;                                                                                                                                                                  
             ^                                                                                                                                                                      
indi-gphoto/CMakeFiles/indi_gphoto_ccd.dir/build.make:54: recipe for target 'indi-gphoto/CMakeFiles/indi_gphoto_ccd.dir/gphoto_ccd.o' failed                                        
make[2]: *** [indi-gphoto/CMakeFiles/indi_gphoto_ccd.dir/gphoto_ccd.o] Error 1                                                                                                      
CMakeFiles/Makefile2:75: recipe for target 'indi-gphoto/CMakeFiles/indi_gphoto_ccd.dir/all' failed                                                                                  
make[1]: *** [indi-gphoto/CMakeFiles/indi_gphoto_ccd.dir/all] Error 2                                                                                                               
Makefile:117: recipe for target 'all' failed                                                                                                                                        
make: *** [all] Error 2  

Thanks for any help anyway, although it might be a pretty simple solution, since I'm not a High-End Programmer.
Regards
Last edit: 8 years 2 months ago by erik.
8 years 2 months ago #6731
Attachments:

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

  • Posts: 35
  • Thank you received: 1
To me it seems like he somehow does not get the definitions of the indicontroller-methods, but I do not know, if I'm supposed to #include the indicontroller.cpp in the Gphoto.cpp or whereever, since I've only got those C++ skills which I learned during my studies. ;-D

_____
INDI Lib Version 1.0.0, compiled from source
Linux tyrion 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u2 (2016-01-02) x86_64 GNU/Linux
8 years 2 months ago #6740

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

  • Posts: 35
  • Thank you received: 1
I'm pretty much stepping on the same place since last Thursday and can't get what's missing, i transfered anything in LX200generic, which was about the controller, function calls, etc., to the GPhoto driver gphoto_ccd.cpp + .h.
Next step is always to try to compile it like normal, using cmake/make. I always get the above error message.

Any hints would be greatly appreciated! :-D

Anyway, where do I set those Callback functions? Pretty unsure, because I can't find anything proper on that in the lx200generic or celestron drivers....
Last edit: 8 years 2 months ago by erik.
8 years 2 months ago #6776

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

  • Posts: 35
  • Thank you received: 1
Update.
So, I got it to work. It's the compiling environment, that made the point.

New Question:
Since i want to 'command' making a picture from my gamepad, whats the best way to program that in the callback function of those gamepad buttons, as it is done in the telescope driver? Or, for example, to turn on the preview or make an image of N seconds shutterspeed from within the driver callback function?
8 years 6 days ago #7370

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

Time to create page: 0.617 seconds