AttributeError: 'pydrake.geometry.Meshcat' object has no attribute 'SetCameraPose'

131 views Asked by At

I am getting this AttributeError: 'pydrake.geometry.Meshcat' object has no attribute 'SetCameraPose' when trying to set the camera in a Meshcat viz. Really scratching my head on this one, as I can reproduce the error with just:

from pydrake.geometry import Meshcat
meshcat = Meshcat()
meshcat.SetCameraPose(camera_in_world=[3, 4, 5],
                      target_in_world=[1, 1, 1])

... same results with StartMeshCat()

I was putting together a whole pure python Hybrid System Simulation Tutorial and this is the final piece to make things look nice and use the whole systems.frameworks approach.

I should mention that I get a similar attribute error with SetCameraTarget(). I tried first creating a PerspectiveCamera, thinking maybe that needed to be initialized first, but to no avail.

I am able to call all of the other meshcat methods (fairly sure I have tested them all).

Many thanks in advance...

If you care to look, all of the code (minus the camera) is here: https://github.com/drewhamiltonasdf/DrakeTutorials/blob/main/006%20-%20SceneGraph%20Boxcars%20example.ipynb

1

There are 1 answers

0
jwnimmer-tri On

That function was added very recently. You'll need a nightly build 0.0.202308022 or newer to use it (or stable release >= v1.21, once that's available).

The Drake website API reference shows the nightly builds. Here is the tracking issue for showing the Stable API.