rdepena / node-dualshock-controller

Eventing API layer over HID for the Sony DualShock 3 and DualShock 4 controllers
208 stars 46 forks source link

Left analog "jitter" #47

Closed nicjohnson closed 7 years ago

nicjohnson commented 8 years ago

When my DS4 is sitting flat on my desk and logging events, I get lots of jitter on the Left analog x value. Here's a section of log over about 5 seconds:

left:move { x: 130, y: 126 }
left:move { x: 130, y: 128 }
left:move { x: 130, y: 126 }
left:move { x: 130, y: 128 }
left:move { x: 130, y: 126 }
left:move { x: 130, y: 128 }
left:move { x: 130, y: 126 }
left:move { x: 130, y: 128 }
left:move { x: 130, y: 126 }
left:move { x: 130, y: 128 }
left:move { x: 130, y: 126 }
left:move { x: 130, y: 128 }
left:move { x: 130, y: 126 }
left:move { x: 130, y: 128 }
left:move { x: 130, y: 126 }
left:move { x: 130, y: 128 }
left:move { x: 130, y: 126 }
left:move { x: 130, y: 128 }
left:move { x: 130, y: 126 }
left:move { x: 130, y: 128 }
left:move { x: 130, y: 126 }
left:move { x: 130, y: 128 }

I haven't tried it with any other controller. Any ideas?

Edit: I connected a different DS4 and it's having the exact same problem.

rdepena commented 8 years ago

Hmm, I will try to recreate/chase down this week. Try passing "analogStickSmoothing : true" option to remove some of the jitter.

nicjohnson commented 8 years ago

Thanks, Ricardo. I forgot to mention that I was getting this behavior with the smoothing enabled already.

rdepena commented 7 years ago

Hey @nicjohnson not sure if you are still interested but there was a bug on the smoothing code that has been fixed: https://github.com/rdepena/node-dualshock-controller/pull/49

Thank you.