Skip to content
Snippets Groups Projects
Commit 3a389d64 authored by Raphael Grimm's avatar Raphael Grimm
Browse files

Format code

parent 84ce4385
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,7 @@ namespace VirtualRobot
std::vector<ActorDefinition> newDef;
for (auto & actor : actors)
for (auto& actor : actors)
{
ActorDefinition a;
a.colMode = actor.colMode;
......@@ -74,7 +74,7 @@ namespace VirtualRobot
VR_ASSERT(robot);
bool res = true;
for (auto & actor : actors)
for (auto& actor : actors)
{
float v = actor.robotNode->getJointValue() + angle * actor.directionAndSpeed;
......@@ -111,7 +111,7 @@ namespace VirtualRobot
for (auto & actor : actors)
for (auto& actor : actors)
{
float oldV = actor.robotNode->getJointValue();
float v = oldV + angle * actor.directionAndSpeed;
......@@ -135,7 +135,7 @@ namespace VirtualRobot
// actors (don't store contacts)
if (!collision)
{
for (auto & eefActor : eefActors)
for (auto& eefActor : eefActors)
{
// Don't check for collisions with the actor itself (don't store contacts)
if ((eefActor->getName() != name) && isColliding(eefActor)) //isColliding(eef,*a,newContacts) )
......@@ -148,7 +148,7 @@ namespace VirtualRobot
// static (don't store contacts)
if (!collision)
{
for (auto & node : eefStatic)
for (auto& node : eefStatic)
{
SceneObjectPtr so = boost::dynamic_pointer_cast<SceneObject>(node);
......@@ -173,19 +173,20 @@ namespace VirtualRobot
actorStatus[actor.robotNode] = eCollision;
}
} else
}
else
{
actorStatus[actor.robotNode] = eFinished;
}
}
// update contacts
for (auto & newContact : newContacts)
for (auto& newContact : newContacts)
{
// check for double entries (this may happen since we move all actors to the end and may detecting contacts multiple times)
bool doubleEntry = false;
for (auto & storeContact : storeContacts)
for (auto& storeContact : storeContacts)
{
if (storeContact.robotNode == newContact.robotNode && storeContact.obstacle == newContact.obstacle)
{
......@@ -218,11 +219,13 @@ namespace VirtualRobot
// check what we should return
bool res = true;
for (auto & actor : actors)
for (auto& actor : actors)
{
// if at least one actor is not in collision and not at its joint limits, we are still in the process of closing the fingers
if (actorStatus[actor.robotNode] == eMoving)
{
res = false;
}
}
return res;
......@@ -235,9 +238,9 @@ namespace VirtualRobot
//Eigen::Vector3f contact;
bool col = false;
for (auto & actor : actors)
for (auto& actor : actors)
{
for (auto & colModel : colModels)
for (auto& colModel : colModels)
{
if ((actor.colMode & checkColMode) &&
......@@ -271,7 +274,7 @@ namespace VirtualRobot
bool EndEffectorActor::isColliding(SceneObjectSetPtr obstacles, CollisionMode checkColMode)
{
for (auto & actor : actors)
for (auto& actor : actors)
{
if ((actor.colMode & checkColMode) && actor.robotNode->getCollisionModel() && colChecker->checkCollision(actor.robotNode->getCollisionModel(), obstacles))
{
......@@ -289,7 +292,7 @@ namespace VirtualRobot
return false;
}
for (auto & actor : actors)
for (auto& actor : actors)
{
if ((actor.colMode & checkColMode) && actor.robotNode->getCollisionModel() && colChecker->checkCollision(actor.robotNode->getCollisionModel(), obstacle->getCollisionModel()))
{
......@@ -302,7 +305,7 @@ namespace VirtualRobot
bool EndEffectorActor::isColliding(EndEffectorActorPtr obstacle)
{
for (auto & actor : actors)
for (auto& actor : actors)
{
SceneObjectPtr so = boost::dynamic_pointer_cast<SceneObject>(actor.robotNode);
......@@ -323,7 +326,7 @@ namespace VirtualRobot
std::vector<RobotNodePtr> obstacleStatics;
obstacle->getStatics(obstacleStatics);
for (auto & obstacleActor : obstacleActors)
for (auto& obstacleActor : obstacleActors)
{
// Don't check for collisions with the actor itself
if ((obstacleActor->getName() != name) && isColliding(obstacleActor))
......@@ -332,7 +335,7 @@ namespace VirtualRobot
}
}
for (auto & obstacleStatic : obstacleStatics)
for (auto& obstacleStatic : obstacleStatics)
{
SceneObjectPtr so = boost::dynamic_pointer_cast<SceneObject>(obstacleStatic);
......@@ -353,7 +356,7 @@ namespace VirtualRobot
std::vector<RobotNodePtr> obstacleStatics;
obstacle->getStatics(obstacleStatics);
for (auto & obstacleActor : obstacleActors)
for (auto& obstacleActor : obstacleActors)
{
// Don't check for collisions with the actor itself
if ((obstacleActor->getName() != name) && isColliding(eef, obstacleActor, storeContacts))
......@@ -362,7 +365,7 @@ namespace VirtualRobot
}
}
for (auto & obstacleStatic : obstacleStatics)
for (auto& obstacleStatic : obstacleStatics)
{
SceneObjectPtr so = boost::dynamic_pointer_cast<SceneObject>(obstacleStatic);
......@@ -377,7 +380,7 @@ namespace VirtualRobot
bool EndEffectorActor::isColliding(EndEffectorPtr eef, EndEffectorActorPtr obstacle, EndEffector::ContactInfoVector& storeContacts)
{
for (auto & actor : actors)
for (auto& actor : actors)
{
SceneObjectPtr so = boost::dynamic_pointer_cast<SceneObject>(actor.robotNode);
......@@ -401,7 +404,7 @@ namespace VirtualRobot
//Eigen::Vector3f contact;
bool col = false;
for (auto & actor : actors)
for (auto& actor : actors)
{
if ((actor.colMode & checkColMode) &&
......@@ -438,7 +441,7 @@ namespace VirtualRobot
{
std::vector< RobotNodePtr > res;
for (auto & actor : actors)
for (auto& actor : actors)
{
res.push_back(actor.robotNode);
}
......@@ -451,7 +454,7 @@ namespace VirtualRobot
cout << " ****" << endl;
cout << " ** Name:" << name << endl;
for (auto & actor : actors)
for (auto& actor : actors)
{
cout << " *** RobotNode: " << actor.robotNode->getName() << ", Direction/Speed:" << actor.directionAndSpeed << endl;
//actors[i].robotNode->print();
......@@ -512,7 +515,7 @@ namespace VirtualRobot
{
BoundingBox bb_all;
for (auto & actor : actors)
for (auto& actor : actors)
{
if (actor.robotNode->getCollisionModel())
{
......@@ -535,7 +538,7 @@ namespace VirtualRobot
std::vector< RobotConfig::Configuration > c;
for (auto & actor : actors)
for (auto& actor : actors)
{
RobotConfig::Configuration e;
e.name = actor.robotNode->getName();
......@@ -562,7 +565,7 @@ namespace VirtualRobot
std::string ttt = tt + t;
ss << pre << "<Actor name='" << name << "'>" << endl;
for (auto & actor : actors)
for (auto& actor : actors)
{
ss << tt << "<Node name='" << actor.robotNode->getName() << "' ";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment