create kinbody with trimesh?

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

create kinbody with trimesh?

waxwings
hallo Rosen,

i am trying to create a kinbody with trimesh in c++ and am looking for something like the KinBody::InitFromBoxes(...) but with TRIMESH als parameter. Is there a way to do this?

Best Regards
yimei
Reply | Threaded
Open this post in threaded view
|

Re: create kinbody with trimesh?

Rosen Diankov
Administrator
hi yimei,

Great idea! Added KinBody::InitFromTrimesh in (r1730)

Here's how to use it from python:

body = env.CreateKinBody()
vertices = array([[0.0,0,0],[1,0,0],[0,1,0]])
indices = array([[0,1,2]])
body.InitFromTrimesh(trimesh=KinBody.Link.TriMesh(vertices,indices),draw=True)
body.SetName('test')
env.AddKinBody(body)

rosen,

2010/9/14 waxwings <[hidden email]>:

>
> hallo Rosen,
>
> i am trying to create a kinbody with trimesh in c++ and am looking for
> something like the KinBody::InitFromBoxes(...) but with TRIMESH als
> parameter. Is there a way to do this?
>
> Best Regards
> yimei
> --
> View this message in context: http://openrave-users-list.185357.n3.nabble.com/create-kinbody-with-trimesh-tp1472742p1472742.html
> Sent from the OpenRAVE Users List mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Start uncovering the many advantages of virtual appliances
> and start using them to simplify application deployment and
> accelerate your shift to cloud computing.
> http://p.sf.net/sfu/novell-sfdev2dev
> _______________________________________________
> Openrave-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openrave-users
>

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users
Reply | Threaded
Open this post in threaded view
|

Re: create kinbody with trimesh?

waxwings
Hi Rosen,

thanks for the update. we can now load our own environment as Trimesh in Openrave. we would like to add a robot to it too and are trying to this with InitFromFile(...) function in RobotBase. but we are not sure what is expected as the second parm  

const std::list<std::pair<std::string,std::string> >& atts

can you give us a hint? Thanks!

Regards
yimei
Reply | Threaded
Open this post in threaded view
|

Re: create kinbody with trimesh?

Rosen Diankov
Administrator
hi yimei,

Don't worry about that field. Just pass in an empty list
std::list<std::pair<std::string,std::string> >()

rosen,

2010/10/4 waxwings <[hidden email]>:

>
> Hi Rosen,
>
> thanks for the update. we can now load our own environment as Trimesh in
> Openrave. we would like to add a robot to it too and are trying to this with
> InitFromFile(...) function in RobotBase. but we are not sure what is
> expected as the second parm
>
> const std::list<std::pair<std::string,std::string> >& atts
>
> can you give us a hint? Thanks!
>
> Regards
> yimei
> --
> View this message in context: http://openrave-users-list.185357.n3.nabble.com/create-kinbody-with-trimesh-tp1472742p1629913.html
> Sent from the OpenRAVE Users List mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Virtualization is moving to the mainstream and overtaking non-virtualized
> environment for deploying applications. Does it make network security
> easier or more difficult to achieve? Read this whitepaper to separate the
> two and get a better understanding.
> http://p.sf.net/sfu/hp-phase2-d2d
> _______________________________________________
> Openrave-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openrave-users
>

------------------------------------------------------------------------------
Virtualization is moving to the mainstream and overtaking non-virtualized
environment for deploying applications. Does it make network security
easier or more difficult to achieve? Read this whitepaper to separate the
two and get a better understanding.
http://p.sf.net/sfu/hp-phase2-d2d
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users
Reply | Threaded
Open this post in threaded view
|

Re: create kinbody with trimesh?

waxwings
hi Rosen,

we loaded the Robot to the scene and planed it with birrt planner. however, we noticed that it took much longer than when we were doing planning with scenes loaded from xml files. Is it true that there is a difference between scenes loaded from xml files and the ones generated from trimesh?  

Regards
yimei
Reply | Threaded
Open this post in threaded view
|

Re: create kinbody with trimesh?

Rosen Diankov
Administrator
hi yimei,

There should be no difference if the scenes loaded from XML files use
the exact same mesh. However, most of the time scenes use box
primitives for the floor and walls, which makes collisions faster

rosen,

2010/10/6 waxwings <[hidden email]>:

>
> hi Rosen,
>
> we loaded the Robot to the scene and planed it with birrt planner. however,
> we noticed that it took much longer than when we were doing planning with
> scenes loaded from xml files. Is it true that there is a difference between
> scenes loaded from xml files and the ones generated from trimesh?
>
> Regards
> yimei
> --
> View this message in context: http://openrave-users-list.185357.n3.nabble.com/create-kinbody-with-trimesh-tp1472742p1636741.html
> Sent from the OpenRAVE Users List mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Beautiful is writing same markup. Internet Explorer 9 supports
> standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
> Spend less time writing and  rewriting code and more time creating great
> experiences on the web. Be a part of the beta today.
> http://p.sf.net/sfu/beautyoftheweb
> _______________________________________________
> Openrave-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openrave-users
>

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users
Reply | Threaded
Open this post in threaded view
|

Re: create kinbody with trimesh?

