Physics based robot


I’m trying to build a simple world with physics based robotic grippers that can pick up and hold a cylinder. The player is simply trying to place the cylinder into a hole in a wall. The problem is that I need the cylinder to realistically move around in the grippers if the player scrapes the cylinder across the wall.

Is there a best practices way of doing this? Currently I have a kinematic node that the player moves with the keyboard. That node has two slider joints each with a box (the grippers) attached. On a key press, a force is applied to each box (gripper) slamming them together, thus gripping the cylinder (and on another key press the opposite force is applied, separating them). However the pincers lag behind the kinematic node and bounce around like they are attached by a rubber band. I’ve tried setting the restitutionLimLin, but that only helps a little bit, I’ve also tried messing around with the bulletAppState.setSpeed() but that doesn’t really do much either.

Is there a better way to be able to grip the cylinder other than what I’ve laid out here (I’m sure there is, but I’m relatively new to programming)? Oh also I’ve messed around with a set of hinge joints for gripping (think pressing your thumb and forefinger together to grip), but with no luck.

Any help is greatly appreciated,


ps. would a switch to ODE rather than bullet be better for simulating a robot?

You can use the KinematicCharacterControl for this, its mainly used for RagDoll animations but in fact it also is a combination of kinematic bodies that move according to the animation. Generally you don’t want to do everything “realistic” but rather fake the “taking in hand” etc. if its not really just about this. You see in almost every game that when a character picks something up, its basically just beamed to their hand and then sticks to it, having no physical properties of its own. Simulating a whole body with arms etc. is also scarcely seen in computer games, some fighting / boxing games do it nowadays but that is only two characters in a very confined space.

Thank you for the quick answer! So I’m not really building a game, its more of a physics simulator. Hopefully, when I’m done I’ll be able to get people to use it and record data from their movements (and camera positions etc). The robotic manipulator doesn’t necessarily need to be physics based, but from what I’ve read the kinematic objects won’t interact realistically with dynamic objects. Would it be possible use Jmonkey to make a physics simulator like this, with realistic interactions between the static walls and a dynamic cylinder being gripped?

Thanks again,


You should think the other way round if this is supposed to be based on physics I’d say. That is, first make the physics work and then add the models/meshes. At first you can just work by using the physics debug view. Kinematic objects will affect the physics world around them “realistically”, that is they will push stuff hard if you move them quick and just touch it when you move it slowly. The only “advantage” is that gravity and impacts do not work on the kinematic object, so you can move it around absolutely w/o checking what the physics has done to its location all the time.

Do you mean bulletAppState.getPhysicsSpace().enableDebug(assetManager);? I’ve been using that and geometric primitives to test out the physics. I just tried setting the grabbers as kinematic objects and manually setting the distance between them, with bad results. Do you have any suggestions on how I should go about structuring this, other than hinge/slider joints attached to a kinematic node? Do I need to build a full on robot attach to a vehicleControl with wheels etc (similar to the jBullet forklift demo) or can I get away with having the user control the floating object? :?



Yes :stuck_out_tongue: