orocos-toolchain / orogen

Code generator for components and type handling in Rock - the Robot Construction Kit - and the Orocos Toolchain
http://rock-robotics.org
Other
4 stars 35 forks source link

Problem with base/samples/frame/Frame in orogen #100

Closed dmronga closed 7 years ago

dmronga commented 7 years ago

Hi,

on master, whenever I add the above mentioned data type as an output port in an orogen component, I get the following build error:

/home/dfki.uni-bremen.de/dmronga/rock_hybrit/drivers/orogen/test/.orogen/tasks/TaskBase.cpp: In member function 'void test::TaskBase::setupComponentInterface()': /home/dfki.uni-bremen.de/dmronga/rock_hybrit/drivers/orogen/test/.orogen/tasks/TaskBase.cpp:51:27: error: 'ReadOnlyPointer' is not a member of 'RTT::extras' /home/dfki.uni-bremen.de/dmronga/rock_hybrit/drivers/orogen/test/.orogen/tasks/TaskBase.cpp:51:89: error: expected primary-expression before '>' token

The problem seems to be related to c37f00cba84fd7c6388ad1ea1f21755278624e4b, because with the preceding commit the orogen component compiles.

Best, Dennis

doudou commented 7 years ago

Hi Dennis.

You've unfortunately caught this while I was in vacations. I'm checking it out right now.

doudou commented 7 years ago

A plain rock-core install works just fine.

I've added a build test for this: https://github.com/rock-core/build_tests-orogen-ro_ptr. Could you check if this package builds on your machine ? If not, it seems that there's something different about your setup.

dmronga commented 7 years ago

Thanks, the package builds fine. And yeah there is one thing different in my setup: I am not using ro_ptr() around the type. Without it, the build of the package also fails. Is the ro_ptr() statement mandatory for base/samples/frame/Frame?

doudou commented 7 years ago

Is the ro_ptr() statement mandatory for base/samples/frame/Frame?

In principle, yes. Using the type name directly should work if you're importing a typekit that already defines it (common when using e.g. cameras). Otherwise, ro_ptr does the heavy lifting of setting up the smart pointer support during code generation.

What bothers me is that I don't really understand why the code generates at all. And how the commit you've pointed out broke it. I'll check that.

doudou commented 7 years ago

Is https://github.com/rock-core/build_tests-orogen-ro_ptr_import closer to what you were doing ?

This builds fine here as well :(

dmronga commented 7 years ago

That last test package also builds fine on my machine

doudou commented 7 years ago

... damn

Could you put the orogen file that causes problems here ? Maybe I could narrow it down to something reproducible.

dmronga commented 7 years ago

openni2_camera.orogen.zip

doudou commented 7 years ago

The orogen file does not use ReadOnlyPointer ... did you change anything ?

dmronga commented 7 years ago

No, but maybe we talked a bit past each other. I was never using ro_ptr(), but only base/samples/frame/Frame and it always worked for me. Since the commit I pointed to, it stopped compiling, which is why I opened this issue. However, changing everything to ro_ptr() does the trick.

doudou commented 7 years ago

... Now I get the confusion (and why the commit may have caused your troubles) ...

My fault. I assumed you were using ro_ptr because it's the best way to transmit images in the first place and the compilation error mentioned ReadOnlyPointer.

doudou commented 7 years ago

Fixed. Thanks for your patience !