only adding force on primatic_joint using
force = {u,0,0} --u is a variable
torque = {0,0,0}
sim.addForceAndTorque(CarHandle ,force, torque)
and then,
The object is spinning
only adding force on primatic_joint
Re: only adding force on primatic_joint
Sorry, is that a question? If yes, what exactly is the problem?
Cheers
Cheers
Re: only adding force on primatic_joint
well, it is difficult to describe it. So there is the file(.ttt). the link is https://www.dropbox.com/s/y39f0bgfv3kgm ... m.ttt?dl=0
Cheers
Cheers
Re: only adding force on primatic_joint
Hello,
your motor is not dynamically enabled, it is in passive mode. You can notice that if you look at the scene hierarchy: there is no bouncing ball next to that joint. So set that joint into force/torque mode, disable its motor. And adjust its range to be large enough (e.g. [-2;+2] meters). Then, make sure that the car and the base are not colliding, otherwise you'll introduce friction. You can adjust that by slightly moving the car higher, or by change the respondable mask. Then it won't spin anymore.
And in that situation, instead of adding an external force, you could also simply enable the motor of the prismatic joint, and adjust its force with
Cheers
your motor is not dynamically enabled, it is in passive mode. You can notice that if you look at the scene hierarchy: there is no bouncing ball next to that joint. So set that joint into force/torque mode, disable its motor. And adjust its range to be large enough (e.g. [-2;+2] meters). Then, make sure that the car and the base are not colliding, otherwise you'll introduce friction. You can adjust that by slightly moving the car higher, or by change the respondable mask. Then it won't spin anymore.
And in that situation, instead of adding an external force, you could also simply enable the motor of the prismatic joint, and adjust its force with
sim.setJointMaxForce
.Cheers
Re: only adding force on primatic_joint
Hello,
According to your suggestion, I made the following changes:
1) the type of the joint Motor: setting positive model to force/torque mode
2) the motor enabled of the joint Motor: setting disable
3) the car's position: slightly moving the car higher
4) the friction factor: setting it to 0
However I can not control the joint Motor thought
the model's link is :https://www.dropbox.com/s/t35grb8yo31dc ... m.ttt?dl=0
Cheers
According to your suggestion, I made the following changes:
1) the type of the joint Motor: setting positive model to force/torque mode
2) the motor enabled of the joint Motor: setting disable
3) the car's position: slightly moving the car higher
4) the friction factor: setting it to 0
However I can not control the joint Motor thought
Code: Select all
if u > 0 then --u is the controlling force
sim.setJointTargetVelocity(motorHandle, -100)
else
sim.setJointTargetVelocity(motorHandle, 100)
end
sim.setJointMaxForce(motorHandle, math.abs(u))
Cheers
Re: only adding force on primatic_joint
you need to:
- increase the range of your prismatic joint. Currently its limits are [-3;0] (i.e. pos. min is -3, pos. range is 3)
- the prismatic joint motor needs to be enabled of course. Otherwise you can't control it. But keep the control loop of that joint disabled