Fixes for orogen/typegen

I have pushed some orogen/typegen fixes to the toolchain-2.0 branch.

Especially, the generated CMakeListst.txt file should now contain only relative
paths such that it can be used for 'bindings' generation in other
libraries. I also merged Steven's patches, which fixed other cmake related
issues. If you bootstrapped, an 'autoproj update' should get you all these
fixes.

Also note that typegen only generates correct CORBA transports for Omniorb,
since it relies on omniorb-generated classes in 'Convertions.hpp/cpp'. We'll
have to figure out what the equivalents are in TAO. Since TAO may require more
functions to be present than Omniorb, this won't be that easy... but we'll get
there.

Peter

Fixes for orogen/typegen

2010/9/23 Peter Soetens <peter [..] ...>:
> I have pushed some orogen/typegen fixes to the toolchain-2.0 branch.
>
> Especially, the generated CMakeListst.txt file should now contain only relative
> paths such that it can be used for 'bindings' generation in other
> libraries. I also merged Steven's patches, which fixed other cmake related
> issues. If you bootstrapped, an 'autoproj update' should get you all these
> fixes.

I've been able to use this version to succesfully create a typekit and
build it with ROS. I had to make some minor changes (see appendix):

- there is still one absolute path in the definition of the 'regen' command
- I added the rosbuild_init to handle dependencies of other libraries
(so I could comment out the line looking for typelib - which failed
anyway here)
- I adapted the search for RTT to use find_package instead of the
pkg_check_modules. The pkg_check_modules often fails to find RTT,
whereas the find_package always goes fine here. Do others have that
same experience? I've consequently renamed the RTT include dir macros
according to the rtt-config file.
- I addapted the dependency in the manifest and makefile to the new
name 'rtt' as in the orocos_toolchain_ros stack

Steven

>
> Also note that typegen only generates correct CORBA transports for Omniorb,
> since it relies on omniorb-generated classes in 'Convertions.hpp/cpp'. We'll
> have to figure out what the equivalents are in TAO. Since TAO may require more
> functions to be present than Omniorb, this won't be that easy... but we'll get
> there.
>
> Peter
>
> --
> Orocos-Dev mailing list
> Orocos-Dev [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-dev
>

Fixes for orogen/typegen

On Friday 24 September 2010 18:12:09 Steven Bellens wrote:
> 2010/9/23 Peter Soetens <peter [..] ...>:
> > I have pushed some orogen/typegen fixes to the toolchain-2.0 branch.
> >
> > Especially, the generated CMakeListst.txt file should now contain only
> > relative paths such that it can be used for 'bindings' generation in
> > other libraries. I also merged Steven's patches, which fixed other cmake
> > related issues. If you bootstrapped, an 'autoproj update' should get you
> > all these fixes.
>
> I've been able to use this version to succesfully create a typekit and
> build it with ROS. I had to make some minor changes (see appendix):
>
> - there is still one absolute path in the definition of the 'regen' command
> - I added the rosbuild_init to handle dependencies of other libraries
> (so I could comment out the line looking for typelib - which failed
> anyway here)
> - I adapted the search for RTT to use find_package instead of the
> pkg_check_modules. The pkg_check_modules often fails to find RTT,
> whereas the find_package always goes fine here. Do others have that
> same experience? I've consequently renamed the RTT include dir macros
> according to the rtt-config file.
> - I addapted the dependency in the manifest and makefile to the new
> name 'rtt' as in the orocos_toolchain_ros stack

Hi Steven,

I can accept the complete patch on these conditions:

--- a/lib/orogen/templates/typekit/CMakeLists.txt
+++ b/lib/orogen/templates/typekit/CMakeLists.txt
@@ -6,6 +6,9 @@
<% if typekit.standalone? %>
project("<%= typekit.name %>-typekit")
cmake_minimum_required(VERSION 2.6)
+include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
+rosbuild_init()
+set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib/orocos)

