Simbody  3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Constraint_LineOnLineContact.h
Go to the documentation of this file.
1 #ifndef SimTK_SIMBODY_CONSTRAINT_LINE_ON_LINE_CONTACT_H_
2 #define SimTK_SIMBODY_CONSTRAINT_LINE_ON_LINE_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 // LINE ON LINE CONTACT
36 //==============================================================================
143 : public Constraint {
144 public:
145  // no default constructor
146 
147 //------------------------------------------------------------------------------
163 
207  const Transform& defaultEdgeFrameF,
208  Real defaultHalfLengthF,
209  MobilizedBody& mobod_B,
210  const Transform& defaultEdgeFrameB,
211  Real defaultHalfLengthB,
212  bool enforceRolling);
213 
217 
221 const MobilizedBody& getMobilizedBodyF() const;
222 
226 const MobilizedBody& getMobilizedBodyB() const;
227 
231 bool isEnforcingRolling() const;
232 
238 setDefaultEdgeFrameF(const Transform& defaultEdgeFrameF);
244 setDefaultHalfLengthF(Real defaultHalfLengthF);
250 setDefaultEdgeFrameB(const Transform& defaultEdgeFrameB);
256 setDefaultHalfLengthB(Real defaultHalfLengthF);
257 
262 const Transform& getDefaultEdgeFrameF() const;
267 Real getDefaultHalfLengthF() const;
268 
273 const Transform& getDefaultEdgeFrameB() const;
278 Real getDefaultHalfLengthB() const;
281 //------------------------------------------------------------------------------
289 // no controls yet
293 //------------------------------------------------------------------------------
311 
318 const LineOnLineContact&
319 setEdgeFrameF(State& state, const Transform& edgeFrameF) const;
320 
324 const LineOnLineContact&
325 setHalfLengthF(State& state, Real halfLengthF) const;
326 
333 const LineOnLineContact&
334 setEdgeFrameB(State& state, const Transform& edgeFrameB) const;
335 
339 const LineOnLineContact&
340 setHalfLengthB(State& state, Real halfLengthB) const;
341 
345 const Transform& getEdgeFrameF(const State& state) const;
349 Real getHalfLengthF(const State& state) const;
350 
354 const Transform& getEdgeFrameB(const State& state) const;
358 Real getHalfLengthB(const State& state) const;
361 //------------------------------------------------------------------------------
371 Real getPositionError(const State& state) const;
372 
382 Vec3 getVelocityErrors(const State& state) const;
383 
389 Vec3 getAccelerationErrors(const State& state) const;
390 
401 Vec3 getMultipliers(const State& state) const;
402 
410 Vec3 findForceOnBodyBInG(const State& state) const;
411 
422 Transform findContactFrameInG(const State& state) const;
423 
432 void findClosestPointsInG(const State& state, Vec3& Qf, Vec3& Qb,
433  bool& linesAreParallel) const;
434 
442 Real findSeparation(const State& state) const; // hide from Doxygen
447  (LineOnLineContact, LineOnLineContactImpl, Constraint);
449 };
450 
451 } // namespace SimTK
452 
453 #endif // SimTK_SIMBODY_CONSTRAINT_LINE_ON_LINE_CONTACT_H_
454 
455 
456 
This constraint represents a bilateral connection between an edge on one body and a non-parallel edge...
Definition: Constraint_LineOnLineContact.h:142
This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with o...
Definition: Assembler.h:37
LineOnLineContact()
Default constructor creates an empty handle that can be used to reference any LineOnLineContact Const...
Definition: Constraint_LineOnLineContact.h:216
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:577
This object is intended to contain all state information for a SimTK::System, except topological info...
Definition: State.h:276
#define SimTK_INSERT_DERIVED_HANDLE_DECLARATIONS(DERIVED, DERIVED_IMPL, PARENT)
Definition: PrivateImplementation.h:343
This defines the base Constraint class and related classes, which are used to specify limitations on ...
#define SimTK_SIMBODY_EXPORT
Definition: Simbody/include/simbody/internal/common.h:72
A MobilizedBody is Simbody's fundamental body-and-joint object used to parameterize a system's motion...
Definition: MobilizedBody.h:167
This is the base class for all Constraint classes, which is just a handle for the underlying hidden i...
Definition: Constraint.h:66