[ODE] Joint forces
Nate Waddoups
nathan at whatever.net
Wed Aug 28 10:53:02 2002
On Tue, 27 Aug 2002, Russ Smith wrote:
> void dJointSetFeedbackMode (dJointID, int mode);
> const dJointFeedback *dJointGetFeedback (dJointID);
Personally I'd prefer this approach. It will probably make it easier to
use with different languages, and (okay, the real reason...) it would be a
better fit with my application.
I just want to log specific bits of data, and it would be a little more
straightforward to iterate through a list of stuff-to-log, calling
dJointGetFeedback on the appropriate joints, as opposed to waiting for the
callbacks and then looking up the callback joint in the stuff-to-log
list.
What's the joint force data going to be used for in the general case?
(Or is there a general case?) I assume it's mostly going to be useful to
drive a control system for some sort of structure (creature or vehicle),
but maybe that's just me. If that *is* a typical use case, then callbacks
complicate things for the user.
The non-callback API would let the user implement the control system in a
straightforward fashion, e.g. DoCreatureControl () { ... dJointGetFeedback
.... }, whereas with callbacks you'd probably want to get the force data
from the callback, then store it somewhere for later use, return from the
callback, and then actually use the data in a function like
DoCreatureControl () { ... pStoredForceData->xyz ... }. Come to think of
it, is the latter scenario basically what ODE will have to do in order to
implement the functions described above? I think it makes sense to build
that functionality into ODE, rather than leaving it to each application
developer to re-implement identical callback-and-storage mechanisms.
I hope that made sense... it's past my bedtime. :-)
--
Nate Waddoups
Redmond WA USA
http://www.natew.com