waxwings
hi Rosen,

thanks for the reply. i got yet another problem. i loaded the robot with the following code

OpenRAVE::ControllerBasePtr v_ctr=env->CreateController("idealcontroller");
OpenRAVE::RobotBasePtr v_rb=env->CreateRobot("");
v_rb->SetController(v_ctr, "");
v_rb->InitFromFile(f_filename, std::list< std::pair< std::string, std::string > >());
env->AddRobot(v_rb,true);

but there is a warning
[Robot.cpp:2131] no default controller set on robot BarrettWAM

and    
probot->SetActiveMotion(ptraj);
seemed not working.

do you know where the problem is?

yimei


Reply | Threaded
Open this post in threaded view
|

Re: create kinbody with trimesh?

Rosen Diankov
Administrator
hi yimei,

InitFromFile resets everything, you have to call SetController after it.

rosen,

2010/10/12 waxwings <[hidden email]>:

>
> hi Rosen,
>
> thanks for the reply. i got yet another problem. i loaded the robot with the
> following code
>
> OpenRAVE::ControllerBasePtr v_ctr=env->CreateController("idealcontroller");
> OpenRAVE::RobotBasePtr v_rb=env->CreateRobot("");
> v_rb->SetController(v_ctr, "");
> v_rb->InitFromFile(f_filename, std::list< std::pair< std::string,
> std::string > >());
> env->AddRobot(v_rb,true);
>
> but there is a warning
> [Robot.cpp:2131] no default controller set on robot BarrettWAM
>
> and
> probot->SetActiveMotion(ptraj);
> seemed not working.
>
> do you know where the problem is?
>
> yimei
>
>
>
> --
> View this message in context: http://openrave-users-list.185357.n3.nabble.com/create-kinbody-with-trimesh-tp1472742p1682296.html
> Sent from the OpenRAVE Users List mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Beautiful is writing same markup. Internet Explorer 9 supports
> standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
> Spend less time writing and  rewriting code and more time creating great
> experiences on the web. Be a part of the beta today.
> http://p.sf.net/sfu/beautyoftheweb
> _______________________________________________
> Openrave-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openrave-users
>

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users
Reply | Threaded
Open this post in threaded view
|

Re: create kinbody with trimesh?

waxwings
hi Rosen,

now i called SetController after InitFromFile, but it didn't make any difference. any ideal what else could be missing here?

yimei
Reply | Threaded
Open this post in threaded view
|

Re: create kinbody with trimesh?

Rosen Diankov
Administrator
Hi yimei,

Ah yes, the default robot doesn't support any controller setting, a
warning message will be added.

For now, make sure to create a "GenericRobot"

rosen,

2010/10/12 waxwings <[hidden email]>:

>
> hi Rosen,
>
> now i called SetController after InitFromFile, but it didn't make any
> difference. any ideal what else could be missing here?
>
> yimei
> --
> View this message in context: http://openrave-users-list.185357.n3.nabble.com/create-kinbody-with-trimesh-tp1472742p1688215.html
> Sent from the OpenRAVE Users List mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Beautiful is writing same markup. Internet Explorer 9 supports
> standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
> Spend less time writing and  rewriting code and more time creating great
> experiences on the web. Be a part of the beta today.
> http://p.sf.net/sfu/beautyoftheweb
> _______________________________________________
> Openrave-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openrave-users
>

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users
Reply | Threaded
Open this post in threaded view
|

Re: create kinbody with trimesh?

waxwings
yeah, that works. thanks!
Reply | Threaded
Open this post in threaded view
|

Re: create kinbody with trimesh?

Krzysztof Trzciński
In reply to this post by waxwings
>> InitFromFile(...) function in RobotBase. but we are not sure what is
>> expected as the second parm
>>
>> const std::list<std::pair<std::string,std::string> >& atts
>>
> can you give us a hint? Thanks!
> hi yimei,
>
> Don't worry about that field. Just pass in an empty list
> std::list<std::pair<std::string,std::string> >()
>
> rosen,

Is there a reason why there is no default argument for this?

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users
Reply | Threaded
Open this post in threaded view
|

Re: create kinbody with trimesh?

Rosen Diankov
Administrator
c++ won't allow it. If you figure out a way to add a default argument,
please tell us.
rosen,

2010/10/16 Krzysztof Trzciński <[hidden email]>:

>>> InitFromFile(...) function in RobotBase. but we are not sure what is
>>> expected as the second parm
>>>
>>> const std::list<std::pair<std::string,std::string> >& atts
>>>
>> can you give us a hint? Thanks!
>> hi yimei,
>>
>> Don't worry about that field. Just pass in an empty list
>> std::list<std::pair<std::string,std::string> >()
>>
>> rosen,
>
> Is there a reason why there is no default argument for this?
>
> ------------------------------------------------------------------------------
> Download new Adobe(R) Flash(R) Builder(TM) 4
> The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
> Flex(R) Builder(TM)) enable the development of rich applications that run
> across multiple browsers and platforms. Download your free trials today!
> http://p.sf.net/sfu/adobe-dev2dev
> _______________________________________________
> Openrave-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openrave-users
>

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users