Learning Task-Oriented Grasping for Tool Manipulation from Simulated Self-Supervision
Kuan Fang, Yuke Zhu, Animesh Garg, Andrey Kurenkov, Viraj Mehta, Li Fei-Fei, Silvio Savarese
I Introduction
Tool manipulation can be defined as the employment of a manipulable object, i.e. a tool, to fulfill a task goal. For this purpose, the agent needs to effectively orient and then manipulate the tool so as to achieve the desired effect. According to Brown et al. , there are four key aspects to learning task-oriented tool usage: (a) understanding the desired effect, (b) identifying properties of an object that make it a suitable tool, (c) determining the correct orientation of the tool prior to usage, and (d) manipulating the tool. A task-oriented grasp is therefore a grasp that makes it possible to correctly orient the tool and then manipulate it to complete the task.
Consider a hammer object as shown in Figure 1. The best grasp predicted by a task-agnostic task-agnostic grasp prediction model, such as Dex-Net , is likely to reside close to the center of mass to optimize for robustness. However, the hammering task can be best achieved by holding the hammer at the far end of the handle, thus to generate a high moment at the point of impact on the head. And yet when the same object is used for the sweeping task, it should be grasped by the head since that spares the largest contact surface area with the target objects. In order to optimize for the task success, both grasping robustness and suitability for the manipulation should be considered.
The problem of understanding and using tools has been studied in robotics, computer vision, and psychology . Various studies in robotics have primarily focused on reasoning about the geometric properties of tools . They often assume prior knowledge of object geometry and require predefined affordance labels and semantic constraints, which has constrained their usefulness in realistic environments with sensory and control uncertainty. Some pioneering works have also grounded the tool grasping problem in an interactive environment . Nonetheless, their approaches relied on hand-engineered feature representations and simplified action spaces, which are limited to the tasks they are tuned to work for and allow only limited generalization to novel objects in complex manipulation tasks.
In this work, we focus on tool manipulation tasks that consist of two stages. First, the robot picks up a tool resting on the tabletop. Second, it manipulates this tool to complete a task. We propose the Task-Oriented Grasping Network (TOG-Net), a learning-based model for jointly predicting task-oriented grasps and subsequent manipulation actions given the visual inputs. To accommodate the need for large amounts of training data for deep learning, we embrace the self-supervised learning paradigm , where the robot performs grasping and manipulation attempts and the training labels automatically generated thereby. To scale up our self-supervision data collection, we leverage a real-time physics simulator that allows a simulated robot to perform task executions with diverse procedurally generated 3D objects. We evaluate our method on a hammering task and a sweeping task. Our model is proved to learn robust policies that generalize well to novel objects both in simulation and the real world. In the real-world experiments, our model achieves 71.1% task success rate for sweeping and 80.0% task success rate for hammering using 9 unseen objects as tools.
Our primary contributions are three-fold: 1) We propose a learning-based model for jointly learning task-oriented grasping and tool manipulation that directly optimizes task success; 2) To train this model, we develop a mechanism for generating large-scale simulated self-supervision with a large repository of procedurally generated 3D objects; 3) We demonstrate that our model can generalize to using novel objects as tools in both simulation and the real world.
II Related Work
Task-Agnostic Grasping: Robotic grasping is a long-standing challenge that involves perception and control. Classical methods approach the grasping problem from a purely geometric perspective. They optimize grasp quality measures based on analytic models of geometric constraints, such as force closure and form closure . While grasp quality measures offer a principled mathematical framework of grasp analysis, their practical usage is limited by the large space of possible grasps. Several techniques have been proposed to restrict the search space of grasp candidates. This includes representing objects with shape primitives , simplifying the search of grasps in a subspace of reduced dimensionality , and leveraging a dataset of objects with known grasps to speed up grasp selection for novel objects . Another limitation of these approaches is that they require the full 3D geometry of the object, which restricts their usage in unstructured real-world environments. The recent development of machine learning techniques, especially deep learning, has enabled a surge of research that applies data-driven methods to robotic grasping . These learning methods largely fall into two families depending on the source of supervision: 1) supervised learning approaches , where the models are trained with a dataset of objects with ground-truth grasp annotations, and 2) self-supervision approaches , where grasp labels are automatically generated by a robot’s trial and error on large numbers of real-world or simulated grasp attempts. To address the data-hungry nature of deep neural networks, several works relied on depth sensors to train their models in simulation and transfer to the real robot.
Task-Oriented Grasping: A major portion of research in grasping aims at holding the object in the robot gripper so as to not drop it despite external wrenches. In practice, however, the end goal of grasping is often to manipulate an object to fulfill a goal-directed task once it has been grasped. When the grasping problem is contextualized in manipulation tasks, a grasp planner that solely satisfies the stability constraints is no longer sufficient to satisfy the task-specific requirements. In classical grasping literature, researchers have developed task-oriented grasp quality measures using task wrench space .
Data-driven approaches have also been used to learn task-related constraints for grasp planning . These studies incorporate semantic constraints, which specify which object regions to hold or avoid, based on a small dataset of grasp examples. However, these grasping methods cannot entail the success of the downstream manipulation tasks, and the hand-labeled semantic constraints cannot generalize across a large variety of objects. On the contrary, our work jointly learns the task-aware grasping model and the manipulation policy given a grasp. Thus, our grasping model is directly optimized to fulfill its downstream manipulation tasks. Furthermore, we employ deep neural networks to train our task-aware grasping models on a large repository of 3D objects, enabling it to generalize from this repository of objects to unseen objects as well as from simulation to the real world.
Affordance Learning: Another line of related work centers around understanding the affordances of objects . The notion of affordances introduced by Gibson characterizes the functional properties of objects and has been widely used in the robotics community as a framework of reasoning about objects . Prior art has developed methods to learn different forms of object affordance such as semantic labels , spatial maps , and motion trajectories . Our work follows a progression of previous work on behavior-grounded affordance learning , where the robot learns object affordance by observing the effects of actions performed on the objects. Nonetheless, we do not explicitly supervise our model to learn and represent goal-directed object affordances. Instead, we demonstrate that our model’s understanding of object affordance naturally emerges from training grasping and manipulation simultaneously. Recent work by has the closest resemblance to our problem setup; however, their action space consists of a small set of discrete actions, while we employ a multi-dimensional continuous action space. Aside from the problem, their method of self-organizing maps uses hand-designed tool pose and affordance descriptors, while we eschew feature engineering in favor of end-to-end deep learning.
III Problem Statement
Our goal is to control a robot arm to perform tool-based manipulation tasks using novel objects. Each task is a two-stage process. In the first stage, the robot grasps an object as a tool for a task. In the second stage, the robot manipulates the tool to interact with the environment to complete the goal of the task. The visual appearance of the tool is provided for the robot to accomplish this.
Notations of Grasping: The robot operates in a workspace based on camera observations, where denotes the observation space. We consider the grasping problem in the 3D space, where denotes the space of possible grasps. Given a pair of observation and grasp , let denote a binary-valued grasp success metric, where indicates that the grasp is successful according to the predefined metric. In practice, the underlying sensing and motor noise introduce uncertainty to the execution of a grasp. We measure the robustness of a grasp by the probability of grasp success under uncertainty, where . This grasp metric is task-agnostic, which evaluates the quality of a grasp without grounding to a specific task. As we noted in Section II, data-driven grasping methods have focused on optimizing task-agnostic grasps.
Problem Setup: By contrast, we contextualize the grasping problem in tool manipulation tasks. In our setup, the grasping stage is followed by a manipulation stage, where a policy produces actions to interact with the environment once the object is grasped. Intuitively, both the choice of grasps and the manipulation policy play an integral role in the success rate of a task.
Let denote a binary-valued task-specific success metric, where indicates that the task is successfully done based on the goal specification. Clearly the grasp success is the premise of the task success, i.e., entails . Given a manipulation policy for the task, we measure the robustness of a task-oriented grasp by the probability of task success under policy , where . Thereafter, the overall learning objective is to train both policies simultaneously such that:
We aim at selecting the optimal grasp that is most likely to lead to to the completion of the task, and at the same time finding the best policy to perform the task conditioned on a grasp. In practice, we implement both the grasping policy and the manipulation policy using deep neural networks. We detail the design of the neural network models and their training procedures in Sec. IV.
IV Task-Oriented Grasping for Tool Manipulation
As shown in Fig 2, our task-oriented grasping network (TOG-Net) consists of a task-oriented grasping model and a manipulation policy. The two modules are coupled and learn to achieve task success together. In this section, we first present the design and implementation of the two modules, and then describe how they are jointly trained using simulated self-supervision.
High-quality task-oriented grasps should simultaneously satisfy two types of constraints. First, the tool must be stably held in the robot gripper, which is the goal of task-agnostic grasping. Second, the grasp must satisfy a set of physical and semantic constraints that are specific to each task.
For a given observation , a small subset of grasps can robustly lift up the object with a grasp quality higher than , i.e. . Hence, the task agnostic grasp prediction problem involves finding the corresponding grasp that maximizes the grasp quality . This prediction problem can be solved with a variety of methods, and we build upon the approach of Mahler et al. that uses quality function approximation with algorithmic supervision via analytic models.
As noted in Section III, the overall objective is maximizing the probability of task success under a policy , grasp . However, directly solving this problem results in a discrete space search over a large space of grasps, and then a subsequent optimization problem to solve for a manipulation policy given each grasp. Furthermore, we note that tool manipulation task execution only succeeds if the grasp has succeeded. However, not all grasps result in a successful task. Specifically, we can define a conditional robustness metric that measures the probability of task success (under policy ) conditioned on a successful grasp, where . Then, task-oriented grasps form a subset of task-agnostic grasps: , i.e. the grasps which lead to task success with a task quality conditioned on the grasp where is a chosen threshold.
This formulation lets us to effectively decouple the two problems as: 1) finding robust task-agnostic grasps; and 2) finding a robust task-oriented grasp among robust grasps and the corresponding manipulation policy. The key observation is that the task quality metric can be factorized into independently computable terms: and . Formally, the task robustness can be decomposed as follow:
Our model learns to approximate the values of grasp quality and task quality conditioned on grasp using deep neural networks given object and grasp as inputs. We denote the predicted values as and , where and represent the neural network parameters.
The pipeline during testing is shown in Figure 2. We first sample 200 antipodal grasp candidates based on depth gradients . Then is computed for each grasp candidate. We run the cross-entropy method for 3 iterations as in , in order to rank and choose the task-oriented grasp corresponds to the highest .
IV-B Learning the Manipulation Policy
IV-C Neural Network Architecture
In Figure 3 we propose a three-stream neural network architecture for jointly predicting and and . Following the practice of , we convert and into gripper depth and image crops as inputs to the neural network. The gripper depth is defined as the distance from the center of the two fingertips to the object surface. The image crops are centered at the grasp center and aligned with the grasp axis orientation . uses image crops of size to focus on the contact between the gripper and the tool. To achieve the task success, our model is supposed to reason about the interactions between the tool and the task environment which requires a holistic understanding of the shape of the tool. Thus our model predicts and using larger image crops of size which covers most of training and testing objects. Meanwhile the center crop of is used to predict . Our neural network is composed of three streams which share parameters in their low-level convolutional layers, extracting identical image features, denoted by dotted lines. Building atop the GQCNN in , we use residual network layers and batch normalization to facilitate the learning process. On top of the convolutional layers with shared weights, we apply bottleneck layers of convolutional filters for each stream to reduce the size of the network.
IV-D Learning Objectives and Optimization
We jointly train the task-oriented grasping model and the manipulation policy with simulated robot experiments of grasping and manipulation. Each simulated episode in our training dataset contains sampled grasp , action and the resultant grasp success label , task success label . We use cross-entropy loss for training the grasp prediction functions and . For training the policy , we use the policy gradient algorithm with gradients . We use the task success label as the reward of the manipulation policy. Since we are using a Gaussian policy as described in Sec. IV-B, this is equivalent to minimizing with respect to . Let the parameters of the neural network to be denoted as , we jointly train our model by solving the following optimization problem:
where is the indicator function.
V Self-Supervision for Grasping and Manipulation
We train our model in simulation with a large repository of 3D models so as to generalize to unseen objects. However, existing 3D model datasets do not contain enough objects suitable for tool manipulation while exhibiting rich variations in terms of their geometric and physical properties. As shown in Figure 4, we leverage a common strategy of procedural generation to produce a large set of diverse and realistic objects that can be used as tools for tasks we are interested in.
While the generation process can be arbitrarily complex, we choose to generate objects composed of two convex parts. The two parts are connected by a fixed joint. We define three type of composed shapes: T-shapes, L-shapes, and X-shapes. For each object, two convex meshes are first sampled. Then the meshes are randomly scaled along the x, y, and z axes. Depending on the type of object shape, the parts are shifted and rotated with respect to each other. We randomly sample physical dynamic properties such as density and friction coefficients.
We use two sets of meshes to generate two different set of objects: primitive and complex. We generate primitive meshes that are composed by a set of parameterized shape primitives including cuboids, cylinders, and polytopes. The dimensions and textures are randomly chosen from predefined ranges. The primitive meshes are generated by OpenScad . We also obtain convex object parts from a variety of realistic 3D object models as the complex meshes. This done by running convex decomposition on each object from .
V-B Data Generation with Simulated Self-Supervision
In order to collect large-scale datasets for training and evaluating our model, we develop a self-supervision framework to automatically generate training data. We leverage an open-source real-time physics simulator, Bullet , which allows a simulated robot to perform trial and error in millions of trails. We record grasp and task success labels in each trial and use them to train our models described in Section IV. For training each task we collect the data in three rounds. After each round, we train the grasping model and the manipulation policy using the collected data to obtain an updated model. In each round we run the simulation for 500K trials.
In the first round, we perform a random policy using a GQCNN model trained on Dex-Net 2.0 Dataset . The original GQCNN model uses a cross entropy method (CEM) to sample robust grasps corresponds to the highest task-agnostic grasp quality scores. But the trained GQCNN usually lead to a collapsed mode of grasps which is most robust according to the ranking of the predicted scores. Ideally we want to collect data of diverse sampled grasps and evaluate how well they can be used in each task. An alternative is to sample uniformly sample grasps with grasp quality scores higher than a threshold. In practice we found such sampling usually clusters on the long edge of a tool object since there are more antipodal grasps possible there. To encourage diverse exploration, we instead use non-maximum suppression (NMS) which is widely used in object detection algorithms. The NMS algorithm goes through the ranked antipodal grasps, and removes grasps which have short Euclidean distances with previous grasps with higher grasp quality scores. This guarantees all remaining grasps are separate from each other and usually produces 10 to 30 distinguished modes. With these sampled grasp, the random policy uniformly samples manipulation action from the action space for each task.
In the following rounds, we use the -greedy strategy with the updated grasping model. The grasping model uses the CEM method described in Section IV with probability , and uses the NMS method with GQCNN predictions as described above with probability. The manipulation policy predicts and manipulation action parameters in Section IV with probability , and use random actions with probability . We set 0.2 for both and .
VI Experiments
The goal of our experimental evaluation to answer following questions: (1) Does our method improve task performance as compared to baseline methods? (2) Does the joint training qualitatively change the mode of grasping? (3) Can the model be trained with simulated self-supervision work in the real world?
We evaluate our method on two tabletop manipulation tasks: sweeping and hammering. We define our hammering task as a motion primitive that achieves fitting a peg in a hole with tight tolerance, which is prevalent in assembly tasks as shown in . Sweeping, on the other hand, is a primitive in autonomous manipulation, such as in part positioning and reorientation , grasping in clutter , object manipulation without lifting . Sweeping with tools has been studied in the context of singulation and part retrieval . Each of these tasks requires grasping objects in specific modes which can often be different from the best stable grasp available, thereby resulting in competing objectives.
We evaluate our model in both simulation and the real world. The basic setup of both tasks includes a 7-DoF Rethink Robotics Sawyer Arm with a parallel jaw gripper, a table surface, and an overhead Kinect2 camera. In simulation, the robot and camera are placed according to the real-world camera calibration results, in order to obtain consistent performance. For both experiments, we use models solely trained using simulated data as described in Section IV.
The table surface is split into two halves: a grasping region and a manipulation region. Before each episode starts, an object is sampled and randomly dropped onto the grasping region to be used as the tool. A depth image is taken from the overhead Kinect2 camera as the input of the model. The model then predicts the 4-DOF grasp and the parameters of the motion primitive. The robot grasps the object from the grasping region and performs the task in the manipulation region. In our task design, the motion primitive is a predefined single step action. Our model predicts the starting gripper pose relative to a reference point.
Sweeping: Target objects are randomly placed in the manipulation region as the target objects. In the real world we use two soda cans as the target objects, and in simulation we randomly place one or two 3D models of cans. The task goal is to sweep all target objects off the table using the tool. The motion primitive of sweeping is a straight line trajectory of the gripper parallel to the table surface. The gripper trajectory starts from the pose and moves 40cm along y-axis of the world frame. is predicted relative to the mean position of the target objects. The task success is achieved when all target objects contact the ground. For robust sweeping, the tool ideally need to have a large flat surface in contact with the target object.
Hammering: A peg and a slot are randomly placed in the manipulation region, where the peg is horizontally half-way inserted into the slot. The task goal is to use the tool to hammer the peg fully into the slot. The motion primitive of hammering is a rotation of the gripper along the z-axis. The trajectory starts with the gripper pose and ends after the last arm joint rotates by 90 degree counterclockwise at full speed. is predicted relative to the position of the peg. The task success is achieved when the whole peg is inside the slot. This task requires a sufficient contact force between the tool and the peg to overcome the resistance. Meanwhile the tool should avoid collisions with the peg before the hammering.
VI-B Experiment Setup
Training uses 18,000 procedurally generated objects including 9,000 PG-Primitive objects and 9,000 PG-Complex objects. In addition to randomizing physical properties, we randomly sample the camera pose and intrinsics by adding disturbances to the values obtained from the real-world setup.
During testing, we use 3000 instances of each type of procedurally generated object. We also test on 55 realistic objects selected from Dex-Net 1.0 and MPI Grasping dataset . These objects contain both tool-like and non-tool like objects as shown in Figure 4. None of these test objects are seen during training.
Antipodal+Random: Use a sampled antipodal grasp with a random action uniformly sampled with positions in $\theta[-\frac{\pi}{20},\frac{\pi}{20}]$.
Task_Agn+Random: A task-agnostic grasp from Dex-Net 2.0 with a random action.
Task_Agn+Trained: Same as above but with a manipulation policy trained with our method. This is akin to the current best solution.
Task_Ori+Random: An ablative version of our model with task-oriented grasps executed with a randomized action.
VI-C Simulated Experiments
We evaluate our method on both tasks using the simulated setup described above. For each algorithmic method, we run 100,000 episodes in simulation and report the task success rate. The task success analysis for each of the baselines and our method is presented in Figure 5.
Our model outperforms the four baselines in both tasks for all object categories. The contrast is more significant for hammering than sweeping. This is because hammering requires well-trained manipulation policy to direct the tool to hit the peg. A small deviance from the optimal hammering trajectory can let the tool miss the peg or collide with the slot. While for the sweeping task, when the robot uses a long edge of the tool to sweep, there is a high tolerance of manipulation action errors. Even random actions can often succeed. Among the three object categories, PG-Primitive is usually the easiest to manipulate with. Complex meshes cause more grasping failures and are harder for their geometric properties are harder to reason about. Realistic objects are not usually good for sweeping since they are more roundish and very few have long edges. While the hammering performance with realistic objects are much better, because many of these objects are cylinder objects with a bulky head and even actual hammers.
VI-D Real-World Experiments
For our real-world experiments, we use 9 unseen objects consisting of three categories as shown in Figure 6. T-shape and L-shape objects have similar geometric properties with our procedurally generated objects during training, whereas the miscellaneous objects have structures and curvatures totally unseen during training.
In the real world, we compare our model with two baseline methods: antipodal grasping with trained manipulation policy (antipodal + trained) and task-agnostic grasping with trained manipulation policy (task-agnostic + trained). We perform each task with each object for 5 robot trials for a total of 270 trials. The per-category and overall task success rates are shown in Table I. For all object categories, our model achieved better performance compared to the baselines.
For sweeping, our model can successfully grasp the head of T-shapes or the short edge of L-shapes, and sweep with the longer part. For more complex miscellaneous objects, it is less obvious for the model to figure out which part should be grasped. But for most trials, the grasp predicted by our model is intuitive to humans and leads to successful sweeping. For T-shapes, the difference between task-agnostic and task-oriented grasping is larger since the object usually only has one long handle. In contrast for some L-shapes, the two edges are both long enough for the task, grasping either edge does not make a significant difference. For miscellaneous objects, the model can have problems reasoning about novel object parts. For instance, it sometimes chooses to grasp the handle of the pan and sweep with the round part, which is unstable for sweeping roundish target objects.
For hammering, our model performs equally well for T-shapes and L-shapes. And the failures are usually caused by occasional deviations during the execution of grasping or manipulation. As a comparison, baseline models often choose to grasp the head and hammer with the handle, which is sub-optimal. Compared to T-shapes and L-shapes, there might not be an obvious way to use miscellaneous objects as hammers. Among miscellaneous objects, the pan can be used as a hammer very well. The model tends to grasp the handle and hammer with the bulky roundish part.
VI-E Qualitative Analysis
In Figure 7, we demonstrate the same object can be grasped for different tasks by our trained model. Here we show the modes of task-agnostic grasping and task-oriented grasping for 4 example objects, 2 in simulation and 2 in the real world.
For the sweeping task, it is challenging to sweep all target objects off the table in one shot. It requires the tool to have a flat contact surface to facilitate the manipulation of roundish objects and to sweep across large enough area to catch both of them. Our model learns to grasp the end of the tool object and spare as much surface area as possible for sweeping. This enables the robot to robustly sweep the cans most of the time.
For the hammering task, the main concerns are overcoming the resistance of the peg while avoiding collisions during hammering. We expect the robot to grasp the far end of the handle and hit the peg with the bulky part as the hammer head. Ideally, this could generate the largest torque on the hammer head when hitting the peg. In practice, we found the trained model tends to grasp a little closer to the hammer head on the handle. This is because we use a parallel jaw gripper and it is hard to balance the tool when the fingers are far away from the center of mass.
For robust task-agnostic grasping, the GQCNN model usually chooses the thin part near the center of mass. Although this sometimes still overlaps with the set of task-oriented grasps, it is not guaranteed if the selected grasp from the task-agnostic GQCNN is suitable for the task. In Figure 7 we show example task-agnostic grasps which are different from the task-oriented grasps mentioned above.
VII Conclusion
We develop a learning-based approach for task-oriented grasping for tool-based manipulation trained using simulated self-supervision. It jointly optimizes a task-oriented grasping model and its accompanying manipulation policy to maximize the task success rate. We leverage a physics simulator that allows a robot to autonomously perform millions of grasping and manipulation trials. The trial and error of the robot provides training data to supervise the deep neural network models. Our experimental results demonstrate that the task-oriented grasps selected by our model are more suitable for downstream manipulation tasks than the task-agnostic grasps.
In the future, our goal is to further improve the effectiveness and robustness of our model by training on a large dataset of realistic 3D models. Additionally, we plan to scale up our model to complex manipulation tasks with end-to-end trained closed-loop manipulation policies. Supplementary material is available at: bit.ly/task-oriented-grasp
Acknowledgement
We acknowledge the support of Toyota (1186781-31-UDARO). We thank Ozan Sener for constructive discussions about the problem formulation. We thank Alex Fu, Julian Gao and Danfei Xu for helping with the real-world infrastructure. We thank Erwin Coumans for helping with the Bullet simulator.