[ros-sig-robot-control] orocos-toolchain load state machine from c++ interface

Hi Carlos,

it seems like you did not link to the RTT scripting plugin, which is
required to use the scripting API in C++.

CMake example:

find_package(OROCOS-RTT REQUIRED COMPONENTS* rtt-scripting*)
include(${OROCOS-RTT_USE_FILE_PATH}/UseOROCOS-RTT.cmake)

orocos_component(component ...)
target_link_libraries(component *${OROCOS-RTT_RTT-SCRIPTING_LIBRARY}*)

For more details, see
http://www.orocos.org/wiki/orocos/toolchain/getting-started/cmake-and-bu...
.

Cheers,
Johannes

On Thu, Feb 25, 2016 at 12:40 AM, Carlos Perche <
carlosfelipeperche [..] ...> wrote:

> Hello guys,
>
> I'm trying to load a state machine for my component at startHook
> (orocos-toolchain 2.8),
>
> but without success,
>
> this is what I'm doing,
>
> startHook()....
>
> bool TaskSupervisor::startHook() {
> RTT::log(Info) << "TaskVilma executes startHook !" << RTT::endlog();
>
> scripting::StateMachinePtr p;
> shared_ptr<Scripting> scripting = getProvider<Scripting>("scripting");
> ...
>
> but this throws
>
> CMakeFiles/vilma_supervisor.dir/src/supervisor.cpp.o: In function
> `VILMA::TaskSupervisor::startHook()':
> supervisor.cpp:(.text+0x12c6): undefined reference to `typeinfo for
> RTT::Scripting'
> CMakeFiles/vilma_supervisor.dir/src/supervisor.cpp.o: In function
> `boost::detail::sp_if_not_array<RTT::Scripting>::type
> boost::make_shared<RTT::Scripting, RTT::TaskContext*>(RTT::TaskContext*
> const&)':
> supervisor.cpp:(.text._ZN5boost11make_sharedIN3RTT9ScriptingEPNS1_11TaskContextEEENS_6detail15sp_if_not_arrayIT_E4typeERKT0_[_ZN5boost11make_sharedIN3RTT9ScriptingEPNS1_11TaskContextEEENS_6detail15sp_if_not_arrayIT_E4typeERKT0_]+0x62):
> undefined reference to `RTT::Scripting::Scripting(RTT::TaskContext*)'
> collect2: error: ld returned 1 exit status
> make[2]: ***
> [/home/vilma/vilma_ws/devel/lib/orocos/xenomai/vilma_supervisor/libvilma_supervisor-xenomai.so]
> Error 1
> make[1]: ***
> [vilma-vis/vilma_supervisor/CMakeFiles/vilma_supervisor.dir/all] Error 2
> make: *** [all] Error 2
> Invoking "make -j8 -l8" failed
>
> Anyone can help me ?
>
> thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "ROS/Orocos Robot Control Special Interest Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ros-sig-robot-control+unsubscribe [..] ....
> For more options, visit https://groups.google.com/d/optout.
>

[ros-sig-robot-control] orocos-toolchain load state machine from

Yes, that was it.

thanks

On Thursday, February 25, 2016 at 7:29:47 AM UTC-3, Johannes Meyer wrote:
>
> Hi Carlos,
>
> it seems like you did not link to the RTT scripting plugin, which is
> required to use the scripting API in C++.
>
> CMake example:
>
> find_package(OROCOS-RTT REQUIRED COMPONENTS* rtt-scripting*)
> include(${OROCOS-RTT_USE_FILE_PATH}/UseOROCOS-RTT.cmake)
>
> orocos_component(component ...)
> target_link_libraries(component *${OROCOS-RTT_RTT-SCRIPTING_LIBRARY}*)
>
> For more details, see
> http://www.orocos.org/wiki/orocos/toolchain/getting-started/cmake-and-bu...
> .
>
> Cheers,
> Johannes
>
>
> On Thu, Feb 25, 2016 at 12:40 AM, Carlos Perche <carlosfel [dot] [dot] [dot] [..] ...
> <javascript:>> wrote:
>
>> Hello guys,
>>
>> I'm trying to load a state machine for my component at startHook
>> (orocos-toolchain 2.8),
>>
>> but without success,
>>
>> this is what I'm doing,
>>
>> startHook()....
>>
>> bool TaskSupervisor::startHook() {
>> RTT::log(Info) << "TaskVilma executes startHook !" << RTT::endlog();
>>
>> scripting::StateMachinePtr p;
>> shared_ptr<Scripting> scripting = getProvider<Scripting>("scripting");
>> ...
>>
>> but this throws
>>
>> CMakeFiles/vilma_supervisor.dir/src/supervisor.cpp.o: In function
>> `VILMA::TaskSupervisor::startHook()':
>> supervisor.cpp:(.text+0x12c6): undefined reference to `typeinfo for
>> RTT::Scripting'
>> CMakeFiles/vilma_supervisor.dir/src/supervisor.cpp.o: In function
>> `boost::detail::sp_if_not_array<RTT::Scripting>::type
>> boost::make_shared<RTT::Scripting, RTT::TaskContext*>(RTT::TaskContext*
>> const&)':
>> supervisor.cpp:(.text._ZN5boost11make_sharedIN3RTT9ScriptingEPNS1_11TaskContextEEENS_6detail15sp_if_not_arrayIT_E4typeERKT0_[_ZN5boost11make_sharedIN3RTT9ScriptingEPNS1_11TaskContextEEENS_6detail15sp_if_not_arrayIT_E4typeERKT0_]+0x62):
>> undefined reference to `RTT::Scripting::Scripting(RTT::TaskContext*)'
>> collect2: error: ld returned 1 exit status
>> make[2]: ***
>> [/home/vilma/vilma_ws/devel/lib/orocos/xenomai/vilma_supervisor/libvilma_supervisor-xenomai.so]
>> Error 1
>> make[1]: ***
>> [vilma-vis/vilma_supervisor/CMakeFiles/vilma_supervisor.dir/all] Error 2
>> make: *** [all] Error 2
>> Invoking "make -j8 -l8" failed
>>
>> Anyone can help me ?
>>
>> thanks
>>