How to remove ROS dependency from an OROCOS package?

Does anyone know a good way to remove the ROS dependency from an
OROCOS component? For simple OROCOS components it is trivial to
generate a build script from scratch, but how about for something like
the soem/ebox driver:

http://git.mech.kuleuven.be/robotics/soem.git

Note, for components of this complexity I am not trying to replace
CMake; just the hard dependency on ROS meta-operating system's
unstable build system.

Also to the orocos devs, thank you VERY much for keeping the rtt and
ocl core of Orocos free of dependencies on ROS, and for not imposing
the use of a particular build system on the user. In particular I am
very happy that they can build in-source, install in the correct place
by default, and even provide .pc files so that you can use pkg-config.

Cheers,
Andrew

How to remove ROS dependency from an OROCOS package?

2012/11/30 Andrew Wagner <andrew [dot] wagner [..] ...>

> Does anyone know a good way to remove the ROS dependency from an
> OROCOS component? For simple OROCOS components it is trivial to
> generate a build script from scratch, but how about for something like
> the soem/ebox driver:
>
> http://git.mech.kuleuven.be/robotics/soem.git
>
>
Hi Andrew,

Orocos provides a set of CMake macros to build you component without ROS.

You can either have a look at the
install/lib/cmake/orocos-rtt/UseOROCOS-RTT.cmake file, or generating an
empty package to have a simple example with
orocreate-pkg myComponent

It will create a myComponent folder with a CMakeLists.txt containing the
most useful cmake macros for building Orocos components.

Charles.

> Note, for components of this complexity I am not trying to replace
> CMake; just the hard dependency on ROS meta-operating system's
> unstable build system.
>
> Also to the orocos devs, thank you VERY much for keeping the rtt and
> ocl core of Orocos free of dependencies on ROS, and for not imposing
> the use of a particular build system on the user. In particular I am
> very happy that they can build in-source, install in the correct place
> by default, and even provide .pc files so that you can use pkg-config.
>
> Cheers,
> Andrew
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>

How to remove ROS dependency from an OROCOS package?

I already know how to build orocos components with and without CMake,
with and without ROS. Perhaps a better question is:

What hacks can you thing of to take a component with complex ROS based
build scripts, and convert the scripts to something simpler (but
probably uglier) that doesn't depend on ROS?

I'm thinking of hacks like:

A. Try moving the ROS-related CMake scripts into the component
directory and try to manually fix the broken search paths...

B. Build the component once on a machine that ~does have ROS
installed, turn on CMAKE_VERBOSE_MAKEFILE, scrape out all of the
actual build commands, and perhaps do some automated substitutions to
reduce repetition.

C. Configure the component on a machine with ROS, use CMake's ninja
build system script export, and then just use the ninja files
henceforth...

I pretty know there is no good answer, short of re-engineering the
build scripts for said component from scratch, which is a time
investment I would like to avoid if possible.

Cheers,
Andrew

On Fri, Nov 30, 2012 at 2:48 PM, Charles Lesire-Cabaniols
<charles [dot] lesire [..] ...> wrote:
>
>
>
> 2012/11/30 Andrew Wagner <andrew [dot] wagner [..] ...>
>>
>> Does anyone know a good way to remove the ROS dependency from an
>> OROCOS component? For simple OROCOS components it is trivial to
>> generate a build script from scratch, but how about for something like
>> the soem/ebox driver:
>>
>> http://git.mech.kuleuven.be/robotics/soem.git
>>
>
> Hi Andrew,
>
> Orocos provides a set of CMake macros to build you component without ROS.
>
> You can either have a look at the
> install/lib/cmake/orocos-rtt/UseOROCOS-RTT.cmake file, or generating an
> empty package to have a simple example with
> orocreate-pkg myComponent
>
> It will create a myComponent folder with a CMakeLists.txt containing the
> most useful cmake macros for building Orocos components.
>
> Charles.
>
>>
>> Note, for components of this complexity I am not trying to replace
>> CMake; just the hard dependency on ROS meta-operating system's
>> unstable build system.
>>
>> Also to the orocos devs, thank you VERY much for keeping the rtt and
>> ocl core of Orocos free of dependencies on ROS, and for not imposing
>> the use of a particular build system on the user. In particular I am
>> very happy that they can build in-source, install in the correct place
>> by default, and even provide .pc files so that you can use pkg-config.
>>
>> Cheers,
>> Andrew
>> --
>> Orocos-Users mailing list
>> Orocos-Users [..] ...
>> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>
>
>
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>

