Raspberry Pi

Post questions, comments and feedback to our 3Dconnexion UNIX and Linux Development Team.

Moderator: Moderators

jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Raspberry Pi

Post by jwick »

I've created some simple examples that show how to access the SpaceNavigator on a Raspberry Pi on GitHub
It is ideal for robot control.
Enjoy, join and contribute.
nourich
Posts: 3
Joined: Mon Jan 30, 2017 7:14 am

Re: Raspberry Pi

Post by nourich »

Hi, thanks for your help first of all. I am working on a similar project, which cosists on reading the data coming from a 3d mouse and send them afterward through a http-request. I've tried to execute your code of HelloSpaceNavigator but without success, it had detected the spacenavigator device but the axis data weren't caught. I pretend that some whether libraries ors usb packages are missing. I am actually getting a usb.core.USBError. Could you tell me please what I need to install on my linux OS before I execute any of these applications. Thanks in advance
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Raspberry Pi

Post by jwick »

You are running on an RPi or a PC running Linux with python?
This code/project is very RPi-specific.
Still, if you can detect the device you are almost there.
nourich
Posts: 3
Joined: Mon Jan 30, 2017 7:14 am

Re: Raspberry Pi

Post by nourich »

Thank you for your prompt response. I am using directly a RaspberyPi board and try to run the application under the geany editor.
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Raspberry Pi

Post by jwick »

Do you get all the information about the device listed? You should get pages of information.

As I recall, detaching it from the kernel was a very important part to get it to work. You may want to check the error codes around that.

I run this under Raspian (from NOOBS) on a Pi3, in a root terminal window.
I have to run a specific python version for some of the examples (2.x vs 3.x).

I've installed, or had installed, libusb-1.0-0, pyusb (I may have gotten that from sourceforge) and pypubsub, typing for the latter examples.
nourich
Posts: 3
Joined: Mon Jan 30, 2017 7:14 am

Re: Raspberry Pi

Post by nourich »

Yessss it is working now !!! I runned the application as administrator (super user) because it was mentioned at the debugging window that the access to the usb.core was denied cause of insufficient permissions so I had modified the running command of the geany compiler. Now I will try to collect the data infos and build a http request with to send it to the network. Thanks a lot !
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Raspberry Pi

Post by jwick »

Cool. Let us know if you do something fun with it.
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Raspberry Pi

Post by jwick »

I've used the SN+Pi to drive a Zumo tracked vehicle (see GitHub).
It's quite nice control.
Having all these bits of resolution and spatially-mapped movement has quite some possibilities.
Push to go forward, twist to turn is very intuitive. Push harder, twist harder, ... very natural.
Phil999
Posts: 425
Joined: Tue Jun 30, 2009 5:20 am

Re: Raspberry Pi

Post by Phil999 »

very nice, thank you.
Space Navigator x2, Space Pilot, Space Pilot Pro, SpaceMouse Enterprise
jbartates
Posts: 1
Joined: Sun May 05, 2019 1:03 am

Re: Raspberry Pi

Post by jbartates »

Hello, thank you for posting this. I've currently implemented the code on a raspberry pi 3 model B, currently running the HelloSpaceNavigator code.
I'm able to obtain values of the translations (tx, ty, tz) but not the rotations (rx,ry, rz). The data stream seems to provide a new line of data when rotating the mouse, but it's printing translation values of all zeros instead of rotation values. Any idea on how to resolve this? Thank you
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Raspberry Pi

Post by jwick »

It may be the device you have. The protocol changed at some point after the Spacenavigator. The SN had two separate packets (T and R). The newest devices have one 13 byte packet with all 6 T & R values in one packet.
Leon2
Posts: 6
Joined: Sun Nov 22, 2020 2:51 pm

Re: Raspberry Pi

Post by Leon2 »

Dear jwick,
I'm currently working on a project with the spacenavigator (Spacemouse wireless). I"m currently facing the problem that the navigator won't send the right packages, and i keep getting the USBERROR: 75 overflow error while running the HelloSpaceNavigetor.py. Can you help me fix this bug? Or do you have a example program with the fixed package size?

Thanks in advance,

Leon
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Raspberry Pi

Post by jwick »

A SpaceNavigator and a SpaceMouse Wireless are two different USB devices. It searches for only the SN (c626).
Looking at the code, I wonder what happens when it can't find a SpaceNavigator.
It looks it raises an exception. If it continues on, then it probably has nothing to continue on with.
If I could find my RPi, I'd test it...
Leon2
Posts: 6
Joined: Sun Nov 22, 2020 2:51 pm

Re: Raspberry Pi

Post by Leon2 »

You're correct I've changed the id's into the wireless version. So it does find the device, but it Can't receive any data. I hope you can find something. Can you please reply if you can't find your Rpi? Then i will continue my search, or start from scratch. thanks in advance for the effort!
Leon2
Posts: 6
Joined: Sun Nov 22, 2020 2:51 pm

Re: Raspberry Pi

Post by Leon2 »

Thanks for the quick reply! Yes, you're right, i've changed the id's because they did'nt match. I hope that you can find the reason why it does'nt receives the packages. Can you please send a reply if you cannot find the Raspberry. Then I will continue my search or start from scratch.
Post Reply