<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to GraspStudio</title><link>https://sourceforge.net/p/simox/wiki/GraspStudio/</link><description>Recent changes to GraspStudio</description><atom:link href="https://sourceforge.net/p/simox/wiki/GraspStudio/feed" rel="self"/><language>en</language><lastBuildDate>Wed, 02 Jul 2014 11:28:52 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/simox/wiki/GraspStudio/feed" rel="self" type="application/rss+xml"/><item><title>GraspStudio modified by Valerij Wittenbeck</title><link>https://sourceforge.net/p/simox/wiki/GraspStudio/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v6
+++ v7
@@ -1,6 +1,6 @@
-_GraspStudio_ is a library that closely incorporates with _VirtualRobot_ and which can be used for efficient grasp planning. Based on a robot defined in _VirtualRobot_, any end effector can be decoupled from the model and considered for grasp planning. The Grasp Center Point (GCP) of an end effector defines the favorite grasping position and an approach direction. A grasp planner interface is provided, which is used for the implementation of a generic grasp planner. This generic grasp planner mainly relies on two exchangeable functionalities: A generator for building grasping hypothesis and a grasp evaluation component. 
+`GraspStudio` is a library that closely incorporates with `VirtualRobot` and which can be used for efficient grasp planning. Based on a robot defined in `VirtualRobot`, any end effector can be decoupled from the model and considered for grasp planning. The Grasp Center Point (GCP) of an end effector defines the favorite grasping position and an approach direction. A grasp planner interface is provided, which is used for the implementation of a generic grasp planner. This generic grasp planner mainly relies on two exchangeable functionalities: A generator for building grasping hypothesis and a grasp evaluation component.

-You can obtain further information by looking at the source code of the [ examples](Examples_) **GraspPlanner** and **GraspEditor**. 
+You can obtain further information by looking at the source code of the [examples](Examples) **GraspPlanner** and **GraspEditor**. 

 # The Generic Grasp Planner

@@ -38,31 +38,59 @@
     GraspStudio::GenericGraspPlannerPtr planner(new GraspStudio::GenericGraspPlanner(grasps, qualityMeasure, approach, 0.2, true));

-[[img src=GraspPlanner.png width=100%]] 
+[[img src=GraspPlanner.png width=50%]] 

 ## Plan a Grasp

-Grasps can now be planned by calling the _plan_ method of the grasp planner object. Depending on the parameters specified on construction, the grasp planner tries to create the specified number of grasps while respecting the timeout in milliseconds. 
+Grasps can now be planned by calling the `plan` method of the grasp planner object. Depending on the parameters specified on construction, the grasp planner tries to create the specified number of grasps while respecting the timeout in milliseconds. 

-    // Search one grasp with a timeout of 1000 milliseconds
-    int graspsPlanned = planner-&gt;plan(1,1000);
-    
-    // retrieve the pose of the grasp
-    if (graspsPlanned==1)
-    {
-        // mGrasp is the pose of the grasp applied to the global object pose, resulting in the global TCP pose which is related to the grasp
-        Eigen::Matrix4f mGrasp = grasps-&gt;getGrasp(0)-&gt;getTcpPoseGlobal(object-&gt;getGlobalPose());
-        // now the eef can be set to a position so that it's TCP is at mPose 
-        eefCloned-&gt;setGlobalPoseForRobotNode(eefCloned-&gt;getEndEffector("Left Hand")-&gt;getTcp(),mGrasp);
-    }
-    
-    
-    // the last computed quality can be retrieved with
-    float qual = qualityMeasure-&gt;getGraspQuality();
-    bool isFC = qualityMeasure-&gt;isGraspForceClosure();
-    
-    
-    // The contacts information can be retrieved, by closing the end effector
-    // Additionally the visualization of eefCloned will show the closed fingers
-    std::vector
-    
+~~~~~~
+// Search one grasp with a timeout of 1000 milliseconds
+int graspsPlanned = planner-&gt;plan(1,1000);
+
+// retrieve the pose of the grasp
+if (graspsPlanned==1)
+{
+   // mGrasp is the pose of the grasp applied to the global object pose, resulting in the global TCP pose which is related to the grasp
+   Eigen::Matrix4f mGrasp = grasps-&gt;getGrasp(0)-&gt;getTcpPoseGlobal(object-&gt;getGlobalPose());
+   // now the eef can be set to a position so that it's TCP is at mPose 
+   eefCloned-&gt;setGlobalPoseForRobotNode(eefCloned-&gt;getEndEffector("Left Hand")-&gt;getTcp(),mGrasp);
+}
+
+
+// the last computed quality can be retrieved with
+float qual = qualityMeasure-&gt;getGraspQuality();
+bool isFC = qualityMeasure-&gt;isGraspForceClosure();
+
+
+// The contacts information can be retrieved, by closing the end effector
+// Additionally the visualization of eefCloned will show the closed fingers
+std::vector&lt; VirtualRobot::EndEffector::ContactInfo &gt; contacts = eefCloned-&gt;getEndEffector("Left Hand")-&gt;closeActors(object);
+~~~~~~
+
+[[img src=GraspPlanner1.png width=50% alt="A planned grasp with contact information."]]
+
+## Store a Set of Grasps
+
+Grasps can be easily managed by ManipulationObjects, as shown in the following example. A new object is created and cloned instances of the visualization and the collision model are passed to the constructor. Then the set of planned grasps is added and the object is stored to an XML file. The XML file will contain the filename of the visualization model and all grasping information.
+
+~~~~~~
+// create a new object, pass cloned visualizations and collision models to it.
+VirtualRobot::ManipulationObjectPtr newObject(new VirtualRobot::ManipulationObject(object-&gt;getName(),object-&gt;getVisualization()-&gt;clone(),object-&gt;getCollisionModel()-&gt;clone()));
+
+// append the set of planned grasps
+newObject-&gt;addGraspSet(grasps);
+
+// save to XML file
+try
+{
+   ObjectIO::saveManipulationObject(newObject, "ObjectWithGraspSet.xml");
+}
+catch (VirtualRobotException &amp;amp;e)
+{
+   cout &lt;&lt; " ERROR while saving object" &lt;&lt; endl;
+   cout &lt;&lt; e.what();
+}
+~~~~~~
+
+[[img src=Grasp1.png width=50% alt="A planned grasp with contact information."]]
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Valerij Wittenbeck</dc:creator><pubDate>Wed, 02 Jul 2014 11:28:52 -0000</pubDate><guid>https://sourceforge.net95468ed60101296a915b5b6a8323176e901a9180</guid></item><item><title>GraspStudio modified by Valerij Wittenbeck</title><link>https://sourceforge.net/p/simox/wiki/GraspStudio/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v5
+++ v6
@@ -10,10 +10,10 @@
     VirtualRobot::RobotPtr robot = VirtualRobot::RobotIO::loadRobot(filename);

     // get end effector
-    VirtualRobot::EndEffectorPtr eef = robot-&amp;gt;getEndEffector("Left Hand");
+    VirtualRobot::EndEffectorPtr eef = robot-&gt;getEndEffector("Left Hand");

     // set eef to a preshape configuration which is specified in the eef's XML defintion 
-    eef-&amp;gt;setPreshape("Grasp Preshape");
+    eef-&gt;setPreshape("Grasp Preshape");

     // load object
     VirtualRobot::ManipulationObjectPtr object = ObjectIO::loadManipulationObject("MashedPotatoes.xml");
@@ -25,41 +25,41 @@
 To setup the grasp planner, firstly a quality measure module (GraspQualityMeasureWrenchSpace) and a grasp hypotheses generator (ApproachMovementSurfaceNormal) are built. These objects are passed to the generic grasp planner together with some parameters. 

     GraspStudio::GraspQualityMeasureWrenchSpacePtr qualityMeasure(new GraspStudio::GraspQualityMeasureWrenchSpace(object));
-    qualityMeasure-&amp;gt;calculateObjectProperties();
+    qualityMeasure-&gt;calculateObjectProperties();
     GraspStudio::ApproachMovementSurfaceNormalPtr approach(new GraspStudio::ApproachMovementSurfaceNormal(object,eef));

     // get the decoupled eef, which is an independent VirtualRobot::RobotPtr
-    VirtualRobot::RobotPtr eefCloned = approach-&amp;gt;getEEFRobotClone();
+    VirtualRobot::RobotPtr eefCloned = approach-&gt;getEEFRobotClone();

     // newly created grasps will be stored here 
-    VirtualRobot::GraspSetPtr grasps(new VirtualRobot::GraspSet("my new grasp set",robot-&amp;gt;getType(),eef-&amp;gt;getName()));
+    VirtualRobot::GraspSetPtr grasps(new VirtualRobot::GraspSet("my new grasp set",robot-&gt;getType(),eef-&gt;getName()));

     // setup the planner: The minimum quality that must be reached by a planned grasp is set to 0.2 and the grasps have to be force-closure
     GraspStudio::GenericGraspPlannerPtr planner(new GraspStudio::GenericGraspPlanner(grasps, qualityMeasure, approach, 0.2, true));

-[[img src=GraspPlanner.png]] 
+[[img src=GraspPlanner.png width=100%]] 

 ## Plan a Grasp

 Grasps can now be planned by calling the _plan_ method of the grasp planner object. Depending on the parameters specified on construction, the grasp planner tries to create the specified number of grasps while respecting the timeout in milliseconds. 

     // Search one grasp with a timeout of 1000 milliseconds
-    int graspsPlanned = planner-&amp;gt;plan(1,1000);
+    int graspsPlanned = planner-&gt;plan(1,1000);

     // retrieve the pose of the grasp
     if (graspsPlanned==1)
     {
         // mGrasp is the pose of the grasp applied to the global object pose, resulting in the global TCP pose which is related to the grasp
-        Eigen::Matrix4f mGrasp = grasps-&amp;gt;getGrasp(0)-&amp;gt;getTcpPoseGlobal(object-&amp;gt;getGlobalPose());
+        Eigen::Matrix4f mGrasp = grasps-&gt;getGrasp(0)-&gt;getTcpPoseGlobal(object-&gt;getGlobalPose());
         // now the eef can be set to a position so that it's TCP is at mPose 
-        eefCloned-&amp;gt;setGlobalPoseForRobotNode(eefCloned-&amp;gt;getEndEffector("Left Hand")-&amp;gt;getTcp(),mGrasp);
+        eefCloned-&gt;setGlobalPoseForRobotNode(eefCloned-&gt;getEndEffector("Left Hand")-&gt;getTcp(),mGrasp);
     }

     // the last computed quality can be retrieved with
-    float qual = qualityMeasure-&amp;gt;getGraspQuality();
-    bool isFC = qualityMeasure-&amp;gt;isGraspForceClosure();
+    float qual = qualityMeasure-&gt;getGraspQuality();
+    bool isFC = qualityMeasure-&gt;isGraspForceClosure();

     // The contacts information can be retrieved, by closing the end effector
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Valerij Wittenbeck</dc:creator><pubDate>Tue, 01 Jul 2014 11:11:42 -0000</pubDate><guid>https://sourceforge.net4be478aa3fc2e1d5f36cb9776c686c8129f998f1</guid></item><item><title>GraspStudio modified by Nikolaus Vahrenkamp</title><link>https://sourceforge.net/p/simox/wiki/GraspStudio/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nikolaus Vahrenkamp</dc:creator><pubDate>Mon, 23 Jun 2014 06:40:12 -0000</pubDate><guid>https://sourceforge.netafbee8e367af41096d9c466da1a20ce7d78ea79b</guid></item><item><title>GraspStudio modified by Nikolaus Vahrenkamp</title><link>https://sourceforge.net/p/simox/wiki/GraspStudio/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -42,7 +42,7 @@

 ## Plan a Grasp

-Grasps can now be planned by calling the _plan_ method of the grasp planner object. 
+Grasps can now be planned by calling the _plan_ method of the grasp planner object. Depending on the parameters specified on construction, the grasp planner tries to create the specified number of grasps while respecting the timeout in milliseconds. 

     // Search one grasp with a timeout of 1000 milliseconds
     int graspsPlanned = planner-&amp;gt;plan(1,1000);
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nikolaus Vahrenkamp</dc:creator><pubDate>Mon, 23 Jun 2014 06:40:12 -0000</pubDate><guid>https://sourceforge.net2f8fec9a127829f95c4f9556bfd7af4fa8eb1d92</guid></item><item><title>GraspStudio modified by Nikolaus Vahrenkamp</title><link>https://sourceforge.net/p/simox/wiki/GraspStudio/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -20,7 +20,7 @@

-## Setup Grasp Planner
+## Setup the Grasp Planner

 To setup the grasp planner, firstly a quality measure module (GraspQualityMeasureWrenchSpace) and a grasp hypotheses generator (ApproachMovementSurfaceNormal) are built. These objects are passed to the generic grasp planner together with some parameters. 

@@ -38,8 +38,7 @@
     GraspStudio::GenericGraspPlannerPtr planner(new GraspStudio::GenericGraspPlanner(grasps, qualityMeasure, approach, 0.2, true));

