meshcat-dev / meshcat

Remotely-controllable 3D viewer, built on top of three.js
MIT License
256 stars 48 forks source link

Allow registration of user callback invoked with change in camera pose #157

Closed SeanCurtis-TRI closed 1 year ago

SeanCurtis-TRI commented 1 year ago

Allows the introduction of arbitrary code to be executed each time the the camer pose chages.

The camera_callback.html exercises the new functionality.


This change is Reviewable

SeanCurtis-TRI commented 1 year ago
Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
I agree with everything you wrote, up until to this point: > ... they have to explicitly coordinate. That seems clunky. It's not clunky. If the user needs multi-dispatch, then can trivially set up their own dictionary with whatever semantics they want. Having them screw around with our particular choice of semantics for callback "naming" is _more_ clunky. --- In terms of whether we implement a render callback or a camera motion callback, I don't mind either way. It sounds like in either case, it's possible that the Drake handler will need to do some rate-limiting anyway (depending on how high the "higher signal rate" is).

I'm content with deferring this PR for #156. This is halfway between the render callback and what I would actually advocate if we did this. So, I'm simply going to close it. It can always be revisited at some tie in the future.

SeanCurtis-TRI commented 1 year ago

Our purposes are served with the more general render callback (#156). So, we'll close this until we have some proven value.