problem calling grasper in c++

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

problem calling grasper in c++

waxwings
Hello Rosen,

i've been trying with grasper planner in c++ and wrote something like

int grasp(RobotBasePtr f_probot, string target_name){

        RobotBasePtr probot=f_probot;
        EnvironmentBasePtr penv = probot->GetEnv();

        PlannerBasePtr graspplan = penv->CreatePlanner("grasper");

        boost::shared_ptr<GraspParameters> params(new GraspParameters(penv));
        params->SetRobotActiveJoints(probot);
        params->targetbody = probot->GetEnv()->GetKinBody("mug1");
        params->btransformrobot = true;
        params->bonlycontacttarget = true;
        params->btightgrasp = false;
        params->vtargetdirection = Vector(0,0,1);
        params->breturntrajectory =true;
       
        TrajectoryBasePtr ptraj = probot->GetEnv()->CreateTrajectory(probot->GetActiveDOF());
       
        if (!graspplan->InitPlan(probot,params)){
                RAVELOG_ERRORA("init failed\n");
        }
       
        if (!graspplan->PlanPath(ptraj)){
                RAVELOG_ERRORA("plan failed\n");
        }
       
        probot->SetMotion(ptraj);
        return 0;
}

main(){
...
        grasp(probot, "mug3");
}

and this is what i got



could you please give me a hint where i did wrong or what i missed here? thank you so much!

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

Re: problem calling grasper in c++

Rosen Diankov
Administrator
hi waxwings,

looks correct to me.....
where is the problem?

rosen,

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

>
> Hello Rosen,
>
> i've been trying with grasper planner in c++ and wrote something like
>
> int grasp(RobotBasePtr f_probot, string target_name){
>
>        RobotBasePtr probot=f_probot;
>        EnvironmentBasePtr penv = probot->GetEnv();
>
>        PlannerBasePtr graspplan = penv->CreatePlanner("grasper");
>
>        boost::shared_ptr<GraspParameters> params(new GraspParameters(penv));
>        params->SetRobotActiveJoints(probot);
>        params->targetbody = probot->GetEnv()->GetKinBody("mug1");
>        params->btransformrobot = true;
>        params->bonlycontacttarget = true;
>        params->btightgrasp = false;
>        params->vtargetdirection = Vector(0,0,1);
>        params->breturntrajectory =true;
>
>        TrajectoryBasePtr ptraj =
> probot->GetEnv()->CreateTrajectory(probot->GetActiveDOF());
>
>        if (!graspplan->InitPlan(probot,params)){
>                RAVELOG_ERRORA("init failed\n");
>        }
>
>        if (!graspplan->PlanPath(ptraj)){
>                RAVELOG_ERRORA("plan failed\n");
>        }
>
>        probot->SetMotion(ptraj);
>        return 0;
> }
>
> main(){
> ...
>        grasp(probot, "mug3");
> }
>
> and this is what i got
>
> http://openrave-users-list.185357.n3.nabble.com/file/n882345/Screenshot-1.png
>
> could you please give me a hint where i did wrong or what i missed here?
> thank you so much!
>
> Regards
> yimei
>
> --
> View this message in context: http://openrave-users-list.185357.n3.nabble.com/problem-calling-grasper-in-c-tp882345p882345.html
> Sent from the OpenRAVE Users List mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit.  See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> Openrave-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openrave-users
>

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users
Reply | Threaded
Open this post in threaded view
|

Re: problem calling grasper in c++

Rosen Diankov
Administrator
If you want to just close the fingers at the current robot location
without moving the gripper to the desired direction, do

params->btransformrobot = false;

rosen,

2010/6/9 Rosen Diankov <[hidden email]>:

> hi waxwings,
>
> looks correct to me.....
> where is the problem?
>
> rosen,
>
> 2010/6/9 waxwings <[hidden email]>:
>>
>> Hello Rosen,
>>
>> i've been trying with grasper planner in c++ and wrote something like
>>
>> int grasp(RobotBasePtr f_probot, string target_name){
>>
>>        RobotBasePtr probot=f_probot;
>>        EnvironmentBasePtr penv = probot->GetEnv();
>>
>>        PlannerBasePtr graspplan = penv->CreatePlanner("grasper");
>>
>>        boost::shared_ptr<GraspParameters> params(new GraspParameters(penv));
>>        params->SetRobotActiveJoints(probot);
>>        params->targetbody = probot->GetEnv()->GetKinBody("mug1");
>>        params->btransformrobot = true;
>>        params->bonlycontacttarget = true;
>>        params->btightgrasp = false;
>>        params->vtargetdirection = Vector(0,0,1);
>>        params->breturntrajectory =true;
>>
>>        TrajectoryBasePtr ptraj =
>> probot->GetEnv()->CreateTrajectory(probot->GetActiveDOF());
>>
>>        if (!graspplan->InitPlan(probot,params)){
>>                RAVELOG_ERRORA("init failed\n");
>>        }
>>
>>        if (!graspplan->PlanPath(ptraj)){
>>                RAVELOG_ERRORA("plan failed\n");
>>        }
>>
>>        probot->SetMotion(ptraj);
>>        return 0;
>> }
>>
>> main(){
>> ...
>>        grasp(probot, "mug3");
>> }
>>
>> and this is what i got
>>
>> http://openrave-users-list.185357.n3.nabble.com/file/n882345/Screenshot-1.png
>>
>> could you please give me a hint where i did wrong or what i missed here?
>> thank you so much!
>>
>> Regards
>> yimei
>>
>> --
>> View this message in context: http://openrave-users-list.185357.n3.nabble.com/problem-calling-grasper-in-c-tp882345p882345.html
>> Sent from the OpenRAVE Users List mailing list archive at Nabble.com.
>>
>> ------------------------------------------------------------------------------
>> ThinkGeek and WIRED's GeekDad team up for the Ultimate
>> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
>> lucky parental unit.  See the prize list and enter to win:
>> http://p.sf.net/sfu/thinkgeek-promo
>> _______________________________________________
>> Openrave-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/openrave-users
>>
>

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users
Reply | Threaded
Open this post in threaded view
|