-  
-
+[[img src=GraspPlanner.png]] 

 ## Plan a Grasp

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nikolaus Vahrenkamp</dc:creator><pubDate>Mon, 23 Jun 2014 06:40:12 -0000</pubDate><guid>https://sourceforge.netc4fa72e19771ba6ea4f3ccfc2974abba50d4e1d8</guid></item><item><title>GraspStudio modified by Nikolaus Vahrenkamp</title><link>https://sourceforge.net/p/simox/wiki/GraspStudio/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -54,8 +54,16 @@
         // mGrasp is the pose of the grasp applied to the global object pose, resulting in the global TCP pose which is related to the grasp
         Eigen::Matrix4f mGrasp = grasps-&amp;gt;getGrasp(0)-&amp;gt;getTcpPoseGlobal(object-&amp;gt;getGlobalPose());
         // now the eef can be set to a position so that it's TCP is at mPose 
-        eefCloned-&amp;gt;setGlobalPoseForRobotNode(eefCloned-&amp;gt;getEndEffector(eef-&amp;gt;getName())-&amp;gt;getTcp(),mGrasp);
+        eefCloned-&amp;gt;setGlobalPoseForRobotNode(eefCloned-&amp;gt;getEndEffector("Left Hand")-&amp;gt;getTcp(),mGrasp);
     }

-
-[[img src=PlanningBiRrt_ext_ext.png]] 
+    
+    // the last computed quality can be retrieved with
+    float qual = qualityMeasure-&amp;gt;getGraspQuality();
+    bool isFC = qualityMeasure-&amp;gt;isGraspForceClosure();
+    
+    
+    // The contacts information can be retrieved, by closing the end effector
+    // Additionally the visualization of eefCloned will show the closed fingers
+    std::vector
+    
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nikolaus Vahrenkamp</dc:creator><pubDate>Mon, 23 Jun 2014 06:40:12 -0000</pubDate><guid>https://sourceforge.netd39164595bcba09c35f7f73239189dfe4718289e</guid></item><item><title>GraspStudio modified by Nikolaus Vahrenkamp</title><link>https://sourceforge.net/p/simox/wiki/GraspStudio/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;GraspStudio&lt;/em&gt; is a library that closely incorporates with &lt;em&gt;VirtualRobot&lt;/em&gt; and which can be used for efficient grasp planning. Based on a robot defined in &lt;em&gt;VirtualRobot&lt;/em&gt;, any end effector can be decoupled from the model and considered for grasp planning. The Grasp Center Point (GCP) of an end effector defines the favorite grasping position and an approach direction. A grasp planner interface is provided, which is used for the implementation of a generic grasp planner. This generic grasp planner mainly relies on two exchangeable functionalities: A generator for building grasping hypothesis and a grasp evaluation component. &lt;/p&gt;
&lt;p&gt;You can obtain further information by looking at the source code of the &lt;a class="" href="../Examples_"&gt; examples&lt;/a&gt; &lt;strong&gt;GraspPlanner&lt;/strong&gt; and &lt;strong&gt;GraspEditor&lt;/strong&gt;. &lt;/p&gt;
&lt;h1 id="the-generic-grasp-planner"&gt;The Generic Grasp Planner&lt;/h1&gt;
&lt;p&gt;In the following setup, it is showed how the generic grasp planner can be setup and used for planning feasible grasps. &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="c1"&gt;// load robot&lt;/span&gt;
&lt;span class="n"&gt;VirtualRobot&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;RobotPtr&lt;/span&gt; &lt;span class="n"&gt;robot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;VirtualRobot&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;RobotIO&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;loadRobot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// get end effector&lt;/span&gt;
&lt;span class="n"&gt;VirtualRobot&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;EndEffectorPtr&lt;/span&gt; &lt;span class="n"&gt;eef&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;robot&lt;/span&gt;&lt;span class="o"&gt;-&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="n"&gt;getEndEffector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;Left Hand&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// set eef to a preshape configuration which is specified in the eef's XML defintion &lt;/span&gt;
&lt;span class="n"&gt;eef&lt;/span&gt;&lt;span class="o"&gt;-&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="n"&gt;setPreshape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;Grasp Preshape&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// load object&lt;/span&gt;
&lt;span class="n"&gt;VirtualRobot&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;ManipulationObjectPtr&lt;/span&gt; &lt;span class="n"&gt;object&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ObjectIO&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;loadManipulationObject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;MashedPotatoes.xml&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id="setup-grasp-planner"&gt;Setup Grasp Planner&lt;/h2&gt;
&lt;p&gt;To setup the grasp planner, firstly a quality measure module (GraspQualityMeasureWrenchSpace) and a grasp hypotheses generator (ApproachMovementSurfaceNormal) are built. These objects are passed to the generic grasp planner together with some parameters. &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;GraspStudio&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;GraspQualityMeasureWrenchSpacePtr&lt;/span&gt; &lt;span class="n"&gt;qualityMeasure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="n"&gt;GraspStudio&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;GraspQualityMeasureWrenchSpace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;object&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="n"&gt;qualityMeasure&lt;/span&gt;&lt;span class="o"&gt;-&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="n"&gt;calculateObjectProperties&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;GraspStudio&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;ApproachMovementSurfaceNormalPtr&lt;/span&gt; &lt;span class="n"&gt;approach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="n"&gt;GraspStudio&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;ApproachMovementSurfaceNormal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;object&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;eef&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

