Composability framework for robotic control system

Methods, systems, and apparatus, including computer programs encoded on computer storage media, for a composability framework that supports the coordination of the low-level actions of multiple subsystems. One of the methods comprises receiving a multi-device application definition for a real-time robotic control system configured to perform operations comprising controlling a robotic execution environment having multiple robotic components, wherein the application definition comprises: one or more custom high-level software modules for each robotic component of the multiple robotic components; respective module interface definitions for each of the custom high-level software modules, wherein a module interface definition of a custom high-level software module specifies one or more asynchronous or real-time communication channels; and respective device interface definitions for each of the multiple robotic components; and processing the application definition to generate output programs to be executed respectively by the multiple robotic components.

BACKGROUND

This specification relates to frameworks for software control systems.

A software control system is a software system that controls the actions of physical devices, e.g., actuators or robots. Some software control systems are real-time software control systems that control real-time systems. A real-time software control system must execute its control routines within strict timing requirements to achieve normal operation. The timing requirements often specify that certain actions must be executed or outputs must be generated within a particular time window in order for the system to avoid entering a fault state. In the fault state, the system can halt execution or take some other action that interrupts normal operation.

Such real-time software control systems are often used to control physical machines that have high precision and timing requirements. As one example, an execution environment of industrial robots can be controlled by a real-time software control system that requires each robot to repeatedly receive commands at a certain frequency, e.g., 1, 10, or 100 kHz. If one of the robots does not receive a command during one of the periodic time windows, the robot can enter a fault state by halting its operation or by automatically executing a recovery procedure to return to a maintenance position.

Due to such timing requirements, software control systems for physical machines are often implemented by closed software modules that are configured specifically for a highly-specialized tasks. For example, a robot that picks components for placement on a printed circuit board can be controlled by a closed software system that controls each of the low-level picking and placing actions. Often, the coordination of such software control modules follows an observe, plan, and act pattern that involves making a sensor observation, generating a plan, and then acting according to the plan.

SUMMARY

This specification describes a composability framework that supports the coordination of the low-level actions of multiple subsystems, which can include one or more real-time robots. In general, a framework is a library of software modules that provides some basic functionality for building an application in a particular execution environment. In this specification, the execution environment includes multiple subsystems that each have respective computing hardware. The framework provides mechanisms for asynchronous communication channels, discovery of low-level capabilities, and coordination between multiple independent devices. The techniques described below provide a framework for building applications that coordinate the multiple subsystems in the execution environment, each of which may have its own observe, plan, act functionality.

Some existing robotics application frameworks dictate the interface of the devices and software modules, and do not allow a user to customize the interfaces for a particular use case. Some systems described in this application allow a user to compose generic low-level software modules to generate high-level software modules that fit their needs; users can also formulate the data interfaces of the software modules. Some such systems also allow high-level composability of software modules, where custom high-level software modules can themselves be further composed into higher-level software modules. Such higher-level software modules can establish communication channels between their respective constituent software modules, and can coordinate the execution of their respective constituent software modules.

Some systems described in this specification can also provide a discovery mechanism for the devices and software modules, whereby the devices and software modules declare their respective data interfaces upon user request. Thus, the systems provide a user-friendly management of the software modules by making it easy for users to invoke the software modules and retrieve their data interfaces. These systems can therefore be applied to a broad range of applications and a broad range of devices.

Some systems described in this specification allow users to establish communication channels between two or more devices. The communication channels can pass data between the devices, allowing the devices to execute one or more software modules asynchronously.

DETAILED DESCRIPTION

FIG. 1is a diagram that illustrates an example system100. The system100is an example of a system that can implement the techniques described in this specification.

The system100includes a number of functional components, including a planner120and a real-time robotic control system150. Each of these components can be implemented as computer programs installed on one or more computers in one or more locations that are coupled to each other through any appropriate communications network, e.g., an intranet or the Internet, or combination of networks. The system100also includes an execution environment170that includes N robots170a-n.

The real-time robotic control system150is configured to control the robots170a-nin the execution environment170. The real-time robotic control system150must satisfy one or more hard time constraints in the operation of the execution environment170. For example, one of the robots in the execution environment170may be required to perform a certain operation at regular intervals, e.g. 10 milliseconds; if the robot ever fails to execute the operation in a given time window, then the robot enters a fault state.

