getting points on a mesh object

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

getting points on a mesh object

Huan Liu
Hi Rosen and fellow OpenRAVE users,

I want to find the closest point on a mesh object to a point on the gripper.

I see an example in the grasper.h where you shoot rays to the object
and use the collision checker to find the closest contact. Other than
this sampling method, is there any better way?

Thanks!

Huan

------------------------------------------------------------------------------
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: getting points on a mesh object

Rosen Diankov
Administrator
Hi Huan,

The recommended way of getting closest distances is to set the 'pqp'
collision checker. Check out the collision.py example:

http://openrave.programmingvision.com/ordocs/en/openravepy-html/openravepy.examples.collision-pysrc.html

to execute do:

openrave.py --example collision

rosen,

2010/9/19 Huan Liu <[hidden email]>:

> Hi Rosen and fellow OpenRAVE users,
>
> I want to find the closest point on a mesh object to a point on the gripper.
>
> I see an example in the grasper.h where you shoot rays to the object
> and use the collision checker to find the closest contact. Other than
> this sampling method, is there any better way?
>
> Thanks!
>
> Huan
>
> ------------------------------------------------------------------------------
> 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: getting points on a mesh object

Huan Liu
Hi Rosen,
Thanks for the pointer! Here's some notes/questions I wrote down after
playing with collisions.py:

if using pqp, env.CheckCollision(kinbody1,kinbody2) won't work, and i
get RuntimeError: unidentifiable C++ exception. but
help(env.CheckCollision) does list this as a valid usage. maybe
openrave can add some checkings for collision checker dependent
arguments.

why do we need to save the handle when we call env.CheckCollision?
e.g. check = env.CheckCollision(robot1, report)

how do i understand the collision report? e.g. where do i find the
definitions of collisionOptions for different collision checkers?

when CollisionOptions.Distance is enabled, are the contacts returned
by env.CheckCollision the points that are closest to other objects in
the scene?

Thanks!
Huan




On Sat, Sep 18, 2010 at 11:59 AM, Rosen Diankov <[hidden email]> wrote:

> Hi Huan,
>
> The recommended way of getting closest distances is to set the 'pqp'
> collision checker. Check out the collision.py example:
>
> http://openrave.programmingvision.com/ordocs/en/openravepy-html/openravepy.examples.collision-pysrc.html
>
> to execute do:
>
> openrave.py --example collision
>
> rosen,
>
> 2010/9/19 Huan Liu <[hidden email]>:
>> Hi Rosen and fellow OpenRAVE users,
>>
>> I want to find the closest point on a mesh object to a point on the gripper.
>>
>> I see an example in the grasper.h where you shoot rays to the object
>> and use the collision checker to find the closest contact. Other than
>> this sampling method, is there any better way?
>>
>> Thanks!
>>
>> Huan
>>
>> ------------------------------------------------------------------------------
>> 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: getting points on a mesh object

Rosen Diankov
Administrator
hi huan,

I'm not sure why the exception is not being recognized as an openrave
exception.... possibly this is a limitation to C++ shared objects.
Anyway, the reason it is being thrown is because you have the
collision options still set to "distance" and you have not passed in a
"report". Therefore, the function call is useless.

You can find the collisionoptions definitions here:

http://openrave.programmingvision.com/ordocs/en/html/namespaceOpenRAVE.html#a6963e4ecb981351b8fb2e3f9e85acf77

the openravepy CollisionReport is defined here:

http://openrave.programmingvision.com/ordocs/en/openravepy-html/openravepy.openravepy_int.CollisionReport-class.html

the c++ version is defined here:

http://openrave.programmingvision.com/ordocs/en/html/classOpenRAVE_1_1CollisionReport.html

i'm not sure what you mean by "save the handle". what handle?

depending on the CheckCollision call, the contacts returned will be to
the closest 'collidable' object.

rosen

2010/9/20 Huan Liu <[hidden email]>:

