New Orocos RTT tutorial

The past year, we've been giving Orocos training on several occasions. The
first exercises were based on a 'hello world' component and the training
finished with a complete 'build your own controller' exercise. I have made
these exercises self-documenting and now they are here for you, free to use
for teaching or learning.
I consider them to be in the public domain, but any improvements or additions
are welcome.

Peter

AttachmentSize
rtt-exercises-1.6.0.tar.gz50.05 KB
README943 bytes

Including file error

Dear Peter,

   I installed the Orocos Toolchain following the bootstrap instructions (without ROS) on my laptop (Ubuntu system) 
in the "/usr/local/" folder. I also installed Eclipse IDE for C/C++ Linux Developers in the same directory. I added all the directories where the inclusion files are in the Eclipse projects' Path. I successfully imported the rtt-exercises' projects into the workspace but I can't build any of them because of errors related to the include commands. Any help will be appreciated. Thanks!

Andrea

Including file error

On Tue, Mar 15, 2011 at 7:21 PM, <andrea [dot] menegolo [..] ...> wrote:
> Dear Peter,
>   I installed the Orocos Toolchain following the bootstrap instructions (without ROS) on my laptop (Ubuntu system)
> in the "/usr/local/" folder. I also installed Eclipse IDE for C/C++ Linux Developers in the same directory.
> I added all the directories where the inclusion files are in the Eclipse projects' Path.
> I successfully imported the rtt-exercises' projects into the workspace but I can't build any of them because
> of errors related to the include commands.
> Any help will be appreciated.

You're using an older version of the exercises, meant for the RTT 1.x.
You should get the version 2.3.0 from this page :
http://www.orocos.org/wiki/orocos/toolchain/getting-started/toolchain-tu...

Be sure to source env.sh before building these exercises (or before
starting eclipse), such that cmake can find the installation path of
the RTT when you run make.

Peter
--
Orocos-Users mailing list
Orocos-Users [..] ...
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users

Unresolved inclusion and make error

Hi Peter,

       thanks for your fast and precise reply.
I got the 2.3.0 exercises version and I newly sourced the env.sh file as you suggested but I still get unresolved inclusion errors and when I try to build the project a message similar to this appears:

        • Build of configuration Default for project rtt-exercises ****

make all make: *** No rule to create «all» objective. Stopped.

Andrea

Unresolved inclusion and make error

On Wednesday 16 March 2011 18:43:52 andrea [dot] menegolo [..] ... wrote:
> Hi Peter,
> thanks for your fast and precise reply.
> I got the 2.3.0 exercises version and I newly sourced the env.sh file as
> you suggested but I still get unresolved inclusion errors and when I try
> to build the project a message similar to this appears:
>
> **** Build of configuration Default for project rtt-exercises ****
>
> make all
> make: *** No rule to create «all» objective. Stopped.

You need to import every hello-x subdir as a new project. What you did was
creating one top-level project for all subdirs. Remove the .project and
.cproject files in the rtt-exercises directory and re-import the hello-x dirs
as projects. Then build such a project.

Peter
--
Orocos-Users mailing list
Orocos-Users [..] ...
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users

CMake Configuration

Hi Peter,

    thanks for your patience.
I did what you suggested and now the inclusion files are correctly detected. Anyway, when I try to build the any single project the following error appears:


        • Build of configuration Linux GCC for project hello-1-task-execution ****

make all mkdir -p build cd build ; cmake .. -DINSTALL_PATH=orocos && make Makefile:7: This Makefile builds this package with default settings CMake Error at CMakeLists.txt:33 (find_package):

  Could not find module FindOrocos-RTT.cmake or a configuration file for
  package Orocos-RTT.

  Adjust CMAKE_MODULE_PATH to find FindOrocos-RTT.cmake or set Orocos-RTT_DIR
-- Configuring incomplete, errors occurred!
  to the directory containing a CMake configuration file for Orocos-RTT.  The
  file will have one of the following names:

    Orocos-RTTConfig.cmake
    orocos-rtt-config.cmake
CMake Error at CMakeLists.txt:37 (include):
  include could not find load file:

    /UseOROCOS-RTT.cmake
