Closed RussTedrake closed 6 years ago
No, I don't think it would make any difference. Both APIs still distinguish loading a model from setting the transform of an existing model in the same way, so you'd get the same problem in both cases. Loading a new model causes Director to generate a new object, so any tracking behavior attached to that object would still be lost. I think the only way to solve this would be for drake not to always reload the geometry, but I'm not sure how to make that work reliably.
Another solution would be to have director support setting the camera controls via LCM. I think having the simulator set up the camera programmatically on each run is probably the ideal solution.
Sounds like a good idea. As an alternative or in addition, you could teach the "camera control panel" in director to remember the tracked object by name, in the case the object is deleted and reinserted.
@patmarion how to teach the camera control panel to remember the object name? Is it already an existing feature in drake?
It would be a python code change to this file, which is part of a separate project:
https://github.com/RobotLocomotion/director/blob/master/src/python/director/cameracontrolpanel.py
This file defines a class named CameraControlPanel
. It has a function setTarget()
where the target is assigned, and a function onObjectRemoved()
where it un-sets the target when the object is removed. This class would have to be extended to have logic that watches for objects being added. It's quite possible to do, but authoring the code change requires some familiarity with the existing api.
If the feature request is "remember tracked object by name", that's probably better as a Director issue, not a Drake issue. If the feature request is to set up the camera view programatically within the simulation, that's already filed as #5148. Thus, I'm going to close out this issue. If I've missed something, or there's more still to do, please ping back here and/or re-open the issue.
As asked here: https://stackoverflow.com/questions/50195068/drake-let-the-drake-visualizer-camera-track-a-fast-moving-object
@gizatt, @rdeits -- I think the remote-tree viewer API would improve this, correct?
And I think I remember that the published that you have is in python (not c++) because of some json dependency, or something? (sorry if I'm mixing this with MeshCat)? Can you remind me of the status? Thanks!
cc @patmarion