> Hi Rosen,
> Thanks for the pointer! Here's some notes/questions I wrote down after
> playing with collisions.py:
>
> if using pqp, env.CheckCollision(kinbody1,kinbody2) won't work, and i
> get RuntimeError: unidentifiable C++ exception. but
> help(env.CheckCollision) does list this as a valid usage. maybe
> openrave can add some checkings for collision checker dependent
> arguments.
>
> why do we need to save the handle when we call env.CheckCollision?
> e.g. check = env.CheckCollision(robot1, report)
>
> how do i understand the collision report? e.g. where do i find the
> definitions of collisionOptions for different collision checkers?
>
> when CollisionOptions.Distance is enabled, are the contacts returned
> by env.CheckCollision the points that are closest to other objects in
> the scene?
>
> Thanks!
> Huan
>
>
>
>
> On Sat, Sep 18, 2010 at 11:59 AM, Rosen Diankov <[hidden email]> wrote:
>> Hi Huan,
>>
>> The recommended way of getting closest distances is to set the 'pqp'
>> collision checker. Check out the collision.py example:
>>
>> http://openrave.programmingvision.com/ordocs/en/openravepy-html/openravepy.examples.collision-pysrc.html
>>
>> to execute do:
>>
>> openrave.py --example collision
>>
>> rosen,
>>
>> 2010/9/19 Huan Liu <[hidden email]>:
>>> Hi Rosen and fellow OpenRAVE users,
>>>
>>> I want to find the closest point on a mesh object to a point on the gripper.
>>>
>>> I see an example in the grasper.h where you shoot rays to the object
>>> and use the collision checker to find the closest contact. Other than
>>> this sampling method, is there any better way?
>>>
>>> Thanks!
>>>
>>> Huan
>>>
>>> ------------------------------------------------------------------------------
>>> 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: getting points on a mesh object

Huan Liu
Thanks for the answers Rosen! These documentation links are perfect.

By handle I mean the check in line 105 of
http://openrave.programmingvision.com/ordocs/en/openravepy-html/openravepy.examples.collision-pysrc.html

I don't know why openrave doesn't catch the exception, here's how I
get the error:

    env = Environment()
    robot = env.ReadRobotXMLFile('robots/pa10.robot.xml')
    env.AddRobot(robot)
    target = env.ReadKinBodyXMLFile('data/mug1.kinbody.xml')
    env.AddKinBody(target)
    collision_checker = env.CreateCollisionChecker('pqp')
    collision_checker.SetCollisionOptions(CollisionOptions.Distance|CollisionOptions.Contacts)
    env.SetCollisionChecker(collision_checker)
    env.CheckCollision(robot,target)

On Sun, Sep 19, 2010 at 9:47 PM, Rosen Diankov <[hidden email]> wrote:

> hi huan,
>
> I'm not sure why the exception is not being recognized as an openrave
> exception.... possibly this is a limitation to C++ shared objects.
> Anyway, the reason it is being thrown is because you have the
> collision options still set to "distance" and you have not passed in a
> "report". Therefore, the function call is useless.
>
> You can find the collisionoptions definitions here:
>
> http://openrave.programmingvision.com/ordocs/en/html/namespaceOpenRAVE.html#a6963e4ecb981351b8fb2e3f9e85acf77
>
> the openravepy CollisionReport is defined here:
>
> http://openrave.programmingvision.com/ordocs/en/openravepy-html/openravepy.openravepy_int.CollisionReport-class.html
>
> the c++ version is defined here:
>
> http://openrave.programmingvision.com/ordocs/en/html/classOpenRAVE_1_1CollisionReport.html
>
> i'm not sure what you mean by "save the handle". what handle?
>
> depending on the CheckCollision call, the contacts returned will be to
> the closest 'collidable' object.
>
> rosen
>
> 2010/9/20 Huan Liu <[hidden email]>:
>> Hi Rosen,
>> Thanks for the pointer! Here's some notes/questions I wrote down after
>> playing with collisions.py:
>>
>> if using pqp, env.CheckCollision(kinbody1,kinbody2) won't work, and i
>> get RuntimeError: unidentifiable C++ exception. but
>> help(env.CheckCollision) does list this as a valid usage. maybe
>> openrave can add some checkings for collision checker dependent
>> arguments.
>>
>> why do we need to save the handle when we call env.CheckCollision?
>> e.g. check = env.CheckCollision(robot1, report)
>>
>> how do i understand the collision report? e.g. where do i find the
>> definitions of collisionOptions for different collision checkers?
>>
>> when CollisionOptions.Distance is enabled, are the contacts returned
>> by env.CheckCollision the points that are closest to other objects in
>> the scene?
>>
>> Thanks!
>> Huan
>>
>>
>>
>>
>> On Sat, Sep 18, 2010 at 11:59 AM, Rosen Diankov <[hidden email]> wrote:
>>> Hi Huan,
>>>
>>> The recommended way of getting closest distances is to set the 'pqp'
>>> collision checker. Check out the collision.py example:
>>>
>>> http://openrave.programmingvision.com/ordocs/en/openravepy-html/openravepy.examples.collision-pysrc.html
>>>
>>> to execute do:
>>>
>>> openrave.py --example collision
>>>
>>> rosen,
>>>
>>> 2010/9/19 Huan Liu <[hidden email]>:
>>>> Hi Rosen and fellow OpenRAVE users,
>>>>
>>>> I want to find the closest point on a mesh object to a point on the gripper.
>>>>
>>>> I see an example in the grasper.h where you shoot rays to the object
>>>> and use the collision checker to find the closest contact. Other than
>>>> this sampling method, is there any better way?
>>>>
>>>> Thanks!
>>>>
>>>> Huan
>>>>
>>>> ------------------------------------------------------------------------------
>>>> 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: getting points on a mesh object

Rosen Diankov
Administrator
hi huan,

The check is just a boolean value, and it is optional.

openrave does catch the exception in your example, except it cannot
resolve it to an openrave_exception object and give you the details.
In any case, this is correct behavior. You need to do

env.CheckCollision(robot,target,report=report)

rosen,

2010/9/20 Huan Liu <[hidden email]>:

> Thanks for the answers Rosen! These documentation links are perfect.
>
> By handle I mean the check in line 105 of
> http://openrave.programmingvision.com/ordocs/en/openravepy-html/openravepy.examples.collision-pysrc.html
>
> I don't know why openrave doesn't catch the exception, here's how I
> get the error:
>
>    env = Environment()
>    robot = env.ReadRobotXMLFile('robots/pa10.robot.xml')
>    env.AddRobot(robot)
>    target = env.ReadKinBodyXMLFile('data/mug1.kinbody.xml')
>    env.AddKinBody(target)
>    collision_checker = env.CreateCollisionChecker('pqp')
>    collision_checker.SetCollisionOptions(CollisionOptions.Distance|CollisionOptions.Contacts)
>    env.SetCollisionChecker(collision_checker)
>    env.CheckCollision(robot,target)
>
> On Sun, Sep 19, 2010 at 9:47 PM, Rosen Diankov <[hidden email]> wrote:
>> hi huan,
>>
>> I'm not sure why the exception is not being recognized as an openrave
>> exception.... possibly this is a limitation to C++ shared objects.
>> Anyway, the reason it is being thrown is because you have the
>> collision options still set to "distance" and you have not passed in a
>> "report". Therefore, the function call is useless.
>>
>> You can find the collisionoptions definitions here:
>>
>> http://openrave.programmingvision.com/ordocs/en/html/namespaceOpenRAVE.html#a6963e4ecb981351b8fb2e3f9e85acf77
>>
>> the openravepy CollisionReport is defined here:
>>
>> http://openrave.programmingvision.com/ordocs/en/openravepy-html/openravepy.openravepy_int.CollisionReport-class.html
>>
>> the c++ version is defined here:
>>
>> http://openrave.programmingvision.com/ordocs/en/html/classOpenRAVE_1_1CollisionReport.html
>>
>> i'm not sure what you mean by "save the handle". what handle?
>>
>> depending on the CheckCollision call, the contacts returned will be to
>> the closest 'collidable' object.
>>
>> rosen
>>
>> 2010/9/20 Huan Liu <[hidden email]>:
>>> Hi Rosen,
>>> Thanks for the pointer! Here's some notes/questions I wrote down after
>>> playing with collisions.py:
>>>
>>> if using pqp, env.CheckCollision(kinbody1,kinbody2) won't work, and i
>>> get RuntimeError: unidentifiable C++ exception. but
>>> help(env.CheckCollision) does list this as a valid usage. maybe
>>> openrave can add some checkings for collision checker dependent
>>> arguments.
>>>
>>> why do we need to save the handle when we call env.CheckCollision?
>>> e.g. check = env.CheckCollision(robot1, report)
>>>
>>> how do i understand the collision report? e.g. where do i find the
>>> definitions of collisionOptions for different collision checkers?
>>>
>>> when CollisionOptions.Distance is enabled, are the contacts returned
>>> by env.CheckCollision the points that are closest to other objects in
>>> the scene?
>>>
>>> Thanks!
>>> Huan
>>>
>>>
>>>
>>>
>>> On Sat, Sep 18, 2010 at 11:59 AM, Rosen Diankov <[hidden email]> wrote:
>>>> Hi Huan,
>>>>
>>>> The recommended way of getting closest distances is to set the 'pqp'
>>>> collision checker. Check out the collision.py example:
>>>>
>>>> http://openrave.programmingvision.com/ordocs/en/openravepy-html/openravepy.examples.collision-pysrc.html
>>>>
>>>> to execute do:
>>>>
>>>> openrave.py --example collision
>>>>
>>>> rosen,
>>>>
>>>> 2010/9/19 Huan Liu <[hidden email]>:
>>>>> Hi Rosen and fellow OpenRAVE users,
>>>>>
>>>>> I want to find the closest point on a mesh object to a point on the gripper.
>>>>>
>>>>> I see an example in the grasper.h where you shoot rays to the object
>>>>> and use the collision checker to find the closest contact. Other than
>>>>> this sampling method, is there any better way?
>>>>>
>>>>> Thanks!
>>>>>
>>>>> Huan
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> 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: getting points on a mesh object

Huan Liu
I see. I don't have any more question on this. Thanks Rosen!

On Sun, Sep 19, 2010 at 10:45 PM, Rosen Diankov <[hidden email]> wrote:

