FLUIDLAB: A DIFFERENTIABLE ENVIRONMENT FOR BENCHMARKING COMPLEX FLUID MANIPULATION

Abstract

Humans manipulate various kinds of fluids in their everyday life: creating latte art, scooping floating objects from water, rolling an ice cream cone, etc. Using robots to augment or replace human labors in these daily settings remain as a challenging task due to the multifaceted complexities of fluids. Previous research in robotic fluid manipulation mostly consider fluids governed by an ideal, Newtonian model in simple task settings (e.g., pouring water into a container). However, the vast majority of real-world fluid systems manifest their complexities in terms of the fluid's complex material behaviors (e.g., elastoplastic deformation) and multi-component interactions (e.g. coffee and frothed milk when making latte art), both of which were well beyond the scope of the current literature. To evaluate robot learning algorithms on understanding and interacting with such complex fluid systems, a comprehensive virtual platform with versatile simulation capabilities and well-established tasks is needed. In this work, we introduce FluidLab, a simulation environment with a diverse set of manipulation tasks involving complex fluid dynamics. These tasks address interactions between solid and fluid as well as among multiple fluids. At the heart of our platform is a fully differentiable physics simulator, FluidEngine, providing GPU-accelerated simulations and gradient calculations for various material types and their couplings, extending the scope of the existing differentiable simulation engines. We identify several challenges for fluid manipulation learning by evaluating a set of reinforcement learning and trajectory optimization methods on our platform. To address these challenges, we propose several domain-specific optimization schemes coupled with differentiable physics, which are empirically shown to be effective in tackling optimization problems featured by fluid system's non-convex and nonsmooth properties. Furthermore, we demonstrate reasonable sim-to-real transfer by deploying optimized trajectories in real-world settings.

1. INTRODUCTION

Imagine you are fishing on the lakeside. Your hat falls into the water and starts to float out of reach. In order to get it back, you use your hands to paddle the water gently, generating a current that pulls the the hat back into reach. In this scenario, the water functions as a transmitting medium for momentum exchange to accomplish the manipulation task. In fact, from creating latte art to making ice creams, humans frequently interact with different types of fluids everyday (Figure 1 ). However, performing these tasks are still beyond the reach of today's robotic systems due to three major challenges. First, fluid systems exhibit a wide range of material models (e.g., air, liquid, granular flow, etc. (Bridson, 2015) ) that are difficult to simulate within a unified framework. Second, describing the state of a fluid system under manipulation requires a high dimensional state space (Lin et al., 2020) . Third, the nonlinear dynamics of different coupling models pose unique challenges to efficient solution search in the state space (Schenck & Fox, 2018) . For example, although water and smoke face the same computational challenges in solving fluid equations, manipulating these two mediums in different physical contexts requires different strategies. Prior works in robotic manipulation covering fluids mostly adopt relatively simple task settings, and usually consider tasks with a single-phase fluid, such as pouring water (Schenck & Fox, 2018; Lin et al., 2020; Sermanet et al., 2018) or scooping objects from water (Seita et al., 2022; Antonova et al., 2022) . In this work, we aim to study the problem of complex fluid manipulation with more challenging task settings and complex goal configurations. Since virtual environments have played an instrumental role in benchmarking and developing robot learning algorithms (Brockman et al., 2016; Kolve et al., 2017; Xiang et al., 2020) , it is desirable to have a virtual platform providing a versatile set of fluid manipulation tasks. In this work, we propose FluidLab, a new simulation environment to pave the way for robotic learning of complex fluid manipulation skills that could be useful for real-world applications. FluidLab provides a new set of manipulation tasks that are inspired by scenarios encountered in our daily life, and consider both interactions within multiple fluids (e.g., coffee and frothed milk), as well as the coupling between fluids and solids. Building such an environment poses a major challenge to the simulation capability: fluids encountered in our life consist of a wide spectrum of materials with different properties; in addition, simulating these tasks also requires modeling interactions with other non-fluid materials. For example, coffee is a type of (mostly inviscid) Newtonian liquid; frothed milk behaves as viscous Newtonian liquid (i.e., with a constant viscosity that does not change with stress) (Figure 1 , R-A), while ice cream is a type of non-Newtonian fluid (in particular, a shear-thinning fluid with its viscosity decreasing as the local stress increasing) (Figure 1, R-B ); when stirring a cup of coffee, we use a rigid stick to manipulate the coffee (Figure 1, R-A ). However, there still lacks a simulation engine in the research community that supports such a wide variety of materials and couplings between them. Therefore, we developed a new physics engine, named FluidEngine, to support simulating the tasks proposed in FluidLab. FluidEngine is a general-purpose physics simulator that supports modeling solid, liquid and gas, covering materials including elastic, plastic and rigid objects, Newtonian and non-Newtonian liquids, as well as smoke and air. FluidEngine is developed using Taichi (Hu et al., 2019b) , a domain-specific language embedded in Python, and supports massive parallelism on GPUs. In addition, it is implemented in a fully differentiable manner, providing useful gradient information for downstream optimization tasks. FluidEngine follows the OpenAI Gym API (Brockman et al., 2016) and also comes with a user-friendly Python interface for building custom environments. We also provide a GPU-accelerated renderer developed with OpenGL, supporting realistic image rendering in real-time. We evaluate state-of-the-art Reinforcement Learning algorithms and trajectory optimization methods in FluidLab, and highlight major challenges with existing methods for solving the proposed tasks. In addition, since differentiable physics has proved useful in many rigid-body and soft-body robotic tasks (Xu et al., 2021; Lin et al., 2022a; Xu et al., 2022; Li et al., 2022) , it is desirable to extend it to fluid manipulation tasks. However, supporting such a wide spectrum of materials present in FluidLab in a differentiable way is extremely challenging, and optimization using the gradients is also difficult due to the highly non-smooth optimization landscapes of the proposed tasks. We propose several optimization schemes that are generally applicable to the context of fluids, making our simulation fully differentiable and providing useful directions to utilize gradients



Figure 1: We encounter various manipulation tasks involving fluids in everyday life. Left: real-world scenarios including making latte art, making ice creams and designing air ventilation systems. Right: simulation tasks in FluidLab involving latte art, ice-creams and indoor air circulation.

availability

//fluidlab2023.github.io.

