Need help with inputdriver5 for SpaceMouse

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Need help with inputdriver5 for SpaceMouse

sibjo
First of thanks for letting me in here! :)

I just got a SpaceMouse Pro since I'm spending quite some time designing in
OpenSCAD. I was happy to see all the work that's been put into getting
devices like this it to work with OpenSCAD. However, I'm quite a noob when
it comes to compiling and I can not get the SpaceNav driver to be enabled
during the build. I have tried some different things but apparently, I don't
have the knowledge to get it to work.  

This is from my most recent failure:

cd ~/
git clone -b inputdriver5 https://github.com/openscad/openscad.git
cd openscad
git submodule init
git submodule update
./scripts/check-dependencies.sh
qmake CONFIG+=experimental CONFIG+=hidapi CONFIG+=spnav openscad.pro
make -B


I have also tried adding
CONFIG+=experimental
CONFIG+=hidapi
CONFIG+=spnav
manually to the top of the openscad.pro file.

What am I doing wrong? How do I get SpaceNav (or HIDAPI) to work?

Many thanks!
/ Simon



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
tp3
Reply | Threaded
Open this post in threaded view
|

Re: Need help with inputdriver5 for SpaceMouse

tp3
On 01/31/2018 10:52 PM, sibjo wrote:
> I just got a SpaceMouse Pro since I'm spending quite some time
> designing in OpenSCAD.
>
On Linux there's basically 3 options that should be possible.

HIDAPI

- not recommended as this needs root (or probably quite some
   fiddeling with access rights)

SPACENAVD

- using the separate spacenavd daemon
- needs development package installed, on Debian that is called
   libspnav-dev

JSDEV

- using normal Linux joystick interface
- only possible if spacenavd is not running
- if the mouse is picked up by the joystick driver, it should
   show up in the "dmesg" kernel log output

> What am I doing wrong? How do I get SpaceNav (or HIDAPI) to work?
>
For spacenavd (example for Debian/Ubuntu):

- apt install libspnavd-dev
- re-run qmake, this should pick up the client library

The joystick driver should be always available on Linux (we
currently lazily assume the dev stuff is always there)

Note that in the latest version, both the input driver needs
to be enabled in the Preferences and then also check the
drivers are enabled in the respective tab in Preferences.

To just give it a try, you could alternatively also check
the AppImage:
https://download.opensuse.org/repositories/home:/t-paul/AppImage/OpenSCAD-Branch-InputDriver-latest-x86_64.AppImage

Just download, make executable and run, it contains all the
needed files in a single package.

ciao,
   Torsten.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: Need help with inputdriver5 for SpaceMouse

sibjo
Thank you Torsten! That did the trick with SPACENAVD!

I have three more questions:

1: I tried to get the buttons to work, some of them highlight in red when
pushed under "Buttons" and then I
can choose from the list what action I want. However, after closing
preferences (or even restart) none of the buttons work. What do I have to do
to make it work?

2: None of the settings under "Axis Mapping" seems to have any effect so I'm
guessing the settings are stored somewhere else. I had a quick look in
SpaceNavInputDriver.cc but I don't want to mess with anything I don't
understand. Where do I lower the sensitivity?

3: This is related to number 2 - I did a quick test in Blender with the
SpaceNav deamon installed. Any chance I can configure SpaceNav to work the
same way in OpenSCAD? (move the camera, not the object)

I did try the AppImage as well before compiling but none of the checkboxes
for DBus Joystick SpaceNav etc showed up.

Thanks!
/ Simon




--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
tp3
Reply | Threaded
Open this post in threaded view
|

Re: Need help with inputdriver5 for SpaceMouse

