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:

Re: Raspberry Pi

Post by jwick »

Change the dev.read to read 13 bytes.
Then you will get one long packet with the T and R vector together.
This only works with a USB connection. Not the wireless dongle.

I've only tested this on a RPi3.
Leon2
Posts: 6
Joined: Sun Nov 22, 2020 2:51 pm

Re: Raspberry Pi

Post by Leon2 »

Thank you! its working now! Do you have any documents so I can see how the byte-package looks like?
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Raspberry Pi

Post by jwick »

Each USB device tells exactly what it sends and how it sends it in its device descriptor. I print that at the beginning.

It's also useful to uncomment that
# print data
line. To see the various packets that are coming from the device.

On Windows, the software installs with an XML file (Base.xml) that describes the button packets, but it's easier just to press the button to see what comes out.
All the devices, currently have exactly the same 6DOF data.

There isn't much documentation available beyond that.
Leon2
Posts: 6
Joined: Sun Nov 22, 2020 2:51 pm

Re: Raspberry Pi

Post by Leon2 »

Hello its me again ;) the application is working now. Im really thankfull for the support! I have one question left. Does the Spacemouse enterprise have the same data exchange protocol (the 13 byte package)?
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Raspberry Pi

Post by jwick »

Yes, the SpaceMouse Enterprise has the same axis data format.
The buttons may be different.
Let us know what interesting things you are doing with the 3D mouse and an RPi.
Leon2
Posts: 6
Joined: Sun Nov 22, 2020 2:51 pm

Re: Raspberry Pi

Post by Leon2 »

Hey John,
I've made a quick teach-in device for industrial robots from the 3d mouse. You can private message me if you want any further info ;).
BSkog
Posts: 7
Joined: Thu Jun 10, 2021 10:33 am

Re: Raspberry Pi

Post by BSkog »

Hello, total noob here. I am trying to use the SN to control a 6 axis surgical table. Doing this through a Pi3B. Do I need to have the normal driver for the SN installed? If so which OS driver should be installed on the Pi?

So far I run into an error where it can't find "usb.core"

Thanks for any help!
BSkog
Posts: 7
Joined: Thu Jun 10, 2021 10:33 am

Re: Raspberry Pi

Post by BSkog »

Does the normal SN driver need to be installed on the Pi for this to work? If so which OS driver should be used?
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Raspberry Pi

Post by jwick »

There is no driver for the RPi. Interesting idea though. I can see all sorts of possibilities.
The only solution ATM is to directly read the device.
You will need to link in the required libraries.
BSkog
Posts: 7
Joined: Thu Jun 10, 2021 10:33 am

Re: Raspberry Pi

Post by BSkog »

Thank you for the response.
So I am trying to use code you wrote, SpaceNavigatorLEDs.py. When running I get the error "ImportError: No module named usb.core"

What specific libraries do I need to link? Again, total noob here, so thanks for the help. I designed and produced the table, now just trying to come up with a nicer way to operate it than with a bunch of toggle switches.
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Raspberry Pi

Post by jwick »

You may need to unstall pyusb.
Something like:
apt-get install python libusb-1.0-0
pip install pyusb
BSkog
Posts: 7
Joined: Thu Jun 10, 2021 10:33 am

Re: Raspberry Pi

Post by BSkog »

Thanks! The program now looks to run without errors. Is there a way that I can easily see whether the pi is reading the data packets sent by the SN? I don't get any readings from the GPIO pins when moving the SN around.
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Raspberry Pi

Post by jwick »

Print them to the console?
BSkog
Posts: 7
Joined: Thu Jun 10, 2021 10:33 am

Re: Raspberry Pi

Post by BSkog »

Thank you for the help. I've got it working now. It's a little tricky to control the table as it senses even the slightest pressure in any direction. Is there an easy way to make it less sensitive, almost like when being used with CAD where you can set it to only operate one axis at a time? I'm thinking perhaps some how extending a dead zone into the lower values. Again, not a programmer, so not quite sure how this would work.
BSkog
Posts: 7
Joined: Thu Jun 10, 2021 10:33 am

Re: Raspberry Pi

Post by BSkog »

BSkog wrote: Tue Jun 22, 2021 11:57 am Thank you for the help. I've got it working now. It's a little tricky to control the table as it senses even the slightest pressure in any direction. Is there an easy way to make it less sensitive, almost like when being used with CAD where you can set it to only operate one axis at a time? I'm thinking perhaps some how extending a dead zone into the lower values. Again, not a programmer, so not quite sure how this would work.
As soon as I posted, I figured out that I can easily change the "if val <0" and "elif val >0" to have a dead zone. Currently running it between -20 and 20 which has made the control much more manageable.
Post Reply