Question about MotorDemo !

Post Reply
Youne
Posts: 40
Joined: Sun Jan 27, 2008 2:55 pm

Question about MotorDemo !

Post by Youne »

Hi to all,

I’ve just looked at the demo "MotorDemo" and I have a question for the person who developed the function enableAngularMotor. I am currently trying to develop the same function, but in translation. My question is when we give the angularvelocity "fDesiredAngularVel" with which we want our model to move, does the function take into account the mass of the two objects that are linked.

For example, if we add an object with a mass to each leg, will the model behave in the same way as when there was no object (base model)

Thank you for your help

Youne
eddybox
Posts: 25
Joined: Thu Nov 29, 2007 7:08 pm

Re: Question about MotorDemo !

Post by eddybox »

Hi Youne,

I wrote the MotorDemo, but didn't create the hinge constraint (nor the enableAngularMotor method in it). My impression is that the motor tries to achieve the passed velocity, given its settings for max impulse (muscle strength in the demo). Obviously, if the impulse required exceeds the limits, it won't succeed. Also, in the case of complex skeletons (chains of masses and constraints), I wouldn't expect the hinge to deliver an exact response.

Perhaps the creator of the hinge constraint has more to say on the subject...

Cheers,
Eddy
Youne
Posts: 40
Joined: Sun Jan 27, 2008 2:55 pm

Re: Question about MotorDemo !

Post by Youne »

Hi,

I need some explanations from the creator of btHingeConstraint !. How has he done to develop the method EnableAngularMotor ?

Thanks

Youne
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Question about MotorDemo !

Post by Erwin Coumans »

does the function take into account the mass of the two objects that are linked.
Yes. The mass and inertia is taken into account while trying to reach the desired (motor) velocity.
For example, if we add an object with a mass to each leg, will the model behave in the same way as when there was no object (base model)
It will be different. When mouse-picking the leg of the spider, it won't be able to reach the desired velocity.

Hope this helps,
Erwin
Youne
Posts: 40
Joined: Sun Jan 27, 2008 2:55 pm

Re: Question about MotorDemo !

Post by Youne »

Hi,

I looked at the code of btHingeConstraint and I understood that : The mass and inertia is taken into account while trying to reach the desired (motor) velocity (with regards to enableAngularMotor).

I have developped a motor in translation for the constraint btSliderConstraint (enableLinearMotor) (Fig.1). I know that btSliderConstraintSolver links two rigidbodies and to move one of the objects my method takes into consideration the mass. But I want to know if you have an idea what I should do so that this function works in the case where there is an object with a mass M placed (Fig.2) or linked (Fig.3) on top of the slider?

Thank you

Youne
ExampleSlider
ExampleSlider
Slider.JPG (34.32 KiB) Viewed 8241 times
Youne
Posts: 40
Joined: Sun Jan 27, 2008 2:55 pm

Re: Question about MotorDemo !

Post by Youne »

if anyone have idea about my problem please help me.... :( :( :(
User avatar
rponomarev
Posts: 56
Joined: Sat Mar 08, 2008 12:37 am

Re: Question about MotorDemo !

Post by rponomarev »

Hi Youne,
I may add motor(s) to the btSliderJoint. Looks like it will be a useful extension.

I have several questions to better understand your model:

1) Some definitions. As far as I understand you have 2 rigid bodies connected with slider constraint (Fig.1-3). Let’s call the lower body A and the upper – body B. Left drawing is the system at moment t0, right – at moment t0 + dt
2) I suppose that body A is a kinematic body (its mass is 0) and body B is a dynamic body (with mass, say, mB). Body A is fixed to the ground, gravity is directed along slider axis. Is that correct?
3) On Fig.2 body with mass M is placed on top of body B but does not attached to it, so body B works like an elevator. Is that right?
4) On Fig. 3 body with mass M is attached to body B with all 6 DOF fixed, so theoretically they could be considered as one rigid body with mass mB + M. Is that correct?

Thank you,
Roman Ponomarev
Youne
Posts: 40
Joined: Sun Jan 27, 2008 2:55 pm

Re: Question about MotorDemo !

Post by Youne »

Hi Roman,

Firstly, I would like to thank you for replying to me as I have been waiting several days for someone to help me solve my problem.

I totally agree with you on everything you said. However, having said this, I want to model an Elevator with a hydraulic jack. I developped a linear motor but I am not certain that it is functional. The most important is that it works and that it allows me to move the ElevatorGrid. What I have difficulty in integrating in my model is that it takes into account the weight of objects which are on top.

If you have any other questions, please do not hesitate to ask me and I'll reply to you straight away.

Thanks alot

Youne
User avatar
rponomarev
Posts: 56
Joined: Sat Mar 08, 2008 12:37 am

Re: Question about MotorDemo !

Post by rponomarev »

Hi Youne

Try the attached slider with motor, looks like it works
It is not the release version, so it may contain bugs

Best regards,
Roman Ponomarev
Attachments
SliderWithMotor.zip
(10.93 KiB) Downloaded 283 times
Youne
Posts: 40
Joined: Sun Jan 27, 2008 2:55 pm

Re: Question about MotorDemo !

Post by Youne »

Hi Roman,

thank you very much. I am going to have a look at everything you said and i'll let you know what i think a little later.

Thanks alot
Youne
Youne
Posts: 40
Joined: Sun Jan 27, 2008 2:55 pm

Re: Question about MotorDemo !

Post by Youne »

Hi Roman,

You can see my model here (Files Sources and Files Demo)

http://www.bulletphysics.com/Bullet/php ... f=9&t=2174

Best regards,
Youne
Post Reply