drake

Type error in getting context from rootContext

Type error in getting context from rootContext Question: I am trying to include my URDF file with a robot that has contact tags activated, and I intend to use DirectCollocation to generate an optimal trajectory for my robot. First I tried creating the plant using MultibodyPlant(), then created the scene_graph using SceneGraph() and then thought …

Total answers: 1

pydrake: How do I identify slow Python LeafSystem's (to possibly rewrite in C++)?

pydrake: How do I identify slow Python LeafSystem's (to possibly rewrite in C++)? Question: I am prototyping a simple Drake simulation. I have some simple Python LeafSystems that implement controllers, and find that without these systems, my simulation can run at realtime; however, with these systems, my simulation runs much slower than realtime. I don’t …

Total answers: 2

pydrake: How do I aggregate multiple List[ExternallyAppliedSpatialForce] from distinct systems for a plant?

pydrake: How do I aggregate multiple List[ExternallyAppliedSpatialForce] from distinct systems for a plant? Question: I am testing out some simple controllers, and would like to know how to aggregate List[ExternallyAppliedSpatialForce], specifically to provide to MultibodyPlant.get_applied_spatial_force_input_port(). If I try to connect both outputs to it, I get the following error: RuntimeError: Input port is already wired. …

Total answers: 2

How do I set the pose of an object in pydrake manually after creation?

How do I set the pose of an object in pydrake manually after creation? Question: I would like to create an object in pydrake that is loaded from a URDF (e.g. just a single-link URDF that has an object mesh), and be able to manually set the pose of the object as I wish after …

Total answers: 2

Open meshcat-server before code execution to improve easiness in visualization (v1.5.0)?

Open meshcat-server before code execution to improve easiness in visualization (v1.5.0)? Question: I’m learning pydrake via their tutorials executing it locally in my pc (pydrake pip version). I’ve changed the code from simple pendulum to use Meshcat locally instead of in the notebook with: from pydrake.systems.framework import DiagramBuilder from pydrake.examples.pendulum import PendulumPlant, PendulumGeometry from pydrake.geometry …

Total answers: 1