Simbody  3.7
Constraint_Weld.h
Go to the documentation of this file.
1 #ifndef SimTK_SIMBODY_CONSTRAINT_WELD_H_
2 #define SimTK_SIMBODY_CONSTRAINT_WELD_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) 2007-14 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 // WELD (COINCIDENT FRAMES) CONSTRAINT
36 //==============================================================================
37 
61 public:
62  // no default constructor
63 
66 Weld(MobilizedBody& body1, MobilizedBody& body2);
67 
72 Weld(MobilizedBody& body1, const Transform& frame1,
73  MobilizedBody& body2, const Transform& frame2);
74 
76 Weld() {}
77 
78  // Control over generated decorative geometry.
79 
83 Weld& setAxisDisplayLength(Real r);
84 
88 Real getAxisDisplayLength() const;
89 
90  // Defaults for Instance variables.
91 
95 Weld& setDefaultFrameOnBody1(const Transform&);
96 
98 const Transform& getDefaultFrameOnBody1() const;
99 
103 Weld& setDefaultFrameOnBody2(const Transform&);
104 
106 const Transform& getDefaultFrameOnBody2() const;
107 
108 
109  // Stage::Topology
110 
112 MobilizedBodyIndex getBody1MobilizedBodyIndex() const;
113 
115 MobilizedBodyIndex getBody2MobilizedBodyIndex() const;
116 
117 
118  // Stage::Instance
119 const Transform& getFrameOnBody1(const State&) const;
120 const Transform& getFrameOnBody2(const State&) const;
121 
122  // Stage::Position, Velocity, Acceleration
123 Vec6 getPositionErrors(const State&) const;
124 Vec6 getVelocityErrors(const State&) const;
125 
126  // Stage::Acceleration
127 Vec6 getAccelerationErrors(const State&) const;
128 Vec6 getMultipliers(const State&) const;
129 
130  // Forces are reported expressed in the body frame of the indicated body.
131 const SpatialVec& getWeldReactionOnBody1(const State&) const;
132 const SpatialVec& getWeldReactionOnBody2(const State&) const;
133  // hide from Doxygen
137 };
138 
139 
140 } // namespace SimTK
141 
142 #endif // SimTK_SIMBODY_CONSTRAINT_WELD_H_
143 
144 
145 
This is for arrays indexed by mobilized body number within a subsystem (typically the SimbodyMatterSu...
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:606
This object is intended to contain all state information for a SimTK::System, except topological info...
Definition: State.h:280
This is a fixed-length column vector designed for no-overhead inline computation. ...
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:618
Six constraint equations.
Definition: Constraint_Weld.h:60
#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:68
A MobilizedBody is Simbody's fundamental body-and-joint object used to parameterize a system's motion...
Definition: MobilizedBody.h:168
This is the base class for all Constraint classes, which is just a handle for the underlying hidden i...
Definition: Constraint.h:66
Weld()
Default constructor creates an empty handle.
Definition: Constraint_Weld.h:76