Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ target/
# PyCharm project files
.idea

#kdev files
*.kdev4

# Virtual env
.venv

Expand Down
3 changes: 3 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ file(GLOB_RECURSE
tol/plugin/fakebrain.cpp
tol/plugin/helper.cpp
tol/plugin/rlpower.cpp
tol/plugin/simple_split_brain.cpp
tol/plugin/extended_neural_network.cpp
tol/plugin/rlpowered_network.cpp
)

add_library(tolworldcontrol SHARED ${TOL_WORLD_SRC})
Expand Down
11 changes: 8 additions & 3 deletions cpp/tol/plugin/RobotController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

#include "RobotController.h"
#include "rlpower.h"
#include "simple_split_brain.h"
#include "extended_neural_network.h"
#include "rlpowered_network.h"

#include <iostream>

Expand All @@ -17,7 +20,7 @@ RobotController::RobotController() {}
RobotController::~RobotController() {}

void RobotController::Load(::gazebo::physics::ModelPtr _parent, sdf::ElementPtr _sdf) {
::revolve::gazebo::RobotController::Load(_parent, _sdf);
::revolve::gazebo::RobotController::Load(_parent, _sdf);
std::cout << "ToL Robot loaded." << std::endl;
}

Expand All @@ -35,9 +38,11 @@ void RobotController::LoadBrain(sdf::ElementPtr sdf)
std::cerr << "Brain does not define type, this is probably an error." << std::endl;
return;
}

if (brain->GetAttribute("algorithm")->GetAsString() == "rlpower") {
brain_.reset(new tol::RLPower(this->model->GetName(), brain, evaluator_, motors_, sensors_));
// brain_.reset(new tol::RLPower(this->model->GetName(), brain,evaluator_, motors_, sensors_));
brain_.reset(new tol::RLPowerNet(this->model->GetName(), brain,evaluator_, motors_, sensors_));
// brain_. reset(new tol::ExtNN(this->model->GetName(), evaluator_, brain, motors_, sensors_));
// brain_.reset(new tol::ExtendedNeuralNetwork(this->model->GetName(), evaluator_, brain, motors_, sensors_));
} else {
std::cout << "Calling default ANN brain." << std::endl;
revolve::gazebo::RobotController::LoadBrain(sdf);
Expand Down
2 changes: 2 additions & 0 deletions cpp/tol/plugin/RobotController.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#include "rlpower.h"
#include "evaluator.h"

#include <boost/make_shared.hpp>

namespace tol {

class RobotController: public revolve::gazebo::RobotController {
Expand Down
Loading