How to remove ROS dependency from an OROCOS package?

On Fri, Nov 30, 2012 at 3:01 PM, Andrew Wagner
<andrew [dot] wagner [..] ...> wrote:
> I already know how to build orocos components with and without CMake,
> with and without ROS. Perhaps a better question is:
>
> What hacks can you thing of to take a component with complex ROS based
> build scripts, and convert the scripts to something simpler (but
> probably uglier) that doesn't depend on ROS?
>
> I'm thinking of hacks like:
>
> A. Try moving the ROS-related CMake scripts into the component
> directory and try to manually fix the broken search paths...
>
> B. Build the component once on a machine that ~does have ROS
> installed, turn on CMAKE_VERBOSE_MAKEFILE, scrape out all of the
> actual build commands, and perhaps do some automated substitutions to
> reduce repetition.
>
> C. Configure the component on a machine with ROS, use CMake's ninja
> build system script export, and then just use the ninja files
> henceforth...
>
> I pretty know there is no good answer, short of re-engineering the
> build scripts for said component from scratch, which is a time
> investment I would like to avoid if possible.

What I would recommend is to patch soem to use the 'IS_ROS_PACKAGE'
cmake variable, and to not generate the headers from .msg files, but
to do something else. This variable is defined by the UseOrocos.cmake
file. So :
if (IS_ROS_PACKAGE)
# use ros cmake macros
else()
# work around (use typegen + own C headers)
endif()

I'm also not a big fan of using .msg files in soem, since the structs
are quite simple and typekits could easily be generated by typegen.

I think such a patch would be quickly accepted and is little work.

Peter

How to remove ROS dependency from an OROCOS package?

On Fri, Nov 30, 2012 at 3:11 PM, Peter Soetens <peter [..] ...> wrote:

> What I would recommend is to patch soem to use the 'IS_ROS_PACKAGE'
> cmake variable, and to not generate the headers from .msg files, but
> to do something else. This variable is defined by the UseOrocos.cmake
> file. So :
> if (IS_ROS_PACKAGE)
> # use ros cmake macros
> else()
> # work around (use typegen + own C headers)
> endif()
>
> I'm also not a big fan of using .msg files in soem, since the structs
> are quite simple and typekits could easily be generated by typegen.
>
> I think such a patch would be quickly accepted and is little work.

Thanks for the feedback, Peter! I am embarrassed to say that nobody
in our lab has gotten typekits working yet; for over a year we have
been passing everything as vectors of double. I invested some time
trying to figure it out when I arrived in Leuven a year ago, but had
trouble (that I think was related to very old software versions) and
decided to fight other battles.

I'll go ahead and give patching soem the "right" way a shot. I need a
bit more direction to get started though; based on the build
dependencies in the <depend> tags in the manifests, I should try to
get the modules building in the following order:

1. soem_core
2. soem_master
3. or 4. soem_ebox
3. or 4. soem_beckhoff_drivers

Does this agree with what you probably already know about how the
package is built?

Cheers,
Andrew

How to remove ROS dependency from an OROCOS package?

Hello Peter,

On Fri, Nov 30, 2012 at 5:06 PM, Andrew Wagner
<andrew [dot] wagner [..] ...> wrote:
> On Fri, Nov 30, 2012 at 3:11 PM, Peter Soetens <peter [..] ...> wrote:
>
>> What I would recommend is to patch soem to use the 'IS_ROS_PACKAGE'
>> cmake variable, and to not generate the headers from .msg files, but
>> to do something else. This variable is defined by the UseOrocos.cmake
>> file. So :
>> if (IS_ROS_PACKAGE)
>> # use ros cmake macros
>> else()
>> # work around (use typegen + own C headers)
>> endif()
>>
>> I'm also not a big fan of using .msg files in soem, since the structs
>> are quite simple and typekits could easily be generated by typegen.
>>
>> I think such a patch would be quickly accepted and is little work.

I have managed to get soem_core and soem_master to build without ROS,
and am now stuck on getting soem_ebox to build without ROS.
Apparently I need to replace the .msg files with POD C header files
and then use typegen to generate methods for serialization, etc...
After grepping around in the various repositories, I figured out that
typegen is some ruby code in the orogen repository.

So, I just checked out the source for orogen, and it seems to at least
have some superficial dependency on ROS:

$ sudo make install
Makefile:8: This Makefile only works with ROS rosmake. Without
rosmake, create a build directory and run cmake ..
make: *** No rule to make target `install'. Stop.

... but there is no CMakeLists.txt. Shouldn't something as "core" as
the infrastructure for generating message types be able to build
without ROS?

I gather from the Makefile that I'm supposed to run something like "rake setup":

$ rake setup
cannot load the Hoe gem. Distribution is disabled
WARN: cannot load RDoc, documentation generation disabled
WARN: no such file to load -- rdoc/task
cannot load oroGen
did you install Typelib's Ruby bindings and update the RUBYLIB
environment variable accordingly ?
did you add /home/awagner/planepower/extern/orogen/lib to RUBYLIB ?
the error is: no such file to load -- typelib

I already installed typelib using CMake in the customary fashion.
Shouldn't the bindings be getting installed someplace that is already
in ruby's path?

Thanks,
Andrew

How to remove ROS dependency from an OROCOS package?

On Wed, Dec 12, 2012 at 4:16 AM, Andrew Wagner
<andrew [dot] wagner [..] ...> wrote:
> Hello Peter,
>
> On Fri, Nov 30, 2012 at 5:06 PM, Andrew Wagner
> <andrew [dot] wagner [..] ...> wrote:
>> On Fri, Nov 30, 2012 at 3:11 PM, Peter Soetens <peter [..] ...> wrote:
>>
>>> What I would recommend is to patch soem to use the 'IS_ROS_PACKAGE'
>>> cmake variable, and to not generate the headers from .msg files, but
>>> to do something else. This variable is defined by the UseOrocos.cmake
>>> file. So :
>>> if (IS_ROS_PACKAGE)
>>> # use ros cmake macros
>>> else()
>>> # work around (use typegen + own C headers)
>>> endif()
>>>
>>> I'm also not a big fan of using .msg files in soem, since the structs
>>> are quite simple and typekits could easily be generated by typegen.
>>>
>>> I think such a patch would be quickly accepted and is little work.
>
> I have managed to get soem_core and soem_master to build without ROS,
> and am now stuck on getting soem_ebox to build without ROS.
> Apparently I need to replace the .msg files with POD C header files
> and then use typegen to generate methods for serialization, etc...
> After grepping around in the various repositories, I figured out that
> typegen is some ruby code in the orogen repository.
>
> So, I just checked out the source for orogen, and it seems to at least
> have some superficial dependency on ROS:
>
> $ sudo make install
> Makefile:8: This Makefile only works with ROS rosmake. Without
> rosmake, create a build directory and run cmake ..
> make: *** No rule to make target `install'. Stop.
>
> ... but there is no CMakeLists.txt. Shouldn't something as "core" as
> the infrastructure for generating message types be able to build
> without ROS?
>
> I gather from the Makefile that I'm supposed to run something like "rake setup":
>
> $ rake setup
> cannot load the Hoe gem. Distribution is disabled
> WARN: cannot load RDoc, documentation generation disabled
> WARN: no such file to load -- rdoc/task
> cannot load oroGen
> did you install Typelib's Ruby bindings and update the RUBYLIB
> environment variable accordingly ?
> did you add /home/awagner/planepower/extern/orogen/lib to RUBYLIB ?
> the error is: no such file to load -- typelib
>
> I already installed typelib using CMake in the customary fashion.
> Shouldn't the bindings be getting installed someplace that is already
> in ruby's path?

Please use the bootstrap.sh + env.sh + autoproj to learn this
environment. You're working completely backwards (ie bottom-up).
Follow our quick start installation instructions, and when you get a
'good' orocos toolchain compiled and setup, you can use typegen out of
the box and see where you can go from there (after sourcing env.sh,
typegen will be in your PATH).

Peter

How to remove ROS dependency from an OROCOS package?

Hi Andrew

oroGen does not require ROS at all, rest assured of that ;-)

The package is a pure ruby library, and as such does not get installed.
You have to point RUBYLIB to orogen/lib and PATH to orogen/bin

Regards,

How to remove ROS dependency from an OROCOS package?

On Wed, Dec 12, 2012 at 10:53 AM, Sylvain Joyeux <sylvain [dot] joyeux [..] ...> wrote:
> Hi Andrew
>
> oroGen does not require ROS at all, rest assured of that ;-)
>
> The package is a pure ruby library, and as such does not get installed.
> You have to point RUBYLIB to orogen/lib and PATH to orogen/bin
>
> Regards,

So if I want to make orogen install cleanly without harassing the user
about environment variables, what files should I copy where? I'm on
ubuntu 12.04.

Right now our flight code and all of our dependencies is so painful to
set up on a new machine, that AFAIK, it is has never been done in this
history of our project. Before I arrived everyone was even using the
same user account to work on the flight code, and I suspect the lack
of proper system-wide installation of our dependencies was one of the
main reasons. (the unreliable build system was the other)