> hi huan,
>
> The check is just a boolean value, and it is optional.
>
> openrave does catch the exception in your example, except it cannot
> resolve it to an openrave_exception object and give you the details.
> In any case, this is correct behavior. You need to do
>
> env.CheckCollision(robot,target,report=report)
>
> rosen,
>
> 2010/9/20 Huan Liu <[hidden email]>:
>> Thanks for the answers Rosen! These documentation links are perfect.
>>
>> By handle I mean the check in line 105 of
>> http://openrave.programmingvision.com/ordocs/en/openravepy-html/openravepy.examples.collision-pysrc.html
>>
>> I don't know why openrave doesn't catch the exception, here's how I
>> get the error:
>>
>>    env = Environment()
>>    robot = env.ReadRobotXMLFile('robots/pa10.robot.xml')
>>    env.AddRobot(robot)
>>    target = env.ReadKinBodyXMLFile('data/mug1.kinbody.xml')
>>    env.AddKinBody(target)
>>    collision_checker = env.CreateCollisionChecker('pqp')
>>    collision_checker.SetCollisionOptions(CollisionOptions.Distance|CollisionOptions.Contacts)
>>    env.SetCollisionChecker(collision_checker)
>>    env.CheckCollision(robot,target)
>>
>> On Sun, Sep 19, 2010 at 9:47 PM, Rosen Diankov <[hidden email]> wrote:
>>> hi huan,
>>>
>>> I'm not sure why the exception is not being recognized as an openrave
>>> exception.... possibly this is a limitation to C++ shared objects.
>>> Anyway, the reason it is being thrown is because you have the
>>> collision options still set to "distance" and you have not passed in a
>>> "report". Therefore, the function call is useless.
>>>
>>> You can find the collisionoptions definitions here:
>>>
>>> http://openrave.programmingvision.com/ordocs/en/html/namespaceOpenRAVE.html#a6963e4ecb981351b8fb2e3f9e85acf77
>>>
>>> the openravepy CollisionReport is defined here:
>>>
>>> http://openrave.programmingvision.com/ordocs/en/openravepy-html/openravepy.openravepy_int.CollisionReport-class.html
>>>
>>> the c++ version is defined here:
>>>
>>> http://openrave.programmingvision.com/ordocs/en/html/classOpenRAVE_1_1CollisionReport.html
>>>
>>> i'm not sure what you mean by "save the handle". what handle?
>>>
>>> depending on the CheckCollision call, the contacts returned will be to
>>> the closest 'collidable' object.
>>>
>>> rosen
>>>
>>> 2010/9/20 Huan Liu <[hidden email]>:
>>>> Hi Rosen,
>>>> Thanks for the pointer! Here's some notes/questions I wrote down after
>>>> playing with collisions.py:
>>>>
>>>> if using pqp, env.CheckCollision(kinbody1,kinbody2) won't work, and i
>>>> get RuntimeError: unidentifiable C++ exception. but
>>>> help(env.CheckCollision) does list this as a valid usage. maybe
>>>> openrave can add some checkings for collision checker dependent
>>>> arguments.
>>>>
>>>> why do we need to save the handle when we call env.CheckCollision?
>>>> e.g. check = env.CheckCollision(robot1, report)
>>>>
>>>> how do i understand the collision report? e.g. where do i find the
>>>> definitions of collisionOptions for different collision checkers?
>>>>
>>>> when CollisionOptions.Distance is enabled, are the contacts returned
>>>> by env.CheckCollision the points that are closest to other objects in
>>>> the scene?
>>>>
>>>> Thanks!
>>>> Huan
>>>>
>>>>
>>>>
>>>>
>>>> On Sat, Sep 18, 2010 at 11:59 AM, Rosen Diankov <[hidden email]> wrote:
>>>>> Hi Huan,
>>>>>
>>>>> The recommended way of getting closest distances is to set the 'pqp'
>>>>> collision checker. Check out the collision.py example:
>>>>>
>>>>> http://openrave.programmingvision.com/ordocs/en/openravepy-html/openravepy.examples.collision-pysrc.html
>>>>>
>>>>> to execute do:
>>>>>
>>>>> openrave.py --example collision
>>>>>
>>>>> rosen,
>>>>>
>>>>> 2010/9/19 Huan Liu <[hidden email]>:
>>>>>> Hi Rosen and fellow OpenRAVE users,
>>>>>>
>>>>>> I want to find the closest point on a mesh object to a point on the gripper.
>>>>>>
>>>>>> I see an example in the grasper.h where you shoot rays to the object
>>>>>> and use the collision checker to find the closest contact. Other than
>>>>>> this sampling method, is there any better way?
>>>>>>
>>>>>> Thanks!
>>>>>>
>>>>>> Huan
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> 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