00001 00002 #include "deployment/DeploymentComponent.hpp" 00003 #include "taskbrowser/TaskBrowser.hpp" 00004 #include <rtt/InputPort.hpp> 00005 #include <rtt/os/main.h> 00006 #include <rtt/RTT.hpp> 00007 #include <vector> 00008 00009 using namespace Orocos; 00010 00011 class MyTask 00012 : public RTT::TaskContext 00013 { 00014 public: 00015 Property<std::vector<double> > limits; 00016 InputPort<double> p1; 00017 OutputPort<double> p2; 00018 OutputPort<double> p3; 00019 Attribute<double> a; 00020 00021 MyTask(std::string n) 00022 : RTT::TaskContext(n), 00023 limits("limits","desc", std::vector<double>(2) ), 00024 p1("p1"), 00025 p2("p2"), 00026 p3("p3"), 00027 a("a") 00028 { 00029 this->properties()->addProperty( limits); 00030 this->ports()->addPort( p1 ); 00031 this->ports()->addPort( p2 ); 00032 this->ports()->addPort( p3 ); 00033 this->addAttribute( a ); 00034 limits.set()[0] = 10; 00035 limits.set()[1] = 20; 00036 } 00037 }; 00038 00039 int ORO_main(int, char**) 00040 { 00041 MyTask t1("ComponentA"); 00042 MyTask t2("ComponentB"); 00043 00044 { 00045 DeploymentComponent dc; 00046 dc.addPeer( &t1 ); 00047 dc.addPeer( &t2 ); 00048 dc.kickStart("deployment.cpf"); 00049 TaskBrowser tb(&dc); 00050 00051 tb.loop(); 00052 } 00053 return 0; 00054 }