tp3
On 02/01/2018 07:34 PM, sibjo wrote:
> 1: I tried to get the buttons to work, some of them highlight in
> red when pushed under "Buttons" and then I can choose from the list
> what action I want. However, after closing preferences (or even
> restart) none of the buttons work. What do I have to do to make
> it work?
>
Hmm, if the highlight works, it seems the buttons are actually
picked up. So it's strange that it's not working for the actions.
But then there were lots of changes lately, I'll see if I can
test that (just switching notebooks, so quite some setup still
going on...).

What's the "InputDriver" line in Help->LibraryInfo saying?

> 3: This is related to number 2 - I did a quick test in Blender with the
> SpaceNav deamon installed. Any chance I can configure SpaceNav to work the
> same way in OpenSCAD? (move the camera, not the object)
>
I don't know how Blender handles it. There's currently 2 options.
One changes the object, the other keeps the changes relative to
the viewport. Which one is used depends on the axis selection.

> I did try the AppImage as well before compiling but none of the
> checkboxes for DBus Joystick SpaceNav etc showed up.
>
Oh, oops, the spacenav lib might be missing there. I'll have to
check if it's possible to add this to the build. The other drivers
should be there though.

ciao,
   Torsten.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: Need help with inputdriver5 for SpaceMouse

sibjo
Thanks for a quick reply!

Yes the buttons seem to be picked up, all except the rotation lock button
(and esc, shift, ctrl & alt).

>What's the "InputDriver" line in Help->LibraryInfo saying?
>
It's saying:
InputDrivers: SpaceNavInputDriver*, JoystickInputDriver (and DBus also if
I've chosen that option)

>I don't know how Blender handles it. There's currently 2 options.
>One changes the object, the other keeps the changes relative to
>the viewport. Which one is used depends on the axis selection.
>
Ok I understand but I don't understand why the Axis Mapping in preferences
is not taking effect?
Since last compilation some settings in general are not taking effect so I'm
currently forced to use sudo privileges, maybe that got something to do with
everything?  

/ Simon



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
tp3
Reply | Threaded
Open this post in threaded view
|

Re: Need help with inputdriver5 for SpaceMouse

tp3
On 02/01/2018 11:07 PM, sibjo wrote:
> Yes the buttons seem to be picked up, all except the rotation
> lock button (and esc, shift, ctrl & alt).
>
Maybe those are not handled by spacenavd, or we need to
do something else to support them. This is tricky to solve
without access to the hardware. Maybe we can try some
debugging later once the main features are working.

> Ok I understand but I don't understand why the Axis Mapping in
> preferences is not taking effect?
 >
Are the axis indicators moving? I had to restart spacenavd
at some point. It might not be possible to connect to spacenavd
if another application is using it (or another instance of
OpenSCAD).

It looks ok for me, see screencast:
http://files.openscad.org/tmp/Screencast_02-02-2018_inputdriver.mp4

Script:

- Reset all axis mappings to None
- Move Axis 0
- Move Axis 5
- Select Translation-X to Axis 0
- Moves object in X
- Select Rotation-Z to Axis 5
- Rotate Object around Z

Note that events are only passed to the selected OpenSCAD
main window.

> Since last compilation some settings in general are not
> taking effect so I'm currently forced to use sudo privileges,
> maybe that got something to do with everything?
>
That's odd. Admin should not be needed for compilation or
just running via ./openscad in the build directory.

Maybe you ran it earlier via sudo and it did overwrite
some file which now belongs to root.

ciao,
   Torsten.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: Need help with inputdriver5 for SpaceMouse

MichaelPFrey
In reply to this post by tp3
Am 31.01.2018 um 23:29 schrieb Torsten Paul:
To just give it a try, you could alternatively also check
the AppImage:
https://download.opensuse.org/repositories/home:/t-paul/AppImage/OpenSCAD-Branch-InputDriver-latest-x86_64.AppImage
This seems to be a bit of an old build, that contains a known bug.
You have to set the gain for the axis manually to 1,00, as the default gain is 0,01:

Unfortunately, this is also written to the preference file, meaning the bug affects/transfer to other instances.

With Kind regards,
Michael Frey

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Need help with inputdriver5 for SpaceMouse

MichaelPFrey
In reply to this post by sibjo
Am 01.02.2018 um 19:34 schrieb sibjo:
> 2: None of the settings under "Axis Mapping" seems to have any effect so I'm
> guessing the settings are stored somewhere else. I had a quick look in
> SpaceNavInputDriver.cc but I don't want to mess with anything I don't
> understand. Where do I lower the sensitivity?
The spaceNavInputDriver is not using the axis mapping feature.
The spaceNavInputDriver is directly effecting translation and rotation
of the view.
Therefor, I currently also do not know how to adjust the sensitivity
when using the spaceNavInputDriver.
> 3: This is related to number 2 - I did a quick test in Blender with the
> SpaceNav deamon installed. Any chance I can configure SpaceNav to work the
> same way in OpenSCAD? (move the camera, not the object)
When using the spaceNavInputDriver: No.

When using other drivers that are using our Axis Mapping: Sure.
I used to use the 3D mouse for openscad with the HidAPI Driver, but
starting OpenSCAD with sudo just to use the HidAPI driver really is not
a good solution. (the Linux HidApi Driver is more meant for developers,
so that we do not need to cross build the windows version.)
> I did try the AppImage as well before compiling but none of the checkboxes
> for DBus Joystick SpaceNav etc showed up.
The AppImage version is a bit old and dated.
"Back in those days" all drivers that where compiled, where always enabled.
The checkboxes to enable/disable specific drivers are pretty recent
additions.

With Kind regards,
Michael Frey

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Need help with inputdriver5 for SpaceMouse

sibjo
Thanks for your help guys!

Now I'm finally getting somewhere :)

I first tried to change some privileges but after a while I just searched
and deleted everything related to OpenSCAD and recompiled it and now the
settings work without being root.

>Are the axis indicators moving? I had to restart spacenavd
>at some point. It might not be possible to connect to spacenavd
>if another application is using it (or another instance of
>OpenSCAD).

It's a little strange because I can use the SpaceMouse to move (however it's
crazy sensitive) but when I'm in preferences the axis indicators are not
moving. Axis mapping settings don't change anything.


