mimicgen.configs package#

Submodules#

mimicgen.configs.config module#

Base MG_Config object for mimicgen data generation.

class mimicgen.configs.config.ConfigMeta(name, bases, class_dict)#

Bases: type

Define a metaclass for constructing a config class. It registers configs into the global registry.

class mimicgen.configs.config.MG_Config(dict_to_load=None)#

Bases: robomimic.config.config.Config

property NAME#

classmethod(function) -> method

Convert a function to be a class method.

A class method receives the class as implicit first argument, just like an instance method receives the instance. To declare a class method, use this idiom:

class C:

@classmethod def f(cls, arg1, arg2, …):

It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()). The instance is ignored except for its class. If a class method is called for a derived class, the derived class object is passed as the implied first argument.

Class methods are different than C++ or Java static methods. If you want those, see the staticmethod builtin.

property TYPE#

classmethod(function) -> method

Convert a function to be a class method.

A class method receives the class as implicit first argument, just like an instance method receives the instance. To declare a class method, use this idiom:

class C:

@classmethod def f(cls, arg1, arg2, …):

It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()). The instance is ignored except for its class. If a class method is called for a derived class, the derived class object is passed as the implied first argument.

Class methods are different than C++ or Java static methods. If you want those, see the staticmethod builtin.

experiment_config()#

This function populates the config.experiment attribute of the config, which has general settings related to the dataset generation (e.g. which environment, robot, and gripper to use for generation, how many demonstrations to try collecting, etc).

obs_config()#

This function populates the config.obs attribute of the config, which has setings for which observations to collect during data generation.

task_config()#

This function populates the config.task attribute of the config, which has settings for each object-centric subtask in a task.

mimicgen.configs.config.config_factory(name, config_type, dic=None)#

Creates an instance of a config from the algo name. Optionally pass a dictionary to instantiate the config from the dictionary.

mimicgen.configs.config.get_all_registered_configs()#

Give access to dictionary of all registered configs for external use.

mimicgen.configs.robosuite module#

Task configs for robosuite.

See @Coffee_Config below for an explanation of each parameter.

class mimicgen.configs.robosuite.CoffeePreparation_Config(dict_to_load=None)#

Bases: mimicgen.configs.config.MG_Config

Corresponds to robosuite CoffeePreparation task and variants.

NAME = 'coffee_preparation'#
TYPE = 'robosuite'#
task_config()#

This function populates the config.task attribute of the config, which has settings for each object-centric subtask in a task. Each dictionary should have kwargs for the @add_subtask method in the @MG_TaskSpec object.

class mimicgen.configs.robosuite.Coffee_Config(dict_to_load=None)#

Bases: mimicgen.configs.config.MG_Config

Corresponds to robosuite Coffee task and variants.

NAME = 'coffee'#
TYPE = 'robosuite'#
task_config()#

This function populates the config.task attribute of the config, which has settings for each object-centric subtask in a task. Each dictionary should have kwargs for the @add_subtask method in the @MG_TaskSpec object.

class mimicgen.configs.robosuite.HammerCleanup_Config(dict_to_load=None)#

Bases: mimicgen.configs.config.MG_Config

Corresponds to robosuite HammerCleanup task and variants.

NAME = 'hammer_cleanup'#
TYPE = 'robosuite'#
task_config()#

This function populates the config.task attribute of the config, which has settings for each object-centric subtask in a task. Each dictionary should have kwargs for the @add_subtask method in the @MG_TaskSpec object.

class mimicgen.configs.robosuite.Kitchen_Config(dict_to_load=None)#

Bases: mimicgen.configs.config.MG_Config

Corresponds to robosuite Kitchen task and variants.

NAME = 'kitchen'#
TYPE = 'robosuite'#
task_config()#

This function populates the config.task attribute of the config, which has settings for each object-centric subtask in a task. Each dictionary should have kwargs for the @add_subtask method in the @MG_TaskSpec object.

class mimicgen.configs.robosuite.MugCleanup_Config(dict_to_load=None)#

Bases: mimicgen.configs.config.MG_Config

Corresponds to robosuite MugCleanup task and variants.

NAME = 'mug_cleanup'#
TYPE = 'robosuite'#
task_config()#

This function populates the config.task attribute of the config, which has settings for each object-centric subtask in a task. Each dictionary should have kwargs for the @add_subtask method in the @MG_TaskSpec object.

class mimicgen.configs.robosuite.NutAssembly_Config(dict_to_load=None)#

Bases: mimicgen.configs.config.MG_Config

Corresponds to robosuite NutAssembly task and variants.

NAME = 'nut_assembly'#
TYPE = 'robosuite'#
task_config()#

This function populates the config.task attribute of the config, which has settings for each object-centric subtask in a task. Each dictionary should have kwargs for the @add_subtask method in the @MG_TaskSpec object.

class mimicgen.configs.robosuite.PickPlace_Config(dict_to_load=None)#

Bases: mimicgen.configs.config.MG_Config

Corresponds to robosuite PickPlace task and variants.

