Re: Using orogen generated typekit with typegen
Ruben Smits <[email protected]> Fri, 17 Apr 2015 12:32:47 +0200
| Newsgroups | gmane.science.robotics.orocos.devel |
|---|---|
| Message-ID | <CAN8PhbnKQ=e=++vB9E0hKbfW_yE16-+CeogXrJ0doNA1bVmioQ@mail.gmail.com> |
--===============0365676745== Content-Type: multipart/alternative; boundary=20cf3026662a2c9ff20513e91b75 --20cf3026662a2c9ff20513e91b75 Content-Type: text/plain; charset=UTF-8 On Thu, Apr 16, 2015 at 4:57 PM, Sylvain Joyeux <[email protected]> wrote: > The first thing I asked myself was "why is it not working there but is > obviously working in Rock" > > The answer is: it works if you have a task context using the > opaque-using type in orogen. It fails if you don't. I'll have a look > as to why, but in the meantime, just add > > task_context 'Workaround' do > property 'p0', '/the/type/which/uses/posix/time' > end > > to the second orogen project. > I tried this and got a little bit further, but now it complains like this: big_mockup.orogen:9: /int32_t, defined in the test typekits, is never exported (OroGen::ConfigError) I'm using an int32_t as type in my boost::posix_ptime wrapper. Should I explicitly export some of these types? Also, > > 2015-04-16 7:16 GMT-03:00 Ruben Smits <[email protected]>: > > Hi all, > > > > In a first orocos package I'm trying to use a boost::posix_time::ptime as > > part of one of my structs. > > > > Since orogen/typegen/gccxml cannot interprete this type, I've created a > > second package that contains a typekit generated with orogen that uses > > Opaques and wrapper types to handle this. That typekit happily builds in > > it's own package, I can start the deployer and use this type. So far so > > good. > > > > Now in my first package I'm using typegen to generate the typekit of the > > first package structs (using boost::posix_time::ptime): > > > > orocos_typegen_headers(Structs.hpp DEPENDS orocos_kdl > > test-typekit-${OROCOS_TARGET}) > > > > This executes something similar like this: > > typegen --output=/tmp --import=orocos_kdl --import=test-typekit-gnulinux > foo > > Structs.hpp > > > > and results in the following error: > > > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/typekit.rb:1242:in > > `orogen_include_of_type': undefined method `<=' for nil:NilClass > > (NoMethodError) > > from > This error is still there, and seems unrelated to the other error. R. > > > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/typekit.rb:1270:in > > `compute_orogen_include_on_type' > > from > > > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/typekit.rb:714:in > > `rescue in find_type' > > from > > > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/typekit.rb:710:in > > `find_type' > > from > > > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/typekit.rb:1496:in > > `block in normalize_registry' > > from > > > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/typekit.rb:1494:in > > `each' > > from > > > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/typekit.rb:1494:in > > `normalize_registry' > > from > > > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/typekit.rb:1859:in > > `generate' > > from /home/rsmits/orocos_ws/install_isolated/bin/typegen:116:in `<main>' > > > > I've instrumented typelib a little bit to start debugging: > > > > diff --git a/typelib/registry.cc b/typelib/registry.cc > > index a986566..2ec3273 100644 > > --- a/typelib/registry.cc > > +++ b/typelib/registry.cc > > @@ -293,6 +293,7 @@ namespace Typelib > > > > const Type* Registry::get(const std::string& name) const > > { > > + std::cout<<"Getting type of "<<name<<std::endl; > > NameMap::const_iterator it = m_current.find(name); > > if (it != m_current.end()) > > return it->second.type; > > @@ -323,6 +324,7 @@ namespace Typelib > > > > void Registry::add(std::string const& name, Type* new_type, bool > > persistent, std::string const& s > > { > > + std::cout<<"Adding type "<<name<<std::endl; > > if (! isValidTypename(name, true)) > > throw BadName(name); > > > > And I see that the types from my orogen generated typekit are definitely > > loaded: > > > > ... > > Getting type of /boost/posix_time/ptime > > Getting type of /boost/posix_time/ptime > > Getting type of /boost/posix_time/ptime > > Adding type /boost/posix_time/ptime > > Getting type of /boost/posix_time/ptime > > Getting type of /boost/posix_time/ptime > > Adding type /boost/posix_time/ptime > > Getting type of /boost/posix_time/ptime > > Getting type of /boost/posix_time/time_duration > > Getting type of /boost/posix_time/time_duration > > Getting type of /boost/posix_time/time_duration > > Adding type /boost/posix_time/time_duration > > Getting type of /boost/posix_time/time_duration > > Getting type of /boost/posix_time/time_duration > > Adding type /boost/posix_time/time_duration > > Getting type of /boost/posix_time/time_duration > > ... > > > > I have no idea what the problem is here. > > > > As a second trial I tried to generate the typekit with orogen instead: > > > > big_mockup.orogen: > > ```` > > name 'big_mockup' > > version '0.1' > > > > import_types_from 'test' > > > > import_types_from "Structs.hpp" > > ```` > > > > Again I see that my boost time typekit get's loaded, it even detects > that it > > should use the wrapper type somehow but than this happens: > > And now I get a different error: > > > > ===== Internal error ======= > > Please report the following error to the orogen developers > > > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/typelib/registry.rb:54:in > > `do_minimal': there is not type '/wrappers/Time' in this registry > > (RuntimeError) > > from > > > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/typelib/registry.rb:54:in > > `minimal' > > from > > > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/typekit.rb:1496:in > > `block in normalize_registry' > > from > > > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/typekit.rb:1494:in > > `each' > > from > > > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/typekit.rb:1494:in > > `normalize_registry' > > from > > > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/typekit.rb:1859:in > > `generate' > > from > > > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/project.rb:676:in > > `generate' > > from /home/rsmits/orocos_ws/install_isolated/bin/orogen:171:in `<main>' > > > > > > I'm using the toolchain-2.8 branches of typelib (based on master at > 68658739 > > ) and orogen (based on master 9bb6ed8901da2d) > > > > Could someone shed a light on this? > > > > R. > > > > -- > > Ruben Smits, Roboticist - Founder > > +32 479 511 786 > > Intermodalics - Kapeldreef 60, 3001 Heverlee - BELGIUM > > www.intermodalics.eu > > > > -- > > Orocos-Dev mailing list > > [email protected] > > http://lists.mech.kuleuven.be/mailman/listinfo/orocos-dev > > > -- Ruben Smits, Roboticist - Founder +32 479 511 786 Intermodalics - Kapeldreef 60, 3001 Heverlee - BELGIUM www.intermodalics.eu --20cf3026662a2c9ff20513e91b75 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo= te">On Thu, Apr 16, 2015 at 4:57 PM, Sylvain Joyeux <span dir=3D"ltr"><<= a href=3D"mailto:[email protected]" target=3D"_blank">sylvain.joyeux@m= 4x.org</a>></span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"= margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,20= 4,204);border-left-style:solid;padding-left:1ex">The first thing I asked my= self was "why is it not working there but is<br> obviously working in Rock"<br> <br> The answer is: it works if you have a task context using the<br> opaque-using type in orogen. It fails if you don't. I'll have a loo= k<br> as to why, but in the meantime, just add<br> <br> task_context 'Workaround' do<br> =C2=A0 property 'p0', '/the/type/which/uses/posix/time'<br> end<br> <br> to the second orogen project.<br></blockquote><div><br></div><div>I tried t= his and got a little bit further, but now it complains like this:</div><div= ><br></div><div>big_mockup.orogen:9: /int32_t, defined in the test typekits= , is never exported (OroGen::ConfigError)<br></div><div><br></div><div>I= 9;m using an int32_t as type in my boost::posix_ptime wrapper.</div><div><b= r></div><div>Should I explicitly export some of these types?=C2=A0</div><di= v>=C2=A0</div><div><br></div><div>Also,=C2=A0</div><blockquote class=3D"gma= il_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;border-le= ft-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> <br> 2015-04-16 7:16 GMT-03:00 Ruben Smits <<a href=3D"mailto:ruben.smits@int= ermodalics.eu">[email protected]</a>>:<br> <div class=3D""><div class=3D"h5">> Hi all,<br> ><br> > In a first orocos package I'm trying to use a boost::posix_time::p= time as<br> > part of one of my structs.<br> ><br> > Since orogen/typegen/gccxml cannot interprete this type, I've crea= ted a<br> > second package that contains a typekit generated with orogen that uses= <br> > Opaques and wrapper types to handle this. That typekit happily builds = in<br> > it's own package, I can start the deployer and use this type. So f= ar so<br> > good.<br> ><br> > Now in my first package I'm using typegen to generate the typekit = of the<br> > first package structs (using boost::posix_time::ptime):<br> ><br> > orocos_typegen_headers(Structs.hpp DEPENDS orocos_kdl<br> > test-typekit-${OROCOS_TARGET})<br> ><br> > This executes something similar like this:<br> > typegen --output=3D/tmp --import=3Dorocos_kdl --import=3Dtest-typekit-= gnulinux foo<br> > Structs.hpp<br> ><br> > and results in the following error:<br> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/type= kit.rb:1242:in<br> > `orogen_include_of_type': undefined method `<=3D' for nil:N= ilClass<br> > (NoMethodError)<br> > from<br></div></div></blockquote><div><br></div><div><br></div><div>Th= is error is still there, and seems unrelated to the other error.</div><div>= <br></div><div>R.</div><div><br></div><div>=C2=A0</div><blockquote class=3D= "gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;borde= r-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><di= v class=3D""><div class=3D"h5"> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/type= kit.rb:1270:in<br> > `compute_orogen_include_on_type'<br> > from<br> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/type= kit.rb:714:in<br> > `rescue in find_type'<br> > from<br> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/type= kit.rb:710:in<br> > `find_type'<br> > from<br> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/type= kit.rb:1496:in<br> > `block in normalize_registry'<br> > from<br> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/type= kit.rb:1494:in<br> > `each'<br> > from<br> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/type= kit.rb:1494:in<br> > `normalize_registry'<br> > from<br> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/type= kit.rb:1859:in<br> > `generate'<br> > from /home/rsmits/orocos_ws/install_isolated/bin/typegen:116:in `<m= ain>'<br> ><br> > I've instrumented typelib a little bit to start debugging:<br> ><br> > diff --git a/typelib/registry.cc b/typelib/registry.cc<br> > index a986566..2ec3273 100644<br> > --- a/typelib/registry.cc<br> > +++ b/typelib/registry.cc<br> > @@ -293,6 +293,7 @@ namespace Typelib<br> ><br> >=C2=A0 =C2=A0 =C2=A0 const Type* Registry::get(const std::string& n= ame) const<br> >=C2=A0 =C2=A0 =C2=A0 {<br> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 std::cout<<"Getting type of &q= uot;<<name<<std::endl;<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NameMap::const_iterator it =3D m_cur= rent.find(name);<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (it !=3D m_current.end())<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return it->second.t= ype;<br> > @@ -323,6 +324,7 @@ namespace Typelib<br> ><br> >=C2=A0 =C2=A0 =C2=A0 void Registry::add(std::string const& name, Ty= pe* new_type, bool<br> > persistent, std::string const& s<br> >=C2=A0 =C2=A0 =C2=A0 {<br> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 std::cout<<"Adding type "= <<name<<std::endl;<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (! isValidTypename(name, true))<b= r> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 throw BadName(name);<b= r> ><br> > And I see that the types from my orogen generated typekit are definite= ly<br> > loaded:<br> ><br> > ...<br> > Getting type of /boost/posix_time/ptime<br> > Getting type of /boost/posix_time/ptime<br> > Getting type of /boost/posix_time/ptime<br> > Adding type /boost/posix_time/ptime<br> > Getting type of /boost/posix_time/ptime<br> > Getting type of /boost/posix_time/ptime<br> > Adding type /boost/posix_time/ptime<br> > Getting type of /boost/posix_time/ptime<br> > Getting type of /boost/posix_time/time_duration<br> > Getting type of /boost/posix_time/time_duration<br> > Getting type of /boost/posix_time/time_duration<br> > Adding type /boost/posix_time/time_duration<br> > Getting type of /boost/posix_time/time_duration<br> > Getting type of /boost/posix_time/time_duration<br> > Adding type /boost/posix_time/time_duration<br> > Getting type of /boost/posix_time/time_duration<br> > ...<br> ><br> > I have no idea what the problem is here.<br> ><br> > As a second trial I tried to generate the typekit with orogen instead:= <br> ><br> > big_mockup.orogen:<br> > ````<br> > name 'big_mockup'<br> > version '0.1'<br> ><br> > import_types_from 'test'<br> ><br> > import_types_from "Structs.hpp"<br> > ````<br> ><br> > Again I see that my boost time typekit get's loaded, it even detec= ts that it<br> > should use the wrapper type somehow but than this happens:<br> > And now I get a different error:<br> ><br> > =3D=3D=3D=3D=3D Internal error =3D=3D=3D=3D=3D=3D=3D<br> > Please report the following error to the orogen developers<br> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/typelib/registr= y.rb:54:in<br> > `do_minimal': there is not type '/wrappers/Time' in this r= egistry<br> > (RuntimeError)<br> > from<br> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/typelib/registr= y.rb:54:in<br> > `minimal'<br> > from<br> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/type= kit.rb:1496:in<br> > `block in normalize_registry'<br> > from<br> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/type= kit.rb:1494:in<br> > `each'<br> > from<br> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/type= kit.rb:1494:in<br> > `normalize_registry'<br> > from<br> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/type= kit.rb:1859:in<br> > `generate'<br> > from<br> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/proj= ect.rb:676:in<br> > `generate'<br> > from /home/rsmits/orocos_ws/install_isolated/bin/orogen:171:in `<ma= in>'<br> ><br> ><br> > I'm using the toolchain-2.8 branches of typelib (based on master a= t 68658739<br> > ) and orogen (based on master 9bb6ed8901da2d)<br> ><br> > Could someone shed a light on this?<br> ><br> > R.<br> ><br> > --<br> > Ruben Smits, Roboticist - Founder<br> > +32 479 511 786<br> > Intermodalics - Kapeldreef 60, 3001 Heverlee - BELGIUM<br> > <a href=3D"http://www.intermodalics.eu" target=3D"_blank">www.intermod= alics.eu</a><br> ><br> </div></div><span class=3D""><font color=3D"#888888">> --<br> > Orocos-Dev mailing list<br> > <a href=3D"mailto:[email protected]">Orocos-Dev@lists.= mech.kuleuven.be</a><br> > <a href=3D"http://lists.mech.kuleuven.be/mailman/listinfo/orocos-dev" = target=3D"_blank">http://lists.mech.kuleuven.be/mailman/listinfo/orocos-dev= </a><br> ><br> </font></span></blockquote></div><br><br clear=3D"all"><div><br></div>-- <b= r><div class=3D"gmail_signature"><div dir=3D"ltr"><div><div dir=3D"ltr">Rub= en Smits, Roboticist - Founder<br>+32 479 511 786<br>Intermodalics - Kapeld= reef 60, 3001 Heverlee - BELGIUM<br><a href=3D"http://www.intermodalics.eu"= target=3D"_blank">www.intermodalics.eu</a><br></div></div></div></div> </div></div> --20cf3026662a2c9ff20513e91b75-- --===============0365676745== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline -- Orocos-Dev mailing list [email protected] http://lists.mech.kuleuven.be/mailman/listinfo/orocos-dev --===============0365676745==--