1. German Larrain
  2. ars

Commits

German Larrain  committed e34af20

joints.Rotary: new methods get_angle and get_angle_rate

  • Participants
  • Parent commits 9e19352
  • Branches dev

Comments (0)

Files changed (1)

File ars/model/robot/joints.py

View file
 			self._inner_joint.addTorque(torque)
 		except:
 			raise exc.PhysicsEngineException('Failed to add torque to this joint')
+	
+	def get_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
+		'''
+		try:
+			return self._inner_joint.getAngle()
+		except:
+			raise exc.PhysicsEngineException('Failed to get the angle of this joint')
+	
+	def get_angle_rate(self):
+		'''
+		Returns the angle rate (float).
+		'''
+		try:
+			return self._inner_joint.getAngleRate()
+		except:
+			raise exc.PhysicsEngineException('Failed to get the angle rate of this joint')
+		
 			
 class Caster(Joint):
 	pass