Unable to compile custom typekit (TransportPlugin) with Corba transports

Hi,

I have followed the typekit guide "Extending the Real-Time Toolkit with
your own Data Types" available on your website, and successfully made a
typekit that works within one deployer. However I want to make my types
available to other deployers by using CORBA. I have followed the guide
at
http://www.orocos.org/wiki/rtt/simple-examples/developing-plugins-and-to...,
but the build sections seems outdated. I cannot find the file
UseCorba.cmake anywhere in the orocos toolchain. Therefore I cannot use
the CMake macro ORO_ADD_CORBA_SERVERS, and I cannot test if my code works.

I tried using the CMake macro orocos_typekit, but it did not process the
.idl file to make C header files.

Anyone know how to compile a transport plugin?

Kim

Unable to compile custom typekit (TransportPlugin) with Corba tr

Hi Kim,

On Fri, Sep 28, 2012 at 11:20 AM, Kim Mathiassen <kimmat [..] ...> wrote:
> Hi,
>
> I have followed the typekit guide "Extending the Real-Time Toolkit with
> your own Data Types" available on your website, and successfully made a
> typekit that works within one deployer.

So this one: http://www.orocos.org/stable/documentation/rtt/v2.x/doc-xml/orocos-typek...

and you used typegen I assume ?

> However I want to make my types
> available to other deployers by using CORBA. I have followed the guide
> at
> http://www.orocos.org/wiki/rtt/simple-examples/developing-plugins-and-to...,
> but the build sections seems outdated. I cannot find the file
> UseCorba.cmake anywhere in the orocos toolchain. Therefore I cannot use
> the CMake macro ORO_ADD_CORBA_SERVERS, and I cannot test if my code works.
>
> I tried using the CMake macro orocos_typekit, but it did not process the
> .idl file to make C header files.
>
> Anyone know how to compile a transport plugin?

By using typegen as well:

usage: typegen [--transports=NAME1,NAME2] [--output=output_dir]
[--import=LIBRARY,TYPEKIT] name inputs
this installation of typegen knows the following transports: corba,
mqueue, typelib
-i, --import=LIBRARY a library or typekit to get
headers and/or types from, using its pkg-config name
-n, --notransports=NAME1,NAME2 list of transports to disable (by
default, corba, typelib, mqueue are enabled)
-t, --transports=NAME1,NAME2 list of transports to enable only
(by default, corba, typelib, mqueue are enabled)
-o, --output=DIR the directory to which the
generated typekit should be written
-v, --verbose
-d, --debug
--help

So, the corba transport should have been prepared for you by default.
Make sure that you source 'env.sh' such that all paths are set
correctly for typegen to work properly.

Cheers,
Peter

Unable to compile custom typekit (TransportPlugin) with Corba tr

Hi,

Thank you for the reply. I am not using typegen, and I see I was not
very clear about this in the previous mail. I need to make a class that
transports images of variable sizes. Therefore I have a pointer to the
memory of the image data and allocate memory using malloc. Using this
approach typegen fails.

My question is then how to compile a TransportPlugin without using typegen?

Kim

On 09/28/2012 11:27 PM, Peter Soetens wrote:
> Hi Kim,
>
> On Fri, Sep 28, 2012 at 11:20 AM, Kim Mathiassen <kimmat [..] ...> wrote:
>> Hi,
>>
>> I have followed the typekit guide "Extending the Real-Time Toolkit with
>> your own Data Types" available on your website, and successfully made a
>> typekit that works within one deployer.
> So this one: http://www.orocos.org/stable/documentation/rtt/v2.x/doc-xml/orocos-typek...
>
> and you used typegen I assume ?
>
>> However I want to make my types
>> available to other deployers by using CORBA. I have followed the guide
>> at
>> http://www.orocos.org/wiki/rtt/simple-examples/developing-plugins-and-to...,
>> but the build sections seems outdated. I cannot find the file
>> UseCorba.cmake anywhere in the orocos toolchain. Therefore I cannot use
>> the CMake macro ORO_ADD_CORBA_SERVERS, and I cannot test if my code works.
>>
>> I tried using the CMake macro orocos_typekit, but it did not process the
>> .idl file to make C header files.
>>
>> Anyone know how to compile a transport plugin?
> By using typegen as well:
>
> usage: typegen [--transports=NAME1,NAME2] [--output=output_dir]
> [--import=LIBRARY,TYPEKIT] name inputs
> this installation of typegen knows the following transports: corba,
> mqueue, typelib
> -i, --import=LIBRARY a library or typekit to get
> headers and/or types from, using its pkg-config name
> -n, --notransports=NAME1,NAME2 list of transports to disable (by
> default, corba, typelib, mqueue are enabled)
> -t, --transports=NAME1,NAME2 list of transports to enable only
> (by default, corba, typelib, mqueue are enabled)
> -o, --output=DIR the directory to which the
> generated typekit should be written
> -v, --verbose
> -d, --debug
> --help
>
> So, the corba transport should have been prepared for you by default.
> Make sure that you source 'env.sh' such that all paths are set
> correctly for typegen to work properly.
>
> Cheers,
> Peter

Unable to compile custom typekit (TransportPlugin) with Corba tr

Hi,

I found a solution that works, but it has some drawbacks. First I add
the following bellow
include(${OROCOS-RTT_USE_FILE_PATH}/UseOROCOS-RTT.cmake):


# You may use cmake -DENABLE_COBRA=TRUE as well
set(ENABLE_CORBA TRUE)

# This path should be found automaitcally, but I don't know how to do this.
set(CMAKE_MODULE_PATH /opt/ros/electric/stacks/orocos_toolchain/ocl/config)
find_package(Corba REQUIRED)
include(/opt/ros/electric/stacks/orocos_toolchain/ocl/config/FindCorba.cmake)

# Just to see that CORBA is found
message(STATUS "CORBA: ${CORBA_FOUND}")
<\code>

The further down I add the following to compile the transport plugin:


# The C++ source, header and the IDL file
set(ISUR_TRANSPORT_CPP src/transports/IsurTransportPlugin.cpp)
set(ISUR_TRANSPORT_HPP src/transports/IsurTransportPlugin.hpp)
set(ISUR_TRANSPORT_IDL src/transports/IsurTypes.idl)

# I don't want to have the generated files in the root directory,
# but this solution puts some other files that should be in the root
# directory in the typekit directory (i.e. cmake_uninstall.cmake
ProjectName-gnulinux.pc)
set(CMAKE_CURRENT_BINARY_DIR "typekit")

# This generates the CORBA code
ORO_ADD_CORBA_SERVERS(ISUR_TRANSPORT_CPP ISUR_TRANSPORT_HPP
${ISUR_TRANSPORT_IDL})

# Just for seeing which files are generated
message(STATUS "IsurTransport idl-file: ${ISUR_TRANSPORT_IDL}")
message(STATUS "IsurTransport headers: ${ISUR_TRANSPORT_HPP}")
message(STATUS "IsurTransport sources: ${ISUR_TRANSPORT_CPP}")

# Compiling the plugin
orocos_typekit(IsurTransport ${ISUR_TRANSPORT_HPP} ${ISUR_TRANSPORT_CPP} )
<\code>

Do anyone have a solution on how to find the FindCorba.cmake file
automatically? Or how to make the generated files in another directory
without also including cmake_uninstall.cmake and ProjectName-gnulinux.pc?

Kim

