Problem in creating gripper using sliding joint

Hi guys,

Recently I am using jmonkey to create a gripper . I am using slider joints to create a two parallel joints in opposite direction . I am getting a problem like this .

gripperproblem

I am adding two slider joints to the same position to the same node in opposite direction. when I add them using the same code .

[java] Node holderNode=PhysicsTestHelper.createPhysicsTestNode(assetManager, new BoxCollisionShape(new Vector3f( 1f, .3f, .3f)),0);
holderNode.getControl(RigidBodyControl.class).setPhysicsLocation(new Vector3f(0f,0,0f));
rootNode.attachChild(holderNode);
getPhysicsSpace().add(holderNode);

    Node hammerNode=PhysicsTestHelper.createPhysicsTestNode(assetManager, new BoxCollisionShape(new Vector3f( .3f, .3f, .3f)),1);
    hammerNode.getControl(RigidBodyControl.class).setPhysicsLocation(new Vector3f(1f,0.6f,0f));
    
    rootNode.attachChild(hammerNode);
    getPhysicsSpace().add(hammerNode);

    joint1=new SliderJoint(hammerNode.getControl(RigidBodyControl.class), holderNode.getControl(RigidBodyControl.class), new Vector3f(0f,-.6f,-.6f), new Vector3f(1f,0f,1f),true);
   getPhysicsSpace().add(joint1);
      Node hammerNode1=PhysicsTestHelper.createPhysicsTestNode(assetManager, new BoxCollisionShape(new Vector3f( .3f, .3f, .3f)),1);
    hammerNode1.getControl(RigidBodyControl.class).setPhysicsLocation(new Vector3f(1f,0.6f,0f));
    
    rootNode.attachChild(hammerNode1);
    getPhysicsSpace().add(hammerNode1);
   joint2=new SliderJoint(hammerNode1.getControl(RigidBodyControl.class), holderNode.getControl(RigidBodyControl.class), new Vector3f(0f,-.6f,-.6f), new Vector3f(-1f,0f,1f),true);
   getPhysicsSpace().add(joint2);
   
   
//    Node node1=PhysicsTestHelper.createPhysicsTestNode(assetManager, new BoxCollisionShape(new Vector3f( 1f, .3f, .3f)),0);
//    node1.getControl(RigidBodyControl.class).setPhysicsLocation(new Vector3f(-2f,0,0f));
//    rootNode.attachChild(node1);
//    getPhysicsSpace().add(node1);
    
//     rootNode.attachChild(node1);
//    getPhysicsSpace().add(node1);

// joint1=new SliderJoint(holderNode.getControl(RigidBodyControl.class), hammerNode.getControl(RigidBodyControl.class), new Vector3f(0f,1f,0f), new Vector3f(1f,0f,0f),true);
// getPhysicsSpace().add(joint1);
// joint1.setMaxAngMotorForce(1f);
// joint1.setPoweredLinMotor(true);
/*
joint1.setLowerAngLimit(0f);
joint1.setUpperAngLimit(-2f);
joint1.setMaxAngMotorForce(1f);
joint1.setPoweredAngMotor(true);
joint1.setTargetAngMotorVelocity(1f);
* */

    joint1.setLowerLinLimit(0f);
    joint1.setUpperLinLimit(1f);
    joint1.setMaxLinMotorForce(1f);
    joint1.setPoweredLinMotor(true);
    joint1.setTargetLinMotorVelocity(1f);
    
     joint2.setLowerLinLimit(0f);
    joint2.setUpperLinLimit(1f);
    joint2.setMaxLinMotorForce(1f);
    joint2.setPoweredLinMotor(true);
    joint2.setTargetLinMotorVelocity(1f);
    [/java] 

One slider joint is not able to show contact between the two nodes. Did I make any mistake here

Regards
Bharath

WTH is a gripper?

Gripper is a tool used in robotic arm. It is used for hold the objects .

bharath