Skip to content

Instantly share code, notes, and snippets.

@cohnt
Last active September 17, 2024 17:37
Show Gist options
  • Save cohnt/b791eecd186769dd5eb91a737faae394 to your computer and use it in GitHub Desktop.
Save cohnt/b791eecd186769dd5eb91a737faae394 to your computer and use it in GitHub Desktop.
Inertia Error
import os
from pydrake.all import (
StartMeshcat,
DiagramBuilder,
AddMultibodyPlantSceneGraph,
Parser,
LoadModelDirectivesFromString,
ProcessModelDirectives,
)
directives_str = """directives:
- add_model:
name: tets
file: package://symmetries/test.obj
"""
meshcat = StartMeshcat()
builder = DiagramBuilder()
plant, scene_graph = AddMultibodyPlantSceneGraph(builder, time_step=0.0)
parser = Parser(plant)
parser.package_map().Add("symmetries", os.getcwd())
directives = LoadModelDirectivesFromString(directives_str)
models = ProcessModelDirectives(directives, plant, parser)
plant.Finalize()
diagram = builder.Build()
<?xml version="1.0"?>
<package format="2">
<name>symmetries</name>
<version>0.0.0</version>
</package>
g test
v 0.000000 0.000000 0.500000
v 0.000000 0.000000 -0.500000
v 0.000000 1.000000 0.500000
v 0.000000 1.000000 -0.500000
v 1.000000 0.000000 0.500000
v 1.000000 0.000000 -0.500000
f 1 3 5
f 2 4 6
f 1 2 3
f 2 3 4
f 3 4 5
f 4 5 6
f 5 6 1
f 6 1 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment