Robot Simulation

Show what you made with Bullet Physics SDK: Games, Demos, Integrations with a graphics engine, modeler or any other application
gonzalez
Posts: 2
Joined: Wed Mar 04, 2009 5:49 pm

Robot Simulation

Post by gonzalez »

Hi everybody.
I'm working on a student project in which i have to simulate a tetrahedral robot composed by pistons and balls
(like in this video: http://www.youtube.com/watch?v=RDT8uE2gpys).
The fisrt step is to model a piston using Bullet.
I used 2 rigidbodies to symbolize ends of piston, and a linear constraint in order to create moves.

Now, i plan to make a move to my piston (make it more bigger).
I try to apply velocity or force to one ends but this vector may change because of the direction of the piston.
I Ask you if i can apply a force allways parallel to the direction of my piston, and how do it.
User avatar
rponomarev
Posts: 56
Joined: Sat Mar 08, 2008 12:37 am

Re: Robot Simulation

Post by rponomarev »

Hello,

You can use the btSliderConstraint with linear motor to simulate a piston.

To enable motor add code like

Code: Select all

	pSlider->setPoweredLinMotor(true); // enable the motor
	pSlider->setMaxLinMotorForce(0.1);  // maximum motor force
	pSlider->setTargetLinMotorVelocity(5.0); // desired velocity
You may also look at Bullet ForkLiftDemo, it uses slider with motor to lift the fork
and shows how to start/stop the motor

Best regards,
Roman
gonzalez
Posts: 2
Joined: Wed Mar 04, 2009 5:49 pm

Re: Robot Simulation

Post by gonzalez »

ok thanks, i will try it.

EDIT: it works very well. Thanks a lot!