Moby
RCArticulatedBody.h
1 /****************************************************************************
2  * Copyright 2005 Evan Drumwright
3  * This library is distributed under the terms of the Apache V2.0
4  * License (obtainable from http://www.apache.org/licenses/LICENSE-2.0).
5  ****************************************************************************/
6 
7 #ifndef _RC_ARTICULATED_BODY_H
8 #define _RC_ARTICULATED_BODY_H
9 
10 #include <pthread.h>
11 #include <map>
12 #include <list>
13 #include <vector>
14 #include <boost/shared_ptr.hpp>
15 #include <Ravelin/Vector3d.h>
16 #include <Ravelin/SForced.h>
17 #include <Moby/Constants.h>
18 #include <Moby/ArticulatedBody.h>
19 #include <Moby/RigidBody.h>
20 #include <Ravelin/RCArticulatedBodyd.h>
21 
22 namespace Moby {
23 
24 class Joint;
25 class UnilateralConstraintProblemData;
26 
28 
43 class RCArticulatedBody : public virtual ArticulatedBody, public virtual Ravelin::RCArticulatedBodyd
44 {
45  public:
47  virtual ~RCArticulatedBody() {}
48 /*
49  virtual Ravelin::MatrixNd& calc_jacobian(const Point3d& point, RigidBodyPtr link, Ravelin::MatrixNd& J);
50  virtual Ravelin::MatrixNd& calc_jacobian(const Point3d& point, const Ravelin::Pose3d& base_pose, const std::map<JointPtr, Ravelin::VectorNd>& q, RigidBodyPtr link, Ravelin::MatrixNd& J);
51 */
53  virtual void load_from_xml(boost::shared_ptr<const XMLTree> node, std::map<std::string, BasePtr>& id_map);
54  virtual void save_to_xml(XMLTreePtr node, std::list<boost::shared_ptr<const Base> >& shared_objects) const;
55  virtual void set_links_and_joints(const std::vector<RigidBodyPtr>& links, const std::vector<JointPtr>& joints);
56  virtual void apply_generalized_impulse(const Ravelin::SharedVectorNd& gj);
57 
58  protected:
59  virtual void compile();
60 
61  private:
62  RCArticulatedBody(const RCArticulatedBody& rcab) {}
63 }; // end class
64 
65 } // end namespace
66 #endif
67 
Abstract class for articulated bodies.
Definition: ArticulatedBody.h:26
virtual void load_from_xml(boost::shared_ptr< const XMLTree > node, std::map< std::string, BasePtr > &id_map)
Implements Base::load_from_xml()
Definition: RCArticulatedBody.cpp:162
RCArticulatedBody()
Default constructor.
Definition: RCArticulatedBody.cpp:33
virtual void apply_generalized_impulse(const Ravelin::SharedVectorNd &gj)
Applies a generalized impulse to the rigid body (calls the simulator)
Definition: RCArticulatedBody.cpp:38
Defines an articulated body for use with reduced-coordinate dynamics algorithms.
Definition: RCArticulatedBody.h:43
virtual void compile()
Compiles this body (updates the link transforms and velocities)
Definition: RCArticulatedBody.cpp:98
RCArticulatedBodyPtr clone() const
Clones this.
Definition: RCArticulatedBody.cpp:45
virtual void save_to_xml(XMLTreePtr node, std::list< boost::shared_ptr< const Base > > &shared_objects) const
Implements Base::save_to_xml()
Definition: RCArticulatedBody.cpp:255
boost::shared_ptr< XMLTree > XMLTreePtr
XML tree smart pointer.
Definition: Types.h:104
boost::shared_ptr< RCArticulatedBody > RCArticulatedBodyPtr
Reduced-coordinate articulated body smart pointer.
Definition: Types.h:68
virtual void set_links_and_joints(const std::vector< RigidBodyPtr > &links, const std::vector< JointPtr > &joints)
Sets the vector of links and joints.
Definition: RCArticulatedBody.cpp:147