- Development
- European Robotics Forum 2011 Workshop on the Orocos Toolchain
- European Robotics Forum 2012: workshops
- Geometric relations semantics
- KDL wiki
- Kuka LBR user group
- Links of Orocos components
- OCL v1.x wiki
- RTT v1.x wiki
- Documentation suggestions
- Examples and Tutorials
- Frequently asked questions (FAQ)
- Installation
- RTT Dictionary
- RTT on MS Windows
- The 1st RTT Developers Workshop
- The Road to RTT 2.0
- Goals for RTT 2.0
- Contribute! Which weakness have you detected in RTT?
- Contribute! Suggest a new feature to be included in RTT 2.0.
- Create Reference Application Architectures
- Detailed Roadmap
- Full distribution support
- RTT 2.0.0-beta1
- RTT 2.0.0-beta2
- RTT and OCL Cleanup
- Real time logging
- Redesign of the data flow interface
- Simplified, more robust default activities
- Streamlined Execution Flow API
- Upgrading from RTT 1.x to 2.0
- Using Eclipse and Orocos
- Using Git and Orocos
- Toolchain v2.x
- Wiki for site admins
- iTaSC wiki
New Message API
This use case shows how one can use messages in the new API. The unchanged method is added for comparison. Note that I have also added the provides() and requires() mechanism such that the RTT 1.0 construction:
method = this->getPeer("PeerX")->getMethod<int(double)>("Method");
is no longer required. The connection is made similar as data flow ports are connected.
/** * Provider */ class TaskA : public TaskContext { Message<void(double)> message; Method<int(double)> method; void mesg(double arg1) { return; } int meth(double arg1) { return 0; } public: TaskA(std::string name) : TaskContext(name), message("Message",&TaskA::mesg, this), method("Method",&TaskA::meth, this) { this->provides()->addMessage(&message, "The Message", "arg1", "Argument 1"); this->provides()->addMethod(&method, "The Method", "arg1", "Argument 1"); // OR: this->provides("FooInterface")->addMessage(&message, "The Message", "arg1", "Argument 1"); this->provides("FooInterface")->addMethod(&method, "The Method", "arg1", "Argument 1"); } }; class TaskB : public TaskContext { Message<void(double)> message; Method<int(double)> method; public: TaskB(std::string name) : TaskContext(name), message("Message"), method("Method") { this->requires()->addMessage( &message ); this->requires()->addMethod( &method ); // OR: this->requires("FooInterface")->addMessage( &message ); this->requires("FooInterface")->addMethod( &method ); } bool configureHook() { // setup is done during deployment. return message.ready() && method.ready(); } void updateHook() { // calls TaskA: method( 4.0 ); // sends two messages: message( 1.0 ); message( 2.0 ); } }; int ORO_main( int, char** ) { // Create your tasks TaskA ta("Provider"); TaskB tb("Subscriber"); connectPeers(ta, tb); // connects interfaces. connectInterfaces(ta, tb); return 0; }
»
- Printer-friendly version
- Login or register to post comments