Contents 1.1 Overview 1.2 Orocos Toolchain 1.3 Demonstration OROCOS application 1.4 Configuration 1.5 WrmOS build options 1.6 Building for WrmOS 1.7 Building for localhost (GNU Linux)
1.1 Overview [up]
w4orocos looks like usual WrmOS application. Project consist from 2 main parts:
- lib/orocos — Orocos Toolchain with additional supporting of WrmOS and SPARC;
- app/orocos — demonstration OROCOS application.
w4orocos is a WrmOS project — it run on top of WrmOS. But also w4orocos allows build and run OROCOS application for local host (GNU Linux). For this feature root Makefile has additional rules. These rules have prefix localhost-.
See Building for localhost (GNU Linux) for details.
1.2 Orocos Toolchain [up]
Orocos Toolchain located in lib/orocos. This directory contains only one file:
While building w4orocos download Orocos Toolchain sources and build it as static library.
Orocos toolchain has CMake based build system. Also OROCOS use for building another utilities and packages — catkin, ruby and other. The simplest way to install all utilities and packages is installing of ROS. Unfortunately ROS:
- is very big and require a lot of disk space;
- my be unfit for installing on OS different from Ubuntu.
If ROS installation is unsuitable way, you can install all OROCOS dependencies manually.
During OROCOS building the following steps are taken:
- Clone orocos_toolchain super-repository from github;
- Clone sub-repositories — log4cpp, ocl, orogen, rtt, rtt_typelib, typelib, utilrb;
- Clone fork of RTT with supported WrmOS and SPARC and override original RTT;
- Build all components: as static library for WrmOS target, and as static and dynamic libraries for GNU Linux target;
1.3 Demonstration OROCOS application [up]
Demonstration application located in app/orocos. This directory contains the following files:
|WrmOS application makefile.
|Directory with OROCOS application.
|OROCOS application build script.
|OROCOS application components header file.
|OROCOS application components source file.
|OROCOS application entry point source for executable application.
|OROCOS application entry point script to run application by deployer.
What the application does
Demonstration application create 4 components (controller, servo, encoder, shaft) and communicate each other via different OROCOS API. This activities emulate work of real robot and demonstrate OROCOS capabilities.
For WrmOS demo-application may be built only as executable file. WrmOS runs it on target board and starts to execute main() function from main.cpp.
For GNU Linux demo-application may be built as static executable and as shared library. Shared library allows run OROCOS components dynamically by deployer application. Script file start.ops contains the same actions as main.cpp, but script language.
During demo-application building the following steps are taken:
- Build components.cpp.
- For static executable: build main.cpp and link executable file.
- For shared library: link shared library with components.
1.4 Configuration [up]
WrmOS part of configuration
w4orocos looks like usual WrmOS application. Therefore its configuration is usual configuration of WrmOS project.
Project parameters include:
- target system parameters (CPU, memory, base system devices, system clock frequency, ...);
- libraries build parameters (debug flags);
- kernel build parameters (debug flags, UART, timer, MMU);
- application build parameters (debug flags);
- applications list;
- Alpha run-time configuration.
OROCOS part of configuration
OROCOS configuration parameters is specifying in lib/orocos/Makefile.
See the orocos.org for detail.
1.5 WrmOS build options [up]
Build options are command line or shell environment variables. Generally build starts by such command:
make build P=cfg/prj/orocos-qemu-leon3.prj W=../wrmos B=../build/orocos-qemu-leon3 -j V=1
Build system supports the next options:
|can be build, clean or rebuild (clean & build)
|specifies project file
|specifies build directory, all build files will be here
|specifies original WrmOS source directory
|verbose flag, may be 0 or 1, allows hide detail of building (V=0, by default) or print it (V=1)
|make parameter, allows to do parallel building and make it faster
1.6 Building for WrmOS [up]
w4orocos is external WrmOS project. It can be build from both 1) the original WrmOS source directory and 2) the w4orocos project directory.
From WrmOS source directory building starts by command:
cd wrmos make build P=../w4orocos/cfg/prj/orocos-qemu-leon3.prj B=../build/orocos-qemu-leon3 E=../w4orocos -j
From w4orocos project directory building starts by command:
cd w4orocos make build P=cfg/prj/orocos-qemu-leon3.prj W=../wrmos B=../build/orocos-qemu-leon3 -j
It is assumed that directories wrmos and w4orocos are near.
Intermediate build files (generated headers, objects, ELFs) will be in build directory that was specified. The main building result is bootloader executable file:
or bootloader disk image:
This file may be loaded on target board or run on QEMU virtual machine:
qemu-system-sparc -M leon3_generic -display none -serial stdio \ -kernel ../build/orocos-qemu-leon3/ldr/bootloader.elf
1.7 Building for localhost (GNU Linux) [up]
w4orocos may be build for local host machine with GNU Linux. For this feature root Makefile contains additional rules:
|Build and run OROCOS and demo-application as static executable and as shared library by deployer. OROCOS library will contains the full set of components.
|Build and run OROCOS and demo-application as static executable. OROCOS library will contains the minimal set of components.
|Clean OROCOS library and demo-application.
|Clean OROCOS library and demo-application and remove downloaded sources.
|Download sources from external repositories.
|Build OROCOS and demo-application as static executable and as shared library by deployer. OROCOS library will contains the full set of components.
|Build OROCOS and demo-application as static executable. OROCOS library will contains the minimal set of components.
|Build OROCOS as static and as shared library. OROCOS library will contains the full set of components.
|Build OROCOS as static library. OROCOS library will contains the minimal set of components.
|Clean OROCOS library.
|Run deployer and execute script start.ops.
|Run static linked executable.
For example, to build and run OROCOS and demo-application as static executable and after that run demo-components by deployer use this command:
make localhost-full B=../build/orocos.loc -j
See additional information in the article Running w4orocos.