Commits

German Larrain committed 1b8dd49

all bin/* demos were shortened, eliminating "import sys" and "sys.exit". Also the variable that hold the simulation program was renamed from "a" to "sim_program".

Comments (0)

Files changed (12)

bin/CentrifugalForceTest.py

 		self.sim.get_joint('r2').get_joint().add_torque(torque)
 
 if __name__ == '__main__':
-	a = CentrifugalForceTest()
-	a.start()
+	sim_program = CentrifugalForceTest()
+	sim_program.start()

bin/ControlledSimpleArm.py

 There's friction proportional to angle speed, for both joints.
 """
 
-import sys
-
 from ars.app import Program
 import ars.utilities.mathematical as mut
 import ars.constants as cts
 
 if __name__ == '__main__':
 	print('Python file being executed: %s' % __file__)
-	a = ControlledSimpleArm()
-	a.start()
-	sys.exit(None)
+	sim_program = ControlledSimpleArm()
+	sim_program.start()

bin/FallingBall.py

 		self.sim.add_sphere(1, 0.5, (1,10,1))
 
 if __name__ == '__main__':
-	a = FallingBall()
-	a.start()
+	sim_program = FallingBall()
+	sim_program.start()

bin/FallingBalls.py

 		self.sim.add_sphere(1, 0.3, (3,2,3))
 
 if __name__ == '__main__':
-	a = FallingBall()
-	a.start()
+	sim_program = FallingBall()
+	sim_program.start()
 2012 Robotics Science and Systems conference
 """
 
-import sys
 from VehicleWithArm import VehicleWithArm, mut
 
 
 		end_effector_pos = self.sim.get_object(self.link2).get_position()
 		
 		return (r1_angle, r1_angle_rate, r1_angle_accel, r2_angle, r2_angle_rate, r2_angle_accel, end_effector_pos)
-		
 
 if __name__ == '__main__':
-	a = RSS1()
-	a.start()
-	sys.exit(None)
+	sim_program = RSS1()
+	sim_program.start()
 2012 Robotics Science and Systems conference
 """
 
-import sys
 from random import random
 
 from ars.model.simulator import Simulation
 		self.sim.update_actors()
 
 if __name__ == '__main__':
-	a = RSS2()
-	a.start()
-	sys.exit(None)
+	sim_program = RSS2()
+	sim_program.start()

bin/RagdollSim.py

 #
 # @author: german
 
-import sys
-
 from ars.app import Program
 
 DO_TEST = True
 			self.sim.add_fixed_joint(self.sim.get_object(sphere1), self.sim.get_object(box2))
 			self.sim.add_rotary_joint('r1', self.sim.get_object(box4), self.sim.get_object(box5), (-2.4,2.5,0.2), (0,1,0))
 
-
 if __name__ == '__main__':
-	print('this is RagdollSim.py')
-	a = RagdollSim()
-	a.start()
-	sys.exit(None)
+	sim_program = RagdollSim()
+	sim_program.start()
 Runs a simulation of a simple arm, with 2 links and 2 rotary joints
 """
 
-import sys
-
 from ars.app import Program
 import ars.utilities.mathematical as mut
 import ars.constants as cts
 
 if __name__ == '__main__':
 	print('Python file being executed: %s' % __file__)
-	a = SimpleArm()
-	a.start()
-	sys.exit(None)
+	sim_program = SimpleArm()
+	sim_program.start()
 #
 # @author: german
 
-import sys
-
 from ars.app import Program
 
 class Vehicle1(Program):
 		self.sim.get_joint('r4').add_torque(-self.TORQUE/2)
 
 if __name__ == '__main__':
-	a = Vehicle1()
-	a.start()
-	sys.exit(None)
+	sim_program = Vehicle1()
+	sim_program.start()
 free-rotating spherical wheel.
 """
 
-import sys
-
 from ars.app import Program
 import ars.constants as cts
 
 		self.sim.get_joint('r2').add_torque(-self.TORQUE)
 
 if __name__ == '__main__':
-	a = Vehicle2()
-	a.start()
-	sys.exit(None)
+	sim_program = Vehicle2()
+	sim_program.start()

bin/VehicleWithArm.py

 joint speed. 
 """
 
-import sys
-
 from ars.app import Program
 import ars.utilities.mathematical as mut
 import ars.constants as cts
 		self.apply_torque_to_joints(-q1p * self.Q1_FRICTION_COEFF, -q2p * self.Q2_FRICTION_COEFF)
 
 if __name__ == '__main__':
-	a = VehicleWithArm()
-	a.start()
-	sys.exit(None)
+	sim_program = VehicleWithArm()
+	sim_program.start()

bin/VehicleWithControlledArm.py

 joint speed. The second joint has a PD controller.
 """
 
-import sys
-
 from VehicleWithArm import VehicleWithArm
 
 def output_data(time, sp, cv, error, torque):
 		return torque
 
 if __name__ == '__main__':
-	a = VehicleWithControlledArm(False, False)
-	a.start()
-	sys.exit(None)
+	sim_program = VehicleWithControlledArm(False, False)
+	sim_program.start()