Commits

German Larrain committed fb00231

RSS1:
-Superclass class attributes are now overriden appropriately. VEHICLE_OFFSET, CAMERA_POSITION
-apply_torque method renamed to apply_torque_to_wheels

  • Participants
  • Parent commits 2794ab6

Comments (0)

Files changed (1)

 
 class RSS1(VehicleWithArm):
 
-	VehicleWithArm.VEHICLE_OFFSET = (-4,0.5,2)
-	VehicleWithArm.CAMERA_POSITION = (0,8,15)
+	VEHICLE_OFFSET = (-4,0.5,2)
+	CAMERA_POSITION = (0,8,15)
 	
 	kp = 10
 	speeds = ((0,0), (1,0), (5,1), (9,1), (13,0), (14,0)) # (time,speed)
 			linear_vel_plane = (linear_vel[0], linear_vel[2])
 			cv = length2(linear_vel_plane) * mut.sign(linear_vel[0])
 			torque = self.compensate(sp, cv)
-			self.apply_torque(torque)
+			self.apply_torque_to_wheels(torque)
 			
 			print('time: %f, speed_i: %d, sp: %f, cv: %f, error: %f, torque: %f' % 
 				(time, self.speed_i, sp, cv, sp - cv, torque))
 	def compensate(self, sp, cv):
 		return (sp - cv) * self.kp
 	
-	def apply_torque(self, torque):
+	def apply_torque_to_wheels(self, torque):
 		self.sim.get_joint('w1').add_torque(torque)
 		self.sim.get_joint('w2').add_torque(torque)