Commits

German Larrain committed b204700

demos.IROS: in example{2, 4} fixed bug introduced in eaea3a91ed0f, and now
'dispatcher' is accessed through 'ars.app' instead of imported directly from
'ars.lib.pydispatch'.

Comments (0)

Files changed (2)

demos/IROS/example2_conical_pendulum.py

 """Example #2.
 
 """
+import ars.app
 from ars.app import Program, Simulation
-from ars.lib.pydispatch import dispatcher
 from ars.model.simulator import signals
 import ars.utils.mathematical as mut
 import ars.constants as cts
 
 	def __init__(self):
 		Program.__init__(self)
-		dispatcher.connect(self.on_pre_step, signals.SIM_PRE_STEP)
+		ars.app.dispatcher.connect(self.on_pre_step, signals.SIM_PRE_STEP)
 
 		self.q1p_prev = 0.0
 		self.q2p_prev = 0.0
 
 		# set up the simulation parameters
 		self.sim = Simulation(self.FPS, self.STEPS_PER_FRAME)
+		self.sim.graph_adapter = ars.app.gp
 		self.sim.add_basic_simulation_objects()
 		self.sim.add_axes()
 		self.sim.add_floor(

demos/IROS/example4_sinusoidal_terrain.py

 """
 from random import random
 
-from ars.lib.pydispatch import dispatcher
+import ars.app
 from ars.model.collision.base import HeightfieldTrimesh
 from ars.model.simulator import Simulation, signals
 import ars.utils.mathematical as mut
 	def __init__(self):
 		"""Constructor, calls the superclass constructor first."""
 		VehicleWithArm.__init__(self)
-		dispatcher.connect(self.on_pre_step, signals.SIM_PRE_STEP)
+		ars.app.dispatcher.connect(self.on_pre_step, signals.SIM_PRE_STEP)
 
 		self.q1_previous_error = 0.0
 		self.q2_previous_error = 0.0
 
 		# set up the simulation parameters
 		self.sim = Simulation(self.FPS, self.STEPS_PER_FRAME)
+		self.sim.graph_adapter = ars.app.gp
 		self.sim.add_basic_simulation_objects()
 		self.sim.add_axes()
 		self.sim.add_trimesh_floor(vertices, faces, center=(-10, 0, -10),