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