SET (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/config")

->guard these three lines with IF( $ENV{ROS_ROOT}) ... ENDIF( $ENV{ROS_ROOT})

--- a/lib/orogen/templates/typekit/typelib/CMakeLists.txt
+++ b/lib/orogen/templates/typekit/typelib/CMakeLists.txt
@@ -1,6 +1,6 @@
# Generated from orogen/lib/orogen/templates/typekit/typelib/CMakeLists.txt

-pkg_check_modules(TYPELIB REQUIRED typelib)
+#pkg_check_modules(TYPELIB REQUIRED typelib)

set(libname <%= typekit.name %>-transport-typelib-${OROCOS_TARGET})
add_library(${libname} SHARED

-> same here, guard with $ENV{ROS_ROOT}...

Could you resubmit that ?

Peter

Fixes for orogen/typegen

2010/9/27 Peter Soetens <peter [..] ...>:
> On Friday 24 September 2010 18:12:09 Steven Bellens wrote:
>> 2010/9/23 Peter Soetens <peter [..] ...>:
>> > I have pushed some orogen/typegen fixes to the toolchain-2.0 branch.
>> >
>> > Especially, the generated CMakeListst.txt file should now contain only
>> > relative paths such that it can be used for 'bindings' generation in
>> > other libraries. I also merged Steven's patches, which fixed other cmake
>> > related issues. If you bootstrapped, an 'autoproj update' should get you
>> > all these fixes.
>>
>> I've been able to use this version to succesfully create a typekit and
>> build it with ROS. I had to make some minor changes (see appendix):
>>
>> - there is still one absolute path in the definition of the 'regen' command
>> - I added the rosbuild_init to handle dependencies of other libraries
>> (so I could comment out the line looking for typelib - which failed
>> anyway here)
>> - I adapted the search for RTT to use find_package instead of the
>> pkg_check_modules. The pkg_check_modules often fails to find RTT,
>> whereas the find_package always goes fine here. Do others have that
>> same experience? I've consequently renamed the RTT include dir macros
>> according to the rtt-config file.
>> - I addapted the dependency in the manifest and makefile to the new
>> name 'rtt' as in the orocos_toolchain_ros stack
>
> Hi Steven,
>
> I can accept the complete patch on these conditions:
>
> --- a/lib/orogen/templates/typekit/CMakeLists.txt
> +++ b/lib/orogen/templates/typekit/CMakeLists.txt
> @@ -6,6 +6,9 @@
>  <% if typekit.standalone? %>
>  project("<%= typekit.name %>-typekit")
>  cmake_minimum_required(VERSION 2.6)
> +include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
> +rosbuild_init()
> +set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib/orocos)
>
>  SET (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/config")
>
>
> ->guard these three lines with IF( $ENV{ROS_ROOT}) ... ENDIF( $ENV{ROS_ROOT})
>
> --- a/lib/orogen/templates/typekit/typelib/CMakeLists.txt
> +++ b/lib/orogen/templates/typekit/typelib/CMakeLists.txt
> @@ -1,6 +1,6 @@
>  # Generated from orogen/lib/orogen/templates/typekit/typelib/CMakeLists.txt
>
> -pkg_check_modules(TYPELIB REQUIRED typelib)
> +#pkg_check_modules(TYPELIB REQUIRED typelib)
>
>  set(libname <%= typekit.name %>-transport-typelib-${OROCOS_TARGET})
>  add_library(${libname} SHARED
>
> -> same here, guard with $ENV{ROS_ROOT}...
>
> Could you resubmit that ?

The direct IF( $ENV{ROS_ROOT}) does not work, so I have replaced it with
SET (ROS_ROOT $ENV{ROS_ROOT})
IF( ROS_ROOT )

updated patch in appendix

Steven

>
> Peter
>

Fixes for orogen/typegen

On Monday 27 September 2010 12:01:41 Steven Bellens wrote:
> 2010/9/27 Peter Soetens <peter [..] ...>:
> > On Friday 24 September 2010 18:12:09 Steven Bellens wrote:
> >> 2010/9/23 Peter Soetens <peter [..] ...>:
> >> > I have pushed some orogen/typegen fixes to the toolchain-2.0 branch.
> >> >
> >> > Especially, the generated CMakeListst.txt file should now contain only
> >> > relative paths such that it can be used for 'bindings' generation in
> >> > other libraries. I also merged Steven's patches, which fixed other
> >> > cmake related issues. If you bootstrapped, an 'autoproj update'
> >> > should get you all these fixes.
> >>
> >> I've been able to use this version to succesfully create a typekit and
> >> build it with ROS. I had to make some minor changes (see appendix):
> >>
> >> - there is still one absolute path in the definition of the 'regen'
> >> command - I added the rosbuild_init to handle dependencies of other
> >> libraries (so I could comment out the line looking for typelib - which
> >> failed anyway here)
> >> - I adapted the search for RTT to use find_package instead of the
> >> pkg_check_modules. The pkg_check_modules often fails to find RTT,
> >> whereas the find_package always goes fine here. Do others have that
> >> same experience? I've consequently renamed the RTT include dir macros
> >> according to the rtt-config file.
> >> - I addapted the dependency in the manifest and makefile to the new
> >> name 'rtt' as in the orocos_toolchain_ros stack
> >
> > Hi Steven,
> >
> > I can accept the complete patch on these conditions:
> >
> > --- a/lib/orogen/templates/typekit/CMakeLists.txt
> > +++ b/lib/orogen/templates/typekit/CMakeLists.txt
> > @@ -6,6 +6,9 @@
> > <% if typekit.standalone? %>
> > project("<%= typekit.name %>-typekit")
> > cmake_minimum_required(VERSION 2.6)
> > +include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
> > +rosbuild_init()
> > +set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib/orocos)
> >
> > SET (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/config")
> >
> >
> > ->guard these three lines with IF( $ENV{ROS_ROOT}) ... ENDIF(
> > $ENV{ROS_ROOT})
> >
> > --- a/lib/orogen/templates/typekit/typelib/CMakeLists.txt
> > +++ b/lib/orogen/templates/typekit/typelib/CMakeLists.txt
> > @@ -1,6 +1,6 @@
> > # Generated from
> > orogen/lib/orogen/templates/typekit/typelib/CMakeLists.txt
> >
> > -pkg_check_modules(TYPELIB REQUIRED typelib)
> > +#pkg_check_modules(TYPELIB REQUIRED typelib)
> >
> > set(libname <%= typekit.name %>-transport-typelib-${OROCOS_TARGET})
> > add_library(${libname} SHARED
> >
> > -> same here, guard with $ENV{ROS_ROOT}...
> >
> > Could you resubmit that ?
>
> The direct IF( $ENV{ROS_ROOT}) does not work, so I have replaced it with
> SET (ROS_ROOT $ENV{ROS_ROOT})
> IF( ROS_ROOT )
>
> updated patch in appendix

Thanks a lot, I have applied it as-is. I'm removing the remaining absolute
paths right now and will push everything when it's ready.

Peter

Fixes for orogen/typegen

On Monday 27 September 2010 12:57:30 Peter Soetens wrote:
> On Monday 27 September 2010 12:01:41 Steven Bellens wrote:
> > 2010/9/27 Peter Soetens <peter [..] ...>:
> > > On Friday 24 September 2010 18:12:09 Steven Bellens wrote:
> > >> 2010/9/23 Peter Soetens <peter [..] ...>:
> > >> > I have pushed some orogen/typegen fixes to the toolchain-2.0 branch.
> > >> >
> > >> > Especially, the generated CMakeListst.txt file should now contain
> > >> > only relative paths such that it can be used for 'bindings'
> > >> > generation in other libraries. I also merged Steven's patches,
> > >> > which fixed other cmake related issues. If you bootstrapped, an
> > >> > 'autoproj update' should get you all these fixes.
> > >>
> > >> I've been able to use this version to succesfully create a typekit and
> > >> build it with ROS. I had to make some minor changes (see appendix):
> > >>
> > >> - there is still one absolute path in the definition of the 'regen'
> > >> command - I added the rosbuild_init to handle dependencies of other
> > >> libraries (so I could comment out the line looking for typelib - which
> > >> failed anyway here)
> > >> - I adapted the search for RTT to use find_package instead of the
> > >> pkg_check_modules. The pkg_check_modules often fails to find RTT,
> > >> whereas the find_package always goes fine here. Do others have that
> > >> same experience? I've consequently renamed the RTT include dir macros
> > >> according to the rtt-config file.
> > >> - I addapted the dependency in the manifest and makefile to the new
> > >> name 'rtt' as in the orocos_toolchain_ros stack
> > >
> > > Hi Steven,
> > >
> > > I can accept the complete patch on these conditions:
> > >
> > > --- a/lib/orogen/templates/typekit/CMakeLists.txt
> > > +++ b/lib/orogen/templates/typekit/CMakeLists.txt
> > > @@ -6,6 +6,9 @@
> > >
> > > <% if typekit.standalone? %>
> > > project("<%= typekit.name %>-typekit")
> > > cmake_minimum_required(VERSION 2.6)
> > >
> > > +include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
> > > +rosbuild_init()
> > > +set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib/orocos)
> > >
> > > SET (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/config")
> > >
> > > ->guard these three lines with IF( $ENV{ROS_ROOT}) ... ENDIF(
> > > $ENV{ROS_ROOT})
> > >
> > > --- a/lib/orogen/templates/typekit/typelib/CMakeLists.txt
> > > +++ b/lib/orogen/templates/typekit/typelib/CMakeLists.txt
> > > @@ -1,6 +1,6 @@
> > >
> > > # Generated from
> > >
> > > orogen/lib/orogen/templates/typekit/typelib/CMakeLists.txt
> > >
> > > -pkg_check_modules(TYPELIB REQUIRED typelib)
> > > +#pkg_check_modules(TYPELIB REQUIRED typelib)
> > >
> > > set(libname <%= typekit.name %>-transport-typelib-${OROCOS_TARGET})
> > > add_library(${libname} SHARED
> > >
> > > -> same here, guard with $ENV{ROS_ROOT}...
> > >
> > > Could you resubmit that ?
> >
> > The direct IF( $ENV{ROS_ROOT}) does not work, so I have replaced it with
> > SET (ROS_ROOT $ENV{ROS_ROOT})
> > IF( ROS_ROOT )
> >
> > updated patch in appendix
>
> Thanks a lot, I have applied it as-is. I'm removing the remaining absolute
> paths right now and will push everything when it's ready.

I have fixed & pushed this + all that I have in orocos-toolchain to gitorious
(toolchain-2.0 branch).

I still have one question. orogen depends in ros builds on typelib using the
manifest file. However, typelib itself does not have a top-level Makefile. How
do you build typelib then using rosbuild ?

Peter

Fixes for orogen/typegen

2010/9/27 Peter Soetens <peter [..] ...>:
> On Monday 27 September 2010 12:57:30 Peter Soetens wrote:
>> On Monday 27 September 2010 12:01:41 Steven Bellens wrote:
>> > 2010/9/27 Peter Soetens <peter [..] ...>:
>> > > On Friday 24 September 2010 18:12:09 Steven Bellens wrote:
>> > >> 2010/9/23 Peter Soetens <peter [..] ...>:
>> > >> > I have pushed some orogen/typegen fixes to the toolchain-2.0 branch.
>> > >> >
>> > >> > Especially, the generated CMakeListst.txt file should now contain
>> > >> > only relative paths such that it can be used for 'bindings'
>> > >> > generation in other libraries. I also merged Steven's patches,
>> > >> > which fixed other cmake related issues. If you bootstrapped, an
>> > >> > 'autoproj update' should get you all these fixes.
>> > >>
>> > >> I've been able to use this version to succesfully create a typekit and
>> > >> build it with ROS. I had to make some minor changes (see appendix):
>> > >>
>> > >> - there is still one absolute path in the definition of the 'regen'
>> > >> command - I added the rosbuild_init to handle dependencies of other
>> > >> libraries (so I could comment out the line looking for typelib - which
>> > >> failed anyway here)
>> > >> - I adapted the search for RTT to use find_package instead of the
>> > >> pkg_check_modules. The pkg_check_modules often fails to find RTT,
>> > >> whereas the find_package always goes fine here. Do others have that
>> > >> same experience? I've consequently renamed the RTT include dir macros
>> > >> according to the rtt-config file.
>> > >> - I addapted the dependency in the manifest and makefile to the new
>> > >> name 'rtt' as in the orocos_toolchain_ros stack
>> > >
>> > > Hi Steven,
>> > >
>> > > I can accept the complete patch on these conditions:
>> > >
>> > > --- a/lib/orogen/templates/typekit/CMakeLists.txt
>> > > +++ b/lib/orogen/templates/typekit/CMakeLists.txt
>> > > @@ -6,6 +6,9 @@
>> > >
>> > >  <% if typekit.standalone? %>
>> > >  project("<%= typekit.name %>-typekit")
>> > >  cmake_minimum_required(VERSION 2.6)
>> > >
>> > > +include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
>> > > +rosbuild_init()
>> > > +set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib/orocos)
>> > >
>> > >  SET (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/config")
>> > >
>> > > ->guard these three lines with IF( $ENV{ROS_ROOT}) ... ENDIF(
>> > > $ENV{ROS_ROOT})
>> > >
>> > > --- a/lib/orogen/templates/typekit/typelib/CMakeLists.txt
>> > > +++ b/lib/orogen/templates/typekit/typelib/CMakeLists.txt
>> > > @@ -1,6 +1,6 @@
>> > >
>> > >  # Generated from
>> > >
>> > > orogen/lib/orogen/templates/typekit/typelib/CMakeLists.txt
>> > >
>> > > -pkg_check_modules(TYPELIB REQUIRED typelib)
>> > > +#pkg_check_modules(TYPELIB REQUIRED typelib)
>> > >
>> > >  set(libname <%= typekit.name %>-transport-typelib-${OROCOS_TARGET})
>> > >  add_library(${libname} SHARED
>> > >
>> > > -> same here, guard with $ENV{ROS_ROOT}...
>> > >
>> > > Could you resubmit that ?
>> >
>> > The direct IF( $ENV{ROS_ROOT}) does not work, so I have replaced it with
>> > SET (ROS_ROOT $ENV{ROS_ROOT})
>> > IF( ROS_ROOT )
>> >
>> > updated patch in appendix
>>
>> Thanks a lot, I have applied it as-is. I'm removing the remaining absolute
>> paths right now and will push everything when it's ready.
>
> I have fixed & pushed this + all that I have in orocos-toolchain to gitorious
> (toolchain-2.0 branch).
>
> I still have one question. orogen depends in ros builds on typelib using the
> manifest file. However, typelib itself does not have a top-level Makefile. How
> do you build typelib then using rosbuild ?

We've packaged typelib in a ROS package, available at
https://svn.mech.kuleuven.be/websvn/orocos/trunk/kul-ros-pkg/stacks/oroc...
Ros starts from the Makefile contained in that package and calls the
cmake command in the subdirectories...

Steven

>
> Peter
>