&lt;span class="c1"&gt;// get the decoupled eef, which is an independent VirtualRobot::RobotPtr&lt;/span&gt;
&lt;span class="n"&gt;VirtualRobot&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;RobotPtr&lt;/span&gt; &lt;span class="n"&gt;eefCloned&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;approach&lt;/span&gt;&lt;span class="o"&gt;-&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="n"&gt;getEEFRobotClone&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// newly created grasps will be stored here &lt;/span&gt;
&lt;span class="n"&gt;VirtualRobot&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;GraspSetPtr&lt;/span&gt; &lt;span class="n"&gt;grasps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="n"&gt;VirtualRobot&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;GraspSet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;my new grasp set&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;robot&lt;/span&gt;&lt;span class="o"&gt;-&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="n"&gt;getType&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;&lt;span class="n"&gt;eef&lt;/span&gt;&lt;span class="o"&gt;-&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="n"&gt;getName&lt;/span&gt;&lt;span class="p"&gt;()));&lt;/span&gt;

&lt;span class="c1"&gt;// setup the planner: The minimum quality that must be reached by a planned grasp is set to 0.2 and the grasps have to be force-closure&lt;/span&gt;
&lt;span class="n"&gt;GraspStudio&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;GenericGraspPlannerPtr&lt;/span&gt; &lt;span class="n"&gt;planner&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="n"&gt;GraspStudio&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;GenericGraspPlanner&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;grasps&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;qualityMeasure&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;approach&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id="plan-a-grasp"&gt;Plan a Grasp&lt;/h2&gt;
&lt;p&gt;Grasps can now be planned by calling the &lt;em&gt;plan&lt;/em&gt; method of the grasp planner object. &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="c1"&gt;// Search one grasp with a timeout of 1000 milliseconds&lt;/span&gt;
&lt;span class="k"&gt;int&lt;/span&gt; &lt;span class="n"&gt;graspsPlanned&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;planner&lt;/span&gt;&lt;span class="o"&gt;-&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="n"&gt;plan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mh"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// retrieve the pose of the grasp&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;graspsPlanned&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="mh"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// mGrasp is the pose of the grasp applied to the global object pose, resulting in the global TCP pose which is related to the grasp&lt;/span&gt;
    &lt;span class="n"&gt;Eigen&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;Matrix4f&lt;/span&gt; &lt;span class="n"&gt;mGrasp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;grasps&lt;/span&gt;&lt;span class="o"&gt;-&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="n"&gt;getGrasp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="n"&gt;getTcpPoseGlobal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;object&lt;/span&gt;&lt;span class="o"&gt;-&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="n"&gt;getGlobalPose&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
    &lt;span class="c1"&gt;// now the eef can be set to a position so that it's TCP is at mPose &lt;/span&gt;
    &lt;span class="n"&gt;eefCloned&lt;/span&gt;&lt;span class="o"&gt;-&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="n"&gt;setGlobalPoseForRobotNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;eefCloned&lt;/span&gt;&lt;span class="o"&gt;-&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="n"&gt;getEndEffector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;eef&lt;/span&gt;&lt;span class="o"&gt;-&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="n"&gt;getName&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;&lt;span class="o"&gt;-&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="n"&gt;getTcp&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;&lt;span class="n"&gt;mGrasp&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;img src="./attachment/PlanningBiRrt_ext_ext.png" /&gt; &lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nikolaus Vahrenkamp</dc:creator><pubDate>Mon, 23 Jun 2014 06:40:12 -0000</pubDate><guid>https://sourceforge.netf1a8f524725d2ed906733801fb4f389455247ae3</guid></item></channel></rss>