CMake Error at CMakeLists.txt:40 (orocos_executable):
  Unknown CMake command "orocos_executable".
make: *** [all] Errore 1

I'm not very familiar with the linux environment so I probably skipped the CMake configuration but I am not able to fix it. Can you tell me exactly what to type and where to type it in? I have newly installed the toolchain and eclipse and so my folders are:

/home/andrew/orocos-toolchain-2.3.1

/home/andrew/rtt-exercises-2.3.0

/home/andrew/eclipse

Thanks a lot for your help!

Andrea

CMake Configuration

On Thursday 31 March 2011 12:44:41 andrea [dot] menegolo [..] ... wrote:
> Hi Peter,
> thanks for your patience.
> I did what you suggested and now the inclusion files are correctly
> detected. Anyway, when I try to build the any single project the following
> error appears:
>
> ---------------------------------------------------------------------------
> -- **** Build of configuration Linux GCC for project hello-1-task-execution
> ****
>
> make all
> mkdir -p build
> cd build ; cmake .. -DINSTALL_PATH=orocos && make
> Makefile:7: This Makefile builds this package with default settings
> CMake Error at CMakeLists.txt:33 (find_package):
> Could not find module FindOrocos-RTT.cmake or a configuration file for
> package Orocos-RTT.
>
> Adjust CMAKE_MODULE_PATH to find FindOrocos-RTT.cmake or set
> Orocos-RTT_DIR -- Configuring incomplete, errors occurred!
> to the directory containing a CMake configuration file for Orocos-RTT.
> The file will have one of the following names:
>
> Orocos-RTTConfig.cmake
> orocos-rtt-config.cmake
>
>
>
> CMake Error at CMakeLists.txt:37 (include):
> include could not find load file:
>
> /UseOROCOS-RTT.cmake
>
>
> CMake Error at CMakeLists.txt:40 (orocos_executable):
> Unknown CMake command "orocos_executable".
>
>
> make: *** [all] Errore 1
> ---------------------------------------------------------------------------
> --
>
> I'm not very familiar with the linux environment so I probably skipped the
> CMake configuration but I am not able to fix it. Can you tell me exactly
> what to type and where to type it in? I have newly installed the toolchain
> and eclipse and so my folders are:
>
> /home/andrew/orocos-toolchain-2.3.1
>
> /home/andrew/rtt-exercises-2.3.0
>
> /home/andrew/eclipse
>
> Thanks a lot for your help!

You get this error because the Orocos installation is not found. Did you
source env.sh ? It is also required to source this file before you start
eclipse.

Ie:

&#10;source /home/andrew/orocos-toolchain-2.3.1/env.sh&#10;./eclipse&#10;

No cmake specific configuration is needed. Just run 'make', or the Build button
in eclipse.

Peter

CMake Configuration

On Thursday 31 March 2011 14:32:32 Andrea Menegolo wrote:
> Thanks Peter,
> I was wrong thinking I had to source the env file only once.
> The build process now starts correctly but it stops with this message:
>
> ---------------------------------------------------------------------------
> -- **** Build of configuration Linux GCC for project hello-1-task-execution
> ****
>
> make all
> Makefile:7: This Makefile builds this package with default settings
> mkdir -p build
> cd build ; cmake .. -DINSTALL_PATH=orocos && make
> Detected OROCOS_TARGET environment variable. Using: gnulinux
> Orocos-RTT found in
> /home/andrew/orocos-toolchain-2.3.1/install/lib/cmake/orocos-rtt/orocos-rt
> t-gnulinux-libraries.cmake -- Found orocos-rtt for the gnulinux target.
> Available transports: corba mqueue [UseOrocos] Building package
> hello-1-task-execution
> -- checking for one of the modules 'ocl;ocl-gnulinux'

He should have said here:
-- found ocl-gnulinux, version 2.3.1

Does /home/andrew/orocos-toolchain-2.3.1/install/lib/pkgconfig contain a file
ocl-gnulinux.pc ?

What if you do 'autoproj build ocl' ? And then try again to make the exercise.

The bootstrap should have built OCL, but maybe Sylvan disabled that ?

Peter

CMake Configuration

