1. German Larrain
  2. ars

Commits

German Larrain  committed 2c3fbb6

demos.sensors: renamed classes to better explain their purpose.

  • Participants
  • Parent commits e472028
  • Branches dev

Comments (0)

Files changed (13)

File demo_runner.py

View file
  • Ignore whitespace
 	('IROS.example4b_sinusoidal_terrain_with_screenshot_recorder', 'Example4SR'),
 	('IROS.example5_vehicle_with_user_input', 'Example5'),
 
-	('sensors.accelerometer1', 'Accelerometer'),
-	('sensors.accelerometer2', 'Accelerometer'),
-	('sensors.body', 'GPSSensor'),
-	('sensors.joint_power1', 'JointPower'),
-	('sensors.joint_torque1', 'JointTorque'),
-	('sensors.kinetic_energy1', 'KineticEnergy'),
-	('sensors.laser', 'LaserSensor'),
-	('sensors.laser', 'VisualLaser'),
-	('sensors.potential_energy1', 'PotentialEnergy'),
-	('sensors.rotary_joint', 'RotaryJointSensor'),
-	('sensors.system_total_energy1', 'SystemTotalEnergy'),
-	('sensors.total_energy1', 'TotalEnergy'),
-	('sensors.velometer1', 'Velometer'),
+	('sensors.accelerometer1', 'FallingBallsAccelerometer'),
+	('sensors.accelerometer2', 'CentrifugalForceAccelerometer'),
+	('sensors.body', 'FallingBallsGPSSensor'),
+	('sensors.joint_power1', 'CentrifugalForceJointPower'),
+	('sensors.joint_torque1', 'CentrifugalForceJointTorque'),
+	('sensors.kinetic_energy1', 'FallingBallsKineticEnergy'),
+	('sensors.laser', 'FallingBallsLaserSensor'),
+	('sensors.laser', 'FallingBallsVisualLaser'),
+	('sensors.potential_energy1', 'FallingBallsPotentialEnergy'),
+	('sensors.rotary_joint', 'CentrifugalForceJointRotation'),
+	('sensors.system_total_energy1', 'FallingBallsSystemTotalEnergy'),
+	('sensors.total_energy1', 'FallingBallsBodyTotalEnergy'),
+	('sensors.velometer1', 'FallingBallsVelometer'),
 ]
 
 INTRODUCTION_MSG = """

File demos/sensors/accelerometer1.py

View file
  • Ignore whitespace
 from .base import FallingBalls, PrintDataMixin, logger
 
 
-class Accelerometer(FallingBalls, PrintDataMixin):
+class FallingBallsAccelerometer(FallingBalls, PrintDataMixin):
 
 	def __init__(self):
 		FallingBalls.__init__(self)

File demos/sensors/accelerometer2.py

View file
  • Ignore whitespace
 from .base import CentrifugalForce2, PrintDataMixin, logger
 
 
-class Accelerometer(CentrifugalForce2, PrintDataMixin):
+class CentrifugalForceAccelerometer(CentrifugalForce2, PrintDataMixin):
 
 	def create_sim_objects(self):
 		CentrifugalForce2.create_sim_objects(self)

File demos/sensors/body.py

View file
  • Ignore whitespace
 from .base import FallingBalls, PrintDataMixin, logger
 
 
-class GPSSensor(FallingBalls, PrintDataMixin):
+class FallingBallsGPSSensor(FallingBalls, PrintDataMixin):
 
 	def __init__(self):
 		FallingBalls.__init__(self)

File demos/sensors/joint_power1.py

View file
  • Ignore whitespace
 from .base import CentrifugalForce, PrintDataMixin
 
 
-class JointPower(CentrifugalForce, PrintDataMixin):
+class CentrifugalForceJointPower(CentrifugalForce, PrintDataMixin):
 
 	"""Simulation of a virtual power sensor attached to a joint (``r2``).
 

File demos/sensors/joint_torque1.py

View file
  • Ignore whitespace
 from .base import CentrifugalForce, PrintDataMixin
 
 
-class JointTorque(CentrifugalForce, PrintDataMixin):
+class CentrifugalForceJointTorque(CentrifugalForce, PrintDataMixin):
 
 	def create_sim_objects(self):
 		CentrifugalForce.create_sim_objects(self)

