Hello,
just a quick Question about a Property:
1. The Property was defined as:
Property
2. initialized as :
motorI2CAddressesProperty( "MotorI2CAddresses",
"I2C addresses of rover motors",
std::vector
3. and added to the task as:
properties()->addProperty( &motorI2CAddressesProperty );
therefore, if i start the task in TaskBrowser i got following error:
0.001 [ ERROR ][TypeInfoName] Can not build Property of unknown_t.
ls
Configuration Properties:
string ControllerCommPort = /dev/ttyUSB0 (rover hardware controller communication port)
unknown_t MotorI2CAddresses = (unknown_t) (I2C addresses of rover motors)
int MotorPeakCurrent = 0 (Motor current while motion is performed)
int MotorHoldCurrent = 0 (Motor current for holding the motor before or after a motion)
the same error if i read the properties from a CPF file
440.034 [ Info ][main()] read property file
440.034 [ Info ][PropertyLoader:configure] Configuring TaskContext 'RoverController' with '/home/vitali/project/agent/rover/src/deployment/RoverController.cpf'.
440.035 [ ERROR ][TypeInfoName] Can not build Property of unknown_t.
440.035 [ ERROR ][TypeInfoName] Can not compose unknown_t.
440.035 [ ERROR ][refreshProperties] Could not update, nor compose Property unknown_t MotorI2CAddresses: type mismatch, can not refresh with type PropertyBag
hmmm, what is going wrong ???
cheers,
-vitali
unknown_t Property
On Monday 09 February 2009 23:05:20 vitali [..] ... wrote:
>
> Hello,
>
> just a quick Question about a Property:
>
> 1. The Property was defined as:
>
> Property<std::vector
> 2. initialized as :
>
> motorI2CAddressesProperty( "MotorI2CAddresses",
> "I2C addresses of rover motors",
> std::vector<int>(4,0) ),
>
> 3. and added to the task as:
>
> properties()->addProperty( &motorI2CAddressesProperty );
>
> therefore, if i start the task in TaskBrowser i got following error:
> 0.001 [ ERROR ][TypeInfoName] Can not build Property of unknown_t.
See this link : http://www.orocos.org/stable/documentation/rtt/v1.6.x/doc-
xml/orocos-toolkit-plugin.html
The RTT only knows a limited set of C++ data types. If you want to add one
yourself. For std::vector there's an utility function in OCL. You need to
write:
#include <ocl/VectorTemplateComposition.hp
RTT::TypeInfoRepository::Instance()->addType( new
RTT::StdVectorTemplateTypeInfo<int>("ints") );
and most stuff will work now.
Peter
Thanks Peter,it works
Thanks Peter,
it works well when i create the task in ORO_main
routine, but is it possible/necessary to
define new type info for std::vector
in an X.cpf file for the deployer ?
An another question:
I use for my component following namespace
AGENT::ROVER
so wenn i use a macro for component loader
ORO_CREATE_COMPONENT( AGENT::ROVER::RoverController )
i get following error:
/home/vitali/project/agent/rover/src/RoverController.cpp:347: error: expected unqualified-id before ‘{’ token
/home/vitali/project/agent/rover/src/RoverController.cpp:347: error: expected `}' at end of input
if i instead use the other two:
ORO_CREATE_COMPONENT_TYPE()
ORO_LIST_COMPONENT_TYPE( AGENT::ROVER::RoverController )
it works well, but i don't have multiple components in my lib. Is it not allowed/a problem to use such namespaces ?
The second Question is:
how should be the name of the component dynamic lib ?
I suggest :
agent-rover-rovercontroller-${OROCOS_TARGET}
but it doesn't works:
deployer-gnulinux --start ../rover/src/deployment/application.xml -linfo
0.005 [ Info ][DeploymentComponent::loadLibrary] Loaded shared library 'rover/src/libagent-rover-rovercontroller-gnulinux.so'
0.006 [ ERROR ][DeploymentComponent::loadComponent] Unable to locate Orocos plugin 'AGENT::ROVER::RoverController': unknown component type.
The part of appropriate CMakeLists.txt:
ADD_LIBRARY( agent-rover-rovercontroller-${OROCOS_TARGET} SHARED ${SRCS} )
TARGET_LINK_LIBRARIES( agent-rover-rovercontroller-${OROCOS_TARGET} ${PROJECT_NAME}-i2c )
TARGET_LINK_LIBRARIES( agent-rover-rovercontroller-${OROCOS_TARGET} ${PROJECT_NAME}-motor )
To many Questions at ones ?
cheers,
-vitali
Thanks Peter,it works
On Tuesday 10 February 2009 17:52:21 vitali [..] ... wrote:
> Thanks Peter,
>
> it works well when i create the task in ORO_main
> routine, but is it possible/necessary to
> define new type info for std::vector<int>
> in an X.cpf file for the deployer ?
The current solution is to compile a toolkit library and import it in the
deployer. The deployer also looks for such libraries in ComponentPath +
"/rtt/" + target + "/plugins" during a configure().
I'll add example code to section 1.3 of the plugin manual. For now, you need
to copy/paste from KDLTookitPlugin in orocos-kdl.
>
> An another question:
>
> I use for my component following namespace
>
> AGENT::ROVER
>
> so wenn i use a macro for component loader
> ORO_CREATE_COMPONENT( AGENT::ROVER::RoverController )
>
> i get following error:
> /home/vitali/project/agent/rover/src/RoverController.cpp:347: error:
> expected unqualified-id before ‘{’ token
> /home/vitali/project/agent/rover/src/RoverController.cpp:347: error:
> expected `}' at end of input
Thanks for reporting. I'll check if we can improve the macro.
>
> if i instead use the other two:
>
> ORO_CREATE_COMPONENT_TYPE()
> ORO_LIST_COMPONENT_TYPE( AGENT::ROVER::RoverController )
>
> it works well, but i don't have multiple components in my lib. Is it not
> allowed/a problem to use such namespaces ?
That's fine. This will work. We just never tested the macros with nested
namespaces, but there is no limitation.
>
> The second Question is:
> how should be the name of the component dynamic lib ?
> I suggest :
>
> agent-rover-rovercontroller-${OROCOS_TARGET}
>
> but it doesn't works:
>
> deployer-gnulinux --start ../rover/src/deployment/application.xml -linfo
>
> 0.005 [ Info ][DeploymentComponent::loadLibrary] Loaded shared library
> 'rover/src/libagent-rover-rovercontroller-gnulinux.so'
It should have said: Loaded component library... instead of 'shared'. It looks
like you're doing everything right. But did you compile your library with
-DOCL_DLL_EXPORT
?
> 0.006 [ ERROR
> ][DeploymentComponent::loadComponent] Unable to locate Orocos plugin
> 'AGENT::ROVER::RoverController': unknown component type.
>
> The part of appropriate CMakeLists.txt:
>
> ADD_LIBRARY( agent-rover-rovercontroller-${OROCOS_TARGET} SHARED ${SRCS}
> )
>
> TARGET_LINK_LIBRARIES( agent-rover-rovercontroller-${OROCOS_TARGET}
> ${PROJECT_NAME}-i2c ) TARGET_LINK_LIBRARIES(
> agent-rover-rovercontroller-${OROCOS_TARGET} ${PROJECT_NAME}-motor )
>
>
> To many Questions at ones ?
Not at all :-)
Peter
--
Peter Soetens -- FMTC -- <http://www.fmtc.be>
--
Orocos-Users mailing list
Orocos-Users [..] ...
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
User defined types in RTT
Hello Peter,
thx for your replay
On Tuesday 10 February 2009 17:52:21
The current solution is to compile a toolkit library and import it in the
deployer. The deployer also looks for such libraries in ComponentPath +
"/rtt/" + target + "/plugins" during a configure().
I'll add example code to section 1.3 of the plugin manual. For now, you need
to copy/paste from KDLTookitPlugin in orocos-kdl.
it seems a little bit complex, the question is if Orocos RTT already provides support for native C++ types AND vector and string, were is it maybe useful to provide also support for all vector types, where T is native C++ types, eg. vector, vector ... ?
On Tuesday 10 February 2009 17:52:21
It should have said: Loaded component library... instead of 'shared'. It looks
like you're doing everything right. But did you compile your library with
-DOCL_DLL_EXPORT
?
I didn't :(, after adding
ADD_DEFINITIONS( -DOCL_DLL_EXPORT )
in CMakeLists.txt
it says:
0.005 [ Info ][DeploymentComponent::loadLibrary] Loaded multi component library 'rover/src/libagent-rover-rovercontroller-gnulinux.so'
cool !
Btw, is there any restriction on component library name for the deployer ??? according to the namespace and component class name ?
-vitali
User defined types in RTT
On Wednesday 11 February 2009 11:34:55 vitali [..] ... wrote:
>
> 0.005 [ Info ][DeploymentComponent::loadLibrary] Loaded multi component
> library 'rover/src/libagent-rover-rovercontroller-gnulinux.so'
>
> cool !
>
> Btw, is there any restriction on component library name for the deployer
> ??? according to the namespace and component class name ?
The library name is independent of the namespace and component class name. One
library may host components of multiple namespaces.
There is some name-shuffling when you say for example:
import("rovercontroller")
It will look for: rovercontroller.so, librovercontroller.so, rovercontroller-
gnulinux.so and librovercontroller-gnulinux.so
in various places.
Peter
User defined types in RTT
On Wednesday 11 February 2009 11:34:55 vitali [..] ... wrote:
> Hello Peter,
>
> thx for your replay
>
>
>
> The current solution is to compile a toolkit library and import it in the
> deployer. The deployer also looks for such libraries in ComponentPath +
> "/rtt/" + target + "/plugins" during a configure().
>
> I'll add example code to section 1.3 of the plugin manual. For now, you
> need to copy/paste from KDLTookitPlugin in orocos-kdl.
>
>
>
> it seems a little bit complex, the question is if Orocos RTT already
> provides support for native C++ types AND vector<double> and string, were
> is it maybe useful to provide also support for all vector<T> types, where T
> is native C++ types, eg. vector<bool>, vector<int> ... ?
We have support for this, but it is located in the ocl-pma branch for now
since Peter did not yet accept this patch, or made up his mind if it has to go
in rtt or ocl.
I'll attach the necessary patch.
>
>
> It should have said: Loaded component library... instead of 'shared'. It
> looks like you're doing everything right. But did you compile your library
> with -DOCL_DLL_EXPORT
>
> ?
>
>
>
> I didn't :(, after adding
>
> ADD_DEFINITIONS( -DOCL_DLL_EXPORT )
>
> in CMakeLists.txt
>
> it says:
>
> 0.005 [ Info ][DeploymentComponent::loadLibrary] Loaded multi component
> library 'rover/src/libagent-rover-rovercontroller-gnulinux.so'
>
> cool !
>
> Btw, is there any restriction on component library name for the deployer
> ??? according to the namespace and component class name ?
>
> -vitali
Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm