Commits

German Larrain committed bc49770

small changes in CasterSim.create_sim_objects

Comments (0)

Files changed (1)

 
 class CasterSim(Program):
 	
-	TORQUE = 100
+	TORQUE = 300
 	
 	def __init__(self):
 		Program.__init__(self)
 		self.key_press_functions.add('right', self.turn_right)
 	
 	def create_sim_objects(self):
-		offset = (1,1,1)
-		wheelR = self.sim.add_cylinder(1, 0.3, 0.4, (0,0,0)) # POR: point of reference
-		wheelL = self.sim.add_cylinder(1, 0.3, 0.4, (0,0,1))
-		caster = self.sim.add_sphere(1, 0.2, (1,-0.5,0.5))
-		chassis = self.sim.add_box(10, (1.3,0.2,0.6), (0.5,0,0.5))
+		
+		z_axis = (0,0,1)
+		offset = (1,1,0)
+		
+		wheelR = self.sim.add_cylinder(1, 0.2, 0.3, (0,0,-0.5)) # POR: point of reference
+		wheelL = self.sim.add_cylinder(1, 0.2, 0.3, (0,0,0.5))
+		caster = self.sim.add_sphere(1, 0.3, (1,0,0))
+		chassis = self.sim.add_box(10, (2,0.4,1.5), (0.5,0.55,0))
+		
+		self.sim.add_rotary_joint('r1', 
+							self.sim.get_object(chassis), 
+							self.sim.get_object(wheelR), 
+							None, z_axis)
+		self.sim.add_rotary_joint('r2', 
+							self.sim.get_object(chassis), 
+							self.sim.get_object(wheelL), 
+							None, z_axis)
+		self.sim.add_ball_socket_joint('bs', 
+								self.sim.get_object(chassis), 
+								self.sim.get_object(caster),
+								None)
 		
 		self.sim.get_object(wheelR).offset_by_position(offset)
 		self.sim.get_object(wheelL).offset_by_position(offset)
 		self.sim.get_object(caster).offset_by_position(offset)
 		self.sim.get_object(chassis).offset_by_position(offset)
-		
-		self.sim.add_rotary_joint('r1', self.sim.get_object(chassis), 
-							self.sim.get_object(wheelR), (1,1,1), (0,0,1))
-		self.sim.add_rotary_joint('r2', self.sim.get_object(chassis), 
-							self.sim.get_object(wheelL), (1,1,2), (0,0,1))
-		self.sim.add_ball_socket_joint('bs', self.sim.get_object(chassis), 
-								self.sim.get_object(caster), (2,0.5,1.5))
 	
 	def go_forwards(self):
 		""" Rotate both powered wheels in the same direction, forwards """
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.