Skip to content

Commit 72087d3

Browse files
committed
pbio/virtual/physics: Avoid simulation on read.
We'll stick to simulating on actuation only. This was causing the simulation to call itself recursively if simulation was called on short intervals. This was preventing the robot from working with the normal wall clock or a fuzzy counting clock.
1 parent a677f67 commit 72087d3

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

lib/pbio/cpython/pbio_virtual/physics/simulation.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,5 @@ def get_output_at_time(self, time, tolerance):
152152
ratio = (time - self.times[i - 1]) / (self.times[i] - self.times[i - 1])
153153
return self.outputs[:, i - 1] + ratio * (self.outputs[:, i] - self.outputs[:, i - 1])
154154

155-
# If time is farther into the future than our tolerance, simulate up
156-
# to the given time. Otherwise we avoid simulating negligible time.
157-
if time > self.times[-1] + tolerance:
158-
self.simulate(time)
159-
160155
# Return latest available data.
161156
return self.outputs[:, -1]

0 commit comments

Comments
 (0)