The real-time robotic control system150is composed of one or more software module loops, each of which contains multiple software modules that execute repeatedly in a predetermined sequence in order to control the robots170a-n. For simplicity,FIG. 1shows a single software module loop that includes M software modules150a-m. Each software module can execute one or more functions of a respective robot of the robots170a-n.

Each software module can have a corresponding data interface that specifies the real-time data that the software module receives as input and provides as output. During execution, the software modules exchange P real-time messages152a-pthat are required for the respective software modules to execute. For example, software module150acan provide real-time message152ato software module150b, and software module150bcan provide real-time message152pto software module150m.

The overall goal of the planner120is to generate a schedule135that allows the real-time robotic control system150to control the robots in the execution environment170in order to execute a certain task.

The planner120receives an application definition110. The application definition110can be generated by a user. The application definition110can identify a particular task to be completed by the robots in the execution environment170. To complete the task, the application definition110can specify a software module loop, including identifying the software modules150a-min the software module loop. The application definition110can also specify the real-time messages152a-pexchanged between the software modules according to the data interfaces of the software modules.

Some of the software modules150a-mcan be high-level software modules composed of one or more lower-level software modules and a data interface, generated by the user using the lower-level software modules. That is, a custom high-level software module can depend on one or more low-level software modules.

The low-level software modules can execute basic functionality of a respective robot of the robots170a-n. In some implementations, each low-level software modules depends on a custom software module that is customized for the respective robot. That is, the custom software module can execute a particular low-level functionality that is designed for the particular robot, e.g., that is tuned for the particular specifications of the particular robot. In some cases, a low-level software module can depend on a custom software module that is provided by the manufacturer of the robot; that is, the custom software module can be provided for users of the robot out-of-the-box.

Each software module can be associated with one or more of the robots in the execution environment170; the software modules that a given device supports can be identified using a device interface definition. This process is discussed in more detail below in reference toFIG. 2andFIG. 3.

The planner120uses the application definition110to generate a schedule135for the real-time robotic control system150to execute the software module loop to complete the particular task.

The planner120gives the schedule135to the real-time robotic control system150, which executes the software module loop according to the schedule135. That is, the real-time robotic control system150executes the software modules150a-m, causing the real-time robotic control system150to issue commands155to the execution environment170in order to drive the movements of the robots170a-n. While the software modules150a-mare controlling the execution environment170, the software modules150a-mare exchanging real-time messages152a-p.

FIG. 2illustrates an example execution environment200. The execution environment includes several robotic components, including a robot210with an arm215, a conveyor belt220, and a camera230.

Each of the devices in the execution environment200has a device interface definition that declares what software modules the respective device can execute. For example, the robot210has a robot interface210athat specifies a list of software modules that the robot can execute, including high-level software modules1A and1B, and a low-level software module1C. Each high-level software module can be composed of one or more low-level software modules and/or one or more other high-level software modules. Composable software modules are described in more detail below in reference toFIG. 3.

Similarly, the conveyor belt220has a conveyor belt interface220athat specifies a list of software modules that the conveyor belt can execute, and the camera230has a camera interface230athat specifies a list of software modules that the camera can execute.

A user generating an application definition for the devices in the execution environment200to accomplish a particular task can use the device interface definitions210a-cto determine the software modules that can be executed by the devices in the environment200, and compose the available software modules to accomplish the task. As a particular example, the application definition can identify one or more software modules in the conveyor belt interface220athat allow the conveyor belt220to move an object in front of the robot210. The application definition can also identify one or more software modules in the robot interface210athat allow the robot210to execute a pick-and-place of the object, where the arm215of the robot210moves the object from one position on the conveyor belt220to another position on the conveyor belt220. Finally, the application definition can identify one or more software modules in the camera interface230athat allow the camera to capture an image of the object after it has been moved by the robot210and use the image to confirm that the object is in a correct position. For example, a software module in the camera interface230amight execute a machine learning perception algorithm that processes an image and generates a predicted pose of an identified object in the image. The application definition can specify that these software modules are to be executed iteratively in a software module loop; that is, the conveyor belt can move the object further down the line after its position has been approved, replacing it with a new object in the same location in front of the robot210.