File demos/sensors/kinetic_energy1.py

View file
  • Ignore whitespace
 from .base import FallingBalls, PrintDataMixin, logger
 
 
-class KineticEnergy(FallingBalls, PrintDataMixin):
+class FallingBallsKineticEnergy(FallingBalls, PrintDataMixin):
 
 	def __init__(self):
 		FallingBalls.__init__(self)

File demos/sensors/laser.py

View file
  • Ignore whitespace
 from .base import FallingBalls, PrintDataMixin, logger
 
 
-class LaserSensor(FallingBalls, PrintDataMixin):
+class FallingBallsLaserSensor(FallingBalls, PrintDataMixin):
 
 	"""Simulation of a laser sensor detecting intersection with a ball as it
 	falls.
 			logger.exception("Exception when executing on_post_step")
 
 
-class VisualLaser(LaserSensor):
+class FallingBallsVisualLaser(FallingBallsLaserSensor):
 
-	"""A simulation identical to :class:`LaserSensor` but more
+	"""A simulation identical to :class:`FallingBallsLaserSensor` but more
 	interesting visually. For each intersection of the laser and an object,
 	a small colored sphere is shown.
 
 	SPHERE_COLOR = (1.0, 1.0, 0.0)
 
 	def __init__(self):
-		super(VisualLaser, self).__init__()
+		super(FallingBallsVisualLaser, self).__init__()
 		self.intersection_point = None
 		ars.app.dispatcher.connect(self.on_post_on_change, self.SIGNAL)
 
 		if self.intersection_point is not None:
 			self.gAdapter.remove_object(self.intersection_point)
 			self.intersection_point = None
-		super(VisualLaser, self).on_post_step()
+		super(FallingBallsVisualLaser, self).on_post_step()
 
 	def on_post_on_change(self, sender, *args, **kwargs):
 		"""Create and paint laser's closest contact point.

File demos/sensors/potential_energy1.py

View file
  • Ignore whitespace
 from .base import FallingBalls, PrintDataMixin, logger
 
 
-class PotentialEnergy(FallingBalls, PrintDataMixin):
+class FallingBallsPotentialEnergy(FallingBalls, PrintDataMixin):
 
 	def __init__(self):
 		FallingBalls.__init__(self)

File demos/sensors/rotary_joint.py

View file
  • Ignore whitespace
 from .base import CentrifugalForce, PrintDataMixin, logger
 
 
-class RotaryJointSensor(CentrifugalForce, PrintDataMixin):
+class CentrifugalForceJointRotation(CentrifugalForce, PrintDataMixin):
 
 	def create_sim_objects(self):
 		CentrifugalForce.create_sim_objects(self)
 
 	def on_pre_frame(self):
 		# superclass' `on_pre_frame` sets r1 speed and applies friction to r2
-		super(RotaryJointSensor, self).on_pre_frame()
+		super(CentrifugalForceJointRotation, self).on_pre_frame()
 		try:
 			time = self.sim.sim_time
 			self.sensor.on_change(time)

File demos/sensors/system_total_energy1.py

View file
  • Ignore whitespace
 from .base import FallingBalls, PrintDataMixin, logger
 
 
-class SystemTotalEnergy(FallingBalls, PrintDataMixin):
+class FallingBallsSystemTotalEnergy(FallingBalls, PrintDataMixin):
 
 	def __init__(self):
 		FallingBalls.__init__(self)

File demos/sensors/total_energy1.py

View file
  • Ignore whitespace
 from .base import FallingBalls, PrintDataMixin, logger
 
 
-class TotalEnergy(FallingBalls, PrintDataMixin):
+class FallingBallsBodyTotalEnergy(FallingBalls, PrintDataMixin):
 
 	def __init__(self):
 		FallingBalls.__init__(self)

File demos/sensors/velometer1.py

View file
  • Ignore whitespace
 from .base import FallingBalls, PrintDataMixin, logger
 
 
-class Velometer(FallingBalls, PrintDataMixin):
+class FallingBallsVelometer(FallingBalls, PrintDataMixin):
 
 	def __init__(self):
 		FallingBalls.__init__(self)