Simbody  3.8
Constraint_PointOnPlaneContact.h
Go to the documentation of this file.
1 #ifndef SimTK_SIMBODY_CONSTRAINT_POINT_ON_PLANE_CONTACT_H_
2 #define SimTK_SIMBODY_CONSTRAINT_POINT_ON_PLANE_CONTACT_H_
3 
4 /* -------------------------------------------------------------------------- *
5  * Simbody(tm) *
6  * -------------------------------------------------------------------------- *
7  * This is part of the SimTK biosimulation toolkit originating from *
8  * Simbios, the NIH National Center for Physics-Based Simulation of *
9  * Biological Structures at Stanford, funded under the NIH Roadmap for *
10  * Medical Research, grant U54 GM072970. See https://simtk.org/home/simbody. *
11  * *
12  * Portions copyright (c) 2014 Stanford University and the Authors. *
13  * Authors: Michael Sherman *
14  * Contributors: *
15  * *
16  * Licensed under the Apache License, Version 2.0 (the "License"); you may *
17  * not use this file except in compliance with the License. You may obtain a *
18  * copy of the License at http://www.apache.org/licenses/LICENSE-2.0. *
19  * *
20  * Unless required by applicable law or agreed to in writing, software *
21  * distributed under the License is distributed on an "AS IS" BASIS, *
22  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
23  * See the License for the specific language governing permissions and *
24  * limitations under the License. *
25  * -------------------------------------------------------------------------- */
26 
31 
32 namespace SimTK {
33 
34 //==============================================================================
35 // POINT ON PLANE CONTACT
36 //==============================================================================
37 
88 : public Constraint {
89 public:
90  // no default constructor
91 
92 //------------------------------------------------------------------------------
109  const Transform& defaultPlaneFrame,
110  MobilizedBody& followerBody,
111  const Vec3& defaultFollowerPoint);
112 
116 
121 setDefaultPlaneFrame(const Transform& defaultPlaneFrame);
126 setDefaultFollowerPoint(const Vec3& defaultFollowerPoint);
127 
132 
142 //------------------------------------------------------------------------------
150 
172 //------------------------------------------------------------------------------
187 
193 const Transform& getPlaneFrame(const State& state) const;
194 const Vec3& getFollowerPoint(const State& state) const;
198 //------------------------------------------------------------------------------
207 Real getPositionError(const State& state) const;
208 
218 Vec3 getVelocityErrors(const State& state) const;
219 
223 Vec3 getAccelerationErrors(const State& state) const;
224 
231 Vec3 getMultipliers(const State& state) const;
232 
237 Vec3 getForceOnFollowerPoint(const State& state) const; // hide from Doxygen
242  (PointOnPlaneContact, PointOnPlaneContactImpl, Constraint);
244 };
245 
246 } // namespace SimTK
247 
248 #endif // SimTK_SIMBODY_CONSTRAINT_POINT_ON_PLANE_CONTACT_H_
249 
250 
251 
This defines the base Constraint class and related classes, which are used to specify limitations on ...
#define SimTK_INSERT_DERIVED_HANDLE_DECLARATIONS(DERIVED, DERIVED_IMPL, PARENT)
Definition: PrivateImplementation.h:343
#define SimTK_SIMBODY_EXPORT
Definition: Simbody/include/simbody/internal/common.h:68
(Advanced) This is the underlying constraint for unilateral contact with friction but must be combine...
Definition: Constraint_PointOnPlaneContact.h:88
MobilizedBodyIndex getPlaneMobilizedBodyIndex() const
Return the MobilizedBodyIndex of the plane MobilizedBody.
const Vec3 & getFollowerPoint(const State &state) const
Return the plane frame X_SP that is currently in effect for this Constraint.
PointOnPlaneContact & setDefaultPlaneFrame(const Transform &defaultPlaneFrame)
Replace the default plane frame that was supplied on construction.
PointOnPlaneContact & setPlaneDisplayHalfWidth(Real halfWidth)
This affects only generated decorative geometry for default visualization; the plane is really infini...
PointOnPlaneContact()
Default constructor creates an empty handle that can be used to reference any PointOnPlaneContact Con...
Definition: Constraint_PointOnPlaneContact.h:115
Real getPlaneDisplayHalfWidth() const
Return the plane half-width that will be used if we're asked to generate default visualization geomet...
const Transform & getPlaneFrame(const State &state) const
Return the plane frame X_SP that is currently in effect for this Constraint.
const Transform & getDefaultPlaneFrame() const
Return the default plane frame as set during construction or by the most recent call to setDefaultPla...
PointOnPlaneContact(MobilizedBody &planeBody, const Transform &defaultPlaneFrame, MobilizedBody &followerBody, const Vec3 &defaultFollowerPoint)
Construct a point-in-plane normal constraint and two no-slip friction constraints as described in the...
const Vec3 & getDefaultFollowerPoint() const
Return the default follower point as set during construction or by the most recent call to setDefault...
PointOnPlaneContact & setDefaultFollowerPoint(const Vec3 &defaultFollowerPoint)
Replace the default follower point that was supplied on construction.
Vec3 getAccelerationErrors(const State &state) const
This vector is the time derivative of the value returned by getVelocityError().
PointOnPlaneContact & setPointDisplayRadius(Real radius)
This affects only generated decorative geometry for default visualization; the point is really zero r...
Vec3 getForceOnFollowerPoint(const State &state) const
This is the force applied by the plane body to the follower point, expressed in the contact frame.
Vec3 getMultipliers(const State &state) const
These are the Lagrange multipliers required to enforce the three constraint equations generated here.
MobilizedBodyIndex getFollowerMobilizedBodyIndex() const
Return the MobilizedBodyIndex of the follower MobilizedBody.
Vec3 getVelocityErrors(const State &state) const
The velocity error vector is the velocity of the follower point in the contact frame.
Real getPositionError(const State &state) const
The returned position error can be viewed as a signed distance.
Real getPointDisplayRadius() const
Return the sphere radius that will be used to visualize the follower point if we're asked to generate...
This is the base class for all Constraint classes, which is just a handle for the underlying hidden i...
Definition: Constraint.h:67
This is for arrays indexed by mobilized body number within a subsystem (typically the SimbodyMatterSu...
A MobilizedBody is Simbody's fundamental body-and-joint object used to parameterize a system's motion...
Definition: MobilizedBody.h:169
This object is intended to contain all state information for a SimTK::System, except topological info...
Definition: State.h:280
This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with o...
Definition: Assembler.h:37
SimTK_Real Real
This is the default compiled-in floating point type for SimTK, either float or double.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:607