struct robotTarget{
VECTOR targetPositionDH; VECTOR targetVelocityDH; VECTOR targetCurrent; int targetMode;}; "VECTOR" is an alias for an Armadillo class
#define VECTOR fcolvec::fixed1According to http://www.orocos.org/stable/documentation/rtt/v2.x/doc-xml/orocos-typekit-plugin.html I write
namespace boost {
namespace serialization { template<class Archive> void serialize( Archive & a, VECTOR & cd, unsigned int) { using boost::serialization::make_nvp; using boost::serialization::make_array; float app[6]; for(int i=0;i<20;i++) app[i]=cd.at(i); a & make_nvp("VECTOR", make_array(app, 20)); } }}
namespace boost {
namespace serialization { template<class Archive> void serialize( Archive & a, robotTarget & cd, unsigned int) { using boost::serialization::make_nvp; a & make_nvp("targetPositionDH", cd.targetPositionDH); a & make_nvp("targetVelocityDH", cd.targetVelocityDH); a & make_nvp("targetCurrent", cd.targetCurrent); a & make_nvp("targetMode", cd.targetMode); } } } struct VECTORTypeInfo : public RTT::types::StructTypeInfo2 { VECTORTypeInfo() : RTT::types::StructTypeInfo3("VECTOR") {} }; struct robotTargetTypeInfo : public RTT::types::StructTypeInfo4 { robotTargetTypeInfo() : RTT::types::StructTypeInfo5("robotTarget") {} };RTT::types::Types()->addType( new RTT::types::StructTypeInfo<VECTOR>("VECTOR") );
RTT::types::Types()->addType( new RTT::types::StructTypeInfo<robotTarget>("robotTarget") );
When I start the ReportingComponent I have a segmentation fault. Any idea? Thanks D.
Armadillo and Typekit in c++
2014-04-02 11:08 GMT+02:00 <dgerb [..] ...>:
> Dear all,
> I want to use OCL::ReportingComponent for capturing data of my
> "ControlLoop"
> component. I define my type called "robotTarget" for the outputport (
> OutputPort targetFromUser;) which is a struct defined as:
> struct robotTarget
> {
> VECTOR targetPositionDH;
> VECTOR targetVelocityDH;
> VECTOR targetCurrent;
> int targetMode;
> };
> "VECTOR" is an alias for an Armadillo class
> #define VECTOR fcolvec::fixed
>
>
> According to
>
> http://www.orocos.org/stable/documentation/rtt/v2.x/doc-xml/orocos-typek...
> I write
>
> namespace boost {
> namespace serialization {
> template
> void serialize( Archive & a, VECTOR & cd, unsigned int) {
> using boost::serialization::make_nvp;
> using boost::serialization::make_array;
> float app[6];
> for(int i=0;iaddType( new
> RTT::types::StructTypeInfo("VECTOR") );
>
> RTT::types::Types()->addType( new RTT::types::StructTypeInfo("robotTarget")
> );
>
> When I start the ReportingComponent I have a segmentation fault. Any idea?
> Thanks
> D.
> --
>
I just have had the same problem yesterday on another case but I didn't
investigate further. Could you please provide the callstack when
segfaulting ?
There is maybe tools for generating typekits automatically to prevent user
code errors (orogren ? typegen ?)
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>
Armadillo and Typekit in c++
Thanks for you answer. This is the callstack: Reporting [S]> start
Program received signal SIGSEGV, Segmentation fault. 0xf8bff3c0 in ?? () (gdb) backtrace
) at /usr/local/src/orocos/orocos-toolchain/rtt/rtt/os/MutexLock.hpp:71
) at /usr/local/src/orocos/orocos-toolchain/rtt/rtt/types/TypeInfoRepository.cpp:110 Cannot access memory at address 0x3
Armadillo and Typekit in c++
I added the line RTT::types::Types()->addType( new CArrayTypeInfo<types::carray< fcolvec > >("fcolvec[]") ); and now I have
Reporting [S]> start OrocosUnisa-lxrt: /usr/local/src/orocos/orocos-toolchain/install/include/rtt/types/type_discovery.hpp:195: bool RTT::types::type_discovery::referenceMember(RTT::internal::Reference*, T&, std::string) [with T = arma::Col<float>::fixed<20u>]: Assertion `ref' failed.
Program received signal SIGABRT, Aborted. 0xb7fe2424 in __kernel_vsyscall () (gdb) backtrace
)
what I miss?