-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LinearCmd Client Device method should throw if pos is outside [0, 1] #248
Comments
Nope that's a buttplug-js bug. We're not encoding position as a 0.0 < x < 1.0 double here. |
@mnh86 Ok, taking a look at this again: Are you sending 28 as the position? Because we expect 0.0 <= x <= 1.0 for position. You'd need to calculate that yourself. If this is for funscript, is assumes 0 <= x <= 100 I think, so you'd want to send 0.28. That said, I should still at least check and throw if invalid values are sent, so I'll keep this bug open but change the deliverable for it. |
After seeing your first comment I did try with the following change, but was still seeing errors in the intiface logs:
Logs
|
@mnh86 Oh I see what the issue is there. You aren't putting a move duration in, and the system isn't throwing when you miss the argument. God I hate js. https://buttplugio.github.io/buttplug-js/classes/ButtplugClientDevice.html#linear So the signature here is incorrect, it should be device.linear(values: [number, number]) (position, duration in ms) or or device.linear(number, number). If you're only sending one linear command (we currently have no devices that accept multiple linear commands). I'll add the check for this and fix the type signature though. I'm also about to overhaul the command API to make this way easier to deal with, the current command signatures are gross. |
Ah OK, got it. Thanks for finding that. I'll give that a try with the |
Please do not move with linear duration 0. Either things will not work or it will move as fast as possible and in some cases can cause the device to break itself (these things are not well designed). |
Ah, my current implementation was doing its own interpolation values between keyframes on a frequency. Sounds like buttplug can handle the interpolations itself, I just have to send the keyframes and duration. Will try that out, thanks. It will also help cut down on number of messages being sent over websockets and be more smooth for the device/user. |
@mnh86 Depends on the toy. Some of them we handle interp for (kiiroo), some of them do it internally (handy). That said, almost none of them (outside of the OSR-2/SR-6, which are directly connected and DIY so user numbers are tiny), can handle a stream of realtime updates. They all mostly expect sparse updates (a few per second, max, esp because you're limited by bluetooth's unknown update rate). |
Describe the bug
await device.linear(pos);
buttplug-js
client side when sending.Should this be reported within the https://github.com/intiface/intiface-central project instead?
The text was updated successfully, but these errors were encountered: