Re: Using orogen generated typekit with typegen
Ruben Smits <[email protected]> Fri, 24 Apr 2015 14:53:47 +0200
| Newsgroups | gmane.science.robotics.orocos.devel |
|---|---|
| Message-ID | <CAN8PhbkepjLNCQK4o1hXxBWwZ9+EjPJMxnfGt7Emw0DrTW=nPg@mail.gmail.com> |
--===============0203339618== Content-Type: multipart/alternative; boundary=20cf301d3cf45a5caf051477e4b2 --20cf301d3cf45a5caf051477e4b2 Content-Type: text/plain; charset=UTF-8 On Fri, Apr 24, 2015 at 2:33 PM, Sylvain Joyeux <[email protected]> wrote: > Hi Ruben > > The problem lies in I having made base/orogen/std a mandatory > dependency of (at least) the task generation parts of orogen. > > The most future-proof way would really be to build and install > https://github.com/rock-core/base-orogen-std (use the 'stable' branch) > > Alternatively, use orogen's --no-extended-states option. But I do plan > to make extended states non-optional in the future, so that would > break in the long run. > > Thanks for the heads up, I managed to work around the issue for now. I'll test your suggested approach. Any news on why it's not working with typegen? R. > Sylvain > > 2015-04-17 7:32 GMT-03:00 Ruben Smits <[email protected]>: > > > > > > 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 > -- Ruben Smits, Roboticist - Founder +32 479 511 786 Intermodalics - Kapeldreef 60, 3001 Heverlee - BELGIUM www.intermodalics.eu --20cf301d3cf45a5caf051477e4b2 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 Fri, Apr 24, 2015 at 2:33 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Ruben<br> <br> The problem lies in I having made base/orogen/std a mandatory<br> dependency of (at least) the task generation parts of orogen.<br> <br> The most future-proof way would really be to build and install<br> <a href=3D"https://github.com/rock-core/base-orogen-std" target=3D"_blank">= https://github.com/rock-core/base-orogen-std</a> (use the 'stable' = branch)<br> <br> Alternatively, use orogen's --no-extended-states option. But I do plan<= br> to make extended states non-optional in the future, so that would<br> break in the long run.<br> <br></blockquote><div><br></div><div>Thanks for the heads up, I managed to = work around the issue for now. I'll test your suggested approach.</div>= <div><br></div><div>Any news on why it's not working with typegen?</div= ><div><br></div><div>R.</div><div>=C2=A0</div><blockquote class=3D"gmail_qu= ote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex= "> Sylvain<br> <br> 2015-04-17 7:32 GMT-03:00 Ruben Smits <<a href=3D"mailto:ruben.smits@int= ermodalics.eu">[email protected]</a>>:<br> <div class=3D"HOEnZb"><div class=3D"h5">><br> ><br> > On Thu, Apr 16, 2015 at 4:57 PM, Sylvain Joyeux <<a href=3D"mailto:= [email protected]">[email protected]</a>><br> > wrote:<br> >><br> >> The first thing I asked myself was "why is it not working the= re 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 h= ave a look<br> >> as to why, but in the meantime, just add<br> >><br> >> task_context 'Workaround' do<br> >>=C2=A0 =C2=A0property 'p0', '/the/type/which/uses/posix= /time'<br> >> end<br> >><br> >> to the second orogen project.<br> ><br> ><br> > I tried this and got a little bit further, but now it complains like t= his:<br> ><br> > big_mockup.orogen:9: /int32_t, defined in the test typekits, is never<= br> > exported (OroGen::ConfigError)<br> ><br> > I'm using an int32_t as type in my boost::posix_ptime wrapper.<br> ><br> > Should I explicitly export some of these types?<br> ><br> ><br> > Also,<br> >><br> >><br> >> 2015-04-16 7:16 GMT-03:00 Ruben Smits <<a href=3D"mailto:ruben.= [email protected]">[email protected]</a>>:<br> >> > Hi all,<br> >> ><br> >> > In a first orocos package I'm trying to use a boost::posi= x_time::ptime<br> >> > as<br> >> > part of one of my structs.<br> >> ><br> >> > Since orogen/typegen/gccxml cannot interprete this type, I= 9;ve created a<br> >> > second package that contains a typekit generated with orogen = that uses<br> >> > Opaques and wrapper types to handle this. That typekit happil= y builds in<br> >> > it's own package, I can start the deployer and use this t= ype. So far 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<br> >> > foo<br> >> > Structs.hpp<br> >> ><br> >> > and results in the following error:<br> >> ><br> >> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen= /gen/typekit.rb:1242:in<br> >> > `orogen_include_of_type': undefined method `<=3D' = for nil:NilClass<br> >> > (NoMethodError)<br> >> > from<br> ><br> ><br> ><br> > This error is still there, and seems unrelated to the other error.<br> ><br> > R.<br> ><br> ><br> >><br> >> ><br> >> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen= /gen/typekit.rb:1270:in<br> >> > `compute_orogen_include_on_type'<br> >> > from<br> >> ><br> >> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen= /gen/typekit.rb:714:in<br> >> > `rescue in find_type'<br> >> > from<br> >> ><br> >> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen= /gen/typekit.rb:710:in<br> >> > `find_type'<br> >> > from<br> >> ><br> >> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen= /gen/typekit.rb:1496:in<br> >> > `block in normalize_registry'<br> >> > from<br> >> ><br> >> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen= /gen/typekit.rb:1494:in<br> >> > `each'<br> >> > from<br> >> ><br> >> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen= /gen/typekit.rb:1494:in<br> >> > `normalize_registry'<br> >> > from<br> >> ><br> >> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen= /gen/typekit.rb:1859:in<br> >> > `generate'<br> >> > from /home/rsmits/orocos_ws/install_isolated/bin/typegen:116:= in `<main>'<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::stri= ng& name) const<br> >> >=C2=A0 =C2=A0 =C2=A0 {<br> >> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 std::cout<<"Getting t= ype of "<<name<<std::endl;<br> >> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NameMap::const_iterator it = =3D m_current.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.type;<br> >> > @@ -323,6 +324,7 @@ namespace Typelib<br> >> ><br> >> >=C2=A0 =C2=A0 =C2=A0 void Registry::add(std::string const&= name, Type* 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 ty= pe "<<name<<std::endl;<br> >> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (! isValidTypename(name,= true))<br> >> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 throw BadName= (name);<br> >> ><br> >> > And I see that the types from my orogen generated typekit are= definitely<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 e= ven detects<br> >> > 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= > >> ><br> >> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/typeli= b/registry.rb:54:in<br> >> > `do_minimal': there is not type '/wrappers/Time' = in this registry<br> >> > (RuntimeError)<br> >> > from<br> >> ><br> >> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/typeli= b/registry.rb:54:in<br> >> > `minimal'<br> >> > from<br> >> ><br> >> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen= /gen/typekit.rb:1496:in<br> >> > `block in normalize_registry'<br> >> > from<br> >> ><br> >> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen= /gen/typekit.rb:1494:in<br> >> > `each'<br> >> > from<br> >> ><br> >> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen= /gen/typekit.rb:1494:in<br> >> > `normalize_registry'<br> >> > from<br> >> ><br> >> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen= /gen/typekit.rb:1859:in<br> >> > `generate'<br> >> > from<br> >> ><br> >> > /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen= /gen/project.rb:676:in<br> >> > `generate'<br> >> > from /home/rsmits/orocos_ws/install_isolated/bin/orogen:171:i= n `<main>'<br> >> ><br> >> ><br> >> > I'm using the toolchain-2.8 branches of typelib (based on= master at<br> >> > 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= .intermodalics.eu</a><br> >> ><br> >> > --<br> >> > Orocos-Dev mailing list<br> >> > <a href=3D"mailto:[email protected]">Orocos-D= [email protected]</a><br> >> > <a href=3D"http://lists.mech.kuleuven.be/mailman/listinfo/oro= cos-dev" target=3D"_blank">http://lists.mech.kuleuven.be/mailman/listinfo/o= rocos-dev</a><br> >> ><br> ><br> ><br> ><br> ><br> > --<br> > Ruben Smits, Roboticist - Founder<br> > <a href=3D"tel:%2B32%20479%20511%20786" value=3D"+32479511786">+32 479= 511 786</a><br> > Intermodalics - Kapeldreef 60, 3001 Heverlee - BELGIUM<br> > <a href=3D"http://www.intermodalics.eu" target=3D"_blank">www.intermod= alics.eu</a><br> </div></div></blockquote></div><br><br clear=3D"all"><div><br></div>-- <br>= <div class=3D"gmail_signature"><div dir=3D"ltr"><div><div dir=3D"ltr">Ruben= Smits, Roboticist - Founder<br>+32 479 511 786<br>Intermodalics - Kapeldre= ef 60, 3001 Heverlee - BELGIUM<br><a href=3D"http://www.intermodalics.eu" t= arget=3D"_blank">www.intermodalics.eu</a><br></div></div></div></div> </div></div> --20cf301d3cf45a5caf051477e4b2-- --===============0203339618== 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 --===============0203339618==--