Each software module can also have a data interface that identifies how it can communicate with other software modules. For example, a software module in the conveyor belt interface220amight send a real-time message to a software module in the robot interface210acommunicating that a new object has been moved in front of the robot210. Data interfaces are discussed in more detail below in reference toFIG. 3.

An application definition that identifies software modules to be executed by the devices in the execution environment200can also specify that one or more of the software modules should be executed asynchronously. That is, a real-time robotic control system executing a plan generated from the application definition, e.g., the real-time robotic control system150depicted inFIG. 1, can launch a software module and perform other operations until it receives a callback that the software module has completed. For example, the real-time robotic control system can launch a first software module and a second software module in parallel. In some existing systems, when a software module is launched, the system must wait for the software module to be completed before continuing with any other operations. The ability to execute software modules asynchronously can be important because device actuation takes a large amount of time to execute from the perspective of a CPU, and thus a lot of time can be saved in a given iteration of a software module loop by executing multiple operations in parallel. For example, a joint move executed by the robot210in the execution environment200can take 3 seconds, which is a large amount of time in a real-time context.

FIG. 3illustrates an example device interface definition310and example software modules320and350.

The device interface definition310declares the software modules that a particular device or a particular group of devices can execute. For example, the particular device can execute high-level software modules320and330, and a low-level software module340. Each of the high-level software modules depend on one or more low-level software modules and/or one or more other high-level software modules. Each of the low-level software modules can execute basic functionality of the respective device. The high-level software module320is composed of a high-level software module320aand low-level software modules320band320c. That is, the operations executed by the high-level software module320include operations executed by the high-level software module320aand the low-level software modules320band320c, either sequentially or in parallel.

For example, the device interface definition310can be for a robotic arm, and the high-level software module320can execute a pick-and-place action, where the arm picks up an object in the execution environment, moves the object to a different location in the execution environment, and places the object down. The high-level software module320acan execute a movement of the arm, the low-level software module320bcan execute a suction action of a suction gripper attached to the arm, and the low-level software module320ccan execute a de-suction action of the suction gripper attached to the arm. Thus, the high-level software module320can execute the pick-and-place by invoking the high-level software module320ato move the arm into place over the object, the low-level software module320bto pick up the object using the suction gripper, the high-level software module320aagain to move the object to a different location, and the low-level software module320cto release the object using the suction gripper.

Similarly, the high-level software module320afor moving the arm can be composed of M low-level software modules321-m. For example, each of the low-level software modules321a-mcan execute a movement of the arm in a particular degree of freedom. As a particular example, a robotic arm may have 6 degrees of freedom, so a high-level software module for moving the arm may be composed of 6 low-level software modules, each of which control a particular degree of freedom.

The high-level software module320includes a module interface322. The module interface specifies one or more communication channels by which the high-level software module320can either receive data as input or emit data as output. A communication channel can be internal, i.e. between two software modules executed by the same robot, e.g., between high-level software modules320and330. A communication channel can also be external, i.e., between two software modules executed by respective different robots.

As a particular example, the module interface322can specify a communication channel360between the high-level software module320and another high-level software module350that is executed by a different robotic component. Similarly, the high-level software module350has a module interface352that specifies the communication channel360.

In some cases, the communication channel360can be a hard real-time communication channel. That is, the communication channel360is configured to send data packets of a particular type from the high-level software module320to the high-level software module350continuously, e.g., every 10 ms or 100 ms. In some cases, the high-level software module350can enter an error state if the high-level software module320fails to send a data packet.

In some other cases, the communication channel360can be asynchronous. That is, the communication channel360is configured to send data packets of a particular type from the high-level software module320to the high-level software module350whenever the data packets are made available by the high-level software module320. In other words, the high-level software module320generates the data packets at an irregular frequency, and therefore the high-level software module350receives the data packets at varying intervals. The high-level software module350can then execute a particular operation every time the high-level software module320sends a data packet.

The device interface definition310can also include a list of communication channels by which the device can receive input data or transmit output data. That is, the device interface definition310can declare the external communication channels of each respective software module in the device interface definition310, where an external communication channel is a communication channel that a software module shares with another software module of a different device.

