I found a useful demo in github(https://github.com/maggiewu19/compass-gait-simulator). However, the codes didn't work with the newest pydrake. I ran the codes in google colab and got errors.
Any reply will be appreciated.
I found a useful demo in github(https://github.com/maggiewu19/compass-gait-simulator). However, the codes didn't work with the newest pydrake. I ran the codes in google colab and got errors.
Any reply will be appreciated.
I see. This is quite old -- it is using RigidBodyPlant
which has been replaced by MultibodyPlant
.
Drake has supported quite a long deprecation period on this. You can make most of it work by pulling the old RigidBodyPlant
classes from attic
, e.g. by changing this
from pydrake.all import (Box,
DiagramBuilder,
FindResourceOrThrow,
Isometry3,
SignalLogger,
Simulator)
from pydrake.attic.all import (FloatingBaseType, RigidBodyTree, RigidBodyPlant, VisualElement)
Unfortunately, I didn't leave as long of a deprecation period on PlanarRigidBodyVisualizer
in the underactuated repo. You will have to pull an old version of underactuated
to make that work.
FTR -- we are currently working on a way to make the colab setup's durable, by having a peg revision of drake (and underactuated) in the setup script. For now, you could download the old version of the underactuated repo, or just that specific file that was removed after it's deprecation period.
I can't guarantee you won't hit more errors after that. It would be much better to use the updated compass gait examples from class which are all using MultibodyPlant
.