Commits

German Larrain committed 128f17a

joints.Rotary: fixed/added docstrings to all methods.

  • Participants
  • Parent commits fe62c2b

Comments (0)

Files changed (1)

File ars/model/robot/joints.py

 			raise exc.PhysicsObjectCreationError(type_='Rotary joint')
 
 	def add_torque(self, torque):
-		"""Applies the torque about the rotation axis
-		torque: float
+		"""Apply torque about the rotation axis.
+
+		:param torque: magnitude
+		:type torque: float
+
 		"""
 		dispatcher.send(signals.JOINT_PRE_ADD_TORQUE, sender=self,
 		                torque=torque)
 
 	@property
 	def angle(self):
-		"""Returns the angle (float) between the two bodies. Its value is
-		between -pi and +pi. The zero angle is determined by the position of
-		the bodies when joint anchor is set."""
+		"""Return the angle between the two bodies.
+
+		The zero angle is determined by the position of the bodies
+		when joint's anchor was set.
+
+		:return: value ranging ``-pi`` and ``+pi``
+		:rtype: float
+
+		"""
 		try:
 			return self._inner_joint.getAngle()
 		except:
 
 	@property
 	def angle_rate(self):
-		"""Returns the angle rate (float)"""
+		"""Return the rate of change of the angle between the two bodies.
+
+		:return: angle rate
+		:rtype: float
+
+		"""
 		try:
 			return self._inner_joint.getAngleRate()
 		except:
 			raise exc.JointError(self, 'Failed to get the angle rate of this joint')
 
 	def set_speed(self, speed, max_force=None):
+		"""Set rotation speed to ``speed``.
+
+		The joint will set that speed by applying a force up to
+		``max_force``, so it is not guaranteed that ``speed``
+		will be reached.
+
+		:param speed: speed to set
+		:type speed: float
+		:param max_force: if not None, the maximum force the joint can
+			apply when trying to set the rotation speed
+		:type max_force: float or None
+
+		"""
 		dispatcher.send(signals.JOINT_PRE_SET_SPEED, sender=self, speed=speed)
 		if max_force is not None:
 			self._inner_joint.setParam(ode.ParamFMax, max_force)