Slider like a bicycle fork suspension

May 25, 2008 at 5:48 PM
Hi, all, Farseer is great - I've had lots of fun playing with it. I seem to be forming a pretty good understanding of the joints and controllers, but I'm confused how to piece joints together into something like a simple bicycle fork (with suspension), attached to another body (like a frame).  Let me illustrate with a simple pic:


Ultimately I'm going to attach a wheel to body2, and so I want body2 to slide along an angle that's fixed relative to body1. I don't care if body1's own angle matches body2's, which is what an AngleJoint seems to offer. I'm more interested in controlling the path body2 follows relative to body1. Ideas, anyone? Incidentally, it seems this is what other people want with their cars' suspensions, as I've seen in other posts. One person proposed a RevoluteJoint but with some give to it. However, I really don't want the fork bending at all. In the end I want the wheel to travel along a very specific line segment relative to the bike's frame. Am I missing a joint that allows this? I got excited about the "slider" joint but that seems to be just a distance limiting joint. Thanks! -Chris
Coordinator
May 28, 2008 at 11:05 AM
I think you will need a RevoluteJoint combined with an AngleJoint (with target angle 0) to lock the position and rotation of body1 and body2 relative to each other. Then, I think you will need a "body3" connected to body2 with the slider joint. This would then act as your "shock".  You could then attach a wheel to body3.

Haven't tried this but I think that' the route I would take.
May 30, 2008 at 3:08 AM
Hey crashlander, thanks for the reply.  What you describe, wouldn't that lock body2 directly with body1, and then make a wheel that slides around in all directions (just limiting the distance from body2)? I'm trying to produce something that can only travel along one line, relative to something else. So the first half of what you said sounds good, but then how do I make the wheel only have freedom on one axis, not both?  A slider joint is a distance limited only, right?

 On a bicycle, a wheel can't move forward or backwards a few inches relative to the bike frame, but it can travel up and down on the path of the fork.  That's what I'm looking to reproduce.

Thanks again for your help!

Chris


May 30, 2008 at 3:19 AM
I think what I'm looking for is what other engines call a "prismatic" joint.  This image is from the Box2D (C++) documentation:



And their documentation says this: "A prismatic joint allows for relative translation of two bodies along a specified axis. A prismatic joint prevents relative rotation. Therefore, a prismatic joint has a single degree of freedom."

This is definitely what I'm looking for.  I noticed the Farseer's slider is also referred to as a prismatic on the home page.  Perhaps I am using it incorrectly?

Thanks!
Coordinator
May 31, 2008 at 11:33 AM
I mis-spoke in my post.

" combined with an AngleJoint (with target angle 0) to lock the position and rotation of body1 and body2 relative to each other" the angle joint will only lock the rotation not position. The bodies should still be able to slide along the "prismatic" joint axis.