How to remove ROS dependency from an OROCOS package?

On 12/12/2012 11:46 AM, Andrew Wagner wrote:
> On Wed, Dec 12, 2012 at 10:53 AM, Sylvain Joyeux <sylvain [dot] joyeux [..] ...> wrote:
>> Hi Andrew
>>
>> oroGen does not require ROS at all, rest assured of that ;-)
>>
>> The package is a pure ruby library, and as such does not get installed.
>> You have to point RUBYLIB to orogen/lib and PATH to orogen/bin
>>
>> Regards,
>
> So if I want to make orogen install cleanly without harassing the user
> about environment variables, what files should I copy where? I'm on
> ubuntu 12.04.
"It depends"

Can you check if you have an rtt_typelib package built ? (if you have
rtt_typelib, the orogen package should have no rtt-typelib
subdirectory). If that is the case, you should copy bin/orogen and
bin/typegen to $PREFIX/bin and lib/orogen to $PREFIX/lib/ruby/vendor_ruby

If not, say so, I'll send an updated instruction list.

I will think about adding an install task to make it less painful (and
create more self-contained installation prefixes, something useful in
general)

How to remove ROS dependency from an OROCOS package?

Thanks Peter and Sylvain,

I am renewing my effort to build the soem component without ROS.

On Peter's recommendation, I have given up trying to build from the
git repos, and I have followed the linux quickstart "bootstrap.sh +
env.sh + autoproj" instructions for building orocos.

I have manually ported the .msg files to structs in C++ header files
with fields of the same names, and typegen is able to generate a
typekit that at least builds.

What is the recommended way of integrating the typekit autogeneration
step into the overall CMake build configuration? What is the
recommended directory structure?

As I work, I am pushing to:

https://github.com/drewm1980/soem
git [..] ...:drewm1980/soem.git

I must emphasize that I am probably not the right person for this
task, but I'm hacking at it anyway since we need to break our ROS
dependency so that we can use orocos compiled for xenomai. I worry
that my hacked up soem component is devolving into chaos a bit more
every time I touch it, and will never be suitable for mainline even if
I get it to work. If someone in town knows enough to get this working
quickly, I'd be happy to do a time exchange for a dance or harmonica
lesson.

Cheers,
Andrew

On Wed, Dec 12, 2012 at 11:58 AM, Sylvain Joyeux <sylvain [dot] joyeux [..] ...> wrote:
> On 12/12/2012 11:46 AM, Andrew Wagner wrote:
>> On Wed, Dec 12, 2012 at 10:53 AM, Sylvain Joyeux <sylvain [dot] joyeux [..] ...> wrote:
>>> Hi Andrew
>>>
>>> oroGen does not require ROS at all, rest assured of that ;-)
>>>
>>> The package is a pure ruby library, and as such does not get installed.
>>> You have to point RUBYLIB to orogen/lib and PATH to orogen/bin
>>>
>>> Regards,
>>
>> So if I want to make orogen install cleanly without harassing the user
>> about environment variables, what files should I copy where? I'm on
>> ubuntu 12.04.
> "It depends"
>
> Can you check if you have an rtt_typelib package built ? (if you have
> rtt_typelib, the orogen package should have no rtt-typelib
> subdirectory). If that is the case, you should copy bin/orogen and
> bin/typegen to $PREFIX/bin and lib/orogen to $PREFIX/lib/ruby/vendor_ruby
>
> If not, say so, I'll send an updated instruction list.
>
> I will think about adding an install task to make it less painful (and
> create more self-contained installation prefixes, something useful in
> general)
> --
> Sylvain Joyeux (Dr.Ing.)
> Space & Security Robotics
>
> !!! Achtung, neue Telefonnummer!!!
>
> Standort Bremen:
> DFKI GmbH
> Robotics Innovation Center
> Robert-Hooke-Straße 5
> 28359 Bremen, Germany
>
> Phone: +49 (0)421 178-454136
> Fax: +49 (0)421 218-454150
> E-Mail: robotik [..] ...
>
> Weitere Informationen: http://www.dfki.de/robotik
> -----------------------------------------------------------------------
> Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
> Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
> Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
> (Vorsitzender) Dr. Walter Olthoff
> Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
> Amtsgericht Kaiserslautern, HRB 2313
> Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
> USt-Id.Nr.: DE 148646973
> Steuernummer: 19/673/0060/3
> -----------------------------------------------------------------------
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users