Simbody 3.9
Loading...
Searching...
No Matches
MobilizedBody_Ellipsoid.h
Go to the documentation of this file.
1#ifndef SimTK_SIMBODY_MOBILIZED_BODY_ELLIPSOID_H_
2#define SimTK_SIMBODY_MOBILIZED_BODY_ELLIPSOID_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-13 Stanford University and the Authors. *
13 * Authors: Ajay Seth, Michael Sherman *
14 * Contributors: Nicholas Bianco *
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
127public:
131
139 Ellipsoid(MobilizedBody& parent, const Transform& X_PF,
140 const Body& bodyInfo, const Transform& X_BM,
141 const Vec3& radii, Direction=Forward);
142
145 Ellipsoid(MobilizedBody& parent, const Body& bodyInfo,
146 const Vec3& radii, Direction=Forward);
147
150 Ellipsoid(MobilizedBody& parent, const Transform& X_PF,
151 const Body& bodyInfo, const Transform& X_BM,
152 Direction=Forward);
153
157 Ellipsoid(MobilizedBody& parent, const Body& bodyInfo, Direction=Forward);
158
164 Ellipsoid(MobilizedBody& parent, const Transform& X_PF,
165 const Body& bodyInfo, const Transform& X_BM, const Vec3& radii,
166 const CoordinateAxis& mirrorAxis, Direction=Forward);
167
171 Ellipsoid(MobilizedBody& parent, const Body& bodyInfo, const Vec3& radii,
172 const CoordinateAxis& mirrorAxis, Direction=Forward);
173
179 const Vec3& getDefaultRadii() const;
180
189 bool isMirrored() const;
198
202 const Vec3& getRadii(const State& state) const;
205 void setRadii(State& state, const Vec3& radii) const;
206
225 const State& state,
226 const Vec3& dradii,
227 Vector_<Vec3>& dp_GB) const;
228
262 const State& state,
263 const Vector_<Vec3>& g_GB) const;
264
278
280 (void)MobilizedBody::addBodyDecoration(X_BD,g); return *this;
281 }
283 (void)MobilizedBody::addOutboardDecoration(X_MD,g); return *this;
284 }
286 (void)MobilizedBody::addInboardDecoration(X_FD,g); return *this;
287 }
288
290 (void)MobilizedBody::setDefaultInboardFrame(X_PF); return *this;
291 }
292
294 (void)MobilizedBody::setDefaultOutboardFrame(X_BM); return *this;
295 }
296
297
298
299 // Generic default state Topology methods.
300
302 const Quaternion& getDefaultQ() const;
312 Ellipsoid& setDefaultQ(const Quaternion& q) {updDefaultQ()=q; return *this;}
313
314 const Vec4& getQ(const State&) const;
315 const Vec4& getQDot(const State&) const;
316 const Vec4& getQDotDot(const State&) const;
317 const Vec3& getU(const State&) const;
318 const Vec3& getUDot(const State&) const;
319
320 void setQ(State&, const Vec4&) const;
321 void setU(State&, const Vec3&) const;
322
323 const Vec4& getMyPartQ(const State&, const Vector& qlike) const;
324 const Vec3& getMyPartU(const State&, const Vector& ulike) const;
325
326 Vec4& updMyPartQ(const State&, Vector& qlike) const;
327 Vec3& updMyPartU(const State&, Vector& ulike) const;
328
// hide from Doxygen
333};
334
335} // namespace SimTK
336
337#endif // SimTK_SIMBODY_MOBILIZED_BODY_ELLIPSOID_H_
338
339
340
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 class, along with its sister class CoordinateDirection, provides convenient manipulation of the ...
Definition CoordinateAxis.h:53
This is the client-side interface to an implementation-independent representation of "Decorations" su...
Definition DecorativeGeometry.h:87
Three mobilities – coordinated rotation and translation along the surface of an ellipsoid fixed to th...
Definition MobilizedBody_Ellipsoid.h:126
const Vec4 & getQDot(const State &) const
const Vec3 & getDefaultRadii() const
Get the default semi-axis dimensions of the ellipsoid as specified during construction or via setDefa...
Rotation getDefaultRotation() const
Get the value for the default orientation of this mobilizer; unless changed by setDefaultRotation() i...
Vec3 & updMyPartU(const State &, Vector &ulike) const
void setU(State &, const Vec3 &) const
Ellipsoid & addOutboardDecoration(const Transform &X_MD, const DecorativeGeometry &g)
Definition MobilizedBody_Ellipsoid.h:282
const Vec3 & getUDot(const State &) const
Ellipsoid(MobilizedBody &parent, const Body &bodyInfo, const Vec3 &radii, const CoordinateAxis &mirrorAxis, Direction=Forward)
Abbreviated constructor for a mirrored Ellipsoid mobilizer that you can use if the mobilizer frames a...
Ellipsoid & addInboardDecoration(const Transform &X_FD, const DecorativeGeometry &g)
Definition MobilizedBody_Ellipsoid.h:285
const Vec3 & getU(const State &) const
Vec4 & updMyPartQ(const State &, Vector &qlike) const
Ellipsoid()
Default constructor provides an empty handle that can be assigned to reference any MobilizedBody::Ell...
Definition MobilizedBody_Ellipsoid.h:130
Quaternion & updDefaultQ()
Update the default coordinates.
Ellipsoid(MobilizedBody &parent, const Transform &X_PF, const Body &bodyInfo, const Transform &X_BM, const Vec3 &radii, const CoordinateAxis &mirrorAxis, Direction=Forward)
Create a mirrored Ellipsoid mobilizer, that is, the mirror image of the joint produced by the corresp...
bool isMirrored() const
Return true if this mobilizer is the mirror image of the standard Ellipsoid joint,...
Ellipsoid & setDefaultOutboardFrame(const Transform &X_BM)
Definition MobilizedBody_Ellipsoid.h:293
CoordinateAxis getMirrorAxis() const
Get the axis of the inboard frame F that this mobilizer is mirrored about.
void multiplyByPositionJacobianWrtRadii(const State &state, const Vec3 &dradii, Vector_< Vec3 > &dp_GB) const
Calculate the product of the body position Jacobian with respect to this mobilizer's ellipsoid radii,...
Ellipsoid & clearMirrorAxis()
Remove any mirroring from this mobilizer, restoring the standard Ellipsoid joint, so that isMirrored(...
const Vec4 & getQDotDot(const State &) const
Ellipsoid(MobilizedBody &parent, const Transform &X_PF, const Body &bodyInfo, const Transform &X_BM, const Vec3 &radii, Direction=Forward)
Create an Ellipsoid mobilizer between an existing parent (inboard) body P and a new child (outboard) ...
Ellipsoid & addBodyDecoration(const Transform &X_BD, const DecorativeGeometry &g)
Definition MobilizedBody_Ellipsoid.h:279
Ellipsoid(MobilizedBody &parent, const Body &bodyInfo, const Vec3 &radii, Direction=Forward)
Abbreviated constructor you can use if the mobilizer frames are coincident with the parent and child ...
const Vec3 & getMyPartU(const State &, const Vector &ulike) const
const Vec3 & getRadii(const State &state) const
Get the semi-axis dimensions of the ellipsoid currently in use, from the given state.
void setQ(State &, const Vec4 &) const
Vec3 multiplyByPositionJacobianWrtRadiiTranspose(const State &state, const Vector_< Vec3 > &g_GB) const
Calculate the product of the transposed body position Jacobian with respect to mobilizer radii,...
Ellipsoid(MobilizedBody &parent, const Transform &X_PF, const Body &bodyInfo, const Transform &X_BM, Direction=Forward)
This constructor assumes you'll set the ellipsoid dimensions later; meanwhile it uses some default di...
Ellipsoid & setDefaultQ(const Quaternion &q)
Set the default coordinates.
Definition MobilizedBody_Ellipsoid.h:312
const Vec4 & getMyPartQ(const State &, const Vector &qlike) const
Ellipsoid & setDefaultRotation(const Rotation &R_FM)
Provide a default orientation for this mobilizer if you don't want to start with the identity rotatio...
const Quaternion & getDefaultQ() const
Get the default coordinates.
Ellipsoid(MobilizedBody &parent, const Body &bodyInfo, Direction=Forward)
This constructor assumes you'll set the ellipsoid dimensions later; meanwhile it uses some default di...
void setRadii(State &state, const Vec3 &radii) const
Change the semi-axis dimensions of the ellipsoid in the given state, invalidating Stage::Instance.
Ellipsoid & setDefaultRadii(const Vec3 &radii)
Modify the default semi-axis dimensions of the ellipsoid, given in the F frame.
Ellipsoid & setDefaultInboardFrame(const Transform &X_PF)
Definition MobilizedBody_Ellipsoid.h:289
Ellipsoid & setMirrorAxis(const CoordinateAxis &mirrorAxis)
Make this mobilizer the mirror image of the standard Ellipsoid joint, reflected about the plane norma...
const Vec4 & getQ(const State &) const
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
A Quaternion is a Vec4 with the following behavior:
Definition Quaternion.h:65
This object is intended to contain all state information for a SimTK::System, except topological info...
Definition State.h:280
This is the vector class intended to appear in user code for large, variable size column vectors.
Definition Vector_.h:52
This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with o...
Definition Assembler.h:37