Simbody
3.5
|
00001 #ifndef SimTK_SIMBODY_CONSTRAINT_WELD_H_ 00002 #define SimTK_SIMBODY_CONSTRAINT_WELD_H_ 00003 00004 /* -------------------------------------------------------------------------- * 00005 * Simbody(tm) * 00006 * -------------------------------------------------------------------------- * 00007 * This is part of the SimTK biosimulation toolkit originating from * 00008 * Simbios, the NIH National Center for Physics-Based Simulation of * 00009 * Biological Structures at Stanford, funded under the NIH Roadmap for * 00010 * Medical Research, grant U54 GM072970. See https://simtk.org/home/simbody. * 00011 * * 00012 * Portions copyright (c) 2007-14 Stanford University and the Authors. * 00013 * Authors: Michael Sherman * 00014 * Contributors: * 00015 * * 00016 * Licensed under the Apache License, Version 2.0 (the "License"); you may * 00017 * not use this file except in compliance with the License. You may obtain a * 00018 * copy of the License at http://www.apache.org/licenses/LICENSE-2.0. * 00019 * * 00020 * Unless required by applicable law or agreed to in writing, software * 00021 * distributed under the License is distributed on an "AS IS" BASIS, * 00022 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 00023 * See the License for the specific language governing permissions and * 00024 * limitations under the License. * 00025 * -------------------------------------------------------------------------- */ 00026 00030 #include "simbody/internal/Constraint.h" 00031 00032 namespace SimTK { 00033 00034 //============================================================================== 00035 // WELD (COINCIDENT FRAMES) CONSTRAINT 00036 //============================================================================== 00037 00060 class SimTK_SIMBODY_EXPORT Constraint::Weld : public Constraint { 00061 public: 00062 // no default constructor 00063 00066 Weld(MobilizedBody& body1, MobilizedBody& body2); 00067 00072 Weld(MobilizedBody& body1, const Transform& frame1, 00073 MobilizedBody& body2, const Transform& frame2); 00074 00076 Weld() {} 00077 00078 // Control over generated decorative geometry. 00079 00083 Weld& setAxisDisplayLength(Real r); 00084 00088 Real getAxisDisplayLength() const; 00089 00090 // Defaults for Instance variables. 00091 00095 Weld& setDefaultFrameOnBody1(const Transform&); 00096 00098 const Transform& getDefaultFrameOnBody1() const; 00099 00103 Weld& setDefaultFrameOnBody2(const Transform&); 00104 00106 const Transform& getDefaultFrameOnBody2() const; 00107 00108 00109 // Stage::Topology 00110 00112 MobilizedBodyIndex getBody1MobilizedBodyIndex() const; 00113 00115 MobilizedBodyIndex getBody2MobilizedBodyIndex() const; 00116 00117 00118 // Stage::Instance 00119 const Transform& getFrameOnBody1(const State&) const; 00120 const Transform& getFrameOnBody2(const State&) const; 00121 00122 // Stage::Position, Velocity, Acceleration 00123 Vec6 getPositionErrors(const State&) const; 00124 Vec6 getVelocityErrors(const State&) const; 00125 00126 // Stage::Acceleration 00127 Vec6 getAccelerationErrors(const State&) const; 00128 Vec6 getMultipliers(const State&) const; 00129 00130 // Forces are reported expressed in the body frame of the indicated body. 00131 const SpatialVec& getWeldReactionOnBody1(const State&) const; 00132 const SpatialVec& getWeldReactionOnBody2(const State&) const; 00133 // hide from Doxygen 00135 SimTK_INSERT_DERIVED_HANDLE_DECLARATIONS(Weld, WeldImpl, Constraint); 00137 }; 00138 00139 00140 } // namespace SimTK 00141 00142 #endif // SimTK_SIMBODY_CONSTRAINT_WELD_H_ 00143 00144 00145