Hormodular 1.0
Locomotion gait discovery by using digital hormones on modular robots
ModularRobot.h
00001 //------------------------------------------------------------------------------
00002 //-- ModularRobot
00003 //------------------------------------------------------------------------------
00004 //--
00005 //-- Modular robot for modular robotics
00006 //--
00007 //------------------------------------------------------------------------------
00008 //--
00009 //-- This file belongs to the Hormodular project
00010 //-- (https://github.com/David-Estevez/hormodular.git)
00011 //--
00012 //------------------------------------------------------------------------------
00013 //-- Author: David Estevez-Fernandez
00014 //--
00015 //-- Released under the GPL license (more info on LICENSE.txt file)
00016 //------------------------------------------------------------------------------
00017 
00024 #ifndef MODULAR_ROBOT_H
00025 #define MODULAR_ROBOT_H
00026 
00027 #include "ConfigParser.h"
00028 #include "Module.hpp"
00029 #include "ModularRobotInterface.hpp"
00030 #include "ModularRobotInterfaceFactory.hpp"
00031 
00032 namespace hormodular {
00033 
00043 class ModularRobot
00044 {
00045     public:
00053         ModularRobot(ConfigParser configParser, std::string robotInterfaceType="simulated");
00054         ~ModularRobot();
00055 
00056 
00057 
00063         bool run(unsigned long runTime);
00064 
00072         bool reset();
00073 
00074 
00075         bool setTimeStep(float step_ms);
00076         bool setProperty(std::string property, std::string value);
00077 
00078         float getTravelledDistance();
00079 
00080         static const int COMMUNICATION_PERIOD_MS = 100;
00081 
00082    private:
00091         bool attachModules();
00092 
00093         ConfigParser configParser;
00094         std::vector<Module *> modules;
00095         ModularRobotInterface * robotInterface;
00096 
00098         unsigned long elapsed_time;
00099 
00101         float step_ms;
00102 
00103         std::vector<float> joint_values;
00104 };
00105 }
00106 #endif //-- MODULAR_ROBOT_H
 All Classes Functions Variables Friends