On Thursday 31 March 2011 16:27:05 Andrea Menegolo wrote:
> The /home/andrew/orocos-toolchain-2.3.1/install/lib/pkgconfig folder
> CONTAINS the ocl-gnulinux.pc
>
> The command 'autoproj build ocl' produces the following output:
> ------------------------------------------------------------------------
> andrea@PcBOB:~/orocos-toolchain-2.3.1$ autoproj build ocl
> Which prepackaged software (a.k.a. 'osdeps') should autoproj install
> automatically (all, ruby, os, none) ? all Access method to gitorious (git,
> http or ssh): git
> autoproj: loading ...
> run 'autoproj reconfigure' to change configuration options
> and use 'autoproj switch-config' to change the remote source for
> autoproj's main build configuration
> the target operating system for Orocos/RTT (gnulinux or xenomai):
> gnulinux which CORBA implementation should the RTT use ? omniorb
>
> autoproj: importing and loading selected packages
> autoproj: building and installing packages
>
> checking for undefined symbols in installed libraries
> WARN: /home/andrew/orocos-toolchain-2.3.1/install/lib/liblog4cpp.so has
> undefined symbols
>
> autodetected the shell to be bash, sourcing autoproj shell helpers
> add "Autoproj.shell_helpers = false" in autoproj/init.rb to disable
> autoproj: updated /home/andrew/orocos-toolchain-2.3.1/env.sh
> Build finished successfully at Thu Mar 31 15:31:26 +0200 2011
> --------------------------------------------------------------------------
>
> When I try to re-build the project in Ecplise an error similar to the
> previous one appears but it does not contain the '-- checking for one of
> the modules 'ocl;ocl-gnulinux' row anymore, as you can see in the
> following:

...

Rebuilding causes the cached searches not to be done anymore, so I think this
is why it's no longer printed. To really compare, you always need to remove
the build/CMakeCache.txt file and re-run make.

I can't reproduce what you're having. I either have these two lines together:
-- checking for one of the modules 'ocl;ocl-gnulinux'
-- found ocl-gnulinux, version 2.3.1

on the initial run of cmake, or not at all on each next run.

could you post the output of:
cd build
make VERBOSE=1
?

I'm probably onto something, but I need to see how the linker is called on
your system.

Peter

