Simbody
3.4 (development)
|
One non-holonomic constraint equation. More...
#include <Constraint.h>
Public Member Functions | |
NoSlip1D (MobilizedBody &caseBodyC, const Vec3 &P_C, const UnitVec3 &n_C, MobilizedBody &movingBody0, MobilizedBody &movingBody1) | |
Define the up to three bodies involved in this constraint: the two "moving" bodies and a Case body, and a default contact point and no-slip direction in the Case body frame C. | |
NoSlip1D () | |
Default constructor creates an empty handle. | |
void | setContactPoint (State &state, const Vec3 &point_C) const |
Change the contact point at which this Constraint acts. | |
void | setDirection (State &state, const UnitVec3 &direction_C) const |
Change the no-slip direction along which this Constraint acts. | |
const Vec3 & | getContactPoint (const State &state) const |
Return from the given state the contact point, in the Case body frame. | |
const UnitVec3 & | getDirection (const State &state) const |
Return from the given state the no-slip direction, in the Case body frame. | |
NoSlip1D & | setDirectionDisplayLength (Real) |
For visualization only, set the length of the line used to show the no-slip direction. | |
NoSlip1D & | setPointDisplayRadius (Real) |
For visualization only, set the radius of the sphere used to show the contact point location. | |
Real | getDirectionDisplayLength () const |
Return the current value of the visualization line length for the no-slip direction. | |
Real | getPointDisplayRadius () const |
Return the current value of the radius for visualization of the contact point. | |
NoSlip1D & | setDefaultContactPoint (const Vec3 &) |
Change the default contact point; this is the initial value for for the actual contact point and is a topological change. | |
NoSlip1D & | setDefaultDirection (const UnitVec3 &) |
Change the default no-slip direction; this is the initial value for for the actual direction and is a topological change. | |
MobilizedBodyIndex | getCaseMobilizedBodyIndex () const |
Get the mobilized body index of the Case body that was set during construction. | |
MobilizedBodyIndex | getMovingBodyMobilizedBodyIndex (int which) const |
Get the mobilized body index of moving body 0 or moving body 1 that was set during construction. | |
const UnitVec3 & | getDefaultDirection () const |
Obtain the default value for the no-slip direction, expressed in the Case body frame. | |
const Vec3 & | getDefaultContactPoint () const |
Obtain the default value for the contact point, in the Case body frame. | |
Real | getVelocityError (const State &state) const |
Get the velocity error for this constraint equation, using configuration and velocity information from the given state, which must already have been realized through Velocity stage. | |
Real | getAccelerationError (const State &) const |
Get the acceleration error for this constraint equation, using configuration, velocity, and acceleration information from the given state, which must already have been realized through Acceleration stage. | |
Real | getMultiplier (const State &) const |
Get the Lagrange multiplier for this constraint equation, using configuration, velocity, and acceleration information from the given state, which must already have been realized through Acceleration stage. | |
Real | getForceAtContactPoint (const State &) const |
Determine the constraint force currently being generated by this constraint. |
One non-holonomic constraint equation.
There is a contact point P and a no-slip direction n fixed in a case body C. There are two moving bodies B0 and B1. The material point of B0 and the material point of B1 which are each coincident with the contact point P must have identical velocities in C, along the direction n. This can be used to implement simple rolling contact between disks, such as occurs in gear trains.
The assembly condition is the same as the run-time constraint: the velocities must be made to match.
SimTK::Constraint::NoSlip1D::NoSlip1D | ( | MobilizedBody & | caseBodyC, |
const Vec3 & | P_C, | ||
const UnitVec3 & | n_C, | ||
MobilizedBody & | movingBody0, | ||
MobilizedBody & | movingBody1 | ||
) |
Define the up to three bodies involved in this constraint: the two "moving" bodies and a Case body, and a default contact point and no-slip direction in the Case body frame C.
(If you are modeling gears then the Case is the gearbox.) The case serves to define the contact geometry but no forces are applied to it. It is OK for the Case body to be the same body as one of the moving bodies.
SimTK::Constraint::NoSlip1D::NoSlip1D | ( | ) | [inline] |
Default constructor creates an empty handle.
void SimTK::Constraint::NoSlip1D::setContactPoint | ( | State & | state, |
const Vec3 & | point_C | ||
) | const |
Change the contact point at which this Constraint acts.
Provide the station location in the Case body local frame. This overrides the default point that was supplied on construction. This is an Instance-stage change.
void SimTK::Constraint::NoSlip1D::setDirection | ( | State & | state, |
const UnitVec3 & | direction_C | ||
) | const |
Change the no-slip direction along which this Constraint acts.
Provide the direction unit vector in the Case body local frame. This overrides the default direction that was supplied on construction. This is an Instance-stage change.
const Vec3& SimTK::Constraint::NoSlip1D::getContactPoint | ( | const State & | state | ) | const |
Return from the given state the contact point, in the Case body frame.
const UnitVec3& SimTK::Constraint::NoSlip1D::getDirection | ( | const State & | state | ) | const |
Return from the given state the no-slip direction, in the Case body frame.
For visualization only, set the length of the line used to show the no-slip direction.
For visualization only, set the radius of the sphere used to show the contact point location.
Real SimTK::Constraint::NoSlip1D::getDirectionDisplayLength | ( | ) | const |
Return the current value of the visualization line length for the no-slip direction.
Real SimTK::Constraint::NoSlip1D::getPointDisplayRadius | ( | ) | const |
Return the current value of the radius for visualization of the contact point.
Change the default contact point; this is the initial value for for the actual contact point and is a topological change.
Change the default no-slip direction; this is the initial value for for the actual direction and is a topological change.
Get the mobilized body index of the Case body that was set during construction.
MobilizedBodyIndex SimTK::Constraint::NoSlip1D::getMovingBodyMobilizedBodyIndex | ( | int | which | ) | const |
Get the mobilized body index of moving body 0 or moving body 1 that was set during construction.
Set which to 0 or 1 accordingly.
const UnitVec3& SimTK::Constraint::NoSlip1D::getDefaultDirection | ( | ) | const |
Obtain the default value for the no-slip direction, expressed in the Case body frame.
const Vec3& SimTK::Constraint::NoSlip1D::getDefaultContactPoint | ( | ) | const |
Obtain the default value for the contact point, in the Case body frame.
Real SimTK::Constraint::NoSlip1D::getVelocityError | ( | const State & | state | ) | const |
Get the velocity error for this constraint equation, using configuration and velocity information from the given state, which must already have been realized through Velocity stage.
Real SimTK::Constraint::NoSlip1D::getAccelerationError | ( | const State & | ) | const |
Get the acceleration error for this constraint equation, using configuration, velocity, and acceleration information from the given state, which must already have been realized through Acceleration stage.
Real SimTK::Constraint::NoSlip1D::getMultiplier | ( | const State & | ) | const |
Get the Lagrange multiplier for this constraint equation, using configuration, velocity, and acceleration information from the given state, which must already have been realized through Acceleration stage.
While this is linearly related to the constraint force it may have arbitrary sign and scaling; if you want an actual force use getForceAtContactPoint() instead.
Real SimTK::Constraint::NoSlip1D::getForceAtContactPoint | ( | const State & | ) | const |
Determine the constraint force currently being generated by this constraint.
The force is as applied to the second moving body, that is, moving body 1, and is applied along the no-slip direction vector.