def _add_wheel(self, side_x): from parts import Cylinder, Joint, Material wheel = Cylinder((0.2, 0.04, 0.2), material=Material(1, 0xFF202020), name='wheel_' + side_name(side_x)) wheel.add_joint(Joint((0, 0, 0), rot=(0, 1, 0, 0), name='hips')) hips = self.hips hips.add_joint( Joint(hips.end_pos(1, (side_x, 0, 0), -1) + side_x * wheel.radii[1], rot=(-side_x, 0, 0, 0), name=wheel.name)) hips.attach(wheel) return wheel
def _add_wheel(self, side_x): from parts import Cylinder, Joint, Material wheel = Cylinder( (0.2,0.04,0.2), material=Material(1, 0xFF202020), name='wheel_'+side_name(side_x)) wheel.add_joint(Joint((0,0,0), rot=(0,1,0,0), name='hips')) hips = self.hips hips.add_joint(Joint( hips.end_pos(1,(side_x,0,0),-1) + side_x*wheel.radii[1], rot=(-side_x,0,0,0), name=wheel.name)) hips.attach(wheel) return wheel
def _add_casters(self): from parts import Capsule, Cylinder, Joint, Limits hips = self.hips wheel = self.wheel_left support = Cylinder((0.9 * self.hips.radius, 0.02, wheel.radii[0]), name='support') support.add_joint( Joint((0, 0, 0), rot=(0, 1, 0, 0), limits=Limits.zero(), name='hips')) hips.add_joint( Joint(hips.end_pos(-1), rot=(0, 1, 0, 0), limits=Limits.zero(), name='support')) hips.attach(support) # Automate caster position to same bottom level as wheels. offset_y = wheel.pos[1] - support.pos[1] for side_z in (-1, 1): caster = Capsule(0.49 * offset_y, 0, material=wheel.material, name='caster_' + side_z_name(side_z)) support.add_joint( Joint((0, 0, side_z * support.radii[2]), name=caster.name)) caster.add_joint(Joint((0, 0, 0), name=support.name)) support.attach(caster)
def _add_casters(self): from parts import Capsule, Cylinder, Joint, Limits hips = self.hips wheel = self.wheel_left support = Cylinder( (0.9*self.hips.radius,0.02,wheel.radii[0]), name='support') support.add_joint(Joint( (0,0,0), rot=(0,1,0,0), limits=Limits.zero(), name='hips')) hips.add_joint(Joint( hips.end_pos(-1), rot=(0,1,0,0), limits=Limits.zero(), name='support')) hips.attach(support) # Automate caster position to same bottom level as wheels. offset_y = wheel.pos[1] - support.pos[1] for side_z in (-1,1): caster = Capsule( 0.49*offset_y, 0, material=wheel.material, name='caster_'+side_z_name(side_z)) support.add_joint(Joint( (0,0,side_z*support.radii[2]), name=caster.name)) caster.add_joint(Joint((0,0,0), name=support.name)) support.attach(caster)