Commit 758640d7 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Fix cppcheck warnings.

parent cb0f1ffd
......@@ -39,7 +39,7 @@ namespace hpp {
const fcl::CollisionObjectConstPtr_t& object)
{
ObjectVector_t::iterator it;
for (it = vector.begin (); it != vector.end (); it++) {
for (it = vector.begin (); it != vector.end (); ++it) {
const CollisionObjectPtr_t& local = *it;
if (local->fcl ()->collisionGeometry () ==
object->collisionGeometry ()) return it;
......@@ -305,10 +305,10 @@ namespace hpp {
fcl::CollisionResult collisionResult;
for (ObjectVector_t::const_iterator itInner =
collisionInnerObjects_.begin ();
itInner != collisionInnerObjects_.end (); itInner++) {
itInner != collisionInnerObjects_.end (); ++itInner) {
for (ObjectVector_t::const_iterator itOuter =
collisionOuterObjects_.begin ();
itOuter != collisionOuterObjects_.end (); itOuter++) {
itOuter != collisionOuterObjects_.end (); ++itOuter) {
if (fcl::collide ((*itInner)->fcl ().get (),
(*itOuter)->fcl ().get (),
collisionRequest, collisionResult) != 0) {
......@@ -326,13 +326,13 @@ namespace hpp {
{
fcl::DistanceRequest distanceRequest (true, 0, 0, fcl::GST_INDEP);
for (ObjectVector_t::iterator itInner = distanceInnerObjects_.begin ();
itInner != distanceInnerObjects_.end (); itInner++) {
itInner != distanceInnerObjects_.end (); ++itInner) {
// Compute global position if inner object
fcl::Transform3f globalPosition = joint ()->currentTransformation ()*
(*itInner)->positionInJointFrame ();
(*itInner)->fcl ()->setTransform (globalPosition);
for (ObjectVector_t::iterator itOuter = distanceOuterObjects_.begin ();
itOuter != distanceOuterObjects_.end (); itOuter++) {
itOuter != distanceOuterObjects_.end (); ++itOuter) {
// Compute global position if inner object
results [offset].fcl.clear ();
fcl::distance ((*itInner)->fcl ().get (), (*itOuter)->fcl ().get (),
......
......@@ -150,7 +150,7 @@ namespace hpp {
<< body1->name () << ": " << collisionObjects.size ());
for (ObjectVector_t::const_iterator itObj1 =
collisionObjects.begin ();
itObj1 != collisionObjects.end (); itObj1++) {
itObj1 != collisionObjects.end (); ++itObj1) {
body2->addOuterObject (*itObj1, true, false);
hppDout (info, "Adding object " << (*itObj1)->name ()
<< " to body " << body2->name ()
......@@ -183,7 +183,7 @@ namespace hpp {
<< body1->name () << ": " << distanceObjects.size ());
for (ObjectVector_t::const_iterator itObj1 =
distanceObjects.begin ();
itObj1 != distanceObjects.end (); itObj1++) {
itObj1 != distanceObjects.end (); ++itObj1) {
body2->addOuterObject (*itObj1, false, true);
hppDout (info, "Adding object " << (*itObj1)->name ()
<< " to body " << body2->name ()
......@@ -225,7 +225,7 @@ namespace hpp {
<< joint1->name () << ": " << collisionObjects.size ());
for (ObjectVector_t::const_iterator itObj1 =
collisionObjects.begin ();
itObj1 != collisionObjects.end (); itObj1++) {
itObj1 != collisionObjects.end (); ++itObj1) {
body2->removeOuterObject (*itObj1, true, false);
hppDout (info, "delete object " << (*itObj1)->name ()
<< " to body " << body2->name ()
......@@ -238,7 +238,7 @@ namespace hpp {
<< joint2->name () << ": " << collisionObjects2.size ());
for (ObjectVector_t::const_iterator itObj2 =
collisionObjects2.begin ();
itObj2 != collisionObjects2.end (); itObj2++) {
itObj2 != collisionObjects2.end (); ++itObj2) {
body1->removeOuterObject (*itObj2, true, false);
hppDout (info, "delete object " << (*itObj2)->name ()
<< " to body " << body1->name ()
......@@ -268,7 +268,7 @@ namespace hpp {
<< joint1->name () << ": " << distanceObjects.size ());
for (ObjectVector_t::const_iterator itObj1 =
distanceObjects.begin ();
itObj1 != distanceObjects.end (); itObj1++) {
itObj1 != distanceObjects.end (); ++itObj1) {
body2->removeOuterObject (*itObj1, false, true);
hppDout (info, "delete object " << (*itObj1)->name ()
<< " to body " << body2->name ()
......@@ -280,7 +280,7 @@ namespace hpp {
<< joint2->name () << ": " << distanceObjects2.size ());
for (ObjectVector_t::const_iterator itObj2 =
distanceObjects2.begin ();
itObj2 != distanceObjects2.end (); itObj2++) {
itObj2 != distanceObjects2.end (); ++itObj2) {
body1->removeOuterObject (*itObj2, false, true);
hppDout (info, "delete object " << (*itObj2)->name ()
<< " to body " << body1->name ()
......@@ -318,7 +318,7 @@ namespace hpp {
JointVector_t joints = getJointVector ();
JointVector_t::size_type size = 0;
for (JointVector_t::iterator it = joints.begin (); it != joints.end ();
it++) {
++it) {
BodyPtr_t body = (*it)->linkedBody ();
if (body) {
size += body->innerObjects (DISTANCE).size () *
......@@ -335,7 +335,7 @@ namespace hpp {
JointVector_t joints = getJointVector ();
JointVector_t::size_type offset = 0;
for (JointVector_t::iterator it = joints.begin (); it != joints.end ();
it++) {
++it) {
BodyPtr_t body = (*it)->linkedBody ();
if (body) {
body->computeDistances (distances_, offset);
......@@ -349,7 +349,7 @@ namespace hpp {
bool Device::collisionTest () const
{
for (JointVector_t::const_iterator itJoint = jointVector_.begin ();
itJoint != jointVector_.end (); itJoint++) {
itJoint != jointVector_.end (); ++itJoint) {
BodyPtr_t body = (*itJoint)->linkedBody ();
if (body != 0x0) {
if (body->collisionTest ()) {
......@@ -378,13 +378,13 @@ namespace hpp {
// Update positions of bodies from position of joints.
JointVector_t jv = getJointVector ();
for (JointVector_t::iterator itJoint = jv.begin (); itJoint != jv.end ();
itJoint++) {
++itJoint) {
BodyPtr_t body = (*itJoint)->linkedBody ();
if (body) {
const ObjectVector_t& cbv =
body->innerObjects (COLLISION);
for (ObjectVector_t::const_iterator itInner = cbv.begin ();
itInner != cbv.end (); itInner++) {
itInner != cbv.end (); ++itInner) {
// Compute global position if inner object
fcl::Transform3f globalPosition =
(*itJoint)->currentTransformation ()*
......@@ -394,7 +394,7 @@ namespace hpp {
const ObjectVector_t& dbv =
body->innerObjects (DISTANCE);
for (ObjectVector_t::const_iterator itInner = dbv.begin ();
itInner != dbv.end (); itInner++) {
itInner != dbv.end (); ++itInner) {
// Compute global position if inner object
fcl::Transform3f globalPosition =
(*itJoint)->currentTransformation ()*
......@@ -507,7 +507,7 @@ namespace hpp {
{
rootJoint_->computeJacobian ();
for (JointVector_t::const_iterator it = jointVector_.begin ();
it != jointVector_.end (); it++) {
it != jointVector_.end (); ++it) {
}
}
......@@ -524,7 +524,7 @@ namespace hpp {
void Device::computeJacobianCenterOfMass ()
{
for (JointVector_t::iterator it = jointVector_.begin ();
it != jointVector_.end (); it++) {
it != jointVector_.end (); ++it) {
(*it)->writeComSubjacobian (jacobianCom_, mass ());
}
}
......@@ -534,7 +534,7 @@ namespace hpp {
jacobianCom_.resize (3, numberDof_);
jacobianCom_.setZero ();
for (JointVector_t::iterator itJoint = jointVector_.begin ();
itJoint != jointVector_.end () ; itJoint++) {
itJoint != jointVector_.end () ; ++itJoint) {
(*itJoint)->jacobian_.resize (6, numberDof_);
(*itJoint)->jacobian_.setZero ();
}
......
......@@ -45,7 +45,7 @@ namespace hpp {
os << "joint :" << joint ()->name () << std::endl;
os << "disable Collisions : ";
for (JointVector_t::const_iterator itJoint = disabledCollisions_.begin() ;
itJoint != disabledCollisions_.end() ; itJoint++ ) {
itJoint != disabledCollisions_.end() ; ++itJoint ) {
os << (*itJoint)->name() << " ";
}
os << std::endl;
......
......@@ -156,7 +156,7 @@ namespace hpp {
{
computePosition (configuration, parentPosition, currentTransformation_);
for (std::vector <JointPtr_t>::const_iterator itJoint =
children_.begin (); itJoint != children_.end (); itJoint++) {
children_.begin (); itJoint != children_.end (); ++itJoint) {
(*itJoint)->recursiveComputePosition
(configuration, currentTransformation_);
}
......@@ -178,7 +178,7 @@ namespace hpp {
mass_ = body_->mass ();
}
for (std::vector <JointPtr_t>::iterator it = children_.begin ();
it != children_.end (); it++) {
it != children_.end (); ++it) {
mass_ += (*it)->computeMass ();
}
return mass_;
......@@ -192,7 +192,7 @@ namespace hpp {
(body_->localCenterOfMass ()) * body_->mass ();
}
for (std::vector <JointPtr_t>::iterator it = children_.begin ();
it != children_.end (); it++) {
it != children_.end (); ++it) {
(*it)->computeMassTimesCenterOfMass ();
massCom_ += (*it)->massCom_;
}
......@@ -639,7 +639,7 @@ namespace hpp {
const hpp::model::ObjectVector_t& colObjects =
body->innerObjects (hpp::model::COLLISION);
for (hpp::model::ObjectVector_t::const_iterator it =
colObjects.begin (); it != colObjects.end (); it++) {
colObjects.begin (); it != colObjects.end (); ++it) {
os << "name: " << (*it)->name () << "\\n";
os << "position :" << "\\n";
const fcl::Transform3f& transform ((*it)->fcl ()->getTransform ());
......@@ -656,7 +656,7 @@ namespace hpp {
}
// write edges to children joints
for (hpp::model::JointVector_t::const_iterator it =
children_.begin (); it != children_.end (); it++) {
children_.begin (); it != children_.end (); ++it) {
os << "\"" << name () << "\"->\"" << (*it)->name () << "\""
<< std::endl;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment