-
Gack!
Pass in the destination array as a function argument. Right now you're returning a pointer to local (stack) memory which is going to be re-used after the function returns, and pointing "gdcm" at that stack memory. Arrays are not copied by the "=" operator in C. Your array size also needs to be [3][3].
2007-04-18 16:38:18 UTC in mjbWorld
-
That looks about right to me, although I think the spherical joint is 3 DOF; rotation isn't constrained at all.
A helical joint would be constraining one point (the axial point) to a line and another point to a helix around that line, I think. I'm having a little trouble coming up with a definition that doesn't over or under-constrain the points, though. I think one plane would be...
2006-08-08 02:44:30 UTC in mjbWorld
-
I said before, I think, that any two points on an object create a direction vector, which is one-half of the two direction vectors needed to specify the complete orientation of an object. By constraining two different points on an object through translational constraints you are also creating a rotational constraint.
It's kind of hard for an object to rotate without moving any of its points...
2006-08-07 01:22:42 UTC in mjbWorld
-
Actually, since (n) is just a direction vector, then (n') is how the plane of the table is *rotating* in space. So what we're saying is that as the table bounces and flips through space the ball is still constrained to lying in the defined plane. The constraints on the ball depend entirely on the position/orientation, velocity and acceleration of the table.
Or I should say are being defined...
2006-08-05 15:50:11 UTC in mjbWorld
-
How about an example of constraining a billiard ball to the surface of the table? That's just removing one DOF from the ball. So we can formulate that as follows:
rb = ball's position vector
n = normal vector of the table's surface
p0 = point on the table which is a legal position for the ball, i.e. the ball's CoM is one ball-radius above the table surface
Position constraint (C):
C =...
2006-08-04 03:55:19 UTC in mjbWorld
-
Oh, and the big equation we're primarily dealing with is the linear acceleration of points on an object, since we're trying to keep points on two different objects from acceleration away from each other. The equation is:
p'' = a + (I^-1(L x w + T) x r) + (w x (w x r))
Where (all in global coordinates ;) ):
p'' = second derivative wrt time of the point's position
a = the acceleration...
2006-08-03 03:04:43 UTC in mjbWorld
-
Oh, it occurs to me that complex joints may not be that simple. ;) However, I think we can still use vectors to define the prohibited directions of movement, and thus the directions of constraining forces, even if those vectors are derived by some equation instead of just being constant. If we can't define the direction of movement a joint prohibits then we're lost anyway.
Limits to the...
2006-08-02 21:08:59 UTC in mjbWorld
-
It seems to me so far that using normal vectors of planes is the way to go. This provides both a nice scalar constraint function by using the dot-product of the normal and the point/vector we are confining to the plane, and necessarily the direction of the force to maintain the constraint (it will be parallel to the normal vector of the plane). This is nice because we're only solving for the...
2006-08-02 20:19:28 UTC in mjbWorld
-
The problem is how to mathematically describe the geometry of the allowed motion so that you can determine the direction of the forces/torques to maintain the joint constraints. I think it's easier mathematically to start with the "joint" that allows no translational or rotational movement between the two objects so joined. Once you have defined how to do that with force/torques in...
2006-07-31 18:02:02 UTC in mjbWorld
-
Okay, I've been playing with joints and have some preliminary findings.
Physically we have a structure which transmits forces to prohibit acceleration in certain directions. Mathematically we have a constraint function that evaluates to zero when the constraint is satisfied. In a simulation we have to translate between the physics and the mathematics.
For simplicity, I'll go through...
2006-07-30 18:55:36 UTC in mjbWorld