- 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 Event API
The idea of the new Event API is that: 1. only the owner of the event can emit the event (unless the event is also added as a Method or Message) 2. Only methods or message objects can subscribe to events.
/** * Provider of Event */ class TaskA : public TaskContext { Event<void(string)> event; public: TaskA(std::string name) : TaskContext(name), event("Event") { this->provides()->addEvent(&event, "The Event", "arg1", "Argument 1"); // OR: this->provides("FooInterface")->addEvent(&event, "The Event", "arg1", "Argument 1"); // If you want the user to let him emit the event: this->provides()->addMethod(&event, "Emit The Event", "arg1", "Argument 1"); } void updateHook() { event("hello world"); } }; /** * Subscribes a local Method and a Message to Event */ class TaskB : public TaskContext { Message<void(string)> message; Method<void(string)> method; // Message callback void mesg(double arg1) { return; } // Method callback int meth(double arg1) { return 0; } public: TaskB(std::string name) : TaskContext(name), message("Message",&TaskB::mesg, this), method("Method",&TaskB::meth, this) { // optional: // this->provides()->addMessage(&message, "The Message", "arg1", "Argument 1"); // this->provides()->addMethod(&method, "The Method", "arg1", "Argument 1"); // subscribe to event: this->requires()->addCallback("Event", &message); this->requires()->addCallback("Event", &method); // OR: // this->provides("FooInterface")->addMessage(&message, "The Message", "arg1", "Argument 1"); // this->provides("FooInterface")->addMethod(&method, "The Method", "arg1", "Argument 1"); // subscribe to event: this->requires("FooInterface")->addCallback("Event", &message); this->requires("FooInterface")->addCallback("Event", &method); } bool configureHook() { // setup is done during deployment. return message.ready() && method.ready(); } void updateHook() { // we only receive } }; 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