The base class for s-vals.
The base class for s-vals. S-vals, short for "separated values", are a simple symbolic representation for dynamic equations. You will most likely be using s-vals when creating new joint or constraint types; otherwise, you can ignore them.One of the key steps in dynamic simulation is to compute the acceleration of a mechanism's degrees of freedom. To do this, the equations can be organized in the form:
T = M*acc + Vwhere T is a torque vector for the mechanism's degrees of freedom, M is a symmetric positive definite mass matrix for the mechanism, acc is the vector of accelerations for each degree of freedom, and V is a vector containing all terms that do not depend on joint accelerations. s-vals allow M and V to be computed by keeping the multipliers for each DOF acceleration variable separate. Put another way, an s-val is a linear combination of joint acceleration variables plus a constant term. The important things to keep in mind are:In practice, you only need to worry about the first of these two points since the latter is taken care of by dyno. As mentioned earlier, you will normally not need to know anything about s-vals unless you're creating new joint or constraint types. For the case of joints, you need to create an equation (using s-vals) that describes the torque required to cause a given acceleration of the joint. For constraints, you need to create an equation that describes the acceleration of the constraint as a function of the mechanism's joint accelerations. It's best to look at joint::createEquations() and constraint::createConstraintEquations() for examples of s-val use. There are, however, some important rules for s-val equations that should be mentioned here:
- in C++, s-val arithmetic looks pretty similar to normal arithmetic due to the use of operator overloading
- The coefficients for the sval for the i'th DOF's torque equation for the i'th row of M and the i'th entry in V
- You can only create s-vals with the new operator. This is required for reference counting, since a single s-val is often part of many expressions and must only be freed once no other s-vals reference it.
- There are no s-val operators that result in a multiplication of acceleration variables. The reason for this is simple: in the dynamics equations there are never products of acceleration variables, so there should never be a case where acceleration variables get multiplied in an s-val equation.
- When allocating an s-val, you may need to supply the size of the s-val; this is mostly easily had by just accessing an existing s-val's 'n' member.
There are a number of arithmetic operators overloaded for s-vals; they are defined in dynoSvOps.h.
Alphabetic index HTML hierarchy of classes or Java