Page 1 of 1

Robot Simulation

Posted: Wed Mar 04, 2009 6:21 pm
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.

Re: Robot Simulation

Posted: Wed Mar 04, 2009 8:08 pm
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

Re: Robot Simulation

Posted: Thu Mar 05, 2009 11:25 am
by gonzalez
ok thanks, i will try it.

EDIT: it works very well. Thanks a lot!