- 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 Command API
Commands are no longer a part of the TaskContext API. They are helper classes which replicate the old RTT 1.0 behaviour. In order to setup commands more easily, it is allowed to register them as a 'requires()' interface.
This is all very experimental.
/** * Provider of a Message with command-like semantics */ class TaskA : public TaskContext { Message<void(double)> message; Method<bool(double)> message_is_done; Event<void(double)> done_event; void mesg(double arg1) { return; } bool is_done(double arg1) { return true; } public: TaskA(std::string name) : TaskContext(name), message("Message",&TaskA::mesg, this), message_is_done("MessageIsDone",&TaskA::is_done, this), done_event("DoneEvent") { this->provides()->addMessage(&message, "The Message", "arg1", "Argument 1"); this->provides()->addMethod(&method, "Is the Message done?", "arg1", "Argument 1"); this->provides()->addEvent(&done_event, "Emited when the Message is done.", "arg1", "Argument 1"); } }; class TaskB : public TaskContext { // RTT 1.0 style command object Command<bool(double)> command1; Command<bool(double)> command2; public: TaskB(std::string name) : TaskContext(name), command1("command1"), command2("command2") { // the commands are now created client side, you // can not add them to your 'provides' interface command1.useMessage("Message"); command1.useCondition("MessageIsDone"); command2.useMessage("Message"); command2.useEvent("DoneEvent"); // this allows automatic setup of the command. this->requires()->addCommand( &command1 ); this->requires()->addCommand( &command2 ); } bool configureHook() { // setup is done during deployment. return command1.ready() && command2.ready(); } void updateHook() { // calls TaskA: if ( command1.ready() && command2.ready() ) command1( 4.0 ); if ( command1.done() && command2.ready() ) command2( 1.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