18 #ifndef _SIMBODY_PHYSICS_HH
19 #define _SIMBODY_PHYSICS_HH
22 #include <boost/thread/thread.hpp>
23 #include <boost/thread/mutex.hpp>
51 public:
virtual void Load(sdf::ElementPtr _sdf);
54 public:
virtual void Init();
57 public:
virtual void Reset();
64 public:
virtual void InitForThread();
67 public:
virtual void UpdateCollision();
70 public:
virtual void UpdatePhysics();
73 public:
virtual void Fini();
76 public:
virtual std::string GetType()
const;
82 public:
virtual CollisionPtr CreateCollision(
const std::string &_type,
86 public:
virtual JointPtr CreateJoint(
const std::string &_type,
90 public:
virtual ShapePtr CreateShape(
const std::string &_shapeType,
94 public: SimTK::MultibodySystem *GetDynamicsWorld()
const;
100 public:
virtual void DebugPrint()
const;
103 public:
virtual void SetSeed(uint32_t _seed);
121 public:
static SimTK::Vec3 Vector3ToVec3(
const math::Vector3 &_v);
126 public:
static math::Vector3 Vec3ToVector3(
const SimTK::Vec3 &_v);
134 public:
static SimTK::Transform Pose2Transform(
const math::Pose &_pose);
140 public:
static math::Pose Transform2Pose(
const SimTK::Transform &_xAB);
145 public:
static SimTK::Transform GetPose(sdf::ElementPtr _element);
151 public:
static std::string GetTypeString(
unsigned int _type);
160 protected:
virtual void OnRequest(ConstRequestPtr &_msg);
163 protected:
virtual void OnPhysicsMsg(ConstPhysicsPtr &_msg);
173 private:
void CreateMultibodyGraph(
186 private:
void InitSimbodySystem();
190 private:
void AddStaticModelToSimbodySystem(
196 private:
void AddDynamicModelToSimbodySystem(
197 const SimTK::MultibodyGraphMaker &_mbgraph,
202 SimTK::MobilizedBody &_mobod, SimTK::ContactCliqueId _modelClique);
205 public: SimTK::SimbodyMatterSubsystem
matter;
206 public: SimTK::GeneralForceSubsystem
forces;
209 public: SimTK::ContactTrackerSubsystem
tracker;
210 public: SimTK::CompliantContactSubsystem
contact;
219 public:
virtual boost::any GetParam(
const std::string &_key)
const;
222 public:
virtual bool GetParam(
const std::string &_key,
223 boost::any &_value)
const;
226 public:
virtual bool SetParam(
const std::string &_key,
227 const boost::any &_value);
230 private:
double contactMaterialStiffness;
233 private:
double contactMaterialDissipation;
237 private:
double contactMaterialPlasticCoefRestitution;
241 private:
double contactMaterialPlasticImpactVelocity;
245 private:
double contactMaterialStaticFriction;
249 private:
double contactMaterialDynamicFriction;
253 private:
double contactMaterialViscousFriction;
257 private:
double contactImpactCaptureVelocity;
261 private:
double contactStictionTransitionVelocity;
263 private: SimTK::MultibodySystem *dynamicsWorld;
267 private:
double stepTimeDouble;
271 private: std::string solverType;
278 private: std::string integratorType;
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:68
boost::shared_ptr< Model > ModelPtr
Definition: PhysicsTypes.hh:84
#define GZ_PHYSICS_VISIBLE
Definition: system.hh:318
Encapsulates a position and rotation in three space.
Definition: Pose.hh:37
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
boost::shared_ptr< Shape > ShapePtr
Definition: PhysicsTypes.hh:116
SimTK::ContactTrackerSubsystem tracker
Definition: SimbodyPhysics.hh:209
Base class for a physics engine.
Definition: PhysicsEngine.hh:40
boost::shared_ptr< Collision > CollisionPtr
Definition: PhysicsTypes.hh:96
SimTK::MultibodySystem system
Definition: SimbodyPhysics.hh:204
bool simbodyPhysicsStepped
Definition: SimbodyPhysics.hh:216
SimTK::Force::Gravity gravity
Definition: SimbodyPhysics.hh:207
Simbody Link class.
Definition: SimbodyLink.hh:39
SimTK::CompliantContactSubsystem contact
Definition: SimbodyPhysics.hh:210
Simbody physics engine.
Definition: SimbodyPhysics.hh:42
A quaternion class.
Definition: Quaternion.hh:42
Simbody wrapper forward declarations and typedefs.
SimTK::Force::DiscreteForces discreteForces
Definition: SimbodyPhysics.hh:208
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:80
boost::shared_ptr< Joint > JointPtr
Definition: PhysicsTypes.hh:100
EntityType
Unique identifiers for all entity types.
Definition: Base.hh:84
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
SimTK::SimbodyMatterSubsystem matter
Definition: SimbodyPhysics.hh:205
bool simbodyPhysicsInitialized
true if initialized
Definition: SimbodyPhysics.hh:214
SimTK::Integrator * integ
Definition: SimbodyPhysics.hh:211
SimTK::GeneralForceSubsystem forces
Definition: SimbodyPhysics.hh:206
boost::shared_ptr< Link > LinkPtr
Definition: PhysicsTypes.hh:92
A Time class, can be used to hold wall- or sim-time.
Definition: Time.hh:39