Skip to content

Commit

Permalink
more code style cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelli committed Mar 5, 2017
1 parent c4bcf31 commit fb8092e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/app/ddDrakeModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1132,6 +1132,7 @@ int ddDrakeModel::findLinkID(const QString& linkName) const
return this->Internal->Model->FindBodyIndex(linkName.toAscii().data(), -1);
}

//-----------------------------------------------------------------------------
int ddDrakeModel::findFrameID(const QString& frameName) const
{
return this->Internal->Model->findFrame(frameName.toAscii().data())->get_frame_index();
Expand All @@ -1143,6 +1144,7 @@ int ddDrakeModel::findJointID(const QString& jointName) const
return this->Internal->Model->FindIndexOfChildBodyOfJoint(jointName.toAscii().data(), -1);
}

//-----------------------------------------------------------------------------
QString ddDrakeModel::findNameOfChildBodyOfJoint(const QString &jointName) const
{
std::string body_name = this->Internal->Model->FindChildBodyOfJoint(jointName.toAscii().data())->get_name();
Expand Down Expand Up @@ -1188,6 +1190,7 @@ QString ddDrakeModel::getLinkNameForMesh(vtkPolyData* polyData)
return QString();
}

//-----------------------------------------------------------------------------
QString ddDrakeModel::getBodyOrFrameName(int bodyOrFrameId)
{
std::string linkName = this->Internal->Model->getBodyOrFrameName(bodyOrFrameId);
Expand All @@ -1209,7 +1212,6 @@ bool ddDrakeModel::loadFromFile(const QString& filename, const QString& floating

this->Internal->FileName = filename;
this->Internal->Model = model;

this->Internal->Model->cache = std::make_shared<KinematicsCache<double> >(this->Internal->Model->CreateKinematicsCache());
this->setJointPositions(QVector<double>(model->get_num_positions(), 0.0));
return true;
Expand All @@ -1226,7 +1228,6 @@ bool ddDrakeModel::loadFromXML(const QString& xmlString)

this->Internal->FileName = "<xml string>";
this->Internal->Model = model;

this->Internal->Model->cache = std::make_shared<KinematicsCache<double> >(this->Internal->Model->CreateKinematicsCache());
this->setJointPositions(QVector<double>(model->get_num_positions(), 0.0));
return true;
Expand Down Expand Up @@ -1256,6 +1257,7 @@ void ddDrakeModel::getModelMesh(vtkPolyData* polyData)
polyData->DeepCopy(appendFilter->GetOutput());
}

//-----------------------------------------------------------------------------
void ddDrakeModel::getModelMeshWithLinkInfoAndNormals(vtkPolyData* polyData)
{
if (!polyData)
Expand Down
7 changes: 5 additions & 2 deletions src/app/ddDrakeModelOH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,7 @@ QVector<double> ddDrakeModel::getBodyContactPoints(const QString& bodyName) cons
return ret;
}

//-----------------------------------------------------------------------------
// make sure we call do kinematics before we get here
QVector<double> ddDrakeModel::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){

Expand Down Expand Up @@ -1143,6 +1144,7 @@ int ddDrakeModel::findLinkID(const QString& linkName) const
return this->Internal->Model->findLinkId(linkName.toAscii().data(), -1);
}

//-----------------------------------------------------------------------------
int ddDrakeModel::findFrameID(const QString& frameName) const
{
return this->Internal->Model->findFrame(frameName.toAscii().data())->frame_index;
Expand Down Expand Up @@ -1200,6 +1202,7 @@ QString ddDrakeModel::getLinkNameForMesh(vtkPolyData* polyData)
return QString();
}

//-----------------------------------------------------------------------------
QString ddDrakeModel::getBodyOrFrameName(int body_or_frame_id)
{
std::string linkName = this->Internal->Model->getBodyOrFrameName(body_or_frame_id);
Expand All @@ -1219,7 +1222,6 @@ bool ddDrakeModel::loadFromFile(const QString& filename, const QString& floating

this->Internal->FileName = filename;
this->Internal->Model = model;

this->Internal->Model->initializeKinematicsCache();
this->setJointPositions(QVector<double>(model->num_positions, 0.0));
return true;
Expand All @@ -1236,7 +1238,6 @@ bool ddDrakeModel::loadFromXML(const QString& xmlString)

this->Internal->FileName = "<xml string>";
this->Internal->Model = model;

this->Internal->Model->initializeKinematicsCache();
this->setJointPositions(QVector<double>(model->num_positions, 0.0));
return true;
Expand Down Expand Up @@ -1266,6 +1267,7 @@ void ddDrakeModel::getModelMesh(vtkPolyData* polyData)
polyData->DeepCopy(appendFilter->GetOutput());
}

//-----------------------------------------------------------------------------
void ddDrakeModel::getModelMeshWithLinkInfoAndNormals(vtkPolyData* polyData)
{
if (!polyData)
Expand All @@ -1288,6 +1290,7 @@ void ddDrakeModel::getModelMeshWithLinkInfoAndNormals(vtkPolyData* polyData)
polyData->DeepCopy(appendFilter->GetOutput());
}

//-----------------------------------------------------------------------------
void ddDrakeModel::getLinkModelMesh(const QString& linkName, vtkPolyData* polyData){
if (!polyData)
{
Expand Down

0 comments on commit fb8092e

Please sign in to comment.