> --------------------------------------------------------------------------
> **** Build of configuration Linux GCC for project hello-1-task-execution
> ****
>
> make all
> Makefile:7: This Makefile builds this package with default settings
> mkdir -p build
> cd build ; cmake .. -DINSTALL_PATH=orocos && make
> Orocos-RTT found in
> /home/andrew/orocos-toolchain-2.3.1/install/lib/cmake/orocos-rtt/orocos-rt
> t-gnulinux-libraries.cmake -- Found orocos-rtt for the gnulinux target.
> Available transports: corba mqueue [UseOrocos] Building package
> hello-1-task-execution
> [UseOrocos] Linking all targets with libraries from package 'ocl'.
> Building executable HelloWorld
> -- Configuring done
> -- Generating done
> -- Build files have been written to:
> /home/andrew/rtt-exercises-2.3.0/hello-1-task-execution/build make[1]:
> ingresso nella directory
> "/home/andrew/rtt-exercises-2.3.0/hello-1-task-execution/build" make[2]:
> ingresso nella directory
> "/home/andrew/rtt-exercises-2.3.0/hello-1-task-execution/build" make[3]:
> ingresso nella directory
> "/home/andrew/rtt-exercises-2.3.0/hello-1-task-execution/build" make[3]:
> uscita dalla directory
> "/home/andrew/rtt-exercises-2.3.0/hello-1-task-execution/build" make[3]:
> ingresso nella directory
> "/home/andrew/rtt-exercises-2.3.0/hello-1-task-execution/build" Linking
> CXX executable HelloWorld-gnulinux
> /usr/bin/ld: cannot find -lorocos-ocl-taskbrowser-gnulinux
> collect2: ld returned 1 exit status
> make[3]: uscita dalla directory
> "/home/andrew/rtt-exercises-2.3.0/hello-1-task-execution/build" make[3]:
> *** [HelloWorld-gnulinux] Errore 1
> make[2]: uscita dalla directory
> "/home/andrew/rtt-exercises-2.3.0/hello-1-task-execution/build" make[1]:
> uscita dalla directory
> "/home/andrew/rtt-exercises-2.3.0/hello-1-task-execution/build" make[2]:
> *** [CMakeFiles/HelloWorld.dir/all] Errore 2
> make[1]: *** [all] Errore 2
> make: *** [all] Errore 2
> --------------------------------------------------------------------------
>
>
>
>
>
>
>
>
>
>
>
>
>
> ----- Messaggio originale -----
> Da: "Peter Soetens" <peter [..] ...>
> A: "Andrea Menegolo" <andrea [dot] menegolo [..] ...>
> Cc: orocos-users [..] ..., "Sylvain Joyeux"
> <sylvain [dot] joyeux [..] ...> Inviato: Giovedì, 31 marzo 2011 15:16:41
> Oggetto: Re: [Orocos-users] CMake Configuration
>
> On Thursday 31 March 2011 14:32:32 Andrea Menegolo wrote:
> > Thanks Peter,
> >
> > I was wrong thinking I had to source the env file only once.
> >
> > The build process now starts correctly but it stops with this message:
> >
> > -------------------------------------------------------------------------
> > -- -- **** Build of configuration Linux GCC for project
> > hello-1-task-execution ****
> >
> > make all
> > Makefile:7: This Makefile builds this package with default settings
> > mkdir -p build
> > cd build ; cmake .. -DINSTALL_PATH=orocos && make
> > Detected OROCOS_TARGET environment variable. Using: gnulinux
> > Orocos-RTT found in
> > /home/andrew/orocos-toolchain-2.3.1/install/lib/cmake/orocos-rtt/orocos-r
> > t t-gnulinux-libraries.cmake -- Found orocos-rtt for the gnulinux
> > target. Available transports: corba mqueue [UseOrocos] Building package
> > hello-1-task-execution
> > -- checking for one of the modules 'ocl;ocl-gnulinux'
>
> He should have said here:
> -- found ocl-gnulinux, version 2.3.1
>
> Does /home/andrew/orocos-toolchain-2.3.1/install/lib/pkgconfig contain a
> file ocl-gnulinux.pc ?
>
> What if you do 'autoproj build ocl' ? And then try again to make the
> exercise.
>
> The bootstrap should have built OCL, but maybe Sylvan disabled that ?
>
> Peter
> Informativa sulla privacy: http://help.ing.unibs.it/privacy.php
--
Orocos-Users mailing list
Orocos-Users [..] ...
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users

New Orocos RTT tutorial

Hello,

i have played with the exercises hello-1 ( yeah, i am just
somewhere at the begining ) and i just saw one thing, that i couldn't recognize if it is my missundestanding or really a bug.

So, if i create in an slave activity on the stack and call start method like this:

int ORO_main(int argc, char** argv)
{
...
SlaveActivity slave();
slave.start();
...
}

then a got folowing compiler error:

g++ -g -o helloworld HelloWorld.cpp -I/usr/local/include -DOROCOS_TARGET=gnulinux -L/usr/local/lib -Wl,-rpath /usr/local/lib -lorocos-taskbrowser-gnulinux -lorocos-rtt-gnulinux
HelloWorld.cpp: In function ‘int ORO_main_impl(int, char**)’:
HelloWorld.cpp:127: error: request for member ‘start’ in ‘slave’, which is of non-class type ‘RTT::SlaveActivity ()()’

otherwise, if i create SlaveActivity object on the heap

SlaveActivity* slave = new SlaveActivity();
slave->start();

everythink goes well.

Hmmm, any ideas ?

Cheers,
vitali

New Orocos RTT tutorial

On Wednesday 10 December 2008 22:50:44 vitali [..] ... wrote:
> Hello,
>
> i have played with the exercises hello-1 ( yeah, i am just
> somewhere at the begining ) and i just saw one thing, that i couldn't
> recognize if it is my missundestanding or really a bug.
>
> So, if i create in an slave activity on the stack and call start method
> like this:
>
> int ORO_main(int argc, char** argv)
> {
> ...
> SlaveActivity slave();

This line should read:

SlaveActivity slave; // constructing on stack without arguments.

Then all will work fine.

Peter