choppy movements with spacemouse

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

Moderator: Moderators

Post Reply
ondrejsevcik
Posts: 5
Joined: Fri Nov 24, 2023 12:06 pm

choppy movements with spacemouse

Post by ondrejsevcik »

Hello,
we are developing control panel with spacemouse for controlling art installation with sw Resolume. Spacemouse controls movements and rotations of a video layer. It works but the movements are choppy. How to make it smooth and fluent? Which method should we use to change value? Is there any suitable code snipet available?
Thank you
Ondrej
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: choppy movements with spacemouse

Post by jwick »

How choppy is choppy? A dropped frame here and there?

What method/API are you using to get the data from the SpaceMouse to the application?

If the 2D mouse can manipulate the data smoothly, the 3D mouse can also. Often times the libraries have optimized 2D mouse data. You may need to implement that optimization for the 3D mouse.

There are many places choppiness can be introduced. You need to investigate each to find out which is causing it.

1) Print the data you get from the device to a file, with timestamps (and deltas between timestamps), to see if the data is arriving smoothly.
2) You must be transmitting that data inside the application to a place where you are modifying the video parameters. Print the changes of the video parameters, with timestamps. The deltas on the parameters should be consistent.
3) Print timestamps when the video engine is done updating the frame.

You may need to implement a thread inside the application to tie the input device data to the video update.
ondrejsevcik
Posts: 5
Joined: Fri Nov 24, 2023 12:06 pm

Re: choppy movements with spacemouse

Post by ondrejsevcik »

Hello, we are using "periodical read in given time 30msec, compare vals with previous and update new"
Can you please send me source code samples of what you describe?
thx a lot
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: choppy movements with spacemouse

Post by jwick »

What API are you using to do the periodic read?

Sorry, I don't have a specific example of this. But as you dig deeper into your code, I may be able to help.
Are you able to dig into the Resolume code, or are you using that as a library?

You have many moving pieces.
I suggest you remove one component at a time, to see where your choppiness is coming from.
E.g., instead of reading the SpaceMouse, generate a constant stream of values in your code to send downstream. That eliminates any issues with reading the input device. If you still have choppiness, it is happening downstream.
ondrejsevcik
Posts: 5
Joined: Fri Nov 24, 2023 12:06 pm

Re: choppy movements with spacemouse

Post by ondrejsevcik »

We have UART version connected to ARM Microchip. For that we need ANSI C example, is that possible?
Thank you.
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: choppy movements with spacemouse

Post by jwick »

What device exactly do you have? Part number? Serial / USB / ?

We sell an industrial controller, which is different from the commercial devices. Do you have one of those?

It may be more suitable for such a close-to-the-hardware use. It comes without a housing. It is meant to be incorporated into a control housing (e.g., robotics). It has its own SDK that reads directly from the hardware. It is not compatible with any of the Windows software.

If you are directly reading the device, obviously all our Windows software is out of the picture.
In that case, you will need to know what the device USB protocol is.

Either way, the debugging effort will be the same to locate the "choppy movement".
ondrejsevcik
Posts: 5
Joined: Fri Nov 24, 2023 12:06 pm

Re: choppy movements with spacemouse

Post by ondrejsevcik »

Yes. We are using this UART version:
https://3dconnexion.com/cz/product/spacemouse-module/
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: choppy movements with spacemouse

Post by jwick »

Did you get the device from Megatron?
They distribute an SDK showing how to read the device.
I still suspect the debugging procedure will be the same.
ondrejsevcik
Posts: 5
Joined: Fri Nov 24, 2023 12:06 pm

Re: choppy movements with spacemouse

Post by ondrejsevcik »

No, I got the device directly from 3D connexion as a partnership support of the art project.
I asked there for help and the redirected me here.
ngomes
Moderator
Moderator
Posts: 3344
Joined: Mon Nov 27, 2006 7:22 am
Contact:

Re: choppy movements with spacemouse

Post by ngomes »

ondrejsevcik wrote: Mon Dec 11, 2023 8:49 am I asked there for help and the redirected me here.
Did someone from 3Dconnexion redirected you here? If so, could you please share this person's first name and surname initial (or send me the full name over a private message)?
Post Reply