Skip to content

Commit

Permalink
Replace negation operator with not token
Browse files Browse the repository at this point in the history
  • Loading branch information
Milan Jelisavcic committed Aug 2, 2017
1 parent 8240d3e commit 2ef1359
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cpp/tol/plugin/InteractiveEvolutionPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ InteractiveEvolutionPlugin::OnReproduceButton()
auto modelVis1 = visuals[0]->GetRootVisual();
auto modelVis2 = visuals[1]->GetRootVisual();

if (!modelVis1 || !modelVis2 || modelVis1 == modelVis2) {
if (not modelVis1 || not modelVis2 || modelVis1 == modelVis2) {
std::cerr << "Incorrect selection (missing model or models identical)" << std::endl;
return;
}
Expand Down
6 changes: 3 additions & 3 deletions cpp/tol/plugin/RobotController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,18 +157,18 @@ void RobotController::LoadBrain(sdf::ElementPtr sdf)
for (const auto &sensor : sensors_)
sensor_n += sensor->inputs();

if (!sdf->HasElement("rv:brain")) {
if (not sdf->HasElement("rv:brain")) {
std::cerr << "No robot brain detected, this is probably an error." << std::endl;
return;
}
auto brain = sdf->GetElement("rv:brain");

if (!brain->HasAttribute("algorithm")) {
if (not brain->HasAttribute("algorithm")) {
std::cerr << "Brain does not define type, this is probably an error." << std::endl;
return;
}

if (!brain->HasAttribute("algorithm")) {
if (not brain->HasAttribute("algorithm")) {
std::cerr << "Brain does not define type, this is probably an error." << std::endl;
return;
}
Expand Down
14 changes: 8 additions & 6 deletions cpp/tol/plugin/brain/BodyParser.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "BodyParser.h"

namespace rg = revolve::gazebo;

namespace tol
{

Expand Down Expand Up @@ -156,8 +158,8 @@ namespace tol
}

std::pair<std::map<int, size_t>, std::map<int, size_t>>
BodyParser::InputOutputMap(const std::vector<revolve::gazebo::MotorPtr> &actuators,
const std::vector<revolve::gazebo::SensorPtr> &sensors)
BodyParser::InputOutputMap(const std::vector<rg::MotorPtr> &actuators,
const std::vector<rg::SensorPtr> &sensors)
{
size_t p = 0;
std::map<int, size_t> output_map;
Expand All @@ -171,7 +173,7 @@ namespace tol
auto motor = *it;
auto partId = motor->partId();

if (!outputCountMap.count(partId))
if (not outputCountMap.count(partId))
{
outputCountMap[partId] = 0;
}
Expand Down Expand Up @@ -213,7 +215,7 @@ namespace tol
auto sensor = *it;
auto partId = sensor->partId();

if (!inputCountMap.count(partId))
if (not inputCountMap.count(partId))
{
inputCountMap[partId] = 0;
}
Expand Down Expand Up @@ -344,7 +346,7 @@ namespace tol
}

std::vector<std::pair<int, int> >
BodyParser::get_coordinates_sorted(const std::vector<revolve::gazebo::MotorPtr> &actuators)
BodyParser::get_coordinates_sorted(const std::vector<rg::MotorPtr> &actuators)
{
std::vector<std::pair<int, int>> ret;

Expand All @@ -356,7 +358,7 @@ namespace tol
auto motor = *it;
auto partId = motor->partId();

if (!outputCountMap.count(partId))
if (not outputCountMap.count(partId))
{
outputCountMap[partId] = 0;
}
Expand Down

0 comments on commit 2ef1359

Please sign in to comment.