point to point spring constraint possible?

Post Reply
linksan
Posts: 13
Joined: Fri May 23, 2008 4:30 pm

point to point spring constraint possible?

Post by linksan »

Hi,

I was wondering whether it is possible to create a spring constraint from one point to another allowing full rotation?
slider constraints don't seem to allow that

it would be something like a six dof constraint with motors

Thank you.
Dirk Gregorius
Posts: 861
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

Re: point to point spring constraint possible?

Post by Dirk Gregorius »

You can have a distance constraint through the center of gravity of each body. That would not effect rotations.

C = p2 - p1
dC/dt = v2 - v1
J = ( 0 -E 0 E ) where 0 is the 3x3 zero matrix and E is the 3x3 identity matrix

If you now use CFM and ERP you have a stiff spring. I am not sure whether Bullet supports CFM.
User avatar
rponomarev
Posts: 56
Joined: Sat Mar 08, 2008 12:37 am

Re: point to point spring constraint possible?

Post by rponomarev »

Hello,

Do you mean a constraint where all rotational DOF are free, 2 translation DOF are locked and one translation has a spring motor?

In the next release (2.75) we'll have the btGeneric6DOFSpring constraint where you can set a spring to any DOF, so this should solve your problem.

Thanks,
Roman
linksan
Posts: 13
Joined: Fri May 23, 2008 4:30 pm

Re: point to point spring constraint possible?

Post by linksan »

Yes that sound exactly like what I need :)
glad to hear that it's coming soon.

Thanks
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: point to point spring constraint possible?

Post by Erwin Coumans »

Bullet 2.75 beta1 has support for springs through the btGeneric6DofSpringConstraint.

Hope this helps,
Erwin
Ehsanizadi
Posts: 72
Joined: Mon Dec 02, 2013 4:13 pm

Re: point to point spring constraint possible?

Post by Ehsanizadi »

Hi, does btGeneric6DofSpringConstraint support point to point spring constraint when two dynamic objects are moving with respect to each other?

I see that for btGeneric6DofSpringConstraint, spring and damping coefficients can be defined only in 3 directions, which means, if the location of two connected objects are changed with respect to each other, the values of spring stiffnesses should be adapted at each time step.



Regards,
E30
User avatar
drleviathan
Posts: 849
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: point to point spring constraint possible?

Post by drleviathan »

Try the btPoint2PointConstraint.

Edit: I'm sorry I didn't ready that carefully enough. You want it to swivel on both ends but to be springy along one linear direction. The btGeneric6DofConstraint would allow you to make only one swivel point. The btPoint2PointConstraint would allow you to swivel both ends but would be stiff along the axis. Hrm...

Yeah, none of the existing constraints would do it for you in one easy solution.

So, you'd have to write your own custom constraint or... it might be possible to achieve it using four bodies and three constraints:

SwivelA <---- Point2PointConstraint ----> PivotA <---- 6DofSpringConstraint ----> PivotB <---- Point2PointContraint ----> SwivelB

Where:
(1) the 6DofSpringContraint is enabled at only one dimension
(2) the Swivels and Pivots overlap but don't collide with each other (using collision groups). The Pivots would be "hidden" inside the Swivels.

Challenges with this method are: (a) For stability purposes the relative mass differences between Pivot and Swivel must NOT be high. Best to split the mass that should be at each Swivel with its respective Pivot (give each 1/2 the mass). (b) Long chains of constraints will make the constraints "soft" (solver does not achieve high accuracy), however for just three constraints you should be fine. (c) Performance issues: if you want to have lots of these structures bouncing around then the simulation could burn lots of CPU power, but if you only need one or a handfull then you should be fine.
Post Reply