Skip to content

Commit

Permalink
save lcm to fix
Browse files Browse the repository at this point in the history
  • Loading branch information
EricCousineau-TRI committed Feb 26, 2021
1 parent 6e7bea9 commit 4a1c9ef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
12 changes: 9 additions & 3 deletions bug/drake_scipy_opt_oom_or_ubsan/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@ gist: https://gist.github.com/ggould-tri/5c0e1f276e90177a8aafd0fd7da6d213

## Doing the thing

Fix by saving the LCM thing

```
$ ./setup.sh python3 ./repro.py
...
170 experiments run so far...
external/lcm/lcm/lcm_udpm.c pipe(create): Too many open files
LCM instance not initialized. Ignoring call to fileno()
LCM instance not initialized. Ignoring call to publish()
180 experiments run so far...
190 experiments run so far...
200 experiments run so far...
210 experiments run so far...
220 experiments run so far...
230 experiments run so far...
...
```
5 changes: 4 additions & 1 deletion bug/drake_scipy_opt_oom_or_ubsan/repro.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from pydrake.systems.framework import (DiagramBuilder,)
from pydrake.systems.primitives import (ConstantVectorSource,)
from pydrake.lcm import DrakeLcm
from pydrake.geometry import (Box,
DrakeVisualizer)
from pydrake.math import (RigidTransform, RollPitchYaw)
Expand All @@ -11,6 +12,8 @@

from pydrake.systems.analysis import Simulator

global_lcm_ftw = DrakeLcm()

def make_box(mbp, name):
inertia = SpatialInertia.MakeFromCentralInertia(1, [0, 0, 0], RotationalInertia(1/600, 1/120, 1/120))
body = mbp.AddRigidBody(name, inertia)
Expand Down Expand Up @@ -64,7 +67,7 @@ def experiment(start_state, force_schedule, sleeptime=None):
builder = DiagramBuilder()
mbp, sg = make_mbp(builder)
mbp.Finalize()
DrakeVisualizer.AddToBuilder(builder, sg)
DrakeVisualizer.AddToBuilder(builder, sg, lcm=global_lcm_ftw)

thrusters = add_thrusters(builder, mbp)

Expand Down

0 comments on commit 4a1c9ef

Please sign in to comment.