As a particular example, the device interface definition310can be for a camera in an execution environment, and the high-level software module320can execute a machine learning perception algorithm that processes an image of an object in the execution environment captured by the camera and generates an estimated pose of the object. Here, a pose of an object is data that characterizes the position and/or orientation of the object in the execution environment. The high-level software module350can execute a pick-and-place of the object by a robotic arm in the execution environment. The software module350may therefore need to know the pose of the object before picking the object up. The communication channel360can therefore send the estimated poses from the high-level software module320to the high-level software module350asynchronously, as they are generated by the high-level software module320. The high-level software module320can interpolate the received estimated poses and, e.g., send the interpolated poses in real-time over another communication channel to another high-level or low-level software module.

In some cases, a communication channel specified by a module interface of a software module can be optional; that is, the software module can execute without the communication channel. In some other cases, a specified communication channel can be required.

The high-level software module320can be generated by a user. That is, a system can provide multiple low-level software modules that can be executed by one or more devices, as well as a tool for composing the low-level software modules to generate high-level software modules. For example, the system can provide a base class that each module interface of a high-level software module can inherit from, so that a user can easily design an arbitrary interface that specifies particular input channels and output channels. Thus, a user can generate a high-level software module that is specific to the particular use case of the user when such a high-level software module is not provided by a hardware manufacturer out of the box for a given device or group of devices.

In some implementations, the device interface definition310can be for a distributed system of devices. That is, the device interface definition310declares the software modules that can be executed by multiple devices across the distributed system, e.g., multiple computers or robots that are connected by communication channels. In these cases, the communication channels can allow software modules to execute asynchronous and real-time operations across the multiple devices.

FIG. 4is a flowchart of an example process400for generating a program to be executed by one or more devices in an execution environment. The process400can be implemented by one or more computer programs installed on one or more computers and programmed in accordance with this specification. For example, the process400can be performed by the planner120depicted inFIG. 1. For convenience, the process400will be described as being performed by a system of one or more computers.

The system receives one or more custom high-level software modules for each device in the execution environment (step410). Some or all of the custom high-level software modules can include low-level software modules for a real-time robot.

The system receives module interface definitions for each of the custom high-level software modules (step415). A module interface definition of a software module declares the module interface for the software module. In particular, the module interface definition of a custom high-level software module can specify one or more asynchronous or real-time communication channels through which the custom high-level software module can receive input data from a different custom high-level software module or transmit output data to the different custom high-level software module.

The system receives device interface definitions for each device in the execution environment (step420). The device interface definition of a particular device can declare the software modules that the particular device can execute. A device interface definition of a particular device can also include one or more module interfaces for respective software modules that the particular device can execute. That is, if a software module has a module interface that specifies a particular communication channel with a different software module executed by a different device, then the device interface definition for the particular device can also specify the particular communication channel.

The system receives a definition of a communication channel between a first interface of a first device in the execution environment, and a second interface of a second device in the execution environment (step430). In some cases, the execution of one or more software modules of the second device requires the information received through the communication channel, and therefore waits until receiving the information from the first device. That is, the communication channel can be asynchronous. As a particular example, the first device can be a real-time robot, and the information communicated on the channel can be a joint position of a joint of the real-time robot. As another particular example, the first device can be a camera, and the information communicated on the channel can be a pose of an object in the execution environment.

The received high-level software modules, device interface definitions, module interface definitions, and definition of the asynchronous channel can collectively be called an “application definition.”

The system processes the received application definition to generate output programs to be executed by the devices (step440). In some implementations, one or more of the output programs can be executed asynchronously.

The robot functionalities described in this specification can be implemented by a hardware-agnostic software stack, or, for brevity just a software stack, that is at least partially hardware-agnostic. In other words, the software stack can accept as input commands generated by the planning processes described above without requiring the commands to relate specifically to a particular model of robot or to a particular robotic component. For example, the software stack can be implemented at least partially by the real-time robotic control system150ofFIG. 1.

The software stack can include multiple levels of increasing hardware specificity in one direction and increasing software abstraction in the other direction. At the lowest level of the software stack are robot components that include devices that carry out low-level actions and sensors that report low-level statuses. For example, robots can include a variety of low-level components including motors, encoders, cameras, drivers, grippers, application-specific sensors, linear or rotary position sensors, and other peripheral devices. As one example, a motor can receive a command indicating an amount of torque that should be applied. In response to receiving the command, the motor can report a current position of a joint of the robot, e.g., using an encoder, to a higher level of the software stack.

Each next highest level in the software stack can implement an interface that supports multiple different underlying implementations. In general, each interface between levels provides status messages from the lower level to the upper level and provides commands from the upper level to the lower level.

Typically, the commands and status messages are generated cyclically during each control cycle, e.g., one status message and one command per control cycle. Lower levels of the software stack generally have tighter real-time requirements than higher levels of the software stack. At the lowest levels of the software stack, for example, the control cycle can have actual real-time requirements. In this specification, real-time means that a command received at one level of the software stack must be executed and optionally, that a status message be provided back to an upper level of the software stack, within a particular control cycle time. If this real-time requirement is not met, the robot can be configured to enter a fault state, e.g., by freezing all operation.

At a next-highest level, the software stack can include software abstractions of particular components, which will be referred to as motor feedback controllers. A motor feedback controller can be a software abstraction of any appropriate lower-level components and not just a literal motor. A motor feedback controller thus receives state through an interface into a lower-level hardware component and sends commands back down through the interface to the lower-level hardware component based on upper-level commands received from higher levels in the stack. A motor feedback controller can have any appropriate control rules that determine how the upper-level commands should be interpreted and transformed into lower-level commands. For example, a motor feedback controller can use anything from simple logical rules to more advanced machine learning techniques to transform upper-level commands into lower-level commands. Similarly, a motor feedback controller can use any appropriate fault rules to determine when a fault state has been reached. For example, if the motor feedback controller receives an upper-level command but does not receive a lower-level status within a particular portion of the control cycle, the motor feedback controller can cause the robot to enter a fault state that ceases all operations.

At a next-highest level, the software stack can include actuator feedback controllers. An actuator feedback controller can include control logic for controlling multiple robot components through their respective motor feedback controllers. For example, some robot components, e.g., a joint arm, can actually be controlled by multiple motors. Thus, the actuator feedback controller can provide a software abstraction of the joint arm by using its control logic to send commands to the motor feedback controllers of the multiple motors.

At a next-highest level, the software stack can include joint feedback controllers. A joint feedback controller can represent a joint that maps to a logical degree of freedom in a robot. Thus, for example, while a wrist of a robot might be controlled by a complicated network of actuators, a joint feedback controller can abstract away that complexity and exposes that degree of freedom as a single joint. Thus, each joint feedback controller can control an arbitrarily complex network of actuator feedback controllers. As an example, a six degree-of-freedom robot can be controlled by six different joint feedback controllers that each control a separate network of actual feedback controllers.

Each level of the software stack can also perform enforcement of level-specific constraints. For example, if a particular torque value received by an actuator feedback controller is outside of an acceptable range, the actuator feedback controller can either modify it to be within range or enter a fault state.

To drive the input to the joint feedback controllers, the software stack can use a command vector that includes command parameters for each component in the lower levels, e.g., a positive, torque, and velocity, for each motor in the system. To expose status from the joint feedback controllers, the software stack can use a status vector that includes status information for each component in the lower levels, e.g., a position, velocity, and torque for each motor in the system. In some implementations, the command vectors also include some limit information regarding constraints to be enforced by the controllers in the lower levels.

At a next-highest level, the software stack can include joint collection controllers. A joint collection controller can handle issuing of command and status vectors that are exposed as a set of part abstractions. Each part can include a kinematic model, e.g., for performing inverse kinematic calculations, limit information, as well as a joint status vector and a joint command vector. For example, a single joint collection controller can be used to apply different sets of policies to different subsystems in the lower levels. The joint collection controller can effectively decouple the relationship between how the motors are physically represented and how control policies are associated with those parts. Thus, for example if a robot arm has a movable base, a joint collection controller can be used to enforce a set of limit policies on how the arm moves and to enforce a different set of limit policies on how the movable base can move.

At a next-highest level, the software stack can include joint selection controllers. A joint selection controller can be responsible for dynamically selecting between commands being issued from different sources. In other words, a joint selection controller can receive multiple commands during a control cycle and select one of the multiple commands to be executed during the control cycle. The ability to dynamically select from multiple commands during a real-time control cycle allows greatly increased flexibility in control over conventional robot control systems.

At a next-highest level, the software stack can include joint position controllers. A joint position controller can receive goal parameters and dynamically compute commands required to achieve the goal parameters. For example, a joint position controller can receive a position goal and can compute a set point for achieve the goal.

