Exemple #1
0
    def test_WrapObject(self):
        # Make sure the WrapObjects are accessible.
        model = osim.Model()

        sphere = osim.WrapSphere()
        model.getGround().addWrapObject(sphere)

        cylinder = osim.WrapCylinder()
        cylinder.set_radius(0.5)
        model.getGround().addWrapObject(cylinder)

        torus = osim.WrapTorus()
        model.getGround().addWrapObject(torus)

        ellipsoid = osim.WrapEllipsoid()
        model.getGround().addWrapObject(ellipsoid)
Exemple #2
0
actcontroller.prescribeControlForActuator("hp", Constant(0))
actcontroller.prescribeControlForActuator("am", Constant(0))
actcontroller.prescribeControlForActuator("km", Constant(0))
actcontroller.prescribeControlForActuator("hm", Constant(0))
actcontroller.set_interpolation_method(3)
osimModel.addController(actcontroller)
osimModel.setGravity(Vec3(0., -9.81, 0.))

pullymass = .001
resting_length = 0.4
stiffness = 4454.76 * 4.
dissipation = 0.01
pulleyBody = osim.Body("PulleyBody", pullymass, Vec3(0),
                       osim.Inertia(0.1, 0.1, 0.1, 0.1, 0.1, 0.1))
#brick.inertia??
pulley = osim.WrapCylinder()
pulley.set_radius(0.05)
pulley.set_length(0.05)
pulley.set_quadrant("-y")

pulleyBody.addWrapObject(pulley)
osimModel.addBody(pulleyBody)
weld = osim.WeldJoint("weld", linkage3, Vec3(0), Vec3(0), pulleyBody, Vec3(0),
                      Vec3(0))
osimModel.addJoint(weld)

spring = osim.PathSpring("path_spring", resting_length, stiffness, dissipation)
spring.updGeometryPath().appendNewPathPoint("origin", linkage3,
                                            Vec3(0.05, 0.2, 0))
spring.updGeometryPath().appendNewPathPoint("insert", linkage2,
                                            Vec3(0.05, linkageLength2 - .2, 0))