[Rock-dev] Operations yield linker error

Levin Gerdes gerdeslevin at gmail.com
Mon Mar 20 14:44:55 CET 2017


Dear Rock users,


I hope some of you can help me get the operations feature working. My aim
is to set a camera attribute in one task A from a different task B using
the provided operation "bool setAttrib(camera::int_attrib::CamAttrib, int)"
in camera base (drivers/orogen/camera_base/camera_base.orogen).
In my attempt to achieve this, I include OperationCaller in B, get the
TaskContext of A, and try to instantiate an OperationCaller:

Task.cpp:

    TaskContext* a_task = getPeer("ATask");
    OperatonCaller<bool(camera::int_attrib::CamAttrib, int)> mySetAttrib =
a_task->getOperation("setAttrib");

However, this already yields a linker error

    [100%] Building CXX object
CMakeFiles/orogen_default_shutter_controller__Task.dir/.orogen/main-orogen_default_shutter_controller__Task.cpp.o
    Linking CXX executable orogen_default_shutter_controller__Task
    tasks/libshutter_controller-task-gnulinux.so: undefined reference to
`RTT::internal::ValueDataSource<camera::int_attrib::CamAttrib>::ValueDataSource()'
    collect2: error: ld returned exit status

while it finishes building when I replace the enum
camera::int_attrib::CamAttrib by double for example.

Is there maybe just an include missing or is the Orocos OperationCaller
template not allowing Rock's Enums (although they are present in
camera_interface/CamTypes.h and the operations are declared in the
camera_base.orogen)?


Best regards,

Levin


P.S.:

The shutter_controller.orogen looks as follows:

    name "shutter_controller"

    import_types_from "shutter_controllerTypes.hpp"
    import_types_from "base"

    using_task_library "camera_firewire"
    using_task_library "camera_base"
    using_library "shutter_controller"
    using_library "camera_interface"
    import_types_from "shutter_controller/Config.hpp"
    import_types_from "camera_interface/CamTypes.h"

    task_context "Task" do
        needs_configuration
        ...
        input_port("frame", ro_ptr('base::samples::frame::Frame'))
        port_driven "frame"
    end

Task.hpp:

    #include "shutter_controller/TaskBase.hpp"
    #include <rtt/OperationCaller.hpp>          // to call operations
    #include "camera_firewire/CameraTask.hpp"   // for CamAttrib
    ...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.dfki.de/pipermail/rock-dev/attachments/20170320/d336fcf7/attachment.htm 


More information about the Rock-dev mailing list