From: Steve B. <sb...@cs...> - 2008-06-09 16:56:54
|
Hi Joe, You have raised some very good questions. I'll do my best to answer them. 1) Right now dvc has no notion of a spring or damper. If you wish to attach a spring-damper to a body, the only way is through the forceController class. What this means is that you the user will be forced to compute the spring-damper forces as a function of the body's state. This is actually how the mouse interaction works. We attach one end of a virtual spring-damper to the body and the other to the mouse pointer. This spring force is then added to the timestepper code through the applied force vector. 2) Pat is right, we currently do not support joint dissipation directly through the xml file (we should and if I have time I'll try to hack that in). I don't know of a way to add Coulomb friction to a joint if the joint is abstracted as a bilateral constraint. Viscous friction, however, is possible. The way you can do it is by attaching a forceController to the body with the joint, and computing the damping force. Here is what I would do for revolute joint damping. a) attach a forceController to the body with a revolute joint b) In the GetForce function of the ForceController i) get the angular velocity of the body attached to the revolute joint (vel[2]) ii) set outForce[2] = -C*vel[2] where C is your damping coefficient. Force is a bad name for this function, it really should be called getWrench since the 3 dimensional value you are returning is the force and moment. For dry friction in a joint, I think you would have to model the joint geometrically and drop the bilateral representation. If you know of a way to add dry friction into the bilateral joint representation I would love to hear it, because (to the best of my knowledge) this would be something that no one else is doing. 3) This is something that Pat and I have talked about in the past without an ideal solution. The best idea we currently have (un-implemented of course) is to keep the global value (like the current set up), but to allow the user to specify a specific value at a per-body-pair level. If no value is specified by the user, then the global value is used. If this would be sufficient for what you need let us know, because that shouldn't be very hard to do. If you can think of a better solution, also please let me know. I hope this answers all of your questions, feel free to email me back if anything is unclear or if you have more questions. I have also copied this message to the dvc-devel mailing list so a public copy is archived. Thanks, --Steve Joe Hays wrote: > Steve, > > I've learned quite a bit in the last two weeks or so about DVC. With > Pat's help I've successfully made a double pendulum, added a feedback > controller to it and observed closed-loop behavior (even though my > current controller design sucks... I know the loop is closed and > that's what was important to me.) > > The following questions are outstanding in my mind. (Pat has indicated > that you're the right person to elaborate on these topics. If you have > any light you can shed on these topics I'd appreciate it.) > > *How to make the classic "mass-spring-damper" model?* > From what I've seen so far DVC's unique strength is in solving the > Coulomb Friction and Impact dynamics for a rigid-body-system. However, > I've not seen how to create some of the classical models to be > simulated (e.g. the "mass-spring-damper"). Is there a way I can define > general elements such as a spring, with either linear or nonlinear > constitutive law, as well as a damper (such as a viscous damper which > is either linear or non-linear)? > > *How to add dissipation (i.e. viscous and/or Coulomb friction, > preferably both) to joints?* > Pat indicated I need to 'hack' this in as their is no direct facility > for this. Can you give me some guidance on this? > > *Unique friction and restitution coefficients?* > From what I've learned so far both the friction and collision > restitution coefficients are global for the scene. Do you have plans, > back door entry points, or hacks, to allow these to be defined for > each body combination pair? (This is less important for now but will > become important to me in the future...) > > I'm enjoying learning your system. Congratulations on the progress > you've made thus far with DVC, and, thanks for the support. > > Joe > > > |