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">&lt;<=
a href=3D"mailto:[email protected]" target=3D"_blank">sylvain.joyeux@m=
4x.org</a>&gt;</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 &quot;why is it not working there but is<br>
obviously working in Rock&quot;<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&#39;t. I&#39;ll have a loo=
k<br>
as to why, but in the meantime, just add<br>
<br>
task_context &#39;Workaround&#39; do<br>
=C2=A0 property &#39;p0&#39;, &#39;/the/type/which/uses/posix/time&#39;<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&#3=
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 &lt;<a href=3D"mailto:ruben.smits@int=
ermodalics.eu">[email protected]</a>&gt;:<br>
<div class=3D""><div class=3D"h5">&gt; Hi all,<br>
&gt;<br>
&gt; In a first orocos package I&#39;m trying to use a boost::posix_time::p=
time as<br>
&gt; part of one of my structs.<br>
&gt;<br>
&gt; Since orogen/typegen/gccxml cannot interprete this type, I&#39;ve crea=
ted a<br>
&gt; second package that contains a typekit generated with orogen that uses=
<br>
&gt; Opaques and wrapper types to handle this. That typekit happily builds =
in<br>
&gt; it&#39;s own package, I can start the deployer and use this type. So f=
ar so<br>
&gt; good.<br>
&gt;<br>
&gt; Now in my first package I&#39;m using typegen to generate the typekit =
of the<br>
&gt; first package structs (using boost::posix_time::ptime):<br>
&gt;<br>
&gt; orocos_typegen_headers(Structs.hpp DEPENDS orocos_kdl<br>
&gt; test-typekit-${OROCOS_TARGET})<br>
&gt;<br>
&gt; This executes something similar like this:<br>
&gt; typegen --output=3D/tmp --import=3Dorocos_kdl --import=3Dtest-typekit-=
gnulinux foo<br>
&gt; Structs.hpp<br>
&gt;<br>
&gt; and results in the following error:<br>
&gt; /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/type=
kit.rb:1242:in<br>
&gt; `orogen_include_of_type&#39;: undefined method `&lt;=3D&#39; for nil:N=
ilClass<br>
&gt; (NoMethodError)<br>
&gt; 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">
&gt; /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/type=
kit.rb:1270:in<br>
&gt; `compute_orogen_include_on_type&#39;<br>
&gt; from<br>
&gt; /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/type=
kit.rb:714:in<br>
&gt; `rescue in find_type&#39;<br>
&gt; from<br>
&gt; /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/type=
kit.rb:710:in<br>
&gt; `find_type&#39;<br>
&gt; from<br>
&gt; /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/type=
kit.rb:1496:in<br>
&gt; `block in normalize_registry&#39;<br>
&gt; from<br>
&gt; /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/type=
kit.rb:1494:in<br>
&gt; `each&#39;<br>
&gt; from<br>
&gt; /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/type=
kit.rb:1494:in<br>
&gt; `normalize_registry&#39;<br>
&gt; from<br>
&gt; /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/type=
kit.rb:1859:in<br>
&gt; `generate&#39;<br>
&gt; from /home/rsmits/orocos_ws/install_isolated/bin/typegen:116:in `&lt;m=
ain&gt;&#39;<br>
&gt;<br>
&gt; I&#39;ve instrumented typelib a little bit to start debugging:<br>
&gt;<br>
&gt; diff --git a/typelib/registry.cc b/typelib/registry.cc<br>
&gt; index a986566..2ec3273 100644<br>
&gt; --- a/typelib/registry.cc<br>
&gt; +++ b/typelib/registry.cc<br>
&gt; @@ -293,6 +293,7 @@ namespace Typelib<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 const Type* Registry::get(const std::string&amp; n=
ame) const<br>
&gt;=C2=A0 =C2=A0 =C2=A0 {<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 std::cout&lt;&lt;&quot;Getting type of &q=
uot;&lt;&lt;name&lt;&lt;std::endl;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NameMap::const_iterator it =3D m_cur=
rent.find(name);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (it !=3D m_current.end())<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return it-&gt;second.t=
ype;<br>
&gt; @@ -323,6 +324,7 @@ namespace Typelib<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 void Registry::add(std::string const&amp; name, Ty=
pe* new_type, bool<br>
&gt; persistent, std::string const&amp; s<br>
&gt;=C2=A0 =C2=A0 =C2=A0 {<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 std::cout&lt;&lt;&quot;Adding type &quot;=
&lt;&lt;name&lt;&lt;std::endl;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (! isValidTypename(name, true))<b=
r>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 throw BadName(name);<b=
r>
&gt;<br>
&gt; And I see that the types from my orogen generated typekit are definite=
ly<br>
&gt; loaded:<br>
&gt;<br>
&gt; ...<br>
&gt; Getting type of /boost/posix_time/ptime<br>
&gt; Getting type of /boost/posix_time/ptime<br>
&gt; Getting type of /boost/posix_time/ptime<br>
&gt; Adding type /boost/posix_time/ptime<br>
&gt; Getting type of /boost/posix_time/ptime<br>
&gt; Getting type of /boost/posix_time/ptime<br>
&gt; Adding type /boost/posix_time/ptime<br>
&gt; Getting type of /boost/posix_time/ptime<br>
&gt; Getting type of /boost/posix_time/time_duration<br>
&gt; Getting type of /boost/posix_time/time_duration<br>
&gt; Getting type of /boost/posix_time/time_duration<br>
&gt; Adding type /boost/posix_time/time_duration<br>
&gt; Getting type of /boost/posix_time/time_duration<br>
&gt; Getting type of /boost/posix_time/time_duration<br>
&gt; Adding type /boost/posix_time/time_duration<br>
&gt; Getting type of /boost/posix_time/time_duration<br>
&gt; ...<br>
&gt;<br>
&gt; I have no idea what the problem is here.<br>
&gt;<br>
&gt; As a second trial I tried to generate the typekit with orogen instead:=
<br>
&gt;<br>
&gt; big_mockup.orogen:<br>
&gt; ````<br>
&gt; name &#39;big_mockup&#39;<br>
&gt; version &#39;0.1&#39;<br>
&gt;<br>
&gt; import_types_from &#39;test&#39;<br>
&gt;<br>
&gt; import_types_from &quot;Structs.hpp&quot;<br>
&gt; ````<br>
&gt;<br>
&gt; Again I see that my boost time typekit get&#39;s loaded, it even detec=
ts that it<br>
&gt; should use the wrapper type somehow but than this happens:<br>
&gt; And now I get a different error:<br>
&gt;<br>
&gt; =3D=3D=3D=3D=3D Internal error =3D=3D=3D=3D=3D=3D=3D<br>
&gt; Please report the following error to the orogen developers<br>
&gt; /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/typelib/registr=
y.rb:54:in<br>
&gt; `do_minimal&#39;: there is not type &#39;/wrappers/Time&#39; in this r=
egistry<br>
&gt; (RuntimeError)<br>
&gt; from<br>
&gt; /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/typelib/registr=
y.rb:54:in<br>
&gt; `minimal&#39;<br>
&gt; from<br>
&gt; /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/type=
kit.rb:1496:in<br>
&gt; `block in normalize_registry&#39;<br>
&gt; from<br>
&gt; /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/type=
kit.rb:1494:in<br>
&gt; `each&#39;<br>
&gt; from<br>
&gt; /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/type=
kit.rb:1494:in<br>
&gt; `normalize_registry&#39;<br>
&gt; from<br>
&gt; /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/type=
kit.rb:1859:in<br>
&gt; `generate&#39;<br>
&gt; from<br>
&gt; /home/rsmits/orocos_ws/install_isolated/lib/ruby/1.9.1/orogen/gen/proj=
ect.rb:676:in<br>
&gt; `generate&#39;<br>
&gt; from /home/rsmits/orocos_ws/install_isolated/bin/orogen:171:in `&lt;ma=
in&gt;&#39;<br>
&gt;<br>
&gt;<br>
&gt; I&#39;m using the toolchain-2.8 branches of typelib (based on master a=
t 68658739<br>
&gt; ) and orogen (based on master 9bb6ed8901da2d)<br>
&gt;<br>
&gt; Could someone shed a light on this?<br>
&gt;<br>
&gt; R.<br>
&gt;<br>
&gt; --<br>
&gt; Ruben Smits, Roboticist - Founder<br>
&gt; +32 479 511 786<br>
&gt; Intermodalics - Kapeldreef 60, 3001 Heverlee - BELGIUM<br>
&gt; <a href=3D"http://www.intermodalics.eu" target=3D"_blank">www.intermod=
alics.eu</a><br>
&gt;<br>
</div></div><span class=3D""><font color=3D"#888888">&gt; --<br>
&gt; Orocos-Dev mailing list<br>
&gt; <a href=3D"mailto:[email protected]">Orocos-Dev@lists.=
mech.kuleuven.be</a><br>
&gt; <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>
&gt;<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==--