7 #ifndef _ARTICULATED_BODY_H
8 #define _ARTICULATED_BODY_H
11 #include <boost/shared_ptr.hpp>
12 #include <Ravelin/Vector3d.h>
13 #include <Ravelin/Matrix3d.h>
14 #include <Ravelin/SMomentumd.h>
15 #include <Ravelin/sorted_pair>
16 #include <Moby/UnilateralConstraint.h>
17 #include <Moby/ControlledBody.h>
18 #include <Moby/Joint.h>
19 #include <Ravelin/ArticulatedBodyd.h>
32 virtual void load_from_xml(boost::shared_ptr<const XMLTree> node, std::map<std::string, BasePtr>& id_map);
33 virtual void save_to_xml(
XMLTreePtr node, std::list<boost::shared_ptr<const Base> >& shared_objects)
const;
36 virtual void prepare_to_calc_ode(Ravelin::SharedConstVectorNd& x,
double t,
double dt,
void* data);
38 virtual void ode(
double t,
double dt,
void* data, Ravelin::SharedVectorNd& dx);
42 template <
class OutputIterator>
49 boost::shared_ptr<const ArticulatedBody>
get_this()
const {
return boost::dynamic_pointer_cast<
const ArticulatedBody>(Ravelin::ArticulatedBodyd::shared_from_this()); }
55 std::vector<double> _cvio;
58 std::vector<double> _cvel_vio;
61 Ravelin::VectorNd _dq;
65 #include "ArticulatedBody.inl"
Abstract class for articulated bodies.
Definition: ArticulatedBody.h:26
Represents a single rigid body.
Definition: RigidBody.h:43
virtual void update_visualization()
Updates visualization for the body.
Definition: ArticulatedBody.cpp:227
boost::shared_ptr< XMLTree > XMLTreePtr
XML tree smart pointer.
Definition: Types.h:104
virtual void prepare_to_calc_ode_sustained_constraints(Ravelin::SharedConstVectorNd &x, double t, double dt, void *data)
Integrates a dynamic body.
Definition: ArticulatedBody.cpp:75
bool is_joint_constraint_violated() const
Checks for a joint constraint violation.
Definition: ArticulatedBody.cpp:203
ArticulatedBodyPtr get_this()
Gets shared pointer to this object as type ArticulatedBody.
Definition: ArticulatedBody.h:46
virtual void save_to_xml(XMLTreePtr node, std::list< boost::shared_ptr< const Base > > &shared_objects) const
Saves this object to a XML tree.
Definition: ArticulatedBody.cpp:344
boost::shared_ptr< const ArticulatedBody > get_this() const
Gets shared pointer to this object as type const ArticulateBody.
Definition: ArticulatedBody.h:49
void update_joint_constraint_violations()
Updates joint constraint violation (after integration)
Definition: ArticulatedBody.cpp:181
boost::shared_ptr< ArticulatedBody > ArticulatedBodyPtr
Articulated body smart pointer.
Definition: Types.h:65
virtual void load_from_xml(boost::shared_ptr< const XMLTree > node, std::map< std::string, BasePtr > &id_map)
Loads a MCArticulatedBody object from an XML node.
Definition: ArticulatedBody.cpp:236
Superclass for controlled bodies.
Definition: ControlledBody.h:21
virtual void prepare_to_calc_ode(Ravelin::SharedConstVectorNd &x, double t, double dt, void *data)
Prepares to compute the ODE.
Definition: ArticulatedBody.cpp:119
virtual void ode(double t, double dt, void *data, Ravelin::SharedVectorNd &dx)
Returns the ODE's for position and velocity (concatenated into x)
Definition: ArticulatedBody.cpp:163
OutputIterator find_limit_constraints(OutputIterator begin) const
Finds (joint) limit constraints.
Definition: ArticulatedBody.h:10