>When using other drivers that are using our Axis Mapping: Sure.
>I used to use the 3D mouse for openscad with the HidAPI Driver, but
starting OpenSCAD with sudo just to >use the HidAPI driver really is not a
good solution. (the Linux HidApi Driver is more meant for developers, >so
that we do not need to cross build the windows version.)

Good news then! I agree with you on running OpenSCAD as root is a bit of a
PITA but I tried HidAPI anyway. The axis indicators are moving with HidAPI
and the setting for axis mapping actually works! Well, almost... I got it to
work kind of like I want except that the "ViewPort rel.
Translation"-settings doesn't work at all which is sad because I'm almost
getting there.


About the Buttons:
>Maybe those are not handled by spacenavd, or we need to
>do something else to support them. This is tricky to solve
>without access to the hardware. Maybe we can try some
>debugging later once the main features are working.

After recompiling I got some strange news: no more highlights at all. No
matter what drivers I have activated I'm not getting any response from any
button anymore. weird..

/ Simon



 



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
tp3
Reply | Threaded
Open this post in threaded view
|

Re: Need help with inputdriver5 for SpaceMouse

tp3
In reply to this post by MichaelPFrey
On 02/02/2018 06:30 AM, Michael Frey wrote:
> This seems to be a bit of an old build, that contains a known bug.
 >
Oh, indeed. I only checked the build date. But the build server did
not fetch new source. I force a rebuild...

ciao,
   Torsten.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: Need help with inputdriver5 for SpaceMouse

MichaelPFrey
In reply to this post by sibjo
Am 02.02.2018 um 19:48 schrieb sibjo:
Thanks for your help guys! 

