text: Orocos Version 1.12 gives an introduction on the different aspects of interfacing an Orocos component. This is an excerpt from the Component Builder's Manual and walks through the 'Hello World' program.
  Table of Contents
  List of Figures
  Table of Contents
  This manual documents how multi-threaded components can be defined in Orocos such that they form a thread-safe robotics/machine control application. Each control component is defined as a "TaskContext", which defines the environment or "context" in which an application specific task is executed. The context is described by the five Orocos primitives: Event, Property, Command, Method and Data Port. This document defines how a user can write his own task context and how it can be used in an application.
  Figure 1.1. Components Run in Threads
  Components run in (periodic) threads and can communicate transparently. The Orocos RTT does a 'best effort' to deliver the highest performance to the highest priority threads.
  A component components can communicate with non real-time components (and vice verse) transparently.
  The Orocos Component Model enables :
  Lock free, thread-safe, inter-thread function calls.
  Communication between hard Real-Time and non Real-Time threads.
  Deterministic execution time during communication for the higher priority thread.
  Synchronous and asynchronous communication between threads.
  Interfaces for component distribution.
  C++ class implementations for all the above.
  This chapter relates to other chapters as such :
  provides the Command and Event infrastructure, activity to thread mapping, Properties and lock-free data exchange implementations.
  executes the commands, events, real-time programs and scripts in a component.
  provides a real-time scripting language which is convertible to a form which can be accepted by the Execution Engine.
  The Scripting chapter gives more details about script syntax for state machines and programs.
  Figure 1.2. Schematic Overview of a TaskContext
  The Execution Flow is formed by Programs and State Machines sending commands, events,... to Peer Tasks. The Data Flow is the propagation of data from one task to another, where one producer can have multiple consumers and vice verse.
  A component is included in the Orocos Component Library. It contains one TaskContext component, HelloWorld,. The TaskBrowser uses the GNU readline library to easily enter commands to the tasks in your system. This means you can press TAB to complete your commands or press the up arrow to scroll through previous commands.
  #include <ocl/TaskBrowser.hpp> #include <rtt/os/main.h> // ... using namespace Orocos; int ORO_main( int, char** ) { // Create your tasks TaskContext* task = ... // when all is setup : TaskBrowser tbrowser( task ); tbrowser.loop(); return 0; }
  Now let's start the helloworld application. If you downloaded OCL and compiled it from source, You can do this by entering the helloworld subdirectory of your OCL build directory and running ./helloworld
  In case you got OCL as a binary package, enter loadComponent("Hello","orocos-helloworld") at the prompt of the deployer application for your target: ORO_LOGLEVEL=5 deployer-gnulinux for example. This command loads the Orocos-HelloWorld component library and creates a component with name "Hello" (Requires OCL 1.4.1 or later). Finally, type cd Hello to start with the exercise. appeared. the_data_port and the_buffer_port objects are created to represent the data ports of the Hello component. They allow you to to send or receive data to these ports and check if they are connected.
  Last, the peers are shown, that is, the components which are known, and may be used,". This works just like calling a 'C' function.
  When a command is entered, it is sent to the Hello component, which will execute it in its own thread.
  Initially, these ports are unconnected, as the HelloWorld component did not connect its ports to another component. Unconnected ports can hardly be used. In order to test them, you can instruct the TaskBrowser to connect to them. This is done by entering the .connect command (note the '.').
  Since each port has an associated object, we can inspect the interface of a port. In this example, the TaskBrowser has the same ports as the component it visits: the_data_port and the_buffer_port. These were created when we issued the .connect previously. Otherwise, there would be no data ports.
  One can return to the 'inside' view again by typing user-application might need a more suitable interface. However, for testing and inspecting what is happening inside your real-time programs, it is a very useful tool. The next sections show how you can add properties, commands, methods etc to a TaskContext.