Re: problem calling grasper in c++

waxwings
Hi Rosen,

i actually assumed the planner will take into account other Kinbodies in the scene when planning. is this not the case?

yimei
Reply | Threaded
Open this post in threaded view
|

Re: problem calling grasper in c++

waxwings
Hi Rosen,

i got it now. the grasper only does grasp. guess iksolver is what i shall look into. thank you!

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

Re: problem calling grasper in c++

Rosen Diankov
Administrator
the grasper planner only takes into account the hand with the
environment, it ignores the rest of the robot body. This actually
allows you to build grasp sets on the fly without having to create a
new environment with a new hand-only robot.
rosen,

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

>
> Hi Rosen,
>
> i got it now. the grasper only does grasp. guess iksolver is what i shall
> look into. thank you!
>
> Regards
> yimei
> --
> View this message in context: http://openrave-users-list.185357.n3.nabble.com/problem-calling-grasper-in-c-tp882345p888767.html
> Sent from the OpenRAVE Users List mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit.  See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> Openrave-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openrave-users
>

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users
Reply | Threaded
Open this post in threaded view
|

RE: problem calling grasper in c++

waxwings
so it does take into account other Kinbodys in the environment like the table?
yimei


Date: Fri, 11 Jun 2010 09:41:54 -0700
From: [hidden email]
To: [hidden email]
Subject: Re: problem calling grasper in c++

the grasper planner only takes into account the hand with the
environment, it ignores the rest of the robot body. This actually
allows you to build grasp sets on the fly without having to create a
new environment with a new hand-only robot.
rosen,

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

>
> Hi Rosen,
>
> i got it now. the grasper only does grasp. guess iksolver is what i shall
> look into. thank you!
>
> Regards
> yimei
> --
> View this message in context: http://openrave-users-list.185357.n3.nabble.com/problem-calling-grasper-in-c-tp882345p888767.html
> Sent from the OpenRAVE Users List mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit.  See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> Openrave-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openrave-users
>
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users



View message @ http://openrave-users-list.185357.n3.nabble.com/problem-calling-grasper-in-c-tp882345p889072.html
To unsubscribe from Re: problem calling grasper in c++, click here.



聊天+搜索+邮箱 想要轻松出游,手机MSN帮你搞定! 立刻下载!
Reply | Threaded
Open this post in threaded view
|

Re: problem calling grasper in c++

Rosen Diankov
Administrator
params->bonlycontacttarget = true;

controls whether the hand should ignore the environment or not. If
true, it will not return success if the hand touches anything else.

rosen,

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

> so it does take into account other Kinbodys in the environment like the
> table?
> yimei
>
> ________________________________
> Date: Fri, 11 Jun 2010 09:41:54 -0700
> From: [hidden email]
> To: [hidden email]
> Subject: Re: problem calling grasper in c++
>
> the grasper planner only takes into account the hand with the
> environment, it ignores the rest of the robot body. This actually
> allows you to build grasp sets on the fly without having to create a
> new environment with a new hand-only robot.
> rosen,
>
> 2010/6/11 waxwings <[hidden email]>:
>>
>> Hi Rosen,
>>
>> i got it now. the grasper only does grasp. guess iksolver is what i shall
>> look into. thank you!
>>
>> Regards
>> yimei
>> --
>> View this message in context:
>> http://openrave-users-list.185357.n3.nabble.com/problem-calling-grasper-in-c-tp882345p888767.html
>> Sent from the OpenRAVE Users List mailing list archive at Nabble.com.
>>
>>
>> ------------------------------------------------------------------------------
>> ThinkGeek and WIRED's GeekDad team up for the Ultimate
>> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
>> lucky parental unit.  See the prize list and enter to win:
>> http://p.sf.net/sfu/thinkgeek-promo
>> _______________________________________________
>> Openrave-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/openrave-users
>>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit.  See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> Openrave-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openrave-users
>
>
> ________________________________
> View message @
> http://openrave-users-list.185357.n3.nabble.com/problem-calling-grasper-in-c-tp882345p889072.html
> To unsubscribe from Re: problem calling grasper in c++, click here.
>
> ________________________________
> 聊天+搜索+邮箱 想要轻松出游,手机MSN帮你搞定! 立刻下载!
> ________________________________
> View this message in context: RE: problem calling grasper in c++
> Sent from the OpenRAVE Users List mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit.  See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> Openrave-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openrave-users
>
>

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users
Reply | Threaded
Open this post in threaded view
|

Re: problem calling grasper in c++

waxwings
Hi Rosen,

i tried with bonlycontacttarget, but the hand still sticks into the table. are there any other parameters that have influence on this?



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

Re: problem calling grasper in c++

Rosen Diankov
Administrator
hi waxwings,

You are right there was a problem. Please update to r1519 and try again.

rosen,

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

>
> Hi Rosen,
>
> i tried with bonlycontacttarget, but the hand still sticks into the table.
> are there any other parameters that have influence on this?
>
> http://openrave-users-list.185357.n3.nabble.com/file/n903049/Screenshot-1.png
>
> Regards
> yimei
> --
> View this message in context: http://openrave-users-list.185357.n3.nabble.com/problem-calling-grasper-in-c-tp882345p903049.html
> Sent from the OpenRAVE Users List mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit.  See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> Openrave-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openrave-users
>

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users