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.
Robot Simulation
-
- Posts: 56
- Joined: Sat Mar 08, 2008 12:37 am
Re: Robot Simulation
Hello,
You can use the btSliderConstraint with linear motor to simulate a piston.
To enable motor add code like
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
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
and shows how to start/stop the motor
Best regards,
Roman
-
- Posts: 2
- Joined: Wed Mar 04, 2009 5:49 pm
Re: Robot Simulation
ok thanks, i will try it.
EDIT: it works very well. Thanks a lot!
EDIT: it works very well. Thanks a lot!