Slider Joint Constraint Axis


#1

Hello,

I’m trying to build a SliderJoint that’s constrained to the Y axis(vertical).

I use the SliderJoint class and it’s constructor; supplying it the respective controls, their local pivot points and useLinearReferenceFrameA boolean.
The joint gets created but it’s constraint is in the horizontal direction.

I don’t understand how to change the direction of constraint. None of the class methods seem to do so.

I try supplying the alternative constructor with two Matrix3f rotation matrices but that doesn’t change the direction of the slider but rotates the bodies instead.

Any help would be appreciated.


#2

I’m looking into this, but I suspect this may be a built-in limitation of the SliderJoint class.

Could you use a SixDofJoint and disable the other 4 degrees of freedom?


#3

It seems to be a limitation of the underlying software:
https://pybullet.org/Bullet/phpBB3/viewtopic.php?t=2106

Let me know whether SixDofJoint meets your needs or not.


#4

Thanks for the prompt reply Sir!

I’m able to create the SixDofJoint. I am able to place rotational constraints using the Class methods. The linear constraints are making the run unstable.

Can you please clarify the usage of the setLinearLowerLimit, setAngularLowerLimit and their respective counterparts? Also please explain how the Vector3f argument works exactly?


#5

The documentation is sketchy. Here’s what I think:

  • setLinearLowerLimit(), setAngularUpperLimit(), and so on alter the limits of the joint axes (x, y, and z). To emulate a slider joint on the Y axis, I suggest setting the X and Z limits to 0. Lowerlimit = Upperlimit causes an axis to be locked. If you want limits on the Y axis, you can specify those; just make sure upper > lower. Or you can set upper < lower, which will cause the axis to be “free” or unconstrained.

Are those the Vector3f arguments you’re asking about?


#6

Yes I was asking exactly what you told.
Although due to the lack of proper docs it’s pretty tough to get a stable run.

I have resorted to trial and error of the tuning parameters which is causing a lot more headache than it should but I will hopefully make it work.

On a side note, can we update the javadoc for future developers who might get stuck? I will be happy to contribute.

Thanks for all the help!


#7

I’ve despaired of getting the website updated:
https://javadoc.jmonkeyengine.org/

However, we can easily update the javadoc in the source code. The preferred route would be a pull request to:
https://github.com/jMonkeyEngine/jmonkeyengine (for jme3-bullet and/or jme3-jbullet)
and/or
https://github.com/stephengold/Minie (for Minie)

I look forward to your contributions!


#8

I often find that making a debug state with a gui saves from reloading every 30 seconds just to change a few variables. The lemur gui library makes it very simple to make one. You can add sliders or text inputs and bind them using a property panel (I think the property panel is in lemur-Proto). Making these is generally one of those things you get used to doing as time goes by.


#9

Actually, it’s a separate thing: lemur-props https://bintray.com/simsilica/Sim-tools/lemur-props