Simbody 3.9
Loading...
Searching...
No Matches
MobilizedBody_CantileverFreeBeam.h
Go to the documentation of this file.
1#ifndef SimTK_SIMBODY_MOBILIZED_BODY_CANTILEVER_FREE_BEAM_H_
2#define SimTK_SIMBODY_MOBILIZED_BODY_CANTILEVER_FREE_BEAM_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) 2009-25 Stanford University and the Authors. *
13 * Authors: Nicholas Bianco *
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
32namespace SimTK {
33
142 public MobilizedBody {
143public:
147
158 const Body& bodyInfo, const Transform& X_BM, const Real& length,
159 Direction=Forward);
160
163 CantileverFreeBeam(MobilizedBody& parent, const Body& bodyInfo,
164 const Real& length, Direction=Forward);
165
169 const Body& bodyInfo, const Transform& X_BM, Direction=Forward);
170
174 CantileverFreeBeam(MobilizedBody& parent, const Body& bodyInfo,
175 Direction=Forward);
176
180
183 const Real& getDefaultLength() const;
184
192 return setDefaultQ(R_FM.convertRotationToBodyFixedXYZ());
193 }
194
198 Rotation R_FM;
199 R_FM.setRotationToBodyFixedXYZ(getDefaultQ());
200 return R_FM;
201 }
202
204 const DecorativeGeometry& g) {
205 (void)MobilizedBody::addBodyDecoration(X_BD,g); return *this;
206 }
207
209 const DecorativeGeometry& g) {
210 (void)MobilizedBody::addOutboardDecoration(X_MD,g); return *this;
211 }
212
214 const DecorativeGeometry& g) {
215 (void)MobilizedBody::addInboardDecoration(X_FD,g); return *this;
216 }
217
219 (void)MobilizedBody::setDefaultInboardFrame(X_PF); return *this;
220 }
221
223 (void)MobilizedBody::setDefaultOutboardFrame(X_BM); return *this;
224 }
225
226 // Generic default state Topology methods.
227 const Vec3& getDefaultQ() const;
230 updDefaultQ() = q;
231 return *this;
232 }
233
234 const Vec3& getQ(const State&) const;
235 const Vec3& getQDot(const State&) const;
236 const Vec3& getQDotDot(const State&) const;
237 const Vec3& getU(const State&) const;
238 const Vec3& getUDot(const State&) const;
239
240 void setQ(State&, const Vec3&) const;
241 void setU(State&, const Vec3&) const;
242
243 const Vec3& getMyPartQ(const State&, const Vector& qlike) const;
244 const Vec3& getMyPartU(const State&, const Vector& ulike) const;
245
246 Vec3& updMyPartQ(const State&, Vector& qlike) const;
247 Vec3& updMyPartU(const State&, Vector& ulike) const;
248
// hide from Doxygen
251 CantileverFreeBeamImpl, MobilizedBody);
253};
254
255} // namespace SimTK
256
257#endif // SimTK_SIMBODY_MOBILIZED_BODY_CANTILEVER_FREE_BEAM_H_
This defines the MobilizedBody class, which associates a new body (the "child", "outboard",...
#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
The Body class represents a reference frame that can be used to describe mass properties and geometry...
Definition Body.h:55
This is the client-side interface to an implementation-independent representation of "Decorations" su...
Definition DecorativeGeometry.h:87
Although this mobilizer has only three mobilities (all rotational), the mobilized frame M translates ...
Definition MobilizedBody_CantileverFreeBeam.h:142
const Vec3 & getUDot(const State &) const
CantileverFreeBeam & setDefaultInboardFrame(const Transform &X_PF)
Definition MobilizedBody_CantileverFreeBeam.h:218
void setQ(State &, const Vec3 &) const
CantileverFreeBeam & addInboardDecoration(const Transform &X_FD, const DecorativeGeometry &g)
Definition MobilizedBody_CantileverFreeBeam.h:213
Rotation getDefaultRotation() const
Get the value for the default orientation of this mobilizer; unless changed by setDefaultRotation() i...
Definition MobilizedBody_CantileverFreeBeam.h:197
CantileverFreeBeam()
Default constructor provides an empty handle that can be assigned to reference any MobilizedBody::Can...
Definition MobilizedBody_CantileverFreeBeam.h:146
const Vec3 & getU(const State &) const
CantileverFreeBeam & addBodyDecoration(const Transform &X_BD, const DecorativeGeometry &g)
Definition MobilizedBody_CantileverFreeBeam.h:203
const Real & getDefaultLength() const
Get the default length of the beam as specified during construction or via setDefaultLength().
const Vec3 & getQ(const State &) const
CantileverFreeBeam(MobilizedBody &parent, const Body &bodyInfo, const Real &length, Direction=Forward)
Abbreviated constructor you can use if the mobilizer frames are coincident with the parent and child ...
CantileverFreeBeam(MobilizedBody &parent, const Transform &X_PF, const Body &bodyInfo, const Transform &X_BM, const Real &length, Direction=Forward)
Create a CantileverFreeBeam mobilizer between an existing parent (inboard) body P and a new child (ou...
const Vec3 & getMyPartU(const State &, const Vector &ulike) const
CantileverFreeBeam & setDefaultLength(const Real &length)
Modify the default length of the beam.
CantileverFreeBeam & addOutboardDecoration(const Transform &X_MD, const DecorativeGeometry &g)
Definition MobilizedBody_CantileverFreeBeam.h:208
CantileverFreeBeam & setDefaultQ(const Vec3 &q)
Definition MobilizedBody_CantileverFreeBeam.h:229
const Vec3 & getQDot(const State &) const
CantileverFreeBeam(MobilizedBody &parent, const Body &bodyInfo, Direction=Forward)
This constructor assumes you'll set the beam length later; meanwhile it uses a default length.
Vec3 & updMyPartU(const State &, Vector &ulike) const
CantileverFreeBeam(MobilizedBody &parent, const Transform &X_PF, const Body &bodyInfo, const Transform &X_BM, Direction=Forward)
This constructor assumes you'll set the beam length later; meanwhile it uses a default length.
void setU(State &, const Vec3 &) const
CantileverFreeBeam & setDefaultOutboardFrame(const Transform &X_BM)
Definition MobilizedBody_CantileverFreeBeam.h:222
const Vec3 & getMyPartQ(const State &, const Vector &qlike) const
const Vec3 & getQDotDot(const State &) const
Vec3 & updMyPartQ(const State &, Vector &qlike) const
CantileverFreeBeam & setDefaultRotation(const Rotation &R_FM)
Provide a default orientation for this mobilizer if you don't want to start with the identity rotatio...
Definition MobilizedBody_CantileverFreeBeam.h:191
A MobilizedBody is Simbody's fundamental body-and-joint object used to parameterize a system's motion...
Definition MobilizedBody.h:169
Direction
Constructors can take an argument of this type to indicate that the mobilizer is being defined in the...
Definition MobilizedBody.h:181
void setRotationToBodyFixedXYZ(const Vec3P &v)
Set this Rotation_ to represent a rotation characterized by subsequent rotations of: +v[0] about the ...
Definition Rotation.h:336
Vec3P convertRotationToBodyFixedXYZ() const
A convenient special case of convertThreeAxesRotationToThreeAngles().
Definition Rotation.h:861
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:626