1 #ifndef __ddDrakeModel_h
2 #define __ddDrakeModel_h
7 #include "ddSharedPtr.h"
9 #include "ddDrakeVersion.h"
11 #include <drake/systems/plants/RigidBodyTree.h>
13 #include <drake/multibody/rigid_body_tree.h>
21 #define RigidBodyTreed RigidBodyTree
33 bool loadFromFile(
const QString& filename,
const QString& floatingBaseType =
"ROLLPITCHYAW");
34 bool loadFromXML(
const QString& xmlString);
35 const QString& filename()
const;
37 const ddSharedPtr<RigidBodyTreed> getDrakeRBM()
const;
38 const ddSharedPtr<KinematicsCache<double> > getKinematicsCache()
const;
40 void addToRenderer(vtkRenderer* renderer);
41 void removeFromRenderer(vtkRenderer* renderer);
44 void setJointPositions(
const QVector<double>& positions,
const QList<QString>& jointNames);
45 void setJointPositions(
const QVector<double>& positions);
46 QVector<double> getJointPositions(
const QList<QString>& jointNames)
const;
47 const QVector<double>& getJointPositions()
const;
48 QVector<double> getCenterOfMass()
const;
49 QVector<double> getJointLimits(
const QString& jointName)
const;
50 QVector<double> getBodyContactPoints(
const QString& bodyName)
const;
51 QVector<double> geometricJacobian(
int base_body_or_frame_ind,
int end_effector_body_or_frame_ind,
int expressed_in_body_or_frame_ind,
int gradient_order,
bool in_terms_of_qdot =
false);
52 bool getLinkToWorld(
const QString& linkName, vtkTransform* transform);
53 bool getFrameToWorld(
int frameId, vtkTransform* transform);
54 QList<QString> getLinkNames();
55 QList<QString> getJointNames();
56 int findLinkID(
const QString& linkName)
const;
57 int findJointID(
const QString& jointName)
const;
58 int findFrameID(
const QString& frameName)
const;
59 QString findNameOfChildBodyOfJoint(
const QString& jointName)
const;
61 void getModelMesh(vtkPolyData* polyData);
62 void getModelMeshWithLinkInfoAndNormals(vtkPolyData* polyData);
63 void getLinkModelMesh(
const QString& linkName, vtkPolyData* polyData);
64 QString getLinkNameForMesh(vtkPolyData* polyData);
65 QString getBodyOrFrameName(
int body_or_frame_id);
67 void setAlpha(
double alpha);
72 void setTexturesEnabled(
bool enabled);
73 bool texturesEnabled()
const;
75 void setVisible(
bool visible);
79 void setColor(
const QColor& color);
81 void setLinkColor(
const QString& linkName,
const QColor& color);
82 QColor getLinkColor(
const QString& linkName)
const;
84 static void addPackageSearchPath(
const QString& searchPath);
85 static QString findPackageDirectory(
const QString& packageName);
90 void displayChanged();