Commits

German Larrain committed 8892c2e

demos: updated all which used signals in simulator.__init__ to the new definitions in simulator.signals.

Comments (0)

Files changed (6)

demos/CentrifugalForceTest.py

 import ars.utils.mathematical as mut
 import ars.constants as cts
 from ars.lib.pydispatch import dispatcher
-from ars.model.simulator import SIM_PRE_FRAME_SIGNAL
+from ars.model.simulator import signals
 
 #View point
 #===============================================================================
 		self.key_press_functions.add('z', self.dec_joint1_vel)
 		#self.key_press_functions.add('f', self.rotate_clockwise)
 
-		dispatcher.connect(self.on_pre_frame, SIM_PRE_FRAME_SIGNAL)
+		dispatcher.connect(self.on_pre_frame, signals.SIM_PRE_FRAME)
 		
 		self.joint1_vel_user = self.JOINT1_ANGLE_RATE_INITIAL
 		self.large_speed_steps = True

demos/ControlledSimpleArm.py

 import ars.utils.mathematical as mut
 import ars.constants as cts
 from ars.lib.pydispatch import dispatcher
-from ars.model.simulator import SIM_PRE_STEP_SIGNAL
+from ars.model.simulator import signals
 
 def output_data(time, sp, cv, error, torque):
 
 		self.key_press_functions.add('d', self.increase_sp)
 		self.key_press_functions.add('c', self.decrease_sp)
 
-		dispatcher.connect(self.on_pre_step, SIM_PRE_STEP_SIGNAL)
+		dispatcher.connect(self.on_pre_step, signals.SIM_PRE_STEP)
 
 		self.sp = self.q2_INITIAL_SP
 		self.previous_error = 0.0

demos/IROS/example1_bouncing_ball.py

 
 from ars.app import Program
 from ars.lib.pydispatch import dispatcher
-from ars.model.simulator import SIM_PRE_STEP_SIGNAL
+from ars.model.simulator import signals
 
 class Example1(Program):
 	
 	
 	def __init__(self):
 		Program.__init__(self)
-		dispatcher.connect(self.on_pre_step, SIM_PRE_STEP_SIGNAL)
+		dispatcher.connect(self.on_pre_step, signals.SIM_PRE_STEP)
 	
 	def create_sim_objects(self):
 		self.sphere = self.sim.add_sphere(self.RADIUS, self.CENTER, mass=self.MASS)

demos/IROS/example2_conical_pendulum.py

 
 from ars.app import Program, Simulation
 from ars.lib.pydispatch import dispatcher
-import ars.model.simulator
+from ars.model.simulator import signals
 import ars.utils.mathematical as mut
 import ars.constants as cts
 
-SIM_PRE_STEP_SIGNAL = ars.model.simulator.SIM_PRE_STEP_SIGNAL
 
 class Example2(Program):
 	
 
 	def __init__(self):
 		Program.__init__(self)
-		dispatcher.connect(self.on_pre_step, SIM_PRE_STEP_SIGNAL)
+		dispatcher.connect(self.on_pre_step, signals.SIM_PRE_STEP)
 		
 		self.q1p_prev = 0.0
 		self.q2p_prev = 0.0

demos/IROS/example4_sinusoidal_terrain.py

 
 from ars.lib.pydispatch import dispatcher
 from ars.model.collision.base import Trimesh
-from ars.model.simulator import Simulation, SIM_PRE_STEP_SIGNAL
+from ars.model.simulator import Simulation, signals
 import ars.utils.mathematical as mut
 
 # we need to add the parent directory to the Python path (PYTHONPATH)
 	def __init__(self):
 		"""Constructor, calls the superclass constructor first"""
 		VehicleWithArm.__init__(self)
-		dispatcher.connect(self.on_pre_step, SIM_PRE_STEP_SIGNAL)
+		dispatcher.connect(self.on_pre_step, signals.SIM_PRE_STEP)
 
 		self.q1_previous_error = 0.0
 		self.q2_previous_error = 0.0

demos/VehicleWithArm.py

 import ars.utils.mathematical as mut
 import ars.constants as cts
 from ars.lib.pydispatch import dispatcher
-from ars.model.simulator import SIM_PRE_STEP_SIGNAL
+from ars.model.simulator import signals
 
 class VehicleWithArm(Program):
 
 		self.key_press_functions.add('a', self.rotate_clockwise)
 		self.key_press_functions.add('z', self.rotate_counterlockwise)
 
-		dispatcher.connect(self.on_pre_step, SIM_PRE_STEP_SIGNAL)
+		dispatcher.connect(self.on_pre_step, signals.SIM_PRE_STEP)
 
 	def create_sim_objects(self):
 		"""Implementation of the required method. Creates and sets up all the