Fixed path moving bodies

josemarin
Posts: 38
Joined: Fri Aug 12, 2005 5:37 pm

Fixed path moving bodies

Post by josemarin »

Hi!

What´s the "correct" way of create fixed path moving bodies using Bullet?

Imagine a plane, with a cube on it. There are 4 "waypoints" where the cube must travel.

The cube will move on a fixed velocity ( I must choose it) following a path towards the next waypoint.

The main problem is what to use to keep the cube following a path (from point A to point B) on a fixed velocity.

Another kind of moving body it´s a kind of piston: the body moves from point A to point B (decreasing the velocity when getting near point B), then returns to point A, and the cycle restarts.
In this case, it´s better to use a btSliderConstraint, with a mobile body and a fixed boby? How to control the velocity of the moving body?

Thanks!
chunky
Posts: 145
Joined: Tue Oct 30, 2007 9:23 pm

Re: Fixed path moving bodies

Post by chunky »

Sounds like a job for a kinematic body. From the Bullet documentation:
- Kinematic rigidbodies
o animated by the user
o only one-way interaction: dynamic objects will be pushed away but there is no influence from dynamics objects
o every simulation frame, dynamics world will get new world transform using btMotionState::getWorldTransform
Gary (-;
Youne
Posts: 40
Joined: Sun Jan 27, 2008 2:55 pm

Re: Fixed path moving bodies

Post by Youne »

Hi José,

I am in the process of constructing a model made up of several "Hydraulic jacks (Piston)". To start with, I had to model a single "Hydraulic jack" then I had to generalise it to the complete model. I created a "Slider" to model a "Hydraulic jack" using two rigidbodies (box) and the function (btGeneric6DofConstraint as a frist step and then btSliderConstraint).

To move "the beam which lifts" (Fig.1) you have to apply a constant or variable speed to the upper part of the piston.The problem is that the function SetLinearVelocity doesnt work as it's name indicates when we apply it to an object linked to another object (like in my "Hydraulic jack" model).

After having explored all the different available possibilities and after having asked lots of questions, a demo DynamicControlDemo gave me the idea to develop a TranslationMotor(seeing as the Demo used a method «enableAngularMotor» a RotaionalMotor, and TranslationMotor had not yet been developped).

So I got inspired from the way in which this method had been structured to develop the method «enableLinearMotor». It is not entirely perfect, and there is an instability with the model at rest (when we dont apply a speed) and I don't know the source of this problem. And I don't know if there is a method or a way to rectify this instability.

The second problem is that normally when we send a speed of zero to "Hydraulic jack", it is meant to stop whilst in my model "Hydraulic jack" is subject to it's own weight which forces it to go down :( .

I've sent you the source files and the model that I have developped. Perhaps you can give me some ideas to help me improve my model and to solve the problems that I am encountering.

I would really appreciate your help and I thank you in advance!

You can see alos this topics :
Question about MotorDemo !
http://www.bulletphysics.com/Bullet/php ... f=9&t=2129
setLinearVelocity Function ?
http://www.bulletphysics.com/Bullet/php ... f=9&t=2087

Hope this helps,

Youne
You do not have the required permissions to view the files attached to this post.
Youne
Posts: 40
Joined: Sun Jan 27, 2008 2:55 pm

Re: Fixed path moving bodies

Post by Youne »

Hi Jose,

I want to know what do you think about my model ?

thank you in advance

Youne