Now I'm finally getting somewhere :)
You are very welcome.
Getting feedback is very valuable, especially as I mainly develop using a Joystick with the Joystick driver under linux.
I first tried to change some privileges but after a while I just searched
and deleted everything related to OpenSCAD and recompiled it and now the
settings work without being root. 

Are the axis indicators moving? I had to restart spacenavd
at some point. It might not be possible to connect to spacenavd
if another application is using it (or another instance of
OpenSCAD).
It's a little strange because I can use the SpaceMouse to move (however it's
crazy sensitive) but when I'm in preferences the axis indicators are not
moving. Axis mapping settings don't change anything. 
The SpaceNavDriver is ignoring the settings. The SpaceNavDriver is directly affecting the ViewPort.
Meaning: When you are using the SpaceNavDriver, the axis mapping has no effect and the axis indicators have no function.
(I do not know whether this is a feature, a bug or an artifact from the early development phase)
Good news then! I agree with you on running OpenSCAD as root is a bit of a
PITA but I tried HidAPI anyway. The axis indicators are moving with HidAPI
and the setting for axis mapping actually works! Well, almost... I got it to
work kind of like I want except that the "ViewPort rel.
Translation"-settings doesn't work at all which is sad because I'm almost
getting there.
Could you please be more specific? Maybe we need yet an other kind of translation.

The feature works for my use case (left thumbstick of a XBox360 Controller controlling the camera). I have one axis of the stick mapped to ViewPort rel. Translation X and the other to Z.
ViewPort rel. Translation on Y has no effect when you are in orthogonal view ().
When you are in perspective view (), the effect of "ViewPort rel. Translation on Y" is similarly to zooming, but in a very strange way.

That the two relevant axis are X and Z  (and not as a user might think X and Y) has to do with the internal working of openSCAD.

Maybe we should hide the option to configure the "ViewPort rel. Translation on Y".
(but as a developer, I have the tendency to leave in any potentially useful feature - "ViewPort rel. Translation on Y" combined with the Zoom can be used for a vertigo effect, which can be used to precisely match the perspective of a photo with a render)


With Kind regards,
Michael Frey

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Need help with inputdriver5 for SpaceMouse

sibjo
I have done a little bit more testing and thinking now :)

>  
>The SpaceNavDriver is ignoring the settings. The SpaceNavDriver is directly
affecting the ViewPort.
>Meaning: When you are using the SpaceNavDriver, the axis mapping has no
effect and the axis indicators >have no function.
>(I do not know whether this is a feature, a bug or an artifact from the
early development phase)

So in Torsten's screencast is it the Joystick and DBus-driver that are
making the move on the axis indicators? There he is showing that the mapping
is taking effect and he got the HIDAPI disabled so I thought it was the
SpaceNav-driver doing the work.



>The feature works for my use case (left thumbstick of a XBox360 Controller
controlling the camera). I >have one axis of the stick mapped to ViewPort
rel. Translation X and the other to Z.
>ViewPort rel. Translation on Y has no effect when you are in orthogonal
view ().
>When you are in perspective view (), the effect of "ViewPort rel.
Translation on Y" is similarly to zooming, >but in a very strange way.
>
>That the two relevant axis are X and Z  (and not as a user might think X
and Y) has to do with the >internal working of openSCAD.
>
>Maybe we should hide the option to configure the "ViewPort rel. Translation
on Y".
>(but as a developer, I have the tendency to leave in any potentially useful
feature - "ViewPort rel. >Translation on Y" combined with the Zoom can be
used for a vertigo effect, which can be used to precisely >match the
perspective of a photo with a render)

Well, 99% of the time I'm in perspective view so that is usually not a
problem.
This morning just after I started the computer the ViewPort rel. Translation
actually worked!
I changed the gain-setting and it completely stopped working again :/
I restarted OpenSCAD - still not working. Restarted the computer - still not
working. I have no idea why it stopped working and even less idea how it
started to work.      


>Could you please be more specific? Maybe we need yet an other kind of
translation.

First off everyone got different preferences with stuff like this and I
understand that. I've been learning just by spending time designing stuff in
OpenSCAD plus reading Jeremie Francois's tutorial. I'm by no means good at
it since I don't have any programming background and I don't know and don't
use all of its functions but I've still managed to get to a level where
designs are getting a bit complex (at least for me). When working with
multiple objects relating to each other the actual translation is getting
less important than working with single objects. My wish would be to use all
controls in ViewPort rel. both for Translation and rotation. Imagine the
camera is just floating in space and you don't have to think about what's
XYZ. For example, you could "fly" in halfway through a hole in a design,
then stay on that exact spot and rotate 180degress to look back out again
without having to think about where the crosshairs/point of rotation is.
Great for checking stuff and catch design flaws I would most likely miss
otherwise. You can also mimic "traditional" rotation quite easily by
rotating at the same time as you are panning sideways.

The best option for multiuse would probably be to have two standard settings
you could swap between easily by pushing a button/keystroke (kind of like
perspective and orthogonal). Use the rotation around center and  ViewPort
rel. Translation for single objects. For multiobjects and complex design use
the "camera-in-space" setting (viewport rel. translation and rotation). Just
my 2c but if I could change any setting that would be the most
efficient/less frustrating way to do it for me.

I have no idea if it's even possible to implement but we already have the
Viewport: translate, the rotate and the distance so if the Viewport
translate would be just where the "camera" is that would be nice.
I'm not sure if that makes sense. I will see if I can get those settings to
work on Blender and make a screencast if I explained it too badly. (I don't
use Blender btw, just tried it since SpaceMouse was supported..)

/ Simon




--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
tp3
Reply | Threaded
Open this post in threaded view
|

Re: Need help with inputdriver5 for SpaceMouse

tp3
On 02/03/2018 06:45 PM, sibjo wrote:
> So in Torsten's screencast is it the Joystick and DBus-driver
> that are making the move on the axis indicators? There he is
> showing that the mapping is taking effect and he got the HIDAPI
> disabled so I thought it was the SpaceNav-driver doing the work.
>
Looks like it's indeed picking up multiple drivers, which should
not happen. After disabling all the other drivers, I do get the
same result.

I've changed the driver so it will now go through the axis mapping.
Fetching the latest code should give you a SpaceNav driver that
can be configured in the OpenSCAD config screen.

I've only tested with the freshly installed spacenavd so far, no
change of the spacenavd configuration file.

ciao,
   Torsten.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: Need help with inputdriver5 for SpaceMouse

sibjo
>I've changed the driver so it will now go through the axis mapping.
>Fetching the latest code should give you a SpaceNav driver that
>can be configured in the OpenSCAD config screen.

That's good! Seems to work a lot better now!

I got a reply from Michael as well that did not show here on the forum but
things are looking better. I had also missed this little nice tool
https://sourceforge.net/projects/spacenav/files/spacenavd%20config%20gui/spnavcfg%200.3/
where you can set the sensitivity for individual axes which helps a lot. You
can also invert stuff there as well but nothing more than you can in the
axis mapping.

Since Torsten's update, I'm getting movement from the SpNav and changes are
taking effect so I'm ditching HidApi for now. The really nice thing is that
I talked with Michael about view port relative rotation and with SpNav I'm
actually kind of getting it on X and Y (Z is not relative...). Only around
point of rotation of course but still not too bad. The really weird thing is
that it's only acting this well-behaved when you are on >Z and tilted less
than 90 degrees in any direction XY-wise. If not it's kind of a mix with
rotation around axis and view port relative rotation. Mindboggling to say
the least! :/

The view port relative translation is sadly not working and neither are the
buttons but they've started to highlight again when pushed which is good I
guess.    

I'm not really sure what to do now but I'm happy that it's kind of working
at least :)
/ Simon



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org