On 10/01/2012 09:25 AM, Kim Mathiassen wrote:
> Hi,
>
> Thank you for the reply. I am not using typegen, and I see I was not
> very clear about this in the previous mail. I need to make a class that
> transports images of variable sizes. Therefore I have a pointer to the
> memory of the image data and allocate memory using malloc. Using this
> approach typegen fails.
>
> My question is then how to compile a TransportPlugin without using typegen?
>
> Kim
>
> On 09/28/2012 11:27 PM, Peter Soetens wrote:
>> Hi Kim,
>>
>> On Fri, Sep 28, 2012 at 11:20 AM, Kim Mathiassen <kimmat [..] ...> wrote:
>>> Hi,
>>>
>>> I have followed the typekit guide "Extending the Real-Time Toolkit with
>>> your own Data Types" available on your website, and successfully made a
>>> typekit that works within one deployer.
>> So this one: http://www.orocos.org/stable/documentation/rtt/v2.x/doc-xml/orocos-typekit-plugin.html
>>
>> and you used typegen I assume ?
>>
>>> However I want to make my types
>>> available to other deployers by using CORBA. I have followed the guide
>>> at
>>> http://www.orocos.org/wiki/rtt/simple-examples/developing-plugins-and-toolkits/part-3-transport-plugin,
>>> but the build sections seems outdated. I cannot find the file
>>> UseCorba.cmake anywhere in the orocos toolchain. Therefore I cannot use
>>> the CMake macro ORO_ADD_CORBA_SERVERS, and I cannot test if my code works.
>>>
>>> I tried using the CMake macro orocos_typekit, but it did not process the
>>> .idl file to make C header files.
>>>
>>> Anyone know how to compile a transport plugin?
>> By using typegen as well:
>>
>> usage: typegen [--transports=NAME1,NAME2] [--output=output_dir]
>> [--import=LIBRARY,TYPEKIT] name inputs
>> this installation of typegen knows the following transports: corba,
>> mqueue, typelib
>> -i, --import=LIBRARY a library or typekit to get
>> headers and/or types from, using its pkg-config name
>> -n, --notransports=NAME1,NAME2 list of transports to disable (by
>> default, corba, typelib, mqueue are enabled)
>> -t, --transports=NAME1,NAME2 list of transports to enable only
>> (by default, corba, typelib, mqueue are enabled)
>> -o, --output=DIR the directory to which the
>> generated typekit should be written
>> -v, --verbose
>> -d, --debug
>> --help
>>
>> So, the corba transport should have been prepared for you by default.
>> Make sure that you source 'env.sh' such that all paths are set
>> correctly for typegen to work properly.
>>
>> Cheers,
>> Peter

Unable to compile custom typekit (TransportPlugin) with Corba tr

Hi Kim,

On Mon, Oct 1, 2012 at 4:23 PM, Kim Mathiassen <kimmat [..] ...> wrote:
> Hi,
>
> I found a solution that works, but it has some drawbacks. First I add
> the following bellow
> include(${OROCOS-RTT_USE_FILE_PATH}/UseOROCOS-RTT.cmake):
>
>

> # You may use cmake -DENABLE_COBRA=TRUE as well
> set(ENABLE_CORBA TRUE)
>
> # This path should be found automaitcally, but I don't know how to do this.
> set(CMAKE_MODULE_PATH /opt/ros/electric/stacks/orocos_toolchain/ocl/config)
> find_package(Corba REQUIRED)
> include(/opt/ros/electric/stacks/orocos_toolchain/ocl/config/FindCorba.cmake)
 
We typically copy this file into our project's cmake directory. A ROS
package can export a cmake module path by adding an element to its
manifest.xml. Check out other ROS examples.
 
>
> # Just to see that CORBA is found
> message(STATUS "CORBA: ${CORBA_FOUND}")
> <\code>
>
> The further down I add the following to compile the transport plugin:
>
> <code>
> # The C++ source, header and the IDL file
> set(ISUR_TRANSPORT_CPP src/transports/IsurTransportPlugin.cpp)
> set(ISUR_TRANSPORT_HPP src/transports/IsurTransportPlugin.hpp)
> set(ISUR_TRANSPORT_IDL src/transports/IsurTypes.idl)
>
> # I don't want to have the generated files in the root directory,
> # but this solution puts some other files that should be in the root
> # directory in the typekit directory (i.e. cmake_uninstall.cmake
> ProjectName-gnulinux.pc)
> set(CMAKE_CURRENT_BINARY_DIR "typekit")
>
> # This generates the CORBA code
> ORO_ADD_CORBA_SERVERS(ISUR_TRANSPORT_CPP ISUR_TRANSPORT_HPP
> ${ISUR_TRANSPORT_IDL})
>
> # Just for seeing which files are generated
> message(STATUS "IsurTransport idl-file: ${ISUR_TRANSPORT_IDL}")
> message(STATUS "IsurTransport headers:  ${ISUR_TRANSPORT_HPP}")
> message(STATUS "IsurTransport sources:  ${ISUR_TRANSPORT_CPP}")
>
> # Compiling the plugin
> orocos_typekit(IsurTransport ${ISUR_TRANSPORT_HPP} ${ISUR_TRANSPORT_CPP} )
> <\code>
>
> Do anyone have a solution on how to find the FindCorba.cmake file
> automatically? Or how to make the generated files in another directory
> without also including cmake_uninstall.cmake and ProjectName-gnulinux.pc?
>
For your last question. This is so because the cmake macro was written
so, it's hard-coded.
You could use the cmake file copy/move commands instead to put them to
where you want them.
 
There are many examples of this, for example in this thread:
http://www.cmake.org/pipermail/cmake/2007-August/015724.html
 
Peter