Prompt:
 "insert-ell-along-square-path". 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-ell-along-square-path" in a python code block.
###

Response:
 insert-ell-along-square-path: {'task-name': 'insert-ell-along-square-path', 'task-description': 'On the tabletop, there is a square path marked by small blocks. Along the path, there are four colored ell-shaped blocks (red, blue, green, and yellow) and four fixtures of matching colors. The task is to pick up each ell block and insert it into the fixture of the same color. However, the robot must move each ell block along the marked square path to reach the fixture. The task is challenging because it requires precise navigation along the path, color coordination, and insertion accuracy.', 'assets-used': ['block/small.urdf', '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 InsertEllAlongSquarePath(Task):
    """Pick up each ell block and insert it into the fixture of the same color. However, the robot must move each ell block along the marked square path to reach the fixture."""

    def __init__(self):
        super().__init__()
        self.max_steps = 20
        self.lang_template = "move the {color} ell block along the square path and insert it into the {color} fixture"
        self.task_completed_desc = "done inserting ell blocks."
        self.additional_reset()

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

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

        # Add ell blocks and fixtures.
        ell_size = (0.04, 0.04, 0.04)
        ell_urdf = 'insertion/ell.urdf'
        fixture_urdf = 'insertion/fixture.urdf'
        ell_blocks = []
        fixtures = []
        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])
            ell_blocks.append(ell_id)

            # Add fixture
            fixture_pose = self.get_random_pose(env, ell_size)
            fixture_id = env.add_object(fixture_urdf, fixture_pose, color=utils.COLORS[color])
            fixtures.append(fixture_id)

        # Goal: each ell block is inserted into the fixture of the same color.
        for i in range(len(colors)):
            self.add_goal(objs=[ell_blocks[i]], matches=np.ones((1, 1)), targ_poses=[p.getBasePositionAndOrientation(fixtures[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]))

        # Add square path marked by small blocks.
        path_block_size = (0.02, 0.02, 0.02)
        path_block_urdf = 'block/small.urdf'
        path_block_color = utils.COLORS['gray']
        for _ in range(16):
            path_block_pose = self.get_random_pose(env, path_block_size)
            env.add_object(path_block_urdf, path_block_pose, color=path_block_color)```
 END


Prompt:
 "color-ordered-insertion-with-blocking-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 "color-ordered-insertion-with-blocking-boxes" in a python code block.
###

Response:
 color-ordered-insertion-with-blocking-boxes: {'task-name': 'color-ordered-insertion-with-blocking-boxes', 'task-description': 'There are four differently-colored ell objects (red, blue, green, yellow) and a corresponding set of color-coded fixtures. In between the ell objects and the fixtures, there are four spheres positioned randomly, creating a barrier that the robot must navigate around. The task involves picking up each ell object and inserting it into the matching color fixture in a specific order: from left to right, insert red, blue, green, and finally yellow, without knocking over any of the spheres.', 'assets-used': ['insertion/ell.urdf', 'insertion/fixture.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

class ColorOrderedInsertionWithBlockingBoxes(Task):
    """Pick up four differently-colored ell objects and insert them into the matching color fixture in a specific order, without knocking over any of the spheres."""

    def __init__(self):
        super().__init__()
        self.max_steps = 20
        self.lang_template = "insert the {color} ell into the matching fixture"
        self.task_completed_desc = "done inserting ells."
        self.additional_reset()

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

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

        # Add fixtures.
        fixture_size = (0.12, 0.12, 0.12)
        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, color=utils.COLORS[colors[i]], category='fixed')
            fixture_poses.append(fixture_pose)

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

        # Add spheres.
        sphere_size = (0.04, 0.04, 0.04)
        sphere_urdf = 'sphere/sphere-template.urdf'
        for _ in range(4):
            sphere_pose = self.get_random_pose(env, sphere_size)
            env.add_object(sphere_urdf, sphere_pose)

        # Goal: each ell is inserted into the matching color fixture in a specific order.
        for i in range(4):
            self.add_goal(objs=[ells[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=colors[i]))```
 END


Prompt:
 "color-coordinated-box-ball-matching". 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-box-ball-matching" in a python code block.
###

Response:
 color-coordinated-box-ball-matching: {'task-name': 'color-coordinated-box-ball-matching', 'task-description': 'On the tabletop, there are four boxes of different colors (red, blue, green, and yellow) and four balls of corresponding colors. The task is to pick up each ball and place it inside the box of the same color, however, the boxes are placed in a straight line with a row of small blocks acting as a barrier between the boxes and the balls. The challenge lies in the precise placement, color matching, and the navigation around the barrier without knocking over any small blocks.', 'assets-used': ['box/box-template.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 ColorCoordinatedBoxBallMatching(Task):
    """Pick up each ball and place it inside the box of the same color, navigate around the barrier without knocking over any small blocks."""

    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 placing balls in boxes."
        self.additional_reset()

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

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

        # Add boxes.
        box_size = (0.05, 0.05, 0.05)
        box_urdf = 'box/box-template.urdf'
        box_poses = []
        for color in colors:
            box_pose = self.get_random_pose(env, box_size)
            env.add_object(box_urdf, box_pose, color=color, category='fixed')
            box_poses.append(box_pose)

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

        # Add small blocks as barriers.
        barrier_size = (0.01, 0.01, 0.01)
        barrier_urdf = 'block/small.urdf'
        for _ in range(10):
            barrier_pose = self.get_random_pose(env, barrier_size)
            env.add_object(barrier_urdf, barrier_pose, category='fixed')

        # Goal: each ball is in the box of the same color.
        for i in range(len(balls)):
            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/len(balls))
            self.lang_goals.append(self.lang_template.format(color=colors[i]))```
 END


Prompt:
 "color-coordinated-pallet-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-pallet-pyramid" in a python code block.
###

Response:
 color-coordinated-pallet-pyramid: {'task-name': 'color-coordinated-pallet-pyramid', 'task-description': 'On a tabletop, there are three pallets and nine blocks of three different colors (red, blue, green). Each color has three blocks and the blocks are scattered randomly on the table. The task is to pick up the blocks and stack them on the pallets to form a pyramid shape. Each pyramid should contain blocks of the same color with two blocks on the base and one block on top. The pallets with the pyramids should be arranged in a straight line in the following color order: red, blue, green from left to right. The challenge lies in the color coordination, precise stacking and the arrangement of the pallets.', '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 ColorCoordinatedPalletPyramid(Task):
    """Arrange blocks of the same color on pallets to form a pyramid and arrange the pallets in a specific color order."""

    def __init__(self):
        super().__init__()
        self.max_steps = 15
        self.lang_template = "arrange the blocks on the pallets to form a pyramid of the same color and arrange the pallets in the order red, blue, green"
        self.task_completed_desc = "done arranging blocks on pallets."
        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.015)
        pallet_urdf = 'pallet/pallet.urdf'
        pallet_poses = []
        for _ in range(3):
            pallet_pose = self.get_random_pose(env, pallet_size)
            env.add_object(pallet_urdf, pallet_pose, category='fixed')
            pallet_poses.append(pallet_pose)

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

        # Add blocks.
        # x, y, z dimensions for the asset size
        blocks = []
        block_size = (0.04, 0.04, 0.04)
        block_urdf = 'block/block.urdf'
        for i in range(9):
            block_pose = self.get_random_pose(env, block_size)
            block_id = env.add_object(block_urdf, block_pose, color=colors[i//3])
            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)]
        targs = [(utils.apply(pallet_poses[i//3], j), pallet_poses[i//3][1]) for i, j in enumerate(place_pos*3)]

        # Goal: blocks are stacked in a pyramid on each pallet.
        for i in range(3):
            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)```
 END


Prompt:
 "color-coordinated-ball-insertion-in-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 "color-coordinated-ball-insertion-in-boxes" in a python code block.
###

Response:
 color-coordinated-ball-insertion-in-boxes: {'task-name': 'color-coordinated-ball-insertion-in-boxes', 'task-description': 'Pick up four balls of different colors (red, blue, green, and yellow) and insert them into four separate boxes of matching colors. The boxes are located inside corners of a square structure and the task requires precise insertion, color coordination, and careful navigation around the square structure.', 'assets-used': ['ball/ball-template.urdf', 'box/box-template.urdf', 'square/square-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 ColorCoordinatedBallInsertion(Task):
    """Pick up four balls of different colors (red, blue, green, and yellow) and insert them into four separate boxes of matching colors."""

    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 inserting balls into boxes."
        self.additional_reset()

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

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

        # Add boxes.
        # x, y, z dimensions for the asset size
        box_size = (0.12, 0.12, 0.12)
        box_urdf = 'box/box-template.urdf'
        boxes = []
        for color in colors:
            box_pose = self.get_random_pose(env, box_size)
            box_id = env.add_object(box_urdf, box_pose, color=utils.COLORS[color])
            boxes.append(box_id)

        # Add balls.
        # x, y, z dimensions for the asset size
        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 box of the same color.
        for i in range(len(balls)):
            self.add_goal(objs=[balls[i]], matches=np.ones((1, 1)), targ_poses=[p.getBasePositionAndOrientation(boxes[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:
 "cylinder-balancing-and-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 "cylinder-balancing-and-placement" in a python code block.
###

Response:
 cylinder-balancing-and-placement: {'task-name': 'cylinder-balancing-and-placement', 'task-description': 'On a table, there are three differently colored cylinders (red, green, and blue) and three square zones of matching colors. The task involves picking up each cylinder and balancing it on its end at the center of the corresponding colored zone, in the sequence of red, green, and blue from left to right. The task is challenging due to precise balancing required in placing the cylinders, color matching, and sequence following.', '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 CylinderBalancingAndPlacement(Task):
    """Pick up each cylinder and balance it on its end at the center of the corresponding colored zone."""

    def __init__(self):
        super().__init__()
        self.max_steps = 15
        self.lang_template = "balance the {color} cylinder in the {color} zone"
        self.task_completed_desc = "done balancing and placing cylinders."
        self.colors = ['red', 'green', 'blue']
        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_poses = []
        for color in self.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 cylinders.
        cylinder_size = (0.04, 0.04, 0.12)
        cylinder_urdf = 'cylinder/cylinder-template.urdf'
        cylinders = []
        for color in self.colors:
            cylinder_pose = self.get_random_pose(env, cylinder_size)
            cylinder_id = env.add_object(cylinder_urdf, cylinder_pose, color=utils.COLORS[color])
            cylinders.append(cylinder_id)

        # Goal: each cylinder is balanced in the corresponding colored zone.
        for i in range(len(cylinders)):
            self.add_goal(objs=[cylinders[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=self.colors[i]))```
 END


Prompt:
 "align-spheres-in-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-spheres-in-boxes" in a python code block.
###

Response:
 align-spheres-in-boxes: {'task-name': 'align-spheres-in-boxes', 'task-description': 'There are four different colored boxes (red, blue, green, and yellow) and four spheres of corresponding colors on the table. The task is to pick up each sphere and place it into the box of the same color. However, there are small blocks scattered randomly on the table, which the robot has to navigate without knocking them over. The challenge lies in the precise placement of the spheres, color matching, and navigation around the blocks.', 'assets-used': ['box/box-template.urdf', 'sphere/sphere-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 AlignSpheresInBoxes(Task):
    """Pick up each sphere and place it into the box of the same color. Navigate around the blocks."""

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

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

        # Add boxes.
        # x, y, z dimensions for the asset size
        box_size = (0.12, 0.12, 0.12)
        box_urdf = 'box/box-template.urdf'
        box_poses = []
        box_colors = ['red', 'blue', 'green', 'yellow']
        for color in box_colors:
            box_pose = self.get_random_pose(env, box_size)
            env.add_object(box_urdf, box_pose, category='fixed', color=utils.COLORS[color])
            box_poses.append(box_pose)

        # Add spheres.
        # x, y, z dimensions for the asset size
        spheres = []
        sphere_size = (0.04, 0.04, 0.04)
        sphere_urdf = 'sphere/sphere-template.urdf'
        for color in box_colors:
            sphere_pose = self.get_random_pose(env, sphere_size)
            sphere_id = env.add_object(sphere_urdf, sphere_pose, color=utils.COLORS[color])
            spheres.append(sphere_id)

        # Add blocks.
        # x, y, z dimensions for the asset size
        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 sphere is in a box of the same color.
        for i in range(len(spheres)):
            self.add_goal(objs=[spheres[i]], matches=np.ones((1, 1)), targ_poses=[box_poses[i]], replace=False,
                    rotations=True, metric='pose', params=None, step_max_reward=1/len(spheres))
            self.lang_goals.append(self.lang_template.format(color=box_colors[i]))```
 END


Prompt:
 "color-coordinated-sphere-and-cylinder-assembly". 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-sphere-and-cylinder-assembly" in a python code block.
###

Response:
 color-coordinated-sphere-and-cylinder-assembly: {'task-name': 'color-coordinated-sphere-and-cylinder-assembly', 'task-description': 'The robot starts with four spheres of different colors (red, blue, green, yellow) and four cylinders of matching colors. The task is to pick up each sphere and place it on top of the cylinder of the same color, forming four sphere-and-cylinder pairs. However, the challenge here is to do this in a specific color sequence - red, blue, green, and finally yellow.', 'assets-used': ['sphere/sphere-template.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 ColorCoordinatedSphereAndCylinderAssembly(Task):
    """Pick up each sphere and place it on top of the cylinder of the same color, in a specific color sequence."""

    def __init__(self):
        super().__init__()
        self.max_steps = 20
        self.lang_template = "place the {color} sphere on the {color} cylinder"
        self.task_completed_desc = "done placing spheres on cylinders."
        self.colors = ['red', 'blue', 'green', 'yellow']
        self.color_sequence = ['red', 'blue', 'green', 'yellow']

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

        # Add spheres and cylinders.
        sphere_size = (0.05, 0.05, 0.05)
        cylinder_size = (0.05, 0.05, 0.1)
        sphere_template = 'sphere/sphere-template.urdf'
        cylinder_template = 'cylinder/cylinder-template.urdf'

        # Add spheres and cylinders of each color.
        for color in self.colors:
            sphere_pose = self.get_random_pose(env, sphere_size)
            cylinder_pose = self.get_random_pose(env, cylinder_size)
            sphere_id = env.add_object(sphere_template, sphere_pose, color=color)
            cylinder_id = env.add_object(cylinder_template, cylinder_pose, color=color)

            # Goal: each sphere is on top of the cylinder of the same color.
            self.add_goal(objs=[sphere_id], matches=np.ones((1, 1)), targ_poses=[cylinder_pose], replace=False,
                          rotations=True, metric='pose', params=None, step_max_reward=1/4)
            self.lang_goals.append(self.lang_template.format(color=color))

        # The task is completed in a specific color sequence.
        self.color_sequence = ['red', 'blue', 'green', 'yellow']```
 END


Prompt:
 "color-coordinated-cylinder-bowl-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-coordinated-cylinder-bowl-sorting" in a python code block.
###

Response:
 color-coordinated-cylinder-bowl-sorting: {'task-name': 'color-coordinated-cylinder-bowl-sorting', 'task-description': 'There are four different cylinders (red, blue, green, yellow) and four different bowls (red, blue, green, yellow). The task involves picking up each cylinder and placing it in the bowl of the same color. The challenge lies in the precise manipulation of the cylinders and color-coordination.', 'assets-used': ['cylinder/cylinder-template.urdf', 'bowl/bowl.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 ColorCoordinatedCylinderBowlSorting(Task):
    """Pick up each cylinder and place it in the bowl of the same color."""

    def __init__(self):
        super().__init__()
        self.max_steps = 4
        self.lang_template = "put the {color} cylinder in the {color} bowl"
        self.task_completed_desc = "done sorting cylinders."
        self.additional_reset()

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

        # Define colors
        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 color in colors:
            bowl_pose = self.get_random_pose(env, bowl_size)
            env.add_object(bowl_urdf, bowl_pose, color=utils.COLORS[color], category='fixed')
            bowl_poses.append(bowl_pose)

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

        # Goal: each cylinder is in the bowl of the same color.
        for i in range(len(colors)):
            self.add_goal(objs=[cylinders[i]], matches=np.ones((1, 1)), targ_poses=[bowl_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:
 "sequential-block-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 "sequential-block-insertion" in a python code block.
###

Response:
 sequential-block-insertion: {'task-name': 'sequential-block-insertion', 'task-description': 'There are four blocks of different colors (red, blue, green, yellow) and four fixtures of matching colors. 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. However, the challenge lies in the fact that the blocks and fixtures are initially arranged in a mixed order, demanding careful navigation, precise insertion, color matching, and sequence following.', 'assets-used': ['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
import pybullet as p

class SequentialBlockInsertion(Task):
    """Pick up blocks of different colors and insert them into the fixture of the same color in a specific sequence."""

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

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

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

        # Add fixtures.
        # x, y, z dimensions for the asset size
        fixture_size = (0.12, 0.12, 0)
        fixture_urdf = 'insertion/fixture.urdf'
        fixtures = []
        for color in colors:
            fixture_pose = self.get_random_pose(env, fixture_size)
            fixture_id = env.add_object(fixture_urdf, fixture_pose, color=utils.COLORS[color], category='fixed')
            fixtures.append(fixture_id)

        # 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 color in colors:
            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 fixture of the same color.
        for i in range(len(blocks)):
            self.add_goal(objs=[blocks[i]], matches=np.ones((1, 1)), targ_poses=[p.getBasePositionAndOrientation(fixtures[i])], 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]))```
 END


Prompt:
 "sequential-insertion-and-stacking". 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 "sequential-insertion-and-stacking" in a python code block.
###

Response:
 sequential-insertion-and-stacking: {'task-name': 'sequential-insertion-and-stacking', 'task-description': 'The tabletop contains three fixtures and three ell-shaped blocks of different colors - red, blue, and green. The task is to first pick up and insert each ell block into the corresponding colored fixture in the sequence of red, blue, and green. After successful insertion, the robot must pick up the three blocks again from the fixtures and stack them in a corner of the tabletop in the same color sequence - red at the bottom, blue in the middle, and green on top.', 'assets-used': ['insertion/ell.urdf', 'insertion/fixture.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
import pybullet as p

class SequentialInsertionAndStacking(Task):
    """Pick up and insert each ell block into the corresponding colored fixture in the sequence of red, blue, and green. After successful insertion, pick up the three blocks again from the fixtures and stack them in a corner of the tabletop in the same color sequence - red at the bottom, blue in the middle, and green on top."""

    def __init__(self):
        super().__init__()
        self.max_steps = 15
        self.lang_template = "insert the {color} ell block into the {color} fixture and then stack them in the corner"
        self.task_completed_desc = "done inserting and stacking."
        self.additional_reset()

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

        # Add fixtures.
        fixture_size = (0.12, 0.12, 0)
        fixture_urdf = 'insertion/fixture.urdf'
        fixture_poses = []
        colors = ['red', 'blue', 'green']
        for color in colors:
            fixture_pose = self.get_random_pose(env, fixture_size)
            env.add_object(fixture_urdf, fixture_pose, category='fixed', color=utils.COLORS[color])
            fixture_poses.append(fixture_pose)

        # Add ell blocks.
        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 block is in the corresponding colored fixture.
        for i in range(3):
            self.add_goal(objs=[ells[i]], matches=np.ones((1, 1)), targ_poses=[fixture_poses[i]], replace=False,
                    rotations=True, metric='pose', params=None, step_max_reward=1/3)
            self.lang_goals.append(self.lang_template.format(color=colors[i]))

        # Add corner.
        corner_size = (0.12, 0.12, 0)
        corner_pose = self.get_random_pose(env, corner_size)
        corner_urdf = 'corner/corner-template.urdf'
        env.add_object(corner_urdf, corner_pose, category='fixed')

        # Goal: ell blocks are stacked in the corner in the color sequence - red at the bottom, blue in the middle, and green on top.
        stack_poses = [(0, 0, 0.04), (0, 0, 0.08), (0, 0, 0.12)]
        targs = [(utils.apply(corner_pose, i), corner_pose[1]) for i in stack_poses]
        self.add_goal(objs=ells, matches=np.ones((3, 3)), targ_poses=targs, replace=False,
                rotations=True, metric='pose', params=None, step_max_reward=1/3)
        self.lang_goals.append("stack the ell blocks in the corner in the color sequence - red at the bottom, blue in the middle, and green on top")```
 END


Prompt:
 "color-coordinated-block-shifting". 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-shifting" in a python code block.
###

Response:
 color-coordinated-block-shifting: {'task-name': 'color-coordinated-block-shifting', 'task-description': 'On a tabletop, there are three zones marked in three different colors (red, blue, and green) and nine blocks of matching colors (three red, three blue, and three green). Each zone initially contains three blocks of a single color, but the colors of the blocks and zones do not match. The task involves picking up each block 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 zones. The robot has to strategically navigate around these blocks without knocking them over while transporting the blocks to the corresponding zones. The challenge lies in the precise navigation, placement of the blocks, color matching while avoiding the blocks.', 'assets-used': ['zone/zone.urdf', 'block/block.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 ColorCoordinatedBlockShifting(Task):
    """Pick up each block and precisely place it in the zone of the same color."""

    def __init__(self):
        super().__init__()
        self.max_steps = 15
        self.lang_template = "move the {color} blocks to the {color} zone"
        self.task_completed_desc = "done moving blocks."
        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 blocks.
        block_size = (0.04, 0.04, 0.04)
        block_urdf = 'stacking/block.urdf'
        blocks = []
        for color in zone_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)

        # Add small blocks as obstacles.
        small_block_size = (0.02, 0.02, 0.02)
        small_block_urdf = 'stacking/small_block.urdf'
        for _ in range(5):
            small_block_pose = self.get_random_pose(env, small_block_size)
            env.add_object(small_block_urdf, small_block_pose)

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


Prompt:
 "color-coordinated-cylinder-placement-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-coordinated-cylinder-placement-on-pallet" in a python code block.
###

Response:
 color-coordinated-cylinder-placement-on-pallet: {'task-name': 'color-coordinated-cylinder-placement-on-pallet', 'task-description': 'On a tabletop, there are four corners marked in four different colors (red, blue, green, and yellow) and four cylinders of matching colors. Also, there is a pallet on the tabletop with four colored zones matching with the colors of the corners and cylinders. Initially, each cylinder is located at a corner, but not corresponding to the color of the corner. The task is to pick up each cylinder and place it on the pallet zone of the same color. However, this must be done in a specific sequence - red first, then blue, green, and finally yellow. The challenge lies in precise placement, color matching, and following the correct sequence.', 'assets-used': ['corner/corner-template.urdf', '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

class ColorCoordinatedCylinderPlacement(Task):
    """Pick up each cylinder and place it on the pallet zone of the same color in a specific sequence."""

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

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

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

        # Define colors and their sequence.
        colors = ['red', 'blue', 'green', 'yellow']
        color_sequence = [utils.COLORS[color] for color in colors]

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

        # Define zones on the pallet for each color.
        zone_poses = [utils.apply(pallet_pose, (0.1 * i - 0.15, 0.1 * j - 0.15, 0))
                      for i in range(2) for j in range(2)]

        # Add goals for each color in the sequence.
        for i, color in enumerate(colors):
            self.add_goal(objs=[cylinders[i]], matches=np.ones((1, 1)), targ_poses=[zone_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))```
 END


Prompt:
 "guided-block-path". 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 "guided-block-path" in a python code block.
###

Response:
 guided-block-path: {'task-name': 'guided-block-path', 'task-description': 'On the tabletop, there are four colored blocks (red, blue, green, and yellow) and four lines of the corresponding colors. The task is to pick up each block and move it along the line of the same color from start to end. The challenge lies in precise navigation along the line, color coordination, and block manipulation.', 'assets-used': ['block/block.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.task import Task
from cliport.utils import utils
import pybullet as p

class GuidedBlockPath(Task):
    """Pick up each block and move it along the line of the same color from start to end."""

    def __init__(self):
        super().__init__()
        self.max_steps = 20
        self.lang_template = "move the {color} block along the {color} line from start to end"
        self.task_completed_desc = "done moving blocks."
        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 lines and blocks.
        # x, y, z dimensions for the asset size
        line_size = (0.3, 0.01, 0.01)
        block_size = (0.04, 0.04, 0.04)
        block_urdf = 'block/block.urdf'
        line_urdf = 'line/line-template.urdf'

        blocks = []
        lines = []
        for i in range(4):
            # Add line
            line_pose = self.get_random_pose(env, line_size)
            env.add_object(line_urdf, line_pose, color=colors[i], category='fixed')
            lines.append(line_pose)

            # Add block
            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)

            # Add goal
            self.add_goal(objs=[block_id], matches=np.ones((1, 1)), targ_poses=[line_pose], 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:
 "color-ordered-insertion-with-obstacles". 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-insertion-with-obstacles" in a python code block.
###

Response:
 color-ordered-insertion-with-obstacles: {'task-name': 'color-ordered-insertion-with-obstacles', 'task-description': 'On a tabletop, there are four colored ell-shaped blocks (red, blue, green, and yellow) and four fixtures of matching colors, with a line of small blocks serving as barriers, and they are arranged in a straight line. The task is to pick up each ell block, navigate around the small blocks, and insert it into the fixture of the same color in a specific sequence from left to right, starting with red, followed by blue, then green, and finally yellow. The challenges include precise navigation, color coordination, sequence following, and obstacle avoidance.', 'assets-used': ['insertion/ell.urdf', 'insertion/fixture.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 ColorOrderedInsertionWithObstacles(Task):
    """Pick up each ell block, navigate around the small blocks, and insert it into the fixture of the same color in a specific sequence from left to right, starting with red, followed by blue, then green, and finally yellow."""

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

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

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

        # Add ell blocks and fixtures.
        for color in colors:
            # Add ell block
            ell_size = (0.04, 0.04, 0.04)  # x, y, z dimensions for the ell block size
            ell_pose = self.get_random_pose(env, ell_size)
            ell_urdf = 'insertion/ell.urdf'
            ell_id = env.add_object(ell_urdf, ell_pose, color=utils.COLORS[color])

            # Add fixture
            fixture_size = (0.05, 0.05, 0.05)  # x, y, z dimensions for the fixture size
            fixture_pose = self.get_random_pose(env, fixture_size)
            fixture_urdf = 'insertion/fixture.urdf'
            fixture_id = env.add_object(fixture_urdf, fixture_pose, color=utils.COLORS[color])

            # Add goal: ell block is inserted into the fixture of the same color
            self.add_goal(objs=[ell_id], matches=np.ones((1, 1)), targ_poses=[fixture_pose], replace=False,
                          rotations=True, metric='pose', params=None, step_max_reward=1/4)
            self.lang_goals.append(self.lang_template.format(color=color))

        # Add small blocks as obstacles.
        n_obstacles = 10
        obstacle_size = (0.02, 0.02, 0.02)  # x, y, z dimensions for the obstacle size
        obstacle_urdf = 'block/small.urdf'
        for _ in range(n_obstacles):
            obstacle_pose = self.get_random_pose(env, obstacle_size)
            env.add_object(obstacle_urdf, obstacle_pose)```
 END


Prompt:
 "color-matched-block-transfer". 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-block-transfer" in a python code block.
###

Response:
 color-matched-block-transfer: {'task-name': 'color-matched-block-transfer', 'task-description': 'On a tabletop, there are four containers and four blocks of different colors (red, blue, green, and yellow). Each block is inside a container, but not corresponding to the color of the container. The task is to pick up each block and place it in the container of the same color, in the specific sequence of red, blue, green and yellow from left to right. The task is challenging due to the precise placement, color matching and sequence following.', '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 ColorMatchedBlockTransfer(Task):
    """Pick up each block and place it in the container 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} block in the {color} container"
        self.task_completed_desc = "done transferring blocks."
        self.additional_reset()

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

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

        # Add containers.
        container_size = (0.12, 0.12, 0.12)
        container_urdf = 'container/container-template.urdf'
        container_poses = []
        for color in color_sequence:
            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 blocks.
        block_size = (0.04, 0.04, 0.04)
        block_urdf = 'block/block.urdf'
        blocks = []
        for color in color_sequence:
            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 container of the same color.
        for i in range(len(blocks)):
            self.add_goal(objs=[blocks[i]], matches=np.ones((1, 1)), targ_poses=[container_poses[i]], 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]))```
 END


Prompt:
 "mixed-color-block-barrier-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 "mixed-color-block-barrier-insertion" in a python code block.
###

Response:
 mixed-color-block-barrier-insertion: {'task-name': 'mixed-color-block-barrier-insertion', 'task-description': 'There are four different colored blocks (red, blue, green, and yellow), and four fixtures in corresponding colors. Two barriers, each made of three blocks (orange, purple, and brown), are placed in between the blocks and fixtures, forming a path that the robot must navigate. The task involves picking up each colored block, navigating the barriers, and inserting each block into the fixture of the same color. The fixtures are arranged in a sequence from left to right: red, blue, green, and yellow, providing a challenge in precise navigation, color coordination, and insertion.', 'assets-used': ['block/block.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 MixedColorBlockBarrierInsertion(Task):
    """Pick up each colored block, navigate the barriers, and insert each block into the fixture of the same color."""

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

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

        # Define colors for blocks and fixtures
        colors = ['red', 'blue', 'green', 'yellow']

        # Add blocks.
        block_size = (0.04, 0.04, 0.04)
        block_urdf = 'block/block.urdf'
        blocks = []
        for color in colors:
            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 fixtures.
        fixture_size = (0.06, 0.06, 0.06)
        fixture_urdf = 'insertion/fixture.urdf'
        fixtures = []
        for color in colors:
            fixture_pose = self.get_random_pose(env, fixture_size)
            fixture_id = env.add_object(fixture_urdf, fixture_pose, color=utils.COLORS[color])
            fixtures.append(fixture_id)

        # Add barriers.
        barrier_size = (0.12, 0.04, 0.04)
        barrier_colors = ['orange', 'purple', 'brown']
        for _ in range(2):
            for color in barrier_colors:
                barrier_pose = self.get_random_pose(env, barrier_size)
                env.add_object(block_urdf, barrier_pose, color=utils.COLORS[color])

        # Goal: each block is inserted into the fixture of the same color.
        for i in range(len(blocks)):
            self.add_goal(objs=[blocks[i]], matches=np.ones((1, 1)), targ_poses=[p.getBasePositionAndOrientation(fixtures[i])], 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]))```
 END


Prompt:
 "ball-in-bowl-obstacle-course". 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-in-bowl-obstacle-course" in a python code block.
###

Response:
 ball-in-bowl-obstacle-course: {'task-name': 'ball-in-bowl-obstacle-course', 'task-description': 'With the tabletop setup consisting of a maze of small blocks, the task requires the robot to pick up four balls of different colors (red, blue, green, yellow) and place each of them into the corresponding colored bowls strategically positioned at different corners of the maze, without knocking over any blocks, demanding careful navigation and color coordination.', 'assets-used': ['ball/ball-template.urdf', 'block/small.urdf', 'bowl/bowl.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 BallInBowlObstacleCourse(Task):
    """Navigate through a maze of blocks, pick up balls of different colors and place them in the corresponding colored bowls."""

    def __init__(self):
        super().__init__()
        self.max_steps = 20
        self.lang_template = "navigate through the maze and 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)

        # Add blocks to form a maze.
        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)
            env.add_object(block_urdf, block_pose, category='fixed')

        # Add balls of different colors.
        ball_size = (0.04, 0.04, 0.04)
        ball_urdf = 'ball/ball-template.urdf'
        colors = ['red', 'blue', 'green', 'yellow']
        balls = []
        for color in colors:
            ball_pose = self.get_random_pose(env, ball_size)
            ball_id = env.add_object(ball_urdf, ball_pose, color=color)
            balls.append(ball_id)

        # Add bowls of different colors at different corners of the maze.
        bowl_size = (0.12, 0.12, 0)
        bowl_urdf = 'bowl/bowl.urdf'
        bowls = []
        for color in colors:
            bowl_pose = self.get_random_pose(env, bowl_size)
            bowl_id = env.add_object(bowl_urdf, bowl_pose, color=color, category='fixed')
            bowls.append(bowl_id)

        # Goal: each ball is in the bowl of the same color.
        for i in range(len(balls)):
            self.add_goal(objs=[balls[i]], matches=np.ones((1, 1)), targ_poses=[p.getBasePositionAndOrientation(bowls[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-coordinated-bowl-ball-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-bowl-ball-pyramid" in a python code block.
###

Response:
 color-coordinated-bowl-ball-pyramid: {'task-name': 'color-coordinated-bowl-ball-pyramid', 'task-description': 'On a tabletop, there are four bowls and four balls of different colors (red, blue, green, and yellow). The task is to pick up each ball and stack them in the shape of a pyramid inside the bowl of the same color, in the specific sequence of red at the bottom, blue and green in the middle, and yellow at the top. The challenge lies in the precise placement, color matching, and pyramid formation.', '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
import pybullet as p

class ColorCoordinatedBowlBallPyramid(Task):
    """Pick up each ball and stack them in the shape of a pyramid inside the bowl of the same color."""

    def __init__(self):
        super().__init__()
        self.max_steps = 12
        self.lang_template = "stack the balls in the shape of a pyramid inside the bowl of the same color"
        self.task_completed_desc = "done stacking balls in bowls."
        self.additional_reset()

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

        # Add bowls.
        # x, y, z dimensions for the asset size
        bowl_size = (0.12, 0.12, 0)
        bowl_urdf = 'bowl/bowl.urdf'
        bowl_colors = ['red', 'blue', 'green', 'yellow']
        bowl_poses = []
        for color in bowl_colors:
            bowl_pose = self.get_random_pose(env, bowl_size)
            env.add_object(bowl_urdf, bowl_pose, category='fixed', color=utils.COLORS[color])
            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 color in bowl_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 the bowl of the same color.
        self.add_goal(objs=balls, matches=np.eye(4), targ_poses=bowl_poses, replace=False,
                rotations=True, metric='pose', params=None, step_max_reward=1)
        self.lang_goals.append(self.lang_template)```
 END


Prompt:
 "color-coordinated-arch-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 "color-coordinated-arch-construction" in a python code block.
###

Response:
 color-coordinated-arch-construction: {'task-name': 'color-coordinated-arch-construction', 'task-description': 'The task is to construct an arch using six blocks: three red and three blue. The blocks are initially placed in a container. The robot needs to pick each block and place it on a pallet in the following arrangement: place two red blocks in parallel on the pallet, then place a blue block on top of the red blocks to form an arch. Repeat the process with the remaining blocks, placing them on top of the first arch to form a second layer. The task is challenging due to the need for precise placement of the blocks and maintaining the balance of the structure.', 'assets-used': ['block/block.urdf', 'pallet/pallet.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 ColorCoordinatedArchConstruction(Task):
    """Construct an arch using six blocks: three red and three blue."""

    def __init__(self):
        super().__init__()
        self.max_steps = 6
        self.lang_template = "construct an arch using six blocks: three red and three blue"
        self.task_completed_desc = "done constructing arch."
        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')

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

        # Add blocks.
        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.02), (0, 0.05, 0.02),
                     (0, 0, 0.06), (0, -0.05, 0.08),
                     (0, 0.05, 0.08), (0, 0, 0.12)]
        targs = [(utils.apply(pallet_pose, i), pallet_pose[1]) for i in place_pos]

        # Goal: blocks are stacked in an arch (bottom row: red, red, blue).
        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)

        # Goal: blocks are stacked in an arch (top row: red, red, blue).
        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)```
 END


Prompt:
 "color-coordinated-zone-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-coordinated-zone-arrangement" in a python code block.
###

Response:
 color-coordinated-zone-arrangement: {'task-name': 'color-coordinated-zone-arrangement', 'task-description': 'On the tabletop, there are nine blocks of three different colors (three red, three blue, and three green) and three pallets of matching colors (one red, one blue, one green). The task is to pick up each block and place it on the pallet of the same color, arranging the blocks on each pallet in a line. However, there are a few small blocks randomly scattered on the tabletop, which the robot has to navigate around without knocking them over while transporting the blocks to the corresponding pallets. The challenge lies in the precise navigation, placement of the blocks, color matching, and maintaining the balance on the pallets.', 'assets-used': ['block/block.urdf', 'pallet/pallet.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 ColorCoordinatedZoneArrangement(Task):
    """Pick up blocks of different colors and place them on the pallets of the same color."""

    def __init__(self):
        super().__init__()
        self.max_steps = 15
        self.lang_template = "place the {color} blocks on the {color} pallet"
        self.task_completed_desc = "done arranging blocks on pallets."
        self.additional_reset()

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

        # Add pallets.
        # x, y, z dimensions for the asset size
        pallet_size = (0.12, 0.12, 0.02)
        pallet_urdf = 'pallet/pallet.urdf'
        pallet_colors = ['red', 'blue', 'green']
        pallet_poses = []
        for color in pallet_colors:
            pallet_pose = self.get_random_pose(env, pallet_size)
            env.add_object(pallet_urdf, pallet_pose, category='fixed', color=utils.COLORS[color])
            pallet_poses.append(pallet_pose)

        # Add blocks.
        # x, y, z dimensions for the asset size
        blocks = []
        block_size = (0.04, 0.04, 0.04)
        block_urdf = 'block/block.urdf'
        for color in pallet_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)

        # Add small blocks as obstacles.
        small_block_size = (0.02, 0.02, 0.02)
        small_block_urdf = 'block/small.urdf'
        for _ in range(5):
            small_block_pose = self.get_random_pose(env, small_block_size)
            env.add_object(small_block_urdf, small_block_pose)

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


Prompt:
 "color-coordinated-cylinder-stand-assembly". 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-stand-assembly" in a python code block.
###

Response:
 color-coordinated-cylinder-stand-assembly: {'task-name': 'color-coordinated-cylinder-stand-assembly', 'task-description': 'The robot starts with four cylinders of different colors (red, blue, green, yellow) and four stands of matching colors. The task is to pick up each cylinder and place it on top of the stand of the same color, forming four cylinder-and-stand pairs. However, the challenge here is to do this in a specific color sequence - green, yellow, blue, and finally red, while also ensuring that the cylinders do not topple over.', '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

class ColorCoordinatedCylinderStandAssembly(Task):
    """Pick up each cylinder and place it on top of the stand of the same color, in a specific color sequence."""

    def __init__(self):
        super().__init__()
        self.max_steps = 10
        self.lang_template = "place the {color} cylinder on the {color} stand"
        self.task_completed_desc = "done placing cylinders on stands."
        self.additional_reset()

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

        # Define colors and their sequence
        colors = ['green', 'yellow', 'blue', 'red']
        color_sequence = [utils.COLORS[color] for color in colors]

        # Add stands.
        stand_size = (0.04, 0.04, 0.04)
        stand_urdf = 'stacking/stand.urdf'
        stand_poses = []
        for i in range(4):
            stand_pose = self.get_random_pose(env, stand_size)
            env.add_object(stand_urdf, stand_pose, color=color_sequence[i], category='fixed')
            stand_poses.append(stand_pose)

        # Add cylinders.
        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=color_sequence[i])
            cylinders.append(cylinder_id)

        # Goal: each cylinder is on the stand of the same color, in the specified color sequence.
        for i in range(4):
            self.add_goal(objs=[cylinders[i]], matches=np.ones((1, 1)), targ_poses=[stand_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-cylinder-stand-in-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 "color-coordinated-cylinder-stand-in-line" in a python code block.
###

Response:
 color-coordinated-cylinder-stand-in-line: {'task-name': 'color-coordinated-cylinder-stand-in-line', 'task-description': 'There are four stands of different colors (red, blue, green, yellow) and four cylinders of matching colors. The task is to pick up each cylinder and place it on top of the stand of the same color, forming four cylinder-and-stand pairs. However, the challenge here is to do this in a specific color sequence - red, blue, green, and finally yellow, and then line them up in a straight line from left to right according to the same color sequence.', '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

class ColorCoordinatedCylinderStandInLine(Task):
    """Pick up each cylinder and place it on top of the stand of the same color, forming four cylinder-and-stand pairs. However, the challenge here is to do this in a specific color sequence - red, blue, green, and finally yellow, and then line them up in a straight line from left to right according to the same color sequence."""

    def __init__(self):
        super().__init__()
        self.max_steps = 20
        self.lang_template = "place the {color} cylinder on the {color} stand"
        self.task_completed_desc = "done placing cylinders on stands."
        self.additional_reset()

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

        # Define colors and their sequence
        colors = ['red', 'blue', 'green', 'yellow']
        color_sequence = [utils.COLORS[color] for color in colors]

        # Add stands and cylinders
        stand_size = (0.04, 0.04, 0.04)
        cylinder_size = (0.04, 0.04, 0.04)
        stand_urdf = 'stacking/stand.urdf'
        cylinder_urdf = 'cylinder/cylinder-template.urdf'

        stands = []
        cylinders = []
        for i in range(4):
            # Add stand
            stand_pose = self.get_random_pose(env, stand_size)
            stand_id = env.add_object(stand_urdf, stand_pose, color=color_sequence[i])
            stands.append(stand_id)

            # Add cylinder
            cylinder_pose = self.get_random_pose(env, cylinder_size)
            cylinder_id = env.add_object(cylinder_urdf, cylinder_pose, color=color_sequence[i])
            cylinders.append(cylinder_id)

        # Goal: each cylinder is on the stand of the same color, in the color sequence
        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(self.lang_template.format(color=colors[i]))```
 END


Prompt:
 "color-coordinated-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 "color-coordinated-pyramid-construction" in a python code block.
###

Response:
 color-coordinated-pyramid-construction: {'task-name': 'color-coordinated-pyramid-construction', 'task-description': 'On a tabletop, there are six blocks in two colors (three red and three blue). The task involves picking up these blocks and constructing a pyramid with two levels on a stand: the first level should consist of three blocks (two red blocks and one blue block), and the second level should be formed by stacking the remaining three blocks (two blue blocks and one red block) on top of the first level. The challenge lies in the precise placement, color coordination, and maintaining the balance of the pyramid.', 'assets-used': ['stacking/block.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

class ColorCoordinatedPyramidConstruction(Task):
    """Construct a pyramid with two levels on a stand: the first level should consist of three blocks (two red blocks and one blue block), and the second level should be formed by stacking the remaining three blocks (two blue blocks and one red block) on top of the first level."""

    def __init__(self):
        super().__init__()
        self.max_steps = 10
        self.lang_template = "construct a pyramid with two levels on a stand: the first level should consist of three blocks (two red blocks and one blue block), and the second level should be formed by stacking the remaining three blocks (two blue blocks and one red block) on top of the first level."
        self.task_completed_desc = "done constructing pyramid."
        self.additional_reset()

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

        # Add stand.
        stand_size = (0.15, 0.15, 0.005)
        stand_pose = self.get_random_pose(env, stand_size)
        env.add_object('stacking/stand.urdf', stand_pose, 'fixed')

        # Add blocks.
        block_size = (0.04, 0.04, 0.04)
        block_urdf = 'stacking/block.urdf'
        blocks = []
        colors = [utils.COLORS['red'], utils.COLORS['red'], utils.COLORS['blue'], utils.COLORS['blue'], utils.COLORS['blue'], utils.COLORS['red']]
        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(stand_pose, i), stand_pose[1]) for i in place_pos]

        # Goal: blocks are stacked in a pyramid (bottom row: red, red, blue).
        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)

        # Goal: blocks are stacked in a pyramid (top row: blue, blue, red).
        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)```
 END


Prompt:
 "color-coordinated-ball-stacking". 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-stacking" in a python code block.
###

Response:
 color-coordinated-ball-stacking: {'task-name': 'color-coordinated-ball-stacking', 'task-description': 'There are four balls of different colors (red, blue, green, yellow), and four containers of matching colors on the table. The task is to pick up each ball and stack it on top of the corresponding colored container. However, the stacking should be done in a specific color sequence - blue at the bottom, followed by yellow, then green, and finally red at the top. This task enforces challenging skills due to the precision required for stacking the balls, color coordination, and sequencing.', '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
import pybullet as p

class ColorCoordinatedBallStacking(Task):
    """Stack balls on top of the corresponding colored containers in a specific color sequence."""

    def __init__(self):
        super().__init__()
        self.max_steps = 10
        self.lang_template = "stack the balls on top of the corresponding colored containers in the sequence blue, yellow, green, red"
        self.task_completed_desc = "done stacking balls."
        self.additional_reset()

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

        # Define the color sequence
        color_sequence = ['blue', 'yellow', 'green', 'red']

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

        # Add balls.
        ball_size = (0.04, 0.04, 0.04)
        ball_urdf = 'ball/ball-template.urdf'
        balls = []
        for color in color_sequence:
            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 stacked on top of the corresponding colored container in the color sequence.
        for i in range(len(balls)):
            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(balls))
            self.lang_goals.append(self.lang_template.format(obj=color_sequence[i]))

        # Add distractors.
        n_distractors = 0
        while n_distractors < 6:
            is_ball = np.random.rand() > 0.5
            urdf = ball_urdf if is_ball else container_urdf
            size = ball_size if is_ball else container_size
            pose = self.get_random_pose(env, obj_size=size)
            color = np.random.choice(list(utils.COLORS.keys()))

            obj_id = env.add_object(urdf, pose, color=utils.COLORS[color])
            n_distractors += 1```
 END


Prompt:
 "color-coded-blocks-on-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 "color-coded-blocks-on-corner" in a python code block.
###

Response:
 color-coded-blocks-on-corner: {'task-name': 'color-coded-blocks-on-corner', 'task-description': 'On a tabletop, there are four blocks of different colors (red, blue, green, and yellow) and a corner structure. The task involves picking up each block and placing it in the corner structure in a specific color sequence: from left to right, place red, blue, green, and finally yellow. The blocks must be arranged such that they form a straight line along the corner. The challenge lies in the precise placement, color coordination, and maintaining the balance of the blocks along the corner.', 'assets-used': ['block/block.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
import pybullet as p

class ColorCodedBlocksOnCorner(Task):
    """Pick up blocks of different colors and place them in a corner structure in a specific color sequence."""

    def __init__(self):
        super().__init__()
        self.max_steps = 10
        self.lang_template = "place the blocks in the corner in the sequence red, blue, green, yellow"
        self.task_completed_desc = "done placing blocks in the corner."
        self.additional_reset()

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

        # Add corner structure.
        corner_size = (0.15, 0.15, 0.05)
        corner_pose = self.get_random_pose(env, corner_size)
        corner_urdf = 'corner/corner-template.urdf'
        env.add_object(corner_urdf, corner_pose, 'fixed')

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

        # Add blocks.
        block_size = (0.04, 0.04, 0.04)
        block_urdf = 'block/block.urdf'
        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=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, 0.08)]
        targs = [(utils.apply(corner_pose, i), corner_pose[1]) for i in place_pos]

        # Goal: blocks are placed in the corner in the sequence red, blue, green, yellow.
        for i in range(4):
            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 / 4)
            self.lang_goals.append(self.lang_template.format(blocks="the red, blue, green, yellow blocks"))```
 END


Prompt:
 "insertion-in-color-sequenced-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 "insertion-in-color-sequenced-zones" in a python code block.
###

Response:
 insertion-in-color-sequenced-zones: {'task-name': 'insertion-in-color-sequenced-zones', 'task-description': 'On the table, there are four differently-colored insertion ell objects (red, blue, green, yellow) and four zones on the tabletop marked in the same colors. Initially, each ell is placed in a zone but not corresponding to the color of the zone. The task is to pick up each ell and place it in the zone of the same color, in the specific sequence of red, blue, green, and yellow from left to right, requiring careful navigation, precise placement, color matching, and sequence following.', 'assets-used': ['insertion/ell.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 InsertionInColorSequencedZones(Task):
    """Pick up each ell 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 = 20
        self.lang_template = "place the {color} ell in the {color} zone"
        self.task_completed_desc = "done placing ells in color sequenced zones."
        self.additional_reset()

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

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

        # Add zones.
        zone_size = (0.12, 0.12, 0)
        zone_urdf = 'zone/zone.urdf'
        zone_poses = []
        for i in range(4):
            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 ells.
        ell_size = (0.04, 0.04, 0.04)
        ell_urdf = 'insertion/ell.urdf'
        ells = []
        for i in range(4):
            ell_pose = self.get_random_pose(env, ell_size)
            ell_id = env.add_object(ell_urdf, ell_pose, color=utils.COLORS[colors[i]])
            ells.append(ell_id)

        # Goal: each ell is in the zone of the same color.
        for i in range(4):
            self.add_goal(objs=[ells[i]], matches=np.ones((1, 1)), targ_poses=[zone_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:
 "precise-block-placement-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 "precise-block-placement-in-container" in a python code block.
###

Response:
 precise-block-placement-in-container: {'task-name': 'precise-block-placement-in-container', 'task-description': 'The tabletop has a row of four colored containers (red, blue, green, yellow), and twelve blocks of matching colors (three of each color). The task involves picking up each color of blocks and placing them in the container of the same color in a specific orientation: one block standing upright, one block lying flat, and one block on its side. The challenge lies in the precise placement and orientation of blocks within the confined space of the containers, while also maintaining 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 PreciseBlockPlacementInContainer(Task):
    """Pick up each color of blocks and place them in the container of the same color in a specific orientation."""

    def __init__(self):
        super().__init__()
        self.max_steps = 12
        self.lang_template = "place the {color} blocks in the {color} container"
        self.task_completed_desc = "done placing blocks in containers."
        self.additional_reset()

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

        # Define colors for blocks and containers
        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, category='fixed', color=utils.COLORS[color])
            container_poses.append(container_pose)

        # Add blocks.
        blocks = []
        block_size = (0.04, 0.04, 0.04)
        block_urdf = 'block/block.urdf'
        for color in colors:
            for _ in range(3):  # three blocks of each color
                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 a container of the same color.
        for i in range(len(blocks)):
            self.add_goal(objs=[blocks[i]], matches=np.ones((1, 1)), targ_poses=[container_poses[i//3]], replace=False,
                          rotations=True, metric='pose', params=None, step_max_reward=1/12)
            self.lang_goals.append(self.lang_template.format(color=colors[i//3]))```
 END


Prompt:
 "color-coordinated-bowl-stacking". 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-bowl-stacking" in a python code block.
###

Response:
 color-coordinated-bowl-stacking: {'task-name': 'color-coordinated-bowl-stacking', 'task-description': 'There are four bowls and four blocks of different colors (red, blue, green, and yellow) on the table. The task is to pick up each block and place it into the bowl of the same color. Following this, the robot must stack the bowls from largest to smallest (from bottom to top) in the sequence of red, blue, green, and yellow. The challenge lies in not only the precise placement and color coordination, but also in the delicate stacking of the bowls without toppling them over.', 'assets-used': ['bowl/bowl.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
import pybullet as p

class ColorCoordinatedBowlStacking(Task):
    """Pick up each block and place it into the bowl of the same color. Then stack the bowls from largest to smallest (from bottom to top) in the sequence of red, blue, green, and yellow."""

    def __init__(self):
        super().__init__()
        self.max_steps = 10
        self.lang_template = "put each block in the bowl of the same color and stack the bowls from largest to smallest in the sequence of red, blue, green, and yellow"
        self.task_completed_desc = "done stacking bowls."
        self.additional_reset()

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

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

        # Add bowls and blocks of each color
        bowl_size = (0.12, 0.12, 0)
        block_size = (0.04, 0.04, 0.04)
        bowl_urdf = 'bowl/bowl.urdf'
        block_urdf = 'block/block.urdf'
        bowls = []
        blocks = []
        for color in colors:
            # Add bowl
            bowl_pose = self.get_random_pose(env, bowl_size)
            bowl_id = env.add_object(bowl_urdf, bowl_pose, color=utils.COLORS[color])
            bowls.append(bowl_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)

        # Goal: each block is in the bowl of the same color
        for i in range(len(blocks)):
            self.add_goal(objs=[blocks[i]], matches=np.ones((1, 1)), targ_poses=[p.getBasePositionAndOrientation(bowls[i])], replace=False,
                rotations=True, metric='pose', params=None, step_max_reward=1 / len(blocks))

        # Goal: bowls are stacked in the sequence of red, blue, green, and yellow
        stack_poses = [(0, 0, 0.06), (0, 0, 0.12), (0, 0, 0.18), (0, 0, 0.24)]
        for i in range(len(bowls)):
            self.add_goal(objs=[bowls[i]], matches=np.ones((1, 1)), targ_poses=[utils.apply(bowl_pose, stack_poses[i])], replace=False,
                rotations=True, metric='pose', params=None, step_max_reward=1 / len(bowls))

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


Prompt:
 "color-coordinated-zone-stacking". 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-zone-stacking" in a python code block.
###

Response:
 color-coordinated-zone-stacking: {'task-name': 'color-coordinated-zone-stacking', 'task-description': 'On the tabletop, there are three zones and nine blocks of three different colors (red, blue, green). Each color has three blocks and the blocks are scattered randomly on the table. The task is to pick up the blocks and stack them in the zones to form a pyramid shape. Each pyramid should contain blocks of the same color with two blocks on the base and one block on top. The zones with the pyramids should be arranged in a straight line in the following color order: red, blue, green from left to right. The challenge lies in the color coordination, precise stacking and the arrangement of the zones.', '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 ColorCoordinatedZoneStacking(Task):
    """Pick up blocks of different colors and stack them in zones to form a pyramid."""

    def __init__(self):
        super().__init__()
        self.max_steps = 15
        self.lang_template = "stack the blocks in the zones to form a pyramid"
        self.task_completed_desc = "done stacking blocks."
        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_poses = []
        for _ in range(3):
            zone_pose = self.get_random_pose(env, zone_size)
            env.add_object(zone_urdf, zone_pose, 'fixed')
            zone_poses.append(zone_pose)

        # 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'
        blocks = []
        for i in range(9):
            block_pose = self.get_random_pose(env, block_size)
            block_id = env.add_object(block_urdf, block_pose, color=colors[i//3])
            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(zone_poses[i//3], place_pos[i%3]), zone_poses[i//3][1]) for i in range(9)]

        # Goal: blocks are stacked in a pyramid in each zone.
        for i in range(3):
            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(blocks="the red, blue and green blocks",
                                                             row="bottom"))```
 END