Space mouse

175 views
Skip to first unread message

Erik van Oene

unread,
Feb 19, 2015, 8:27:23 AM2/19/15
to robotics...@googlegroups.com
Hi all,

I was wondering if anyone else uses a space mouse (see: http://www.3dconnexion.com/).
I want to use it to control my robotic (simulation) using this 6DOF 'joystick'. I did this before in simulink, using the Simulink® 3D Animation toolbox, although I don't have access to that toolbox anymore.

I know this toolbox comes with 'joystick.m' which is using the SDL but I cannot get this up and running (I am not very good with drivers and compiling). Can anyone guide me to compile 'joystick.c', I don't even know which library to download (from www.libsdl.org), which files to copy and how to compile/MEX it. I'm running on a WIN64 system using Matlab 2014b (64bit).

Kind regards,

Erik


Peter.I.corke

unread,
Feb 19, 2015, 5:19:34 PM2/19/15
to robotics...@googlegroups.com
I haven't looked at this code for a while, but I can only test on a Mac.  What are you using?

I'm playing with a function that uses an iPhone as a 6dof motion input sensor

Peter.

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "Robotics & Machine Vision Toolboxes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotics-tool-...@googlegroups.com.
To post to this group, send email to robotics...@googlegroups.com.
Visit this group at http://groups.google.com/group/robotics-tool-box.
For more options, visit https://groups.google.com/d/optout.

Erik van Oene

unread,
Feb 24, 2015, 6:13:53 AM2/24/15
to robotics...@googlegroups.com
Hi,

I'm using the SpaceNavigator (http://www.3dconnexion.eu/products/spacemouse/spacenavigator.html). It is not to expensive and besides, I already have one which I use for my CAD software (Solidworks).
Thought, using the iPhone as a 6DOF motion input is also interesting as 'possibly' many RVT uses will own a smartphone.

Just to update the status of this topic:
----------------------------------------------------------------------------------------------------------------------------------
I currently have connected the 3D space mouse to the robotic object with succes. I found a 3D mouse drive for matlab in the FEX (3D mouse support) written by Nick Clark (so all credits to Nick!)
His driver uses event which I use to trigger a callback in which I extract the mouse data and use it to calculate the desired joint configuration. like;

% Connect the 3D space mouse to the SerialLink object
import mouse3D.*    % Import the mouse3D package
hDrv = mouse3Ddrv;  % instantiate driver object

lh = event.listener(hDrv,'SenState',@(src,eventdata)CallBackFun(src,eventdata,robot)); % create an event to trigger the callback
hMon = mouse3D.mouse3Dmonitor(hDrv); % just a nice monitor from the package.

Example of the output can be seen in the attached picture.

I build it on top of the toolbox instead of integrating it with the toolbox, Therefore I have to delete the spacemouse objects and event listener myself. I did this on purpose because I don't want to break down my code when updating to a next release. My plan it to extend this with a wrapper function able to flexibly change the control frame (base, tool) and IK algorithms.
----------------------------------------------------------------------------------------------------------------------------------

Although this is nice, a more elegant way would be extending the joystick.m and joy2tr for 6DOF data (if the SDL library supports this) and implement it like the initial idea of joystick.m
Any ideas or remarks are more than welcome!!

Erik
spacemouse.JPG

Peter Corke

unread,
Feb 24, 2015, 7:00:56 AM2/24/15
to robotics...@googlegroups.com
Erik,

From what I can see Nick's code is windows only activex interface.  I'm not sure SDL supports your device, I found some old posts but nothing definite.  SDL is nice because it's multiplatform.

Maybe we create an abstract superclass for 6d input, then subclass it for phone, space mouse or regular joystick, then layer joy2tr on top of that.

Peter


<spacemouse.JPG>

Erik van Oene

unread,
Feb 24, 2015, 8:40:44 AM2/24/15
to robotics...@googlegroups.com
Peter,

The superclass and subclass approach sounds great. The space mouse subclass is something I can take a look at. Definitly for windows however a platform independed library will be preferred.

I'm also willing to try if SDL supports this device. From a post I found, the device should be fully supported from version SDL 1.3.
The only problem is; as in my initial post, I don't no which file(s) (.c, .h, .lib, .dll ectetera...) I need and where to put them in order to mex joystick without errors.

Nevertheless I will give it a try this week and go to some kind of trial and error approach and see what happens when running the mex command.
So far the (64-bit Windows) DLL fails, or I'm not including it correctly. (I really lag experience in code compiling and integration :( , though the interest is there!)

Any suggestions (from everyone) are welcome!!

Kind regards
Erik
Reply all
Reply to author
Forward
0 new messages