Commits

German Larrain committed ceac897

robot.joints: added docstring to all class constructors.

Comments (0)

Files changed (1)

ars/model/robot/joints.py

 
 	@abstractmethod
 	def __init__(self, world, inner_joint, body1=None, body2=None):
+		"""Constructor.
+
+		:param world:
+		:type world: :class:`physics.base.World`
+		:param inner_joint:
+		:type inner_joint: :class:`ode.Joint`
+		:param body1:
+		:type body1: :class:`physics.base.Body`
+		:param body2:
+		:type body2: :class:`physics.base.Body`
+
+		"""
 		self._world = world
 		self._inner_joint = inner_joint
 		self._body1 = body1
 
 class Fixed(Joint):
 	def __init__(self, world, body1, body2):
+		"""Constructor.
+
+		:param world:
+		:type world: :class:`physics.base.World`
+		:param body1:
+		:type body1: :class:`physics.base.Body`
+		:param body2:
+		:type body2: :class:`physics.base.Body`
+
+		"""
 		try:
 			inner_joint = ode.FixedJoint(world._inner_object)
 			inner_joint.attach(body1.inner_object, body2.inner_object)
 
 class Rotary(ActuatedJoint):
 	def __init__(self, world, body1, body2, anchor, axis):
+		"""Constructor.
 
+		:param world:
+		:type world: :class:`physics.base.World`
+		:param body1:
+		:type body1: :class:`physics.base.Body`
+		:param body2:
+		:type body2: :class:`physics.base.Body`
+		:param anchor: joint anchor point
+		:type anchor: 3-tuple of floats
+		:param axis: rotation axis
+		:type axis: 3-tuple of floats
+
+		"""
 		try:
 			inner_joint = ode.HingeJoint(world._inner_object)
 			inner_joint.attach(body1.inner_object, body2.inner_object)
 
 class Universal(Joint):
 	def __init__(self, world, body1, body2, anchor, axis1, axis2):
+		"""Constructor.
 
+		:param world:
+		:type world: :class:`physics.base.World`
+		:param body1:
+		:type body1: :class:`physics.base.Body`
+		:param body2:
+		:type body2: :class:`physics.base.Body`
+		:param anchor: joint anchor point
+		:type anchor: 3-tuple of floats
+		:param axis1: first universal axis
+		:type axis1: 3-tuple of floats
+		:param axis2: second universal axis
+		:type axis2: 3-tuple of floats
+
+		"""
 		try:
 			inner_joint = ode.UniversalJoint(world._inner_object)
 			inner_joint.attach(body1.inner_object, body2.inner_object)
 
 class BallSocket(Joint):
 	def __init__(self, world, body1, body2, anchor):
+		"""Constructor.
 
+		:param world:
+		:type world: :class:`physics.base.World`
+		:param body1:
+		:type body1: :class:`physics.base.Body`
+		:param body2:
+		:type body2: :class:`physics.base.Body`
+		:param anchor: joint anchor point
+		:type anchor: 3-tuple of floats
+
+		"""
 		try:
 			inner_joint = ode.BallJoint(world._inner_object)
 			inner_joint.attach(body1.inner_object, body2.inner_object)
 	"""
 
 	def __init__(self, world, body1, body2, axis):
+		"""Constructor.
 
+		:param world:
+		:type world: :class:`physics.base.World`
+		:param body1:
+		:type body1: :class:`physics.base.Body`
+		:param body2:
+		:type body2: :class:`physics.base.Body`
+		:param axis: rotation axis
+		:type axis: 3-tuple of floats
+
+		"""
 		try:
 			inner_joint = ode.SliderJoint(world._inner_object)
 			inner_joint.attach(body1.inner_object, body2.inner_object)
 class JointFeedback(object):
 	def __init__(self, body1, body2, force1=None, force2=None, torque1=None,
 			torque2=None):
+		"""Constructor.
+
+		:param body1:
+		:type body1: :class:`physics.base.Body`
+		:param body2:
+		:type body2: :class:`physics.base.Body`
+		:param force1:
+		:type force1: 3-tuple of floats
+		:param force2:
+		:type force2: 3-tuple of floats
+		:param torque1:
+		:type torque1: 3-tuple of floats
+		:param torque2:
+		:type torque2: 3-tuple of floats
+
+		"""
 		self._body1 = body1
 		self._body2 = body2
 		self.force1 = force1