At a next-highest level, the software stack can include Cartesian position controllers and Cartesian selection controllers. A Cartesian position controller can receive as input goals in Cartesian space and use inverse kinematics solvers to compute an output in joint position space. The Cartesian selection controller can then enforce limit policies on the results computed by the Cartesian position controllers before passing the computed results in joint position space to a joint position controller in the next lowest level of the stack. For example, a Cartesian position controller can be given three separate goal states in Cartesian coordinates x, y, and z. For some degrees, the goal state could be a position, while for other degrees, the goal state could be a desired velocity.

These functionalities afforded by the software stack thus provide wide flexibility for control directives to be easily expressed as goal states in a way that meshes naturally with the higher-level planning techniques described above. In other words, when the planning process uses a process definition graph to generate concrete actions to be taken, the actions need not be specified in low-level commands for individual robotic components. Rather, they can be expressed as high-level goals that are accepted by the software stack that get translated through the various levels until finally becoming low-level commands. Moreover, the actions generated through the planning process can be specified in Cartesian space in way that makes them understandable for human operators, which makes debugging and analyzing the schedules easier, faster, and more intuitive. In addition, the actions generated through the planning process need not be tightly coupled to any particular robot model or low-level command format. Instead, the same actions generated during the planning process can actually be executed by different robot models so long as they support the same degrees of freedom and the appropriate control levels have been implemented in the software stack.

Embodiment 1 is a method comprising:receiving a multi-device application definition for a real-time robotic control system configured to perform operations comprising controlling a robotic execution environment having multiple robotic components, wherein the application definition comprises:one or more custom high-level software modules for each robotic component of the multiple robotic components, wherein each custom high-level software module is configured to execute one or more functions of the robotic component, and wherein each custom high-level software module depends on one or more low-level software modules of the respective robotic component;respective module interface definitions for each of the custom high-level software modules, wherein a module interface definition of a custom high-level software module specifies one or more asynchronous or real-time communication channels through which the custom high-level software module can receive input data from a different custom high-level software module or transmit output data to the different custom high-level software module; andrespective device interface definitions for each of the multiple robotic components, wherein a device interface definition of a robotic component declares the software modules that the robotic component can execute; andprocessing the application definition to generate output programs to be executed respectively by the multiple robotic components, wherein the output programs comprise a plurality of commands to execute the one or more custom high-level software modules, and wherein a first output program for a first robotic component of the multiple robotic components causes the first robotic component to communicate information on a first communication channel to a second output program for a second robotic component of the multiple robotic components.

Embodiment 2 is the method of embodiment 1, wherein each low-level software module of a robotic component depends on a custom software module that is customized for the particular robotic component.

Embodiment 3 is the method of any one of embodiments 1 or 2, wherein the custom software module is provided by a manufacturer of the robotic component.

Embodiment 4 is the method of any one of embodiments 1-3, wherein the application definition specifies that the one or more high-level software modules of the second robotic component should wait on the information being received from the first robotic component.

Embodiment 5 is the method of any one of embodiments 1-4, wherein the first robotic component is a real-time robot, and wherein the information communicated on the first communication channel is a joint position of a joint of the real-time robot.

Embodiment 6 is the method of any one of embodiments 1-5, wherein the first robotic component is a camera, and wherein the information communicated on the first communication channel is a pose of an object in the execution environment.

Embodiment 7 is the method of any one of embodiments 1-6, wherein one or more of the output programs can be executed asynchronously.

Embodiment 8 is the method of any one of embodiments 1-7, wherein the device interface definition for each of the multiple robotic components comprises one or more module interface definitions of respective high-level software modules that the device can execute.

Embodiment 9 is the method of any one of embodiments 1-8, wherein the application definition further comprises a definition of a second communication channel between a first module interface of a first high-level software module of a third robot of the multiple robotic components, and a second module interface of a second high-level software module of the third robot.

Embodiment 10 is a system comprising: one or more computers and one or more storage devices storing instructions that are operable, when executed by the one or more computers, to cause the one or more computers to perform the method of any one of embodiments 1 to 9. Embodiment 11 is a computer storage medium encoded with a computer program, the program comprising instructions that are operable, when executed by data processing apparatus, to cause the data processing apparatus to perform the method of any one of embodiments 1 to 9.