User Tools

Site Tools


getting_started:tutorials:firstproject

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
getting_started:tutorials:firstproject [2015/08/10 11:08] visentingetting_started:tutorials:firstproject [2016/10/07 14:02] gehrig
Line 1: Line 1:
 ====== Your First EEROS Project ====== ====== Your First EEROS Project ======
-- First of all, make sure that you have set up your environment as described in [[..:install_and_setup_development_environment|Install and Setup Development Environment]].  
-- Then create a new project following the steps under "preparation" on [[..:getting_started:tutorials:helloworld|Getting Started]].  
  
 +  - First of all, make sure that you have set up your environment as described in [[..:install_and_setup_development_environment|Install and Setup Development Environment]]. 
 +  - Then create a new project following the steps under "preparation" on [[getting_started:tutorials:helloworld|Getting Started]].
 +  - The following example shows a typical EEROS application.  
 +  - After creating all those files, modify the CMakeLists.txt and CMAkeCache.txt files accoring to [[getting_started:tutorials:helloworld|Getting Started]], "Say Hello World with EEROS", point 2 and 3. 
  
-http://wiki.eeros.org/getting_started/tutorials/helloworld+<code c> 
 +#include <iostream> 
 +#include <unistd.h>
  
 +#include <eeros/logger/Logger.hpp>
 +#include <eeros/logger/StreamLogWriter.hpp>
 +
 +#include "MySequencer.hpp"
 +#include "MySafetyProperties.hpp"
 +#include "MyControlSystem.hpp"
 +
 +
 +using namespace eeros;
 +using namespace eeros::hal;
 +using namespace eeros::control;
 +using namespace eeros::safety;
 +using namespace eeros::logger;
 +using namespace eeros::sequencer;
 +using namespace testproject;
  
  
-The following example shows a typical EEROS application.   
-<code c> 
 int main() { int main() {
   std::cout << "SCARA Robot Control started" << std::endl;   std::cout << "SCARA Robot Control started" << std::endl;
Line 34: Line 51:
   sequencer.start(&mainSequence);   sequencer.start(&mainSequence);
      
-  while(sequencer.getState() != state::terminated) { +//  while(sequencer.getState() != state::terminated) { 
-      usleep(10000); +//      usleep(10000); 
-  }+//  }
      
-  controlSystem.stop(); +  sequencer.join(); 
-  safetySystem.shutdown(); +   
-  sequencer.shutdown();+//  controlSystem.stop(); 
 +//  safetySystem.shutdown(); 
 +//  sequencer.shutdown();
      
   std::cout << "SCARA Robot Control stopped" << std::endl;   std::cout << "SCARA Robot Control stopped" << std::endl;
Line 107: Line 126:
     // Run Blocks     // Run Blocks
     // e.g. timedomain.addBlock(&constant);     // e.g. timedomain.addBlock(&constant);
-} 
- 
-void MyControlSystem::start() { 
-    timedomain.start(); 
-} 
- 
-void MyControlSystem::stop() { 
-    timedomain.stop(); 
-    timedomain.join();   
 } }
 </code> </code>