Prompt:
 "color-sorted-block-race". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "color-sorted-block-race" in a python code block.
###

Response:
 color-sorted-block-race: {'task-name': 'color-sorted-block-race', 'task-description': 'On one end of a tabletop, there are six blocks in two colors (three red and three blue). On the other end of the tabletop, two sets of three small marked zones are arranged in a straight line, one set for blue and one set for red. The task involves picking up one block at a time and placing it in the corresponding colored zone in a sequence from the bottom end zone to the top end zone. The blocks must be placed following the rule: the three colored blocks must be transported consecutively, e.g., first place all three blue blocks and then place all three red blocks. The challenge lies in careful transportation and placement of the blocks and follows the specific rule.', 'assets-used': ['block/block.urdf', 'zone/zone.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks.task import Task
from cliport.utils import utils

class ColorSortedBlockRace(Task):
    """Pick up blocks of two colors and place them in corresponding colored zones in a sequence."""

    def __init__(self):
        super().__init__()
        self.max_steps = 20
        self.lang_template = "place the blocks in the corresponding colored zones in sequence"
        self.task_completed_desc = "done placing blocks in zones."
        self.additional_reset()

    def reset(self, env):
        super().reset(env)

        # Add zones.
        zone_size = (0.12, 0.12, 0)
        zone_urdf = 'zone/zone.urdf'
        zone_colors = ['blue', 'red']
        zone_poses = []
        for color in zone_colors:
            zone_pose = self.get_random_pose(env, zone_size)
            env.add_object(zone_urdf, zone_pose, 'fixed', color=utils.COLORS[color])
            zone_poses.append(zone_pose)

        # Add blocks.
        block_size = (0.04, 0.04, 0.04)
        block_urdf = 'block/block.urdf'
        block_colors = ['blue', 'red']
        blocks = []
        for color in block_colors:
            for _ in range(3):
                block_pose = self.get_random_pose(env, block_size)
                block_id = env.add_object(block_urdf, block_pose, color=utils.COLORS[color])
                blocks.append(block_id)

        # Goal: each block is in the corresponding colored zone.
        for i, block in enumerate(blocks):
            self.add_goal(objs=[block], matches=np.ones((1, 1)), targ_poses=[zone_poses[i//3]], replace=False,
                          rotations=True, metric='pose', params=None, step_max_reward=1/len(blocks))
        self.lang_goals.append(self.lang_template)```
 END


Prompt:
 "multi-level-block-construction". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "multi-level-block-construction" in a python code block.
###

Response:
 multi-level-block-construction: {'task-name': 'multi-level-block-construction', 'task-description': 'Construct a two-level structure on a pallet using four blocks: two red and two blue. The lower level should be a rectangle created by placing the red blocks side by side. The upper level is made up by placing the blue blocks placed on top of the red blocks creating a line aligned perpendicular to the red blocks. The challenge lies in the precise placement of blocks, maintaining balance of the structure, and correct color arrangement.', 'assets-used': ['block/block.urdf', 'pallet/pallet.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks.task import Task
from cliport.utils import utils

class MultiLevelBlockConstruction(Task):
    """Construct a two-level structure on a pallet using four blocks: two red and two blue.
    The lower level should be a rectangle created by placing the red blocks side by side.
    The upper level is made up by placing the blue blocks placed on top of the red blocks
    creating a line aligned perpendicular to the red blocks."""

    def __init__(self):
        super().__init__()
        self.max_steps = 10
        self.lang_template = "construct a two-level structure on a pallet using four blocks: two red and two blue"
        self.task_completed_desc = "done constructing multi-level block structure."

    def reset(self, env):
        super().reset(env)

        # Add pallet.
        # x, y, z dimensions for the asset size
        pallet_size = (0.15, 0.15, 0.015)
        pallet_urdf = 'pallet/pallet.urdf'
        pallet_pose = self.get_random_pose(env, pallet_size)
        env.add_object(pallet_urdf, pallet_pose, 'fixed')

        # Add blocks.
        # x, y, z dimensions for the asset size
        block_size = (0.04, 0.04, 0.04)
        block_urdf = 'block/block.urdf'
        block_colors = [utils.COLORS['red'], utils.COLORS['red'], utils.COLORS['blue'], utils.COLORS['blue']]
        blocks = []
        for i in range(4):
            block_pose = self.get_random_pose(env, block_size)
            block_id = env.add_object(block_urdf, block_pose, color=block_colors[i])
            blocks.append(block_id)

        # Associate placement locations for goals.
        place_pos = [(0, -0.02, 0.02), (0, 0.02, 0.02),
                     (0, -0.02, 0.06), (0, 0.02, 0.06)]
        targs = [(utils.apply(pallet_pose, i), pallet_pose[1]) for i in place_pos]

        # Goal: red blocks are placed side by side on the pallet.
        self.add_goal(objs=blocks[:2], matches=np.ones((2, 2)), targ_poses=targs[:2], replace=False,
                rotations=True, metric='pose', params=None, step_max_reward=1 / 2, symmetries=[np.pi/2]*2)

        # Goal: blue blocks are stacked on top of the red blocks.
        self.add_goal(objs=blocks[2:], matches=np.ones((2, 2)), targ_poses=targs[2:], replace=False,
                rotations=True, metric='pose', params=None, step_max_reward=1 / 2, symmetries=[np.pi/2]*2)```
 END


Prompt:
 "color-linked-ball-bowl-ordering". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "color-linked-ball-bowl-ordering" in a python code block.
###

Response:
 color-linked-ball-bowl-ordering: {'task-name': 'color-linked-ball-bowl-ordering', 'task-description': 'On a tabletop, there are four bowls and four balls of different colors (red, blue, green, and yellow). Each ball is inside a bowl, but not corresponding to the color of the bowl. The task is to pick up each ball and place it in the bowl of the same color, in the specific sequence of red, blue, green and yellow from left to right. The challenge lies in the precise placement, color matching and sequence following.', 'assets-used': ['bowl/bowl.urdf', 'ball/ball.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks.task import Task
from cliport.utils import utils

class ColorLinkedBallBowlOrdering(Task):
    """Pick up each ball and place it in the bowl of the same color, in the specific sequence of red, blue, green and yellow from left to right."""

    def __init__(self):
        super().__init__()
        self.max_steps = 20
        self.lang_template = "place the {color} ball in the {color} bowl"
        self.task_completed_desc = "done placing balls in bowls."
        self.additional_reset()

    def reset(self, env):
        super().reset(env)

        # Define colors and their order
        colors = ['red', 'blue', 'green', 'yellow']

        # Add bowls.
        # x, y, z dimensions for the asset size
        bowl_size = (0.12, 0.12, 0)
        bowl_urdf = 'bowl/bowl.urdf'
        bowl_poses = []
        for i in range(4):
            bowl_pose = self.get_random_pose(env, bowl_size)
            env.add_object(bowl_urdf, bowl_pose, 'fixed', color=utils.COLORS[colors[i]])
            bowl_poses.append(bowl_pose)

        # Add balls.
        # x, y, z dimensions for the asset size
        balls = []
        ball_size = (0.04, 0.04, 0.04)
        ball_urdf = 'ball/ball.urdf'
        for i in range(4):
            ball_pose = self.get_random_pose(env, ball_size)
            ball_id = env.add_object(ball_urdf, ball_pose, color=utils.COLORS[colors[i]])
            balls.append(ball_id)

        # Goal: each ball is in the bowl of the same color.
        for i in range(4):
            self.add_goal(objs=[balls[i]], matches=np.int32([[1]]), targ_poses=[bowl_poses[i]], replace=False,
                rotations=True, metric='pose', params=None, step_max_reward=1 / 4)
            self.lang_goals.append(self.lang_template.format(color=colors[i]))```
 END


Prompt:
 "color-blocks-in-cylinder-maze". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "color-blocks-in-cylinder-maze" in a python code block.
###

Response:
 color-blocks-in-cylinder-maze: {'task-name': 'color-blocks-in-cylinder-maze', 'task-description': 'Pick up five differently colored blocks (red, blue, yellow, green, and orange) that are scattered randomly on the table top. Arrange three cylindrical containers in a row to create a maze-like structure. Place the red, yellow, and blue block into the first, second, and third cylinder from left respectively. Then, stack the green and orange block on top of any container, followed by placing the same color palette on the respective block.', 'assets-used': ['block/block.urdf', 'cylinder/cylinder-template.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks.task import Task
from cliport.utils import utils

class ColorBlocksInCylinderMaze(Task):
    """Pick up five differently colored blocks (red, blue, yellow, green, and orange) that are scattered randomly on the table top. Arrange three cylindrical containers in a row to create a maze-like structure. Place the red, yellow, and blue block into the first, second, and third cylinder from left respectively. Then, stack the green and orange block on top of any container, followed by placing the same color palette on the respective block."""

    def __init__(self):
        super().__init__()
        self.max_steps = 20
        self.lang_template = "arrange the blocks in the cylinders and stack the green and orange blocks"
        self.task_completed_desc = "done arranging blocks in cylinders."
        self.additional_reset()

    def reset(self, env):
        super().reset(env)

        # Add cylinders.
        cylinder_size = (0.05, 0.05, 0.1)
        cylinder_urdf = 'cylinder/cylinder-template.urdf'
        cylinder_poses = []
        for _ in range(3):
            cylinder_pose = self.get_random_pose(env, cylinder_size)
            env.add_object(cylinder_urdf, cylinder_pose, 'fixed')
            cylinder_poses.append(cylinder_pose)

        # Add blocks.
        block_size = (0.04, 0.04, 0.04)
        block_urdf = 'block/block.urdf'
        block_colors = [utils.COLORS['red'], utils.COLORS['blue'], utils.COLORS['yellow'], utils.COLORS['green'], utils.COLORS['orange']]
        blocks = []
        for i in range(5):
            block_pose = self.get_random_pose(env, block_size)
            block_id = env.add_object(block_urdf, block_pose, color=block_colors[i])
            blocks.append(block_id)

        # Goal: red, yellow, and blue blocks are in the first, second, and third cylinder respectively.
        self.add_goal(objs=blocks[:3], matches=np.ones((3, 3)), targ_poses=cylinder_poses, replace=False,
                rotations=True, metric='pose', params=None, step_max_reward=1 / 2)

        # Goal: green and orange blocks are stacked on top of any cylinder.
        self.add_goal(objs=blocks[3:], matches=np.ones((2, 3)), targ_poses=cylinder_poses, replace=False,
                rotations=True, metric='pose', params=None, step_max_reward=1 / 2)

        self.lang_goals.append(self.lang_template)```
 END


Prompt:
 "create-pyramid-with-color-coded-ells". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "create-pyramid-with-color-coded-ells" in a python code block.
###

Response:
 create-pyramid-with-color-coded-ells: {'task-name': 'create-pyramid-with-color-coded-ells', 'task-description': "There are four insertion ell-shaped objects ('insertion/ell.urdf') of different colors (red, blue, yellow, and green) placed randomly on the tabletop. The task is to pick up each of these objects and stack them onto a fixed-size pallet in the shape of a pyramid. The order of the pyramid from bottom to top should be red, blue, yellow, and green.", 'assets-used': ['insertion/ell.urdf', 'pallet/pallet.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks.task import Task
from cliport.utils import utils
import pybullet as p

class CreatePyramidWithColorCodedElls(Task):
    """Pick up ell-shaped objects of different colors and stack them onto a pallet in the shape of a pyramid."""

    def __init__(self):
        super().__init__()
        self.max_steps = 20
        self.lang_template = "stack the {color} ell on the pyramid"
        self.task_completed_desc = "done stacking ell pyramid."
        self.additional_reset()

    def reset(self, env):
        super().reset(env)

        # Add pallet.
        pallet_size = (0.15, 0.15, 0.01)
        pallet_urdf = 'pallet/pallet.urdf'
        pallet_pose = self.get_random_pose(env, pallet_size)
        env.add_object(pallet_urdf, pallet_pose, category='fixed')

        # Ell colors.
        colors = [
            utils.COLORS['red'], utils.COLORS['blue'],
            utils.COLORS['yellow'], utils.COLORS['green']
        ]
        color_names = ['red', 'blue', 'yellow', 'green']

        # Add Ells.
        ell_size = (0.04, 0.04, 0.04)
        ell_urdf = 'insertion/ell.urdf'
        objs = []
        for i in range(4):
            ell_pose = self.get_random_pose(env, ell_size)
            ell_id = env.add_object(ell_urdf, ell_pose, color=colors[i])
            objs.append(ell_id)

        # Associate placement locations for goals.
        place_pos = [(0, -0.05, 0.03), (0, 0, 0.03),
                     (0, 0.05, 0.03), (0, 0, 0.08)]
        targs = [(utils.apply(pallet_pose, i), pallet_pose[1]) for i in place_pos]

        # Goal: Ells are stacked in a pyramid (bottom row: red, middle row: blue, top row: yellow, green).
        for i in range(4):
            self.add_goal(objs=[objs[i]], matches=np.ones((1, 1)), targ_poses=[targs[i]], replace=False,
                    rotations=True, metric='pose', params=None, step_max_reward=1 / 4, symmetries=[np.pi/2])
            self.lang_goals.append(self.lang_template.format(color=color_names[i]))```
 END


Prompt:
 "move-piles-along-line". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "move-piles-along-line" in a python code block.
###

Response:
 move-piles-along-line: {'task-name': 'move-piles-along-line', 'task-description': 'Move three piles of small blocks, each pile a different color (red, blue, green), along three matching colored lines to three separate zones of the same color using a spatula.', 'assets-used': ['block/small.urdf', 'zone/zone.urdf', 'line/line-template.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils

class MovePilesAlongLine(Task):
    """Move three piles of small blocks, each pile a different color (red, blue, green),
    along three matching colored lines to three separate zones of the same color using a spatula."""

    def __init__(self):
        super().__init__()
        self.max_steps = 20
        self.lang_template = "move the piles of blocks along the lines to the matching colored zones"
        self.task_completed_desc = "done moving piles."
        self.primitive = primitives.push
        self.ee = Spatula
        self.additional_reset()

    def reset(self, env):
        super().reset(env)

        # Add three colored lines.
        line_template = 'line/line-template.urdf'
        line_colors = ['red', 'blue', 'green']
        line_poses = []
        for color in line_colors:
            line_size = self.get_random_size(0.1, 0.15, 0.1, 0.15, 0.05, 0.05)
            line_pose = self.get_random_pose(env, line_size)
            replace = {'DIM': line_size, 'HALF': (line_size[0] / 2, line_size[1] / 2, line_size[2] / 2), 'COLOR': color}
            line_urdf = self.fill_template(line_template, replace)
            env.add_object(line_urdf, line_pose, 'fixed')
            line_poses.append(line_pose)

        # Add three colored zones.
        zone_template = 'zone/zone.urdf'
        zone_poses = []
        for color in line_colors:
            zone_size = self.get_random_size(0.1, 0.15, 0.1, 0.15, 0.05, 0.05)
            zone_pose = self.get_random_pose(env, zone_size)
            replace = {'DIM': zone_size, 'HALF': (zone_size[0] / 2, zone_size[1] / 2, zone_size[2] / 2), 'COLOR': color}
            zone_urdf = self.fill_template(zone_template, replace)
            env.add_object(zone_urdf, zone_pose, 'fixed')
            zone_poses.append(zone_pose)

        # Add three piles of small blocks.
        block_template = 'block/small.urdf'
        block_colors = ['red', 'blue', 'green']
        block_ids = []
        for color in block_colors:
            block_size = self.get_random_size(0.1, 0.15, 0.1, 0.15, 0.05, 0.05)
            block_pose = self.get_random_pose(env, block_size)
            replace = {'DIM': block_size, 'HALF': (block_size[0] / 2, block_size[1] / 2, block_size[2] / 2), 'COLOR': color}
            block_urdf = self.fill_template(block_template, replace)
            block_id = env.add_object(block_urdf, block_pose)
            block_ids.append(block_id)

        # Add goals.
        for i in range(3):
            self.add_goal(objs=[block_ids[i]], matches=np.ones((1, 1)), targ_poses=[zone_poses[i]], replace=False,
                          rotations=False, metric='zone', params=[(zone_poses[i], zone_size)], step_max_reward=1/3)
        self.lang_goals.append(self.lang_template)```
 END


Prompt:
 "color-ordered-blocks-on-pallet". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "color-ordered-blocks-on-pallet" in a python code block.
###

Response:
 color-ordered-blocks-on-pallet: {'task-name': 'color-ordered-blocks-on-pallet', 'task-description': 'On a table there are six different colored blocks (red, blue, green, yellow, orange, and purple), a pallet, and a small corner structure. These colored blocks are arranged randomly within the small corner structure. The task involves picking up each colored block and placing it onto the pallet in specific color sequence: red, blue, green, yellow, orange, and finally purple.', 'assets-used': ['block/block.urdf', 'pallet/pallet.urdf', 'corner/corner-template.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks.task import Task
from cliport.utils import utils

class ColorOrderedBlocksOnPallet(Task):
    """Pick up each colored block and place it onto the pallet in specific color sequence: red, blue, green, yellow, orange, and finally purple."""

    def __init__(self):
        super().__init__()
        self.max_steps = 20
        self.lang_template = "place the colored blocks onto the pallet in the following order: red, blue, green, yellow, orange, and purple"
        self.task_completed_desc = "done placing blocks on the pallet."
        self.additional_reset()

    def reset(self, env):
        super().reset(env)

        # Add pallet.
        # x, y, z dimensions for the asset size
        pallet_size = (0.15, 0.15, 0.02)
        pallet_urdf = 'pallet/pallet.urdf'
        pallet_pose = self.get_random_pose(env, pallet_size)
        env.add_object(pallet_urdf, pallet_pose, 'fixed')

        # Block colors.
        colors = [
            utils.COLORS['red'], utils.COLORS['blue'], utils.COLORS['green'],
            utils.COLORS['yellow'], utils.COLORS['orange'], utils.COLORS['purple']
        ]

        # Add blocks.
        # x, y, z dimensions for the asset size
        block_size = (0.04, 0.04, 0.04)
        block_urdf = 'block/block.urdf'
        blocks = []
        for i in range(6):
            block_pose = self.get_random_pose(env, block_size)
            block_id = env.add_object(block_urdf, block_pose, color=colors[i])
            blocks.append(block_id)

        # Associate placement locations for goals.
        place_pos = [(0, -0.05, 0.03), (0, 0, 0.03),
                     (0, 0.05, 0.03), (0, -0.025, 0.08),
                     (0, 0.025, 0.08), (0, 0, 0.13)]
        targs = [(utils.apply(pallet_pose, i), pallet_pose[1]) for i in place_pos]

        # Goal: blocks are placed on the pallet in the order of red, blue, green, yellow, orange, purple.
        for i in range(6):
            self.add_goal(objs=[blocks[i]], matches=np.ones((1, 1)), targ_poses=[targs[i]], replace=False,
                rotations=True, metric='pose', params=None, step_max_reward=1 / 6, symmetries=[np.pi/2])
        self.lang_goals.append(self.lang_template)```
 END


Prompt:
 "color-ordered-container-arrangement". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "color-ordered-container-arrangement" in a python code block.
###

Response:
 color-ordered-container-arrangement: {'task-name': 'color-ordered-container-arrangement', 'task-description': 'On the tabletop, there are six containers and six blocks of different colors (red, blue, green, yellow, orange, purple). The task is to pick up each block and place it into a container of the same color, then arrange the containers in a line in the following color order: red, blue, green, yellow, orange, and purple.', 'assets-used': ['block/block.urdf', 'container/container-template.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks.task import Task
from cliport.utils import utils

class ColorOrderedContainerArrangement(Task):
    """Arrange six containers with blocks of matching colors in a specific color order."""

    def __init__(self):
        super().__init__()
        self.max_steps = 20
        self.lang_template = "arrange the containers in the color order: red, blue, green, yellow, orange, and purple"
        self.task_completed_desc = "done arranging containers."
        self.additional_reset()

    def reset(self, env):
        super().reset(env)

        # Define color order
        color_order = ['red', 'blue', 'green', 'yellow', 'orange', 'purple']

        # Add containers and blocks
        container_size = (0.12, 0.12, 0.02)
        block_size = (0.04, 0.04, 0.04)
        container_urdf = 'container/container-template.urdf'
        block_urdf = 'block/block.urdf'
        containers = []
        blocks = []
        for color in color_order:
            # Add container
            container_pose = self.get_random_pose(env, container_size)
            container_id = env.add_object(container_urdf, container_pose, color=utils.COLORS[color])
            containers.append(container_id)

            # Add block
            block_pose = self.get_random_pose(env, block_size)
            block_id = env.add_object(block_urdf, block_pose, color=utils.COLORS[color])
            blocks.append(block_id)

            # Add subgoal to place block in container
            self.add_goal(objs=[block_id], matches=np.ones((1, 1)), targ_poses=[container_pose], replace=False,
                          rotations=True, metric='pose', params=None, step_max_reward=1/6)

        # Add final goal to arrange containers in color order
        container_poses = [self.get_random_pose(env, container_size) for _ in color_order]
        self.add_goal(objs=containers, matches=np.eye(len(color_order)), targ_poses=container_poses, replace=False,
                      rotations=True, metric='pose', params=None, step_max_reward=1)

        self.lang_goals.append(self.lang_template)```
 END


Prompt:
 "multi-level-pyramid-construction". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "multi-level-pyramid-construction" in a python code block.
###

Response:
 multi-level-pyramid-construction: {'task-name': 'multi-level-pyramid-construction', 'task-description': 'Construct a two-level pyramid on a pallet using six blocks: three green and three blue. The first level should be a triangle created by placing the green blocks side by side. The second level should be built by placing the blue blocks on top of the green blocks, forming another triangle rotated 60 degrees with respect to the first one. The challenge lies in the precise placement of blocks, maintaining balance of the structure, and correct color arrangement.', 'assets-used': ['block/block.urdf', 'pallet/pallet.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks.task import Task
from cliport.utils import utils

class MultiLevelPyramidConstruction(Task):
    """Construct a two-level pyramid on a pallet using six blocks: three green and three blue."""

    def __init__(self):
        super().__init__()
        self.max_steps = 20
        self.lang_template = "Construct a two-level pyramid on a pallet using six blocks: three green and three blue. The first level should be a triangle created by placing the green blocks side by side. The second level should be built by placing the blue blocks on top of the green blocks, forming another triangle rotated 60 degrees with respect to the first one."
        self.task_completed_desc = "done constructing pyramid."
        self.additional_reset()

    def reset(self, env):
        super().reset(env)

        # Add pallet.
        pallet_size = (0.35, 0.35, 0.01)  # x, y, z dimensions for the pallet size
        pallet_pose = self.get_random_pose(env, pallet_size)
        pallet_urdf = 'pallet/pallet.urdf'
        env.add_object(pallet_urdf, pallet_pose, 'fixed')

        # Add blocks.
        block_size = (0.04, 0.04, 0.04)  # x, y, z dimensions for the block size
        block_urdf = 'block/block.urdf'
        block_colors = [utils.COLORS['green']] * 3 + [utils.COLORS['blue']] * 3  # three green and three blue blocks

        blocks = []
        for color in block_colors:
            block_pose = self.get_random_pose(env, block_size)
            block_id = env.add_object(block_urdf, block_pose, color=color)
            blocks.append(block_id)

        # Associate placement locations for goals.
        place_pos = [(0, -0.05, 0.02), (0, 0, 0.02), (0, 0.05, 0.02),  # first level
                     (0, -0.025, 0.06), (0, 0.025, 0.06), (0, 0, 0.10)]  # second level
        targs = [(utils.apply(pallet_pose, i), pallet_pose[1]) for i in place_pos]

        # Goal: blocks are stacked in a pyramid (first level: green blocks).
        self.add_goal(objs=blocks[:3], matches=np.ones((3, 3)), targ_poses=targs[:3], replace=False,
                      rotations=True, metric='pose', params=None, step_max_reward=1 / 2, symmetries=[np.pi/2]*3)
        self.lang_goals.append(self.lang_template.format(blocks="the green blocks", row="bottom"))

        # Goal: blocks are stacked in a pyramid (second level: blue blocks).
        self.add_goal(objs=blocks[3:], matches=np.ones((3, 3)), targ_poses=targs[3:], replace=False,
                      rotations=True, metric='pose', params=None, step_max_reward=1 / 2, symmetries=[np.pi/2]*3)
        self.lang_goals.append(self.lang_template.format(blocks="the blue blocks", row="top"))```
 END


Prompt:
 "align-balls-in-colored-boxes". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "align-balls-in-colored-boxes" in a python code block.
###

Response:
 align-balls-in-colored-boxes: {'task-name': 'align-balls-in-colored-boxes', 'task-description': 'On a tabletop, there are four balls and four boxes of different colors (red, blue, green, and yellow). Each ball is inside a box, but not corresponding to the color of the box. The task is to pick up each ball and place it in the box of the same color, in the specific sequence of red, blue, green and yellow from left to right. The challenge lies in the precise placement, color matching and sequence following.', 'assets-used': ['ball/ball.urdf', 'box/box-template.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks.task import Task
from cliport.utils import utils
import pybullet as p

class AlignBallsInColoredBoxes(Task):
    """Align balls in colored boxes according to the color and sequence."""

    def __init__(self):
        super().__init__()
        self.max_steps = 20
        self.lang_template = "put the {color} ball in the {color} box"
        self.task_completed_desc = "done aligning balls in boxes."
        self.additional_reset()

    def reset(self, env):
        super().reset(env)

        # Define colors and their sequence
        colors = ['red', 'blue', 'green', 'yellow']
        color_sequence = np.random.permutation(colors)

        # Add boxes.
        box_size = (0.12, 0.12, 0.12)
        box_urdf = 'box/box-template.urdf'
        box_poses = []
        boxes = []
        for i in range(4):
            box_pose = self.get_random_pose(env, box_size)
            box_id = env.add_object(box_urdf, box_pose, color=utils.COLORS[color_sequence[i]])
            boxes.append(box_id)
            box_poses.append(box_pose)

        # Add balls.
        ball_size = (0.04, 0.04, 0.04)
        ball_urdf = 'ball/ball.urdf'
        balls = []
        for i in range(4):
            ball_pose = self.get_random_pose(env, ball_size)
            ball_id = env.add_object(ball_urdf, ball_pose, color=utils.COLORS[colors[i]])
            balls.append(ball_id)

        # Goal: each ball is in the box of the same color.
        for i in range(4):
            self.add_goal(objs=[balls[i]], matches=np.ones((1, 1)), targ_poses=[box_poses[i]], replace=False,
                rotations=True, metric='pose', params=None, step_max_reward=1/4)
            self.lang_goals.append(self.lang_template.format(color=colors[i]))```
 END


Prompt:
 "color-coordinated-pyramid-in-container". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "color-coordinated-pyramid-in-container" in a python code block.
###

Response:
 color-coordinated-pyramid-in-container: {'task-name': 'color-coordinated-pyramid-in-container', 'task-description': 'There are six blocks of three different colors (red, blue, green) and three containers of matching colors. The task involves picking up each color of blocks and placing them in the container of the same color in a pyramid formation, with two blocks at the base and one block on top. The challenge lies in the precise placement of blocks, maintaining balance of the pyramid, and color coordination.', 'assets-used': ['block/block.urdf', 'container/container-template.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks.task import Task
from cliport.utils import utils

class ColorCoordinatedPyramidInContainer(Task):
    """Pick up each color of blocks and place them in the container of the same color in a pyramid formation."""

    def __init__(self):
        super().__init__()
        self.max_steps = 15
        self.lang_template = "build a pyramid of {color} blocks in the {color} container"
        self.task_completed_desc = "done building color-coordinated pyramids."
        self.additional_reset()

    def reset(self, env):
        super().reset(env)

        # Define colors and corresponding names
        colors = [utils.COLORS['red'], utils.COLORS['blue'], utils.COLORS['green']]
        color_names = ['red', 'blue', 'green']

        # Add containers.
        container_size = (0.15, 0.15, 0.05)
        container_urdf = 'container/container-template.urdf'
        container_poses = []
        for color in colors:
            container_pose = self.get_random_pose(env, container_size)
            env.add_object(container_urdf, container_pose, 'fixed', color=color)
            container_poses.append(container_pose)

        # Add blocks.
        block_size = (0.04, 0.04, 0.04)
        block_urdf = 'block/block.urdf'
        blocks = []
        for color in colors:
            for _ in range(3):  # 3 blocks of each color
                block_pose = self.get_random_pose(env, block_size)
                block_id = env.add_object(block_urdf, block_pose, color=color)
                blocks.append(block_id)

        # Associate placement locations for goals.
        place_pos = [(0, -0.05, 0.02), (0, 0.05, 0.02), (0, 0, 0.06)]
        targs = [(utils.apply(container_pose, i), container_pose[1]) for i in place_pos for container_pose in container_poses]

        # Goal: blocks are stacked in a pyramid in the container of the same color.
        for i, color_name in enumerate(color_names):
            self.add_goal(objs=blocks[i*3:(i+1)*3], matches=np.ones((3, 3)), targ_poses=targs[i*3:(i+1)*3], replace=False,
                    rotations=True, metric='pose', params=None, step_max_reward=1 / 3, symmetries=[np.pi/2]*3)
            self.lang_goals.append(self.lang_template.format(color=color_name))```
 END


Prompt:
 "colored-balls-sorting-in-corner". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "colored-balls-sorting-in-corner" in a python code block.
###

Response:
 colored-balls-sorting-in-corner: {'task-name': 'colored-balls-sorting-in-corner', 'task-description': 'There are four balls and four corners of different colors (red, blue, green, and yellow). Each ball is located at a corner, but not corresponding to the color of the corner. The task is to pick up each ball and place it in the corner of the same color, in the specific sequence of red, blue, green and yellow, starting from the leftmost corner to the rightmost. The challenge lies in the precise placement, color matching and sequence following.', 'assets-used': ['ball/ball-template.urdf', 'corner/corner-template.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks.task import Task
from cliport.utils import utils

class ColoredBallsSortingInCorner(Task):
    """Pick up each ball and place it in the corner of the same color, in the specific sequence of red, blue, green and yellow, starting from the leftmost corner to the rightmost."""

    def __init__(self):
        super().__init__()
        self.max_steps = 20
        self.lang_template = "place the {color} ball in the {color} corner"
        self.task_completed_desc = "done sorting balls."
        self.additional_reset()

    def reset(self, env):
        super().reset(env)

        # Define the colors and their sequence
        colors = ['red', 'blue', 'green', 'yellow']

        # Add corners.
        corner_size = (0.12, 0.12, 0)
        corner_urdf = 'corner/corner-template.urdf'
        corner_poses = []
        for i in range(4):
            corner_pose = self.get_random_pose(env, corner_size)
            env.add_object(corner_urdf, corner_pose, 'fixed', color=utils.COLORS[colors[i]])
            corner_poses.append(corner_pose)

        # Add balls.
        ball_size = (0.04, 0.04, 0.04)
        ball_urdf = 'ball/ball-template.urdf'
        balls = []
        for i in range(4):
            ball_pose = self.get_random_pose(env, ball_size)
            ball_id = env.add_object(ball_urdf, ball_pose, color=utils.COLORS[colors[i]])
            balls.append(ball_id)

        # Goal: each ball is in the corner of the same color.
        for i in range(4):
            self.add_goal(objs=[balls[i]], matches=np.ones((1, 1)), targ_poses=[corner_poses[i]], replace=False,
                    rotations=True, metric='pose', params=None, step_max_reward=1/4)
            self.lang_goals.append(self.lang_template.format(color=colors[i]))```
 END


Prompt:
 "color-coordinated-ball-insertion". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "color-coordinated-ball-insertion" in a python code block.
###

Response:
 color-coordinated-ball-insertion: {'task-name': 'color-coordinated-ball-insertion', 'task-description': 'There are five differently-colored ell objects (red, blue, green, yellow, orange) and five sphere-shaped containers of matching colors. The task involves picking up each ell object and inserting it into the sphere container of the same color, but in a specific sequence from left to right: red, blue, green, yellow, and finally orange. The task is challenging due to the sequence, color coordination, and accuracy of insertion required.', 'assets-used': ['insertion/ell.urdf', 'sphere/sphere-template.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks.task import Task
from cliport.utils import utils
import pybullet as p

class ColorCoordinatedBallInsertion(Task):
    """Insert balls into the cylinders of the same color in the order of red, blue, green, and yellow."""

    def __init__(self):
        super().__init__()
        self.max_steps = 10
        self.lang_template = "insert the {color} ball into the {color} cylinder"
        self.task_completed_desc = "done inserting balls into cylinders."
        self.additional_reset()

    def reset(self, env):
        super().reset(env)

        # Define colors and their order
        colors = ['red', 'blue', 'green', 'yellow']

        # Add cylinders.
        # x, y, z dimensions for the asset size
        cylinder_size = (0.05, 0.05, 0.1)
        cylinder_urdf = 'cylinder/cylinder-template.urdf'
        cylinder_poses = []
        for i in range(4):
            cylinder_pose = self.get_random_pose(env, cylinder_size)
            env.add_object(cylinder_urdf, cylinder_pose, category='fixed', color=utils.COLORS[colors[i]])
            cylinder_poses.append(cylinder_pose)

        # Add balls.
        # x, y, z dimensions for the asset size
        balls = []
        ball_size = (0.04, 0.04, 0.04)
        ball_urdf = 'ball/ball-template.urdf'
        for i in range(4):
            ball_pose = self.get_random_pose(env, ball_size)
            ball_id = env.add_object(ball_urdf, ball_pose, color=utils.COLORS[colors[i]])
            balls.append(ball_id)

        # Goal: each ball is in the corresponding color cylinder.
        for i in range(4):
            self.add_goal(objs=[balls[i]], matches=np.ones((1, 1)), targ_poses=[cylinder_poses[i]], replace=False,
                    rotations=True, metric='pose', params=None, step_max_reward=1/4)
            self.lang_goals.append(self.lang_template.format(color=colors[i]))```
 END


Prompt:
 "color-sequenced-pyramid-packing". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "color-sequenced-pyramid-packing" in a python code block.
###

Response:
 color-sequenced-pyramid-packing: {'task-name': 'color-sequenced-pyramid-packing', 'task-description': 'There are twelve cubes of different colors (three red, three green, three blue, and three yellow) scattered on the tabletop. The task is to pick up the cubes, sort them according to color into four pallets, and stack them in each pallet as a pyramid with the base layer containing two cubes and the top layer containing one cube. The challenge lies in the color-based sorting, the precise placement of cubes, and the construction of the pyramid in each pallet.', 'assets-used': ['block/block.urdf', 'pallet/pallet.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks.task import Task
from cliport.utils import utils
import pybullet as p

class ColorSequencedPyramidPacking(Task):
    """Sort cubes by color into four pallets and stack them in each pallet as a pyramid"""

    def __init__(self):
        super().__init__()
        self.max_steps = 12
        self.lang_template = "sort the {color} cubes into the pallet and stack them as a pyramid"
        self.task_completed_desc = "done sorting and stacking cubes."
        self.additional_reset()

    def reset(self, env):
        super().reset(env)

        # Add pallets.
        # x, y, z dimensions for the asset size
        pallet_size = (0.15, 0.15, 0.02)
        pallet_urdf = 'pallet/pallet.urdf'
        pallet_poses = []
        for _ in range(4):
            pallet_pose = self.get_random_pose(env, pallet_size)
            env.add_object(pallet_urdf, pallet_pose, category='fixed')
            pallet_poses.append(pallet_pose)

        # Cube colors.
        colors = [
            utils.COLORS['red'], utils.COLORS['green'], utils.COLORS['blue'], utils.COLORS['yellow']
        ]

        # Add cubes.
        # x, y, z dimensions for the asset size
        cube_size = (0.04, 0.04, 0.04)
        cube_urdf = 'block/block.urdf'

        objs = []
        for i in range(12):
            cube_pose = self.get_random_pose(env, cube_size)
            cube_id = env.add_object(cube_urdf, cube_pose, color=colors[i%4])
            objs.append(cube_id)

        # Associate placement locations for goals.
        place_pos = [(0, -0.05, 0.03), (0, 0, 0.03),
                     (0, 0.05, 0.03), (0, -0.025, 0.08),
                     (0, 0.025, 0.08), (0, 0, 0.13)]
        targs = [(utils.apply(pallet_pose, i), pallet_pose[1]) for i in place_pos for pallet_pose in pallet_poses]

        # Goal: cubes are sorted by color and stacked in a pyramid in each pallet.
        for i in range(4):
            self.add_goal(objs=objs[i*3:(i+1)*3], matches=np.ones((3, 3)), targ_poses=targs[i*3:(i+1)*3], replace=False,
                    rotations=True, metric='pose', params=None, step_max_reward=1 / 4, symmetries=[np.pi/2]*3)
            self.lang_goals.append(self.lang_template.format(color=list(utils.COLORS.keys())[i]))```
 END


Prompt:
 "color-block-ball-goal". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "color-block-ball-goal" in a python code block.
###

Response:
 color-block-ball-goal: {'task-name': 'color-block-ball-goal', 'task-description': 'On a tabletop, there are four zones marked in four different colors (red, blue, green, and yellow) and four balls of matching colors. The task involves picking up each ball and precisely placing it in the zone of the same color. However, there are several small blocks randomly scattered in the path between the balls and the zones. The robot has to strategically navigate around these blocks without knocking them over while transporting the balls to the corresponding zones. The challenge lies in the precise navigation, placement of the balls, and color matching while avoiding the blocks.', 'assets-used': ['zone/zone.urdf', 'ball/ball-template.urdf', 'block/small.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks.task import Task
from cliport.utils import utils

class ColorBlockBallGoal(Task):
    """Pick up each ball and precisely place it in the zone of the same color. Navigate around blocks without knocking them over."""

    def __init__(self):
        super().__init__()
        self.max_steps = 20
        self.lang_template = "place the {color} ball in the {color} zone"
        self.task_completed_desc = "done placing balls in zones."
        self.additional_reset()

    def reset(self, env):
        super().reset(env)

        # Add zones.
        zone_size = (0.12, 0.12, 0)
        zone_urdf = 'zone/zone.urdf'
        zone_colors = ['red', 'blue', 'green', 'yellow']
        zone_poses = []
        for color in zone_colors:
            zone_pose = self.get_random_pose(env, zone_size)
            env.add_object(zone_urdf, zone_pose, 'fixed', color=utils.COLORS[color])
            zone_poses.append(zone_pose)

        # Add balls.
        balls = []
        ball_size = (0.04, 0.04, 0.04)
        ball_urdf = 'ball/ball-template.urdf'
        for color in zone_colors:
            ball_pose = self.get_random_pose(env, ball_size)
            ball_id = env.add_object(ball_urdf, ball_pose, color=utils.COLORS[color])
            balls.append(ball_id)

        # Add blocks.
        blocks = []
        block_size = (0.04, 0.04, 0.04)
        block_urdf = 'block/small.urdf'
        for _ in range(10):
            block_pose = self.get_random_pose(env, block_size)
            block_id = env.add_object(block_urdf, block_pose)
            blocks.append(block_id)

        # Goal: each ball is in a zone of the same color.
        for i in range(len(balls)):
            self.add_goal(objs=[balls[i]], matches=np.ones((1, 1)), targ_poses=[zone_poses[i]], replace=False,
                          rotations=False, metric='pose', params=None, step_max_reward=1/len(balls))
            self.lang_goals.append(self.lang_template.format(color=zone_colors[i]))```
 END


Prompt:
 "ball-sorting-with-blocks-barrier". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "ball-sorting-with-blocks-barrier" in a python code block.
###

Response:
 ball-sorting-with-blocks-barrier: {'task-name': 'ball-sorting-with-blocks-barrier', 'task-description': 'On a tabletop, there are four balls and four zones of different colors (red, blue, green, and yellow). Each ball is located behind a line of small blocks of the same color. The task is to pick up each ball and place it into the zone of the same color, but without knocking over the blocks. The challenge lies in the precise navigation over the block barriers and color matching.', 'assets-used': ['ball/ball-template.urdf', 'zone/zone.urdf', 'block/small.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks.task import Task
from cliport.utils import utils
import pybullet as p

class BallSortingWithBlocksBarrier(Task):
    """Pick up each ball and place it into the zone of the same color, but without knocking over the blocks."""

    def __init__(self):
        super().__init__()
        self.max_steps = 20
        self.lang_template = "place the {color} ball in the {color} zone without knocking over the blocks"
        self.task_completed_desc = "done sorting balls."
        self.additional_reset()

    def reset(self, env):
        super().reset(env)

        # Define colors for the balls and zones
        colors = ['red', 'blue', 'green', 'yellow']

        # Add zones and blocks.
        zone_size = (0.12, 0.12, 0)
        block_size = (0.04, 0.04, 0.04)
        block_urdf = 'block/small.urdf'
        zone_urdf = 'zone/zone.urdf'
        zones = []
        blocks = []
        for color in colors:
            # Add zone of specific color
            zone_pose = self.get_random_pose(env, zone_size)
            env.add_object(zone_urdf, zone_pose, 'fixed', color=utils.COLORS[color])
            zones.append(zone_pose)

            # Add line of blocks of the same color
            for _ in range(5):
                block_pose = self.get_random_pose(env, block_size)
                block_id = env.add_object(block_urdf, block_pose, color=utils.COLORS[color])
                blocks.append(block_id)

        # Add balls.
        ball_size = (0.04, 0.04, 0.04)
        ball_urdf = 'ball/ball-template.urdf'
        balls = []
        for color in colors:
            ball_pose = self.get_random_pose(env, ball_size)
            ball_id = env.add_object(ball_urdf, ball_pose, color=utils.COLORS[color])
            balls.append(ball_id)

        # Goal: each ball is in a zone of the same color.
        for i in range(len(balls)):
            self.add_goal(objs=[balls[i]], matches=np.ones((1, 1)), targ_poses=[zones[i]], replace=False,
                          rotations=True, metric='pose', params=None, step_max_reward=1/len(balls))
            self.lang_goals.append(self.lang_template.format(color=colors[i]))```
 END


Prompt:
 "color-matched-blocks-insertion". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "color-matched-blocks-insertion" in a python code block.
###

Response:
 color-matched-blocks-insertion: {'task-name': 'color-matched-blocks-insertion', 'task-description': 'There are four blocks and four fixtures of different colors (red, blue, green, and yellow). The task involves picking up each block and inserting it into the fixture of the same color, in the specific sequence of red, blue, green, and yellow, starting from the leftmost fixture to the rightmost. The challenge lies in the precise insertion, color matching and sequence following.', 'assets-used': ['insertion/ell.urdf', 'insertion/fixture.urdf', 'block/block.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks.task import Task
from cliport.utils import utils

class ColorMatchedBlocksInsertion(Task):
    """Pick up each block and insert it into the fixture of the same color, in the specific sequence of red, blue, green, and yellow."""

    def __init__(self):
        super().__init__()
        self.max_steps = 10
        self.lang_template = "insert the {color} block into the {color} fixture"
        self.task_completed_desc = "done inserting blocks into fixtures."
        self.additional_reset()

    def reset(self, env):
        super().reset(env)

        # Define colors and their sequence
        colors = ['red', 'blue', 'green', 'yellow']
        color_sequence = np.random.permutation(colors)

        # Add fixtures.
        fixture_size = (0.12, 0.12, 0.02)
        fixture_urdf = 'insertion/fixture.urdf'
        fixture_poses = []
        for i in range(4):
            fixture_pose = self.get_random_pose(env, fixture_size)
            env.add_object(fixture_urdf, fixture_pose, 'fixed', color=utils.COLORS[color_sequence[i]])
            fixture_poses.append(fixture_pose)

        # Add blocks.
        blocks = []
        block_size = (0.04, 0.04, 0.04)
        block_urdf = 'block/block.urdf'
        for i in range(4):
            block_pose = self.get_random_pose(env, block_size)
            block_id = env.add_object(block_urdf, block_pose, color=utils.COLORS[color_sequence[i]])
            blocks.append(block_id)

        # Goal: each block is in the fixture of the same color.
        for i in range(4):
            self.add_goal(objs=[blocks[i]], matches=np.ones((1, 1)), targ_poses=[fixture_poses[i]], replace=False,
                          rotations=True, metric='pose', params=None, step_max_reward=1/4)
            self.lang_goals.append(self.lang_template.format(color=color_sequence[i]))```
 END


Prompt:
 "color-coordinated-block-bridge". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "color-coordinated-block-bridge" in a python code block.
###

Response:
 color-coordinated-block-bridge: {'task-name': 'color-coordinated-block-bridge', 'task-description': 'Construct a bridge by interleaving three differently colored blocks (red, blue, and green) on a pallet in a specific sequence - red block at the edges, blue block in the middle, and a green block on top of the red and blue blocks. Repeat this sequence until a bridge is formed across the length of the pallet.', 'assets-used': ['block/block.urdf', 'pallet/pallet.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks.task import Task
from cliport.utils import utils

class ColorCoordinatedBlockBridge(Task):
    """Construct a bridge by interleaving three differently colored blocks (red, blue, and green) on a pallet in a specific sequence - red block at the edges, blue block in the middle, and a green block on top of the red and blue blocks. Repeat this sequence until a bridge is formed across the length of the pallet."""

    def __init__(self):
        super().__init__()
        self.max_steps = 20
        self.lang_template = "construct a bridge by interleaving three differently colored blocks (red, blue, and green) on a pallet in a specific sequence"
        self.task_completed_desc = "done constructing the bridge."
        self.additional_reset()

    def reset(self, env):
        super().reset(env)

        # Add pallet.
        pallet_size = (0.30, 0.15, 0.02)
        pallet_pose = self.get_random_pose(env, pallet_size)
        env.add_object('pallet/pallet.urdf', pallet_pose, 'fixed')

        # Block colors.
        colors = [utils.COLORS['red'], utils.COLORS['blue'], utils.COLORS['green']]

        # Add blocks.
        block_size = (0.04, 0.04, 0.04)
        block_urdf = 'block/block.urdf'

        objs = []
        for i in range(9):  # 3 sets of 3 colored blocks
            block_pose = self.get_random_pose(env, block_size)
            block_id = env.add_object(block_urdf, block_pose, color=colors[i % 3])
            objs.append(block_id)

        # Associate placement locations for goals.
        place_pos = [(0, -0.05, 0.02), (0, 0, 0.02), (0, 0.05, 0.02),  # bottom layer
                     (0, -0.05, 0.06), (0, 0, 0.06), (0, 0.05, 0.06),  # middle layer
                     (0, -0.05, 0.10), (0, 0, 0.10), (0, 0.05, 0.10)]  # top layer
        targs = [(utils.apply(pallet_pose, i), pallet_pose[1]) for i in place_pos]

        # Goal: blocks are stacked in a bridge (bottom layer: red, blue, red).
        self.add_goal(objs=objs[:3], matches=np.ones((3, 3)), targ_poses=targs[:3], replace=False,
                      rotations=True, metric='pose', params=None, step_max_reward=1 / 3, symmetries=[np.pi/2]*3)

        # Goal: blocks are stacked in a bridge (middle layer: green, green, green).
        self.add_goal(objs=objs[3:6], matches=np.ones((3, 3)), targ_poses=targs[3:6], replace=False,
                      rotations=True, metric='pose', params=None, step_max_reward=1 / 3, symmetries=[np.pi/2]*3)

        # Goal: blocks are stacked in a bridge (top layer: red, blue, red).
        self.add_goal(objs=objs[6:], matches=np.ones((3, 3)), targ_poses=targs[6:], replace=False,
                      rotations=True, metric='pose', params=None, step_max_reward=1 / 3, symmetries=[np.pi/2]*3)```
 END


Prompt:
 "insert-red-block-into-cylinder". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "insert-red-block-into-cylinder" in a python code block.
###

Response:
 insert-red-block-into-cylinder: {'task-name': 'insert-red-block-into-cylinder', 'task-description': "Position a red block ('insertion/ell.urdf') in front of a cylindrical fixture ('insertion/fixture.urdf'), then insert the red block into the cylinder. The challenge includes precision in positioning the block and the correct insertion into the fixture.", 'assets-used': ['insertion/ell.urdf', 'insertion/fixture.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks.task import Task
from cliport.utils import utils
import pybullet as p

class InsertRedBlockIntoCylinder(Task):
    """Insert a red block into a cylindrical fixture."""

    def __init__(self):
        super().__init__()
        self.max_steps = 10
        self.lang_template = "insert the red block into the cylinder"
        self.task_completed_desc = "done inserting block into cylinder."
        self.additional_reset()

    def reset(self, env):
        super().reset(env)

        # Add cylinder fixture.
        # x, y, z dimensions for the asset size
        fixture_size = (0.12, 0.12, 0.12)
        fixture_urdf = 'insertion/fixture.urdf'
        fixture_pose = self.get_random_pose(env, fixture_size)
        env.add_object(fixture_urdf, fixture_pose, category='fixed')

        # Add red block.
        # x, y, z dimensions for the asset size
        block_size = (0.04, 0.04, 0.04)
        block_urdf = 'insertion/ell.urdf'
        block_pose = self.get_random_pose(env, block_size)
        block_id = env.add_object(block_urdf, block_pose, color=utils.COLORS['red'])

        # Goal: the red block is inside the cylindrical fixture.
        self.add_goal(objs=[block_id], matches=np.ones((1, 1)), targ_poses=[fixture_pose], replace=False,
                rotations=True, metric='pose', params=None, step_max_reward=1)
        self.lang_goals.append(self.lang_template)```
 END


Prompt:
 "color-sequential-ball-container-sorting". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "color-sequential-ball-container-sorting" in a python code block.
###

Response:
 color-sequential-ball-container-sorting: {'task-name': 'color-sequential-ball-container-sorting', 'task-description': 'There are six balls of different colors (red, blue, green, yellow, orange, and purple) and six containers of matching colors. The task is to pick up each ball and place it in the container of the same color, but in a specific sequence of red, blue, green, yellow, orange, and purple from left to right. The challenge lies in the precise placement, color matching and sequence following.', 'assets-used': ['ball/ball-template.urdf', 'container/container-template.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks.task import Task
from cliport.utils import utils

class ColorSequentialBallContainerSorting(Task):
    """Pick up each ball and place it in the container of the same color, but in a specific sequence of red, blue, green, yellow, orange, and purple from left to right."""

    def __init__(self):
        super().__init__()
        self.max_steps = 20
        self.lang_template = "place the {color} ball in the {color} container"
        self.task_completed_desc = "done sorting balls into containers."
        self.additional_reset()

    def reset(self, env):
        super().reset(env)

        # Define colors and their sequence
        colors = ['red', 'blue', 'green', 'yellow', 'orange', 'purple']
        color_sequence = np.arange(len(colors))

        # Add containers.
        container_size = (0.12, 0.12, 0)
        container_urdf = 'container/container-template.urdf'
        container_poses = []
        for i in range(len(colors)):
            container_pose = self.get_random_pose(env, container_size)
            env.add_object(container_urdf, container_pose, color=utils.COLORS[colors[i]], category='fixed')
            container_poses.append(container_pose)

        # Add balls.
        balls = []
        ball_size = (0.04, 0.04, 0.04)
        ball_urdf = 'ball/ball-template.urdf'
        for i in range(len(colors)):
            ball_pose = self.get_random_pose(env, ball_size)
            ball_id = env.add_object(ball_urdf, ball_pose, color=utils.COLORS[colors[i]])
            balls.append(ball_id)

        # Goal: each ball is in a container of the same color, in the correct sequence.
        for i in range(len(colors)):
            self.add_goal(objs=[balls[i]], matches=np.ones((1, 1)), targ_poses=[container_poses[i]], replace=False,
                    rotations=True, metric='pose', params=None, step_max_reward=1/len(colors))
            self.lang_goals.append(self.lang_template.format(color=colors[i]))```
 END


Prompt:
 "color-coordinated-cylinder-pyramid". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "color-coordinated-cylinder-pyramid" in a python code block.
###

Response:
 color-coordinated-cylinder-pyramid: {'task-name': 'color-coordinated-cylinder-pyramid', 'task-description': 'Construct a pyramid on a pallet using four cylinders of different colors (red, blue, green, and yellow). The first level should consist of a red cylinder and a blue cylinder side by side. The second level should consist of a green cylinder placed on top of the red and blue cylinders. The third and final level should consist of a yellow cylinder placed on top of the green cylinder. The challenge lies in the precise placement of cylinders, maintaining the balance of the structure, and correct color arrangement.', 'assets-used': ['cylinder/cylinder-template.urdf', 'pallet/pallet.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks.task import Task
from cliport.utils import utils
import pybullet as p

class ColorCoordinatedCylinderPyramid(Task):
    """Construct a pyramid on a pallet using four cylinders of different colors (red, blue, green, and yellow)."""

    def __init__(self):
        super().__init__()
        self.max_steps = 12
        self.lang_template = "make the {row} row with {cylinder}"
        self.task_completed_desc = "done stacking cylinder pyramid."
        self.additional_reset()

    def reset(self, env):
        super().reset(env)

        # Add pallet.
        pallet_size = (0.15, 0.15, 0.005)
        pallet_urdf = 'pallet/pallet.urdf'
        pallet_pose = self.get_random_pose(env, pallet_size)
        env.add_object(pallet_urdf, pallet_pose, category='fixed')

        # Cylinder colors.
        colors = [
            utils.COLORS['red'], utils.COLORS['blue'], utils.COLORS['green'],
            utils.COLORS['yellow']
        ]

        # Add cylinders.
        # x, y, z dimensions for the asset size
        cylinder_size = (0.04, 0.04, 0.04)
        cylinder_urdf = 'cylinder/cylinder-template.urdf'

        cylinders = []
        for i in range(4):
            cylinder_pose = self.get_random_pose(env, cylinder_size)
            cylinder_id = env.add_object(cylinder_urdf, cylinder_pose, color=colors[i])
            cylinders.append(cylinder_id)

        # Associate placement locations for goals.
        place_pos = [(0, -0.05, 0.03), (0, 0.05, 0.03),
                     (0, 0, 0.08), (0, 0, 0.13)]
        targs = [(utils.apply(pallet_pose, i), pallet_pose[1]) for i in place_pos]

        # Goal: cylinders are stacked in a pyramid (bottom row: red, blue).
        self.add_goal(objs=cylinders[:2], matches=np.ones((2, 2)), targ_poses=targs[:2], replace=False,
                rotations=True, metric='pose', params=None, step_max_reward=1 / 2, symmetries=[np.pi/2]*2)
        self.lang_goals.append(self.lang_template.format(cylinder="the red and blue cylinders",
                                                         row="bottom"))

        # Goal: cylinders are stacked in a pyramid (middle row: green).
        self.add_goal(objs=cylinders[2:3], matches=np.ones((1, 1)), targ_poses=targs[2:3], replace=False,
                rotations=True, metric='pose', params=None, step_max_reward=1 / 3, symmetries=[np.pi/2]*1)
        self.lang_goals.append(self.lang_template.format(cylinder="the green cylinder",
                                                         row="middle"))

        # Goal: cylinders are stacked in a pyramid (top row: yellow).
        self.add_goal(objs=cylinders[3:], matches=np.ones((1, 1)), targ_poses=targs[3:], replace=False,
                rotations=True, metric='pose', params=None, step_max_reward=1 / 4, symmetries=[np.pi/2]*1)
        self.lang_goals.append(self.lang_template.format(cylinder="the yellow cylinder",
                                                         row="top"))```
 END


Prompt:
 "cylinder-sorting-with-zone". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "cylinder-sorting-with-zone" in a python code block.
###

Response:
 cylinder-sorting-with-zone: {'task-name': 'cylinder-sorting-with-zone', 'task-description': 'On a tabletop, there are four colored cylinders (red, blue, green, and yellow) and four zones of different colors (red, blue, green, and yellow). Each cylinder is located at a zone, but not corresponding to the color of the zone. The task is to pick up each cylinder and place it in the zone of the same color, in the specific sequence of red, blue, green and yellow from left to right.', 'assets-used': ['cylinder/cylinder-template.urdf', 'zone/zone.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks.task import Task
from cliport.utils import utils

class CylinderSortingWithZone(Task):
    """Pick up each cylinder and place it in the zone of the same color, in the specific sequence of red, blue, green and yellow from left to right."""

    def __init__(self):
        super().__init__()
        self.max_steps = 10
        self.lang_template = "place the {color} cylinder in the {color} zone"
        self.task_completed_desc = "done sorting cylinders."
        self.additional_reset()

    def reset(self, env):
        super().reset(env)

        # Define colors and their sequence
        colors = ['red', 'blue', 'green', 'yellow']
        color_sequence = np.arange(len(colors))

        # Add zones.
        zone_size = (0.12, 0.12, 0)
        zone_urdf = 'zone/zone.urdf'
        zone_poses = []
        for i in color_sequence:
            zone_pose = self.get_random_pose(env, zone_size)
            env.add_object(zone_urdf, zone_pose, 'fixed', color=utils.COLORS[colors[i]])
            zone_poses.append(zone_pose)

        # Add cylinders.
        cylinders = []
        cylinder_size = (0.04, 0.04, 0.04)
        cylinder_urdf = 'cylinder/cylinder-template.urdf'
        for i in color_sequence:
            cylinder_pose = self.get_random_pose(env, cylinder_size)
            cylinder_id = env.add_object(cylinder_urdf, cylinder_pose, color=utils.COLORS[colors[i]])
            cylinders.append(cylinder_id)

        # Goal: each cylinder is in the zone of the same color.
        self.add_goal(objs=cylinders, matches=np.eye(len(cylinders)), targ_poses=zone_poses, replace=False,
                rotations=True, metric='pose', params=None, step_max_reward=1)
        for i in color_sequence:
            self.lang_goals.append(self.lang_template.format(color=colors[i]))```
 END


Prompt:
 "color-coordinated-ball-placement". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "color-coordinated-ball-placement" in a python code block.
###

Response:
 color-coordinated-ball-placement: {'task-name': 'color-coordinated-ball-placement', 'task-description': 'There are three zones marked in three different colors (red, blue, and green) and three balls of matching colors. The task involves picking up each ball and precisely placing it in the zone of the same color. However, there are a few small blocks randomly scattered in the path between the balls and the zones. The robot has to strategically navigate around these blocks without knocking them over while transporting the balls to the corresponding zones. To add to the complexity, the robot must place the balls in each zone in a specific order: red, blue, and then green from left to right. The challenge lies in the precise navigation, placement of the balls, color matching and sequence following while avoiding the blocks.', 'assets-used': ['zone/zone.urdf', 'ball/ball-template.urdf', 'block/small.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks.task import Task
from cliport.utils import utils
import pybullet as p

class ColorCoordinatedBallPlacement(Task):
    """Pick up each ball and precisely place it in the zone of the same color.
    The robot must place the balls in each zone in a specific order: red, blue, and then green."""

    def __init__(self):
        super().__init__()
        self.max_steps = 15
        self.lang_template = "place the {color} ball in the {color} zone"
        self.task_completed_desc = "done placing balls in zones."
        self.additional_reset()

    def reset(self, env):
        super().reset(env)

        # Add zones.
        zone_size = (0.12, 0.12, 0)
        zone_urdf = 'zone/zone.urdf'
        zone_colors = ['red', 'blue', 'green']
        zone_poses = []
        for color in zone_colors:
            zone_pose = self.get_random_pose(env, zone_size)
            env.add_object(zone_urdf, zone_pose, 'fixed', color=utils.COLORS[color])
            zone_poses.append(zone_pose)

        # Add balls.
        ball_size = (0.04, 0.04, 0.04)
        ball_urdf = 'ball/ball-template.urdf'
        balls = []
        for color in zone_colors:
            ball_pose = self.get_random_pose(env, ball_size)
            ball_id = env.add_object(ball_urdf, ball_pose, color=utils.COLORS[color])
            balls.append(ball_id)

        # Add blocks as obstacles.
        block_size = (0.04, 0.04, 0.04)
        block_urdf = 'block/small.urdf'
        for _ in range(5):
            block_pose = self.get_random_pose(env, block_size)
            env.add_object(block_urdf, block_pose)

        # Goal: each ball is in the zone of the same color.
        for i in range(len(balls)):
            self.add_goal(objs=[balls[i]], matches=np.ones((1, 1)), targ_poses=[zone_poses[i]], replace=False,
                rotations=True, metric='pose', params=None, step_max_reward=1/3)
            self.lang_goals.append(self.lang_template.format(color=zone_colors[i]))```
 END


Prompt:
 "sweep-and-sort-blocks". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "sweep-and-sort-blocks" in a python code block.
###

Response:
 sweep-and-sort-blocks: {'task-name': 'sweep-and-sort-blocks', 'task-description': 'Sweep a pile of small blocks of different colors (red, blue, green, and yellow) into their corresponding colored zones marked on the tabletop. The challenge lies in the sweeping action, precise placement, and color coordination.', 'assets-used': ['zone/zone.urdf', 'block/small.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils

class SweepAndSortBlocks(Task):
    """Sweep a pile of small blocks of different colors (red, blue, green, and yellow) into their corresponding colored zones marked on the tabletop."""

    def __init__(self):
        super().__init__()
        self.max_steps = 20
        self.lang_template = "sweep the pile of {color} blocks into the {color} square"
        self.task_completed_desc = "done sweeping and sorting."
        self.primitive = primitives.push
        self.ee = Spatula
        self.additional_reset()

    def reset(self, env):
        super().reset(env)

        # Add colored zones.
        zone_size = (0.12, 0.12, 0)
        zone_urdf = 'zone/zone.urdf'
        colors = ['red', 'blue', 'green', 'yellow']
        zone_poses = []
        for color in colors:
            zone_pose = self.get_random_pose(env, zone_size)
            env.add_object(zone_urdf, zone_pose, 'fixed', color=utils.COLORS[color])
            zone_poses.append(zone_pose)

        # Add piles of colored blocks.
        block_urdf = 'block/small.urdf'
        block_size = (0.04, 0.04, 0.04)
        piles = []
        for color in colors:
            pile = []
            for _ in range(10):
                block_pose = self.get_random_pose(env, block_size)
                block_id = env.add_object(block_urdf, block_pose, color=utils.COLORS[color])
                pile.append(block_id)
            piles.append(pile)

        # Add goals for each color.
        for i, color in enumerate(colors):
            self.add_goal(objs=piles[i], matches=np.ones((10, 1)), targ_poses=[zone_poses[i]], replace=True,
                          rotations=False, metric='zone', params=[(zone_poses[i], zone_size)], step_max_reward=1)
            self.lang_goals.append(self.lang_template.format(color=color))```
 END


Prompt:
 "align-cylinders-in-zones". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "align-cylinders-in-zones" in a python code block.
###

Response:
 align-cylinders-in-zones: {'task-name': 'align-cylinders-in-zones', 'task-description': 'Place four differently colored cylinders (red, blue, green, yellow) each into a matching colored zone. But, the zones are surrounded by small blocks, which the robot needs to move out of the way without knocking them out of their respective zones. The challenge includes precise placement of cylinders, color matching, and careful navigation around the small blocks.', 'assets-used': ['cylinder/cylinder-template.urdf', 'zone/zone.urdf', 'block/small.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks.task import Task
from cliport.utils import utils
import pybullet as p

class AlignCylindersInZones(Task):
    """Place four differently colored cylinders each into a matching colored zone.
    The zones are surrounded by small blocks, which the robot needs to move out of the way
    without knocking them out of their respective zones."""

    def __init__(self):
        super().__init__()
        self.max_steps = 20
        self.lang_template = "place the {color} cylinder in the {color} zone"
        self.task_completed_desc = "done aligning cylinders."
        self.additional_reset()

    def reset(self, env):
        super().reset(env)

        # Cylinder colors.
        colors = ['red', 'blue', 'green', 'yellow']

        # Add cylinders.
        # x, y, z dimensions for the asset size
        cylinder_size = (0.04, 0.04, 0.04)
        cylinder_urdf = 'cylinder/cylinder-template.urdf'

        cylinders = []
        for i in range(4):
            cylinder_pose = self.get_random_pose(env, cylinder_size)
            cylinder_id = env.add_object(cylinder_urdf, cylinder_pose, color=utils.COLORS[colors[i]])
            cylinders.append(cylinder_id)

        # Add zones.
        # x, y, z dimensions for the asset size
        zone_size = (0.12, 0.12, 0)
        zone_urdf = 'zone/zone.urdf'

        zones = []
        for i in range(4):
            zone_pose = self.get_random_pose(env, zone_size)
            env.add_object(zone_urdf, zone_pose, color=utils.COLORS[colors[i]], category='fixed')
            zones.append(zone_pose)

        # Add small blocks around the zones.
        # x, y, z dimensions for the asset size
        block_size = (0.02, 0.02, 0.02)
        block_urdf = 'block/small.urdf'

        for _ in range(16):
            block_pose = self.get_random_pose(env, block_size)
            env.add_object(block_urdf, block_pose)

        # Goal: each cylinder is in a matching colored zone.
        for i in range(4):
            self.add_goal(objs=[cylinders[i]], matches=np.ones((1, 1)), targ_poses=[zones[i]], replace=False,
                    rotations=True, metric='pose', params=None, step_max_reward=1/4)
            self.lang_goals.append(self.lang_template.format(color=colors[i]))```
 END


Prompt:
 "sphere-container-color-match". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "sphere-container-color-match" in a python code block.
###

Response:
 sphere-container-color-match: {'task-name': 'sphere-container-color-match', 'task-description': 'On a tabletop, there are four spheres of different colors (red, blue, green, and yellow) inside four containers of a different color (red, blue, green, and yellow). The task is to pick up each sphere and place it into a container of the same color. The task is challenging due to the manipulation of spherical objects and the color coordination required.', 'assets-used': ['sphere/sphere.urdf', 'container/container-template.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks.task import Task
from cliport.utils import utils
import pybullet as p

class SphereContainerColorMatch(Task):
    """Pick up each sphere and place it into a container of the same color."""

    def __init__(self):
        super().__init__()
        self.max_steps = 4
        self.lang_template = "put the {color} sphere in the {color} container"
        self.task_completed_desc = "done matching spheres and containers."
        self.additional_reset()

    def reset(self, env):
        super().reset(env)

        # Define colors and corresponding names
        colors = [utils.COLORS['red'], utils.COLORS['blue'], utils.COLORS['green'], utils.COLORS['yellow']]
        color_names = ['red', 'blue', 'green', 'yellow']

        # Add containers.
        container_size = (0.12, 0.12, 0.12)
        container_urdf = 'container/container-template.urdf'
        containers = []
        for i in range(4):
            container_pose = self.get_random_pose(env, container_size)
            container_id = env.add_object(container_urdf, container_pose, color=colors[i])
            containers.append(container_id)

        # Add spheres.
        sphere_size = (0.04, 0.04, 0.04)
        sphere_urdf = 'sphere/sphere.urdf'
        spheres = []
        for i in range(4):
            sphere_pose = self.get_random_pose(env, sphere_size)
            sphere_id = env.add_object(sphere_urdf, sphere_pose, color=colors[i])
            spheres.append(sphere_id)

        # Goal: each sphere is in a container of the same color.
        for i in range(4):
            self.add_goal(objs=[spheres[i]], matches=np.ones((1, 1)), targ_poses=[p.getBasePositionAndOrientation(containers[i])], replace=False,
                    rotations=True, metric='pose', params=None, step_max_reward=1/4)
            self.lang_goals.append(self.lang_template.format(color=color_names[i]))```
 END


Prompt:
 "insertion-and-color-sorting". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "insertion-and-color-sorting" in a python code block.
###

Response:
 insertion-and-color-sorting: {'task-name': 'insertion-and-color-sorting', 'task-description': 'On the tabletop, there are two fixtures and four Ell-shaped blocks of different colors (red, blue, green, and yellow). The task is to pick up each block and insert it into a fixture of the same color, then arrange the fixtures in a line in the following color order: red, blue, green, yellow. The challenge lies in the precise insertion, color matching, and sequence following.', 'assets-used': ['insertion/ell.urdf', 'insertion/fixture.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks.task import Task
from cliport.utils import utils

class InsertionAndColorSorting(Task):
    """Pick up each Ell-shaped block, insert it into a fixture of the same color, then arrange the fixtures in a line in the following color order: red, blue, green, yellow."""

    def __init__(self):
        super().__init__()
        self.max_steps = 10
        self.lang_template = "insert the {color} block into the {color} fixture and arrange the fixtures in color order"
        self.task_completed_desc = "done inserting and sorting."
        self.additional_reset()

    def reset(self, env):
        super().reset(env)

        # Ell-shaped block colors.
        colors = ['red', 'blue', 'green', 'yellow']

        # Add Ell-shaped blocks.
        block_size = (0.04, 0.04, 0.04)  # x, y, z dimensions for the block size
        block_urdf = 'insertion/ell.urdf'  # URDF file for Ell-shaped block

        blocks = []
        for color in colors:
            block_pose = self.get_random_pose(env, block_size)
            block_id = env.add_object(block_urdf, block_pose, color=color)
            blocks.append(block_id)

        # Add fixtures.
        fixture_size = (0.05, 0.05, 0.05)  # x, y, z dimensions for the fixture size
        fixture_urdf = 'insertion/fixture.urdf'  # URDF file for fixture

        fixtures = []
        for color in colors:
            fixture_pose = self.get_random_pose(env, fixture_size)
            fixture_id = env.add_object(fixture_urdf, fixture_pose, color=color)
            fixtures.append(fixture_id)

        # Goal: each block is inserted into a fixture of the same color.
        for i in range(len(blocks)):
            self.add_goal(objs=[blocks[i]], matches=np.ones((1, 1)), targ_poses=[fixture_pose], replace=False,
                          rotations=True, metric='pose', params=None, step_max_reward=1 / len(blocks))
            self.lang_goals.append(self.lang_template.format(color=colors[i]))

        # Goal: fixtures are arranged in a line in color order.
        line_poses = [self.get_random_pose(env, fixture_size) for _ in range(len(fixtures))]
        line_poses.sort(key=lambda x: x[0])  # sort by x-coordinate to form a line
        for i in range(len(fixtures)):
            self.add_goal(objs=[fixtures[i]], matches=np.ones((1, 1)), targ_poses=[line_poses[i]], replace=False,
                          rotations=True, metric='pose', params=None, step_max_reward=1 / len(fixtures))```
 END


Prompt:
 "color-coordinated-cylinder-stack". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "color-coordinated-cylinder-stack" in a python code block.
###

Response:
 color-coordinated-cylinder-stack: {'task-name': 'color-coordinated-cylinder-stack', 'task-description': 'On the tabletop, there are four colored (red, blue, green, yellow) cylinders and four stands of corresponding colors. The task is to pick up each cylinder and stack it onto the stand of the same color - the red one at the bottom, followed by blue, green, and finally the yellow one at the top.', 'assets-used': ['cylinder/cylinder-template.urdf', 'stacking/stand.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks.task import Task
from cliport.utils import utils
import pybullet as p

class ColorCoordinatedCylinderStack(Task):
    """Stack cylinders on stands of the same color in a specific order."""

    def __init__(self):
        super().__init__()
        self.max_steps = 10
        self.lang_template = "stack the cylinders on the stands of the same color in the order red, blue, green, yellow"
        self.task_completed_desc = "done stacking cylinders."
        self.additional_reset()

    def reset(self, env):
        super().reset(env)

        # Define colors and corresponding names
        colors = [utils.COLORS['red'], utils.COLORS['blue'], utils.COLORS['green'], utils.COLORS['yellow']]
        color_names = ['red', 'blue', 'green', 'yellow']

        # Add stands.
        # x, y, z dimensions for the asset size
        stand_size = (0.04, 0.04, 0.04)
        stand_urdf = 'stacking/stand.urdf'
        stands = []
        for i in range(4):
            stand_pose = self.get_random_pose(env, stand_size)
            stand_id = env.add_object(stand_urdf, stand_pose, color=colors[i])
            stands.append(stand_id)

        # Add cylinders.
        # x, y, z dimensions for the asset size
        cylinder_size = (0.04, 0.04, 0.04)
        cylinder_urdf = 'cylinder/cylinder-template.urdf'
        cylinders = []
        for i in range(4):
            cylinder_pose = self.get_random_pose(env, cylinder_size)
            cylinder_id = env.add_object(cylinder_urdf, cylinder_pose, color=colors[i])
            cylinders.append(cylinder_id)

        # Goal: each cylinder is stacked on the stand of the same color in the order red, blue, green, yellow.
        for i in range(4):
            self.add_goal(objs=[cylinders[i]], matches=np.ones((1, 1)), targ_poses=[stand_pose], replace=False,
                    rotations=True, metric='pose', params=None, step_max_reward=1/4)
            self.lang_goals.append(f"Place the {color_names[i]} cylinder on the {color_names[i]} stand.")```
 END


Prompt:
 "color-coordinated-container-insertion". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "color-coordinated-container-insertion" in a python code block.
###

Response:
 color-coordinated-container-insertion: {'task-name': 'color-coordinated-container-insertion', 'task-description': 'There are three containers and three ell shaped blocks of different colors (red, blue, green) on the table top. The task is to pick up the ell shaped blocks and insert each one of them into the container of the same color. However, the ell blocks should be inserted in a specific sequence - red first, then blue, and finally green. This task is challenging due to the precision required for insertion and the need for color coordination and sequencing.', 'assets-used': ['insertion/ell.urdf', 'container/container-template.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks.task import Task
from cliport.utils import utils

class ColorCoordinatedContainerInsertion(Task):
    """Insert ell shaped blocks into the container of the same color in a specific sequence."""

    def __init__(self):
        super().__init__()
        self.max_steps = 3
        self.lang_template = "insert the {color} ell block into the {color} container"
        self.task_completed_desc = "done inserting ell blocks into containers."
        self.additional_reset()

    def reset(self, env):
        super().reset(env)

        # Ell block and container colors.
        colors = ['red', 'blue', 'green']

        # Add ell blocks and containers.
        ell_size = (0.04, 0.04, 0.04)
        ell_urdf = 'insertion/ell.urdf'
        container_size = (0.12, 0.12, 0)
        container_urdf = 'container/container-template.urdf'

        objs = []
        for color in colors:
            # Add ell block.
            ell_pose = self.get_random_pose(env, ell_size)
            ell_id = env.add_object(ell_urdf, ell_pose, color=utils.COLORS[color])
            objs.append(ell_id)

            # Add container.
            container_pose = self.get_random_pose(env, container_size)
            env.add_object(container_urdf, container_pose, color=utils.COLORS[color], category='fixed')

            # Goal: each ell block is in the container of the same color.
            self.add_goal(objs=[ell_id], matches=np.ones((1, 1)), targ_poses=[container_pose], replace=False,
                          rotations=True, metric='pose', params=None, step_max_reward=1/3)
            self.lang_goals.append(self.lang_template.format(color=color))```
 END


Prompt:
 "color-coordinated-insertion-in-container". Format the answer in a python dictionary with keys "task-name", "task-description", and "assets-used". Then write the pybullet simulation code for the task "color-coordinated-insertion-in-container" in a python code block.
###

Response:
 color-coordinated-insertion-in-container: {'task-name': 'color-coordinated-insertion-in-container', 'task-description': 'There are four differently-colored ell objects (red, blue, green, yellow) and a corresponding container of matching colors. The task involves picking up each ell object and inserting it into the container of the same color in a specific order: from left to right, insert red, blue, green, and finally yellow. The challenge lies in the precise manipulation of the ell objects and the color-coordination required.', 'assets-used': ['insertion/ell.urdf', 'container/container-template.urdf']}```

###Implementation:
  ```python
import numpy as np
import os
import pybullet as p
import random
from cliport.tasks import primitives
from cliport.tasks.grippers import Spatula
from cliport.tasks.task import Task
from cliport.utils import utils
import numpy as np
from cliport.tasks.task import Task
from cliport.utils import utils

class ColorCoordinatedInsertionInContainer(Task):
    """Insert four differently-colored ell objects into the corresponding container of matching colors in a specific order."""

    def __init__(self):
        super().__init__()
        self.max_steps = 10
        self.lang_template = "insert the {color} ell into the {color} container"
        self.task_completed_desc = "done inserting ell objects into containers."
        self.additional_reset()

    def reset(self, env):
        super().reset(env)

        # Define colors and their order
        colors = ['red', 'blue', 'green', 'yellow']

        # Add containers.
        container_size = (0.12, 0.12, 0.12)
        container_urdf = 'container/container-template.urdf'
        container_poses = []
        for color in colors:
            container_pose = self.get_random_pose(env, container_size)
            env.add_object(container_urdf, container_pose, color=utils.COLORS[color], category='fixed')
            container_poses.append(container_pose)

        # Add ell objects.
        ell_size = (0.04, 0.04, 0.04)
        ell_urdf = 'insertion/ell.urdf'
        ells = []
        for color in colors:
            ell_pose = self.get_random_pose(env, ell_size)
            ell_id = env.add_object(ell_urdf, ell_pose, color=utils.COLORS[color])
            ells.append(ell_id)

        # Goal: each ell object is in the corresponding container of the same color.
        for i in range(len(ells)):
            self.add_goal(objs=[ells[i]], matches=np.ones((1, 1)), targ_poses=[container_poses[i]], replace=False,
                          rotations=True, metric='pose', params=None, step_max_reward=1/len(ells))
            self.lang_goals.append(self.lang_template.format(color=colors[i]))```
 END