Beispiel #1
0
def create_sphere(position: agx.Vec3, scale):
    shape = agxCollide.Sphere(0.5 * scale)
    geometry = agxCollide.Geometry(shape)
    body = agx.RigidBody(geometry)
    body.setPosition(position)
    oneLegRobotApp.create_visual(body)
    return body
Beispiel #2
0
def add_second_joint_aft():
    geometry = agxCollide.Geometry(second_joint_shape_aft.deepCopy(),
                                   agx.AffineMatrix4x4.translate(0, 0, 100))
    geometry.setLocalRotation(agx.EulerAngles(0, 0, math.pi / 2))
    print(geometry.getRotation())
    geometry.setEnableCollisions(True)
    oneLegRobotApp.create_visual(geometry, agxRender.Color.Red())
    oneLegRobotApp.add(geometry)
Beispiel #3
0
def create_cylinder(position: agx.Vec3, scale):
    shape = agxCollide.Cylinder(0.5 * scale, 1 * scale)
    geometry = agxCollide.Geometry(shape)
    body = agx.RigidBody(geometry)
    body.setPosition(position)
    oneLegRobotApp.create_visual(body)
    body.setRotation(agx.EulerAngles(agx.PI_2, 0, 0))
    return body
Beispiel #4
0
def add_section_old(x, y, z, rotx, roty, rotz, path):
    geometry = agxCollide.Geometry(path.deepCopy(),
                                   agx.AffineMatrix4x4.translate(x, y, z))
    geometry.setLocalRotation(agx.EulerAngles(rotx, roty, rotz))
    #print(path + " were added with rotation " + geometry.getRotation())
    geometry.setEnableCollisions(True)
    oneLegRobotApp.create_visual(geometry, agxRender.Color.Red())
    #oneLegRobotApp.add(geometry)
    return geometry
Beispiel #5
0
 def create_section(self, x, y, z, rotx, roty, rotz, path):
     geometry = agxCollide.Geometry(path.deepCopy(),
                                    agx.AffineMatrix4x4.translate(x, y, z))
     geometry.setLocalRotation(agx.EulerAngles(rotx, roty, rotz))
     geometry.setEnableCollisions(True)
     rigidBody = agx.RigidBody(geometry)
     rigidBody.setMotionControl(agx.RigidBody.DYNAMICS)
     oneLegRobotApp.create_visual(rigidBody, agxRender.Color.Red())
     return rigidBody
Beispiel #6
0
def add_first_joint_aft():
    geometry = agxCollide.Geometry(first_joint_shape_aft.deepCopy(),
                                   agx.AffineMatrix4x4.translate(0, 0, 200))
    geometry.setLocalRotation(agx.EulerAngles(0, 0, math.pi / 2))
    print(geometry.getRotation())
    geometry.setEnableCollisions(True)
    rigidBody = agx.RigidBody(geometry)
    oneLegRobotApp.create_visual(rigidBody, agxRender.Color.Red())
    oneLegRobotApp.add(rigidBody)
    rigidBody.setMotionControl(agx.RigidBody.STATIC)
Beispiel #7
0
    def __init__(self):
        super().__init__()

        first_joint_geometry = agxCollide.Geometry(
            first_joint_shape.deepCopy())
        first_joint_geometry.setEnableCollisions(True)
        oneLegRobotApp.create_visual(first_joint_geometry,
                                     agxRender.Color.Black())

        self.add(first_joint_geometry)
Beispiel #8
0
def create_floor():
    w = 200
    b = 200
    h = 10
    #floor = agxCollide.Geometry(agxCollide.Box(2.5, 0.5, h), agx.AffineMatrix4x4.translate(0, 0, -h))

    floor = agxCollide.Geometry(agxCollide.Box(w, b, h))
    floor.setPosition(0, 0, 0)
    floor.setRotation(agx.EulerAngles(0, 0, 0))
    oneLegRobotApp.create_visual(floor, diffuse_color=agxRender.Color.Green())
    oneLegRobotApp.add(floor)
Beispiel #9
0
    def create_floor(self):
        w = 200
        b = 200
        h = 10
        # floor = agxCollide.Geometry(agxCollide.Box(2.5, 0.5, h), agx.AffineMatrix4x4.translate(0, 0, -h))

        floor = agxCollide.Geometry(agxCollide.Box(w, b, h))
        floor.setPosition(0, 0, 0)
        floor.setRotation(agx.EulerAngles(0, 0, 0))
        floor.setEnableCollisions(True)
        rigidBody = agx.RigidBody(floor)
        rigidBody.setMotionControl(agx.RigidBody.STATIC)
        oneLegRobotApp.create_visual(rigidBody,
                                     diffuse_color=agxRender.Color.Green())
        return floor