NAME = 'pick_place'#
TYPE = 'robosuite'#
task_config()#

This function populates the config.task attribute of the config, which has settings for each object-centric subtask in a task. Each dictionary should have kwargs for the @add_subtask method in the @MG_TaskSpec object.

class mimicgen.configs.robosuite.Square_Config(dict_to_load=None)#

Bases: mimicgen.configs.config.MG_Config

Corresponds to robosuite Square task and variants.

NAME = 'square'#
TYPE = 'robosuite'#
task_config()#

This function populates the config.task attribute of the config, which has settings for each object-centric subtask in a task. Each dictionary should have kwargs for the @add_subtask method in the @MG_TaskSpec object.

class mimicgen.configs.robosuite.StackThree_Config(dict_to_load=None)#

Bases: mimicgen.configs.config.MG_Config

Corresponds to robosuite StackThree task and variants.

NAME = 'stack_three'#
TYPE = 'robosuite'#
task_config()#

This function populates the config.task attribute of the config, which has settings for each object-centric subtask in a task. Each dictionary should have kwargs for the @add_subtask method in the @MG_TaskSpec object.

class mimicgen.configs.robosuite.Stack_Config(dict_to_load=None)#

Bases: mimicgen.configs.config.MG_Config

Corresponds to robosuite Stack task and variants.

NAME = 'stack'#
TYPE = 'robosuite'#
task_config()#

This function populates the config.task attribute of the config, which has settings for each object-centric subtask in a task. Each dictionary should have kwargs for the @add_subtask method in the @MG_TaskSpec object.

class mimicgen.configs.robosuite.Threading_Config(dict_to_load=None)#

Bases: mimicgen.configs.config.MG_Config

Corresponds to robosuite Threading task and variants.

NAME = 'threading'#
TYPE = 'robosuite'#
task_config()#

This function populates the config.task attribute of the config, which has settings for each object-centric subtask in a task. Each dictionary should have kwargs for the @add_subtask method in the @MG_TaskSpec object.

class mimicgen.configs.robosuite.ThreePieceAssembly_Config(dict_to_load=None)#

Bases: mimicgen.configs.config.MG_Config

Corresponds to robosuite ThreePieceAssembly task and variants.

NAME = 'three_piece_assembly'#
TYPE = 'robosuite'#
task_config()#

This function populates the config.task attribute of the config, which has settings for each object-centric subtask in a task. Each dictionary should have kwargs for the @add_subtask method in the @MG_TaskSpec object.

mimicgen.configs.task_spec module#

Defines task specification objects, which are used to store task-specific settings for data generation.

class mimicgen.configs.task_spec.MG_TaskSpec#

Bases: object

Stores task-specific settings for data generation. Each task is a sequence of object-centric subtasks, and each subtask stores relevant settings used during the data generation process.

add_subtask(object_ref, subtask_term_signal, subtask_term_offset_range=None, selection_strategy='random', selection_strategy_kwargs=None, action_noise=0.0, num_interpolation_steps=5, num_fixed_steps=0, apply_noise_during_interpolation=False)#

Add subtask to this task spec.

Parameters
  • object_ref (str) – each subtask involves manipulation with respect to a single object frame. This string should specify the object for this subtask. The name should be consistent with the “datagen_info” from the environment interface and dataset.

  • subtask_term_signal (str or None) – the “datagen_info” from the environment and dataset includes binary indicators for each subtask of the task at each timestep. This key should correspond to the key in “datagen_info” that should be used to infer when this subtask is finished (e.g. on a 0 to 1 edge of the binary indicator). Should provide None for the final subtask.

  • subtask_term_offset_range (2-tuple) – if provided, specifies time offsets to be used during data generation when splitting a trajectory into subtask segments. On each data generation attempt, an offset is sampled and added to the boundary defined by @subtask_term_signal.

  • selection_strategy (str) – specifies how the source subtask segment should be selected during data generation from the set of source human demos

  • selection_strategy_kwargs (dict or None) – optional keyword arguments for the selection strategy function used

  • action_noise (float) – amount of action noise to apply during this subtask

  • num_interpolation_steps (int) – number of interpolation steps to bridge previous subtask segment to this one

  • num_fixed_steps (int) – number of additional steps (with constant target pose of beginning of this subtask segment) to add to give the robot time to reach the pose needed to carry out this subtask segment

  • apply_noise_during_interpolation (bool) – if True, apply action noise during interpolation phase leading up to this subtask, as well as during the execution of this subtask

classmethod from_json(json_string=None, json_dict=None)#

Instantiate a TaskSpec object from a json string. This should be consistent with the output of @serialize.

Parameters
  • json_string (str) – top-level of json has a key per subtask in-order (e.g. “subtask_1”, “subtask_2”, “subtask_3”) and under each subtask, there should be an entry for each argument of @add_subtask

  • json_dict (dict) – optionally directly pass json dict

serialize()#

Return a json string corresponding to this task spec object. Compatible with @from_json classmethod.

Module contents#