Skip to content

Commit

Permalink
Throw an error if no brain is specified
Browse files Browse the repository at this point in the history
  • Loading branch information
Milan Jelisavcic committed Jan 15, 2019
1 parent 048524f commit 05471c4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cpprevolve/revolve/gazebo/plugin/RobotController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*
*/

#include <stdexcept>

#include <gazebo/sensors/sensors.hh>

#include <revolve/gazebo/motors/MotorFactory.h>
Expand Down Expand Up @@ -203,6 +205,10 @@ void RobotController::LoadBrain(const sdf::ElementPtr _sdf)
{
brain_.reset(new DifferentialCPG(this->model_, brain, motors_, sensors_));
}
else
{
throw std::runtime_error("Robot brain is not defined.");
}
}

/////////////////////////////////////////////////
Expand Down

0 comments on commit 05471c4

Please sign in to comment.