1. German Larrain
  2. ars

Commits

German Larrain  committed 4c73a9b

demos.sensors.joint_power1: added class docstring to JointPower

  • Participants
  • Parent commits 29652c8
  • Branches dev

Comments (0)

Files changed (1)

File demos/sensors/joint_power1.py

View file
  • Ignore whitespace
 
 class JointPower(CentrifugalForce, PrintDataMixin):
 
+	"""Simulation of a virtual power sensor attached to a joint (``r2``).
+
+	This joint is not powered but because friction is considered
+	an external	torque is applied at each simulation step
+	(see :meth:`apply_friction`). Because it is a friction torque,
+	the applied power is negative.
+
+	The laser is positioned at :attr:`RAY_POS` and its detection range
+	is determined by :attr:`RAY_LENGTH`. The default orientation
+	(positive Z-axis) of the :class:`ars.model.robot.sensors.Laser`
+	may be modified with :attr:`RAY_ROTATION`.
+
+	.. seealso::
+		:class:`ars.model.robot.sensors.Sensor`
+
+	The sensor is created in :meth:`create_sim_objects`:
+		`self.sensor = sen.Laser(space, self.RAY_LENGTH)`
+		`self.sensor.set_position(self.RAY_POS)`
+
+	and it is updated in :meth:`on_post_step`:
+		`self.sensor.on_change(time)`
+
+	"""
+
 	def create_sim_objects(self):
 		CentrifugalForce.create_sim_objects(self)
 		joint_object = self.sim.get_joint('r2')