=== Instruction 1 ===
Is Correct: False
Syntax Pass: False
Code Function: The code defines a function to run a simulation task involving a robotic gripper. It begins by setting up the environment and resetting the task to its initial state. It optionally initializes video recording for the simulation. The function retrieves the positions of various objects in the environment, including a drawer and rubbish.

The task consists of several key steps: first, the gripper rotates to a specified angle; then it moves to the side and anchor positions of a bottom drawer. After that, it picks up the drawer and pulls it out. Next, the gripper picks up rubbish from a table and finally places the rubbish into a bin. Each step checks if the task is completed, and if so, it exits early. The environment is ensured to shut down properly at the end of the task. The function prints status messages throughout the process to indicate progress and completion.
Similarity: {'ok': False, 'reason': 'LLM JSON parsing failed.'}
Differences: 1. **Nature of Content**: TASK is a formal representation of a planning problem in PDDL, while CODE_FUNC describes a procedural function for simulating a robotic task.
2. **Format**: TASK is structured in a domain-specific language (PDDL), whereas CODE_FUNC is written in a programming language (likely Python or similar).
3. **Purpose**: TASK defines the actions, predicates, and initial conditions for a planning problem, while CODE_FUNC outlines the steps to execute a simulation of the task.
4. **Level of Abstraction**: TASK operates at a higher level of abstraction, focusing on the logical relationships and requirements of actions, while CODE_FUNC provides a step-by-step procedural implementation.
5. **Execution**: TASK does not execute actions but defines them for a planner, whereas CODE_FUNC executes the actions in a specific sequence.
6. **State Management**: TASK uses predicates to represent the state of the world, while CODE_FUNC manages state through function calls and variable assignments.
7. **Error Handling**: TASK does not include error handling mechanisms, while CODE_FUNC may include checks and status messages to handle task completion and errors.
8. **Output**: TASK does not produce output directly; it is meant for a planner to derive a sequence of actions. CODE_FUNC includes print statements to indicate progress and completion of the task.
9. **Flexibility**: TASK is designed to be flexible for different planning scenarios, while CODE_FUNC is tailored to a specific simulation task involving a gripper and objects.

In summary, the semantic differences between TASK and CODE_FUNC are significant, reflecting their distinct purposes and structures.

Refined Code Generated:
-------------------
import numpy as np
from pyrep.objects.shape import Shape
from pyrep.objects.proximity_sensor import ProximitySensor

from env import setup_environment, shutdown_environment
from skill_code import *
from video import init_video_writers, recording_step, recording_get_observation
from object_positions import get_object_positions

def run_skeleton_task():
    '''Generic skeleton for running any task in your simulation.'''
    print("===== Starting Skeleton Task =====")
    
    # === Environment Setup ===
    env, task = setup_environment()
    try:
        # Reset the task to its initial state
        _, obs = task.reset()

        # (Optional) Initialize video writers for capturing your simulation
        init_video_writers(obs)

        # Wrap the task steps for recording (if needed)
        original_step = task.step
        task.step = recording_step(original_step)
        original_get_obs = task.get_observation
        task.get_observation = recording_get_observation(original_get_obs)

        # === Retrieve Object Positions ===
        positions = get_object_positions()

        # Define object positions
        bottom_anchor_pos = positions['bottom_anchor_pos']
        bottom_side_pos = positions['bottom_side_pos']
        rubbish_pos = positions['rubbish']
        bin_pos = positions['bin']

        # === Execute the Plan ===
        # Step 1: Rotate the gripper to ninety degrees
        print("[Task] Rotating gripper to ninety degrees.")
        obs, reward, done = rotate(env, task, target_quat=np.array([0, 0, 1, 0]), 
                                   max_steps=100, threshold=0.05, timeout=10.0)
        if done:
            print("[Task] Task ended after rotating!")
            return

        # Step 2: Move to the side position of the bottom drawer
        print("[Task] Moving to side position of the bottom drawer.")
        obs, reward, done = move(env, task, target_pos=bottom_side_pos, 
                                 max_steps=100, threshold=0.01, timeout=10.0)
        if done:
            print("[Task] Task ended after moving to side position!")
            return

        # Step 3: Move to the anchor position of the bottom drawer
        print("[Task] Moving to anchor position of the bottom drawer.")
        obs, reward, done = move(env, task, target_pos=bottom_anchor_pos, 
                                 max_steps=100, threshold=0.01, timeout=10.0)
        if done:
            print("[Task] Task ended after moving to anchor position!")
            return

        # Step 4: Pick the bottom drawer
        print("[Task] Picking the bottom drawer.")
        obs, reward, done = pick_drawer(env, task, gripper='gripper', 
                                         d='bottom', p='anchor-pos-bottom')
        if done:
            print("[Task] Task ended after picking the drawer!")
            return

        # Step 5: Pull the bottom drawer
        print("[Task] Pulling the bottom drawer.")
        obs, reward, done = pull(env, task, pull_distance=0.1, pull_axis='x', 
                                 max_steps=100, threshold=0.01, timeout=10.0)
        if done:
            print("[Task] Task ended after pulling the drawer!")
            return

        # Step 6: Pick the rubbish from the table
        print("[Task] Picking the rubbish from the table.")
        obs, reward, done = pick(env, task, target_pos=rubbish_pos, 
                                 approach_distance=0.15, max_steps=100, 
                                 threshold=0.01, approach_axis='z', timeout=10.0)
        if done:
            print("[Task] Task ended after picking the rubbish!")
            return

        # Step 7: Place the rubbish in the bin
        print("[Task] Placing the rubbish in the bin.")
        obs, reward, done = place(env, task, target_pos=bin_pos, 
                                  approach_distance=0.15, max_steps=100, 
                                  threshold=0.01, approach_axis='z', timeout=10.0)
        if done:
            print("[Task] Task completed successfully! Reward:", reward)
        else:
            print("[Task] Task not completed yet (done=False).")

    finally:
        # Always ensure the environment is properly shutdown
        shutdown_environment(env)

    print("===== End of Skeleton Task =====")

if __name__ == "__main__":
    run_skeleton_task()
-------------------

=== Instruction 2 ===
Is Correct: False
Syntax Pass: False
Code Function: The code defines a function to run a simulation task involving a robotic gripper. It begins by setting up the environment and resetting the task to its initial state. The task captures video recordings of the simulation if needed. It retrieves the positions of various objects, including rubbish and a bin.

The function then executes a series of steps: it rotates the gripper, moves to specific positions near a bottom drawer, picks up the drawer, pulls it open, picks up rubbish, and finally places the rubbish into a bin. After each step, it checks if the task is completed and prints appropriate messages. The environment is ensured to shut down properly at the end of the task. The overall behavior is to simulate a sequence of actions performed by a robot to clean up rubbish.
Similarity: {'ok': False, 'reason': 'LLM JSON parsing failed.'}
Differences: 1. **Purpose**: 
   - **TASK**: Describes a specific instruction for a robot to follow, focusing on the action of pulling a drawer and disposing of rubbish.
   - **CODE_FUNC**: Describes a function that simulates a sequence of actions performed by a robot, including setup, execution, and cleanup.

2. **Level of Abstraction**:
   - **TASK**: High-level instruction without implementation details.
   - **CODE_FUNC**: Low-level implementation details, including specific steps and checks.

3. **Components**:
   - **TASK**: Contains a single instruction and a domain definition.
   - **CODE_FUNC**: Contains multiple steps, including environment setup, action execution, and task completion checks.

4. **Execution Flow**:
   - **TASK**: Does not specify execution flow; it is a directive.
   - **CODE_FUNC**: Specifies a detailed execution flow with sequential actions.

5. **Feedback Mechanism**:
   - **TASK**: No feedback mechanism is described.
   - **CODE_FUNC**: Includes checks and prints messages to indicate task completion and status.

6. **Environment Interaction**:
   - **TASK**: Focuses on the interaction with a drawer and a bin.
   - **CODE_FUNC**: Involves broader interaction with the environment, including video recording and ensuring proper shutdown.

7. **Action Specificity**:
   - **TASK**: General instruction to pull a drawer and drop rubbish.
   - **CODE_FUNC**: Specifies exact actions like rotating the gripper, moving to positions, picking up the drawer, and placing rubbish.

8. **State Management**:
   - **TASK**: Does not manage or track state changes.
   - **CODE_FUNC**: Manages state changes and checks conditions before and after actions.

9. **Error Handling**:
   - **TASK**: No error handling is mentioned.
   - **CODE_FUNC**: Implies checks for task completion and proper execution of actions.

10. **Output**:
    - **TASK**: No output is generated.
    - **CODE_FUNC**: Generates output messages based on the execution of actions.

11. **Simulation Aspect**:
    - **TASK**: Does not mention simulation.
    - **CODE_FUNC**: Clearly states that it runs a simulation task.

12. **Video Recording**:
    - **TASK**: No mention of video recording.
    - **CODE_FUNC**: Includes the option to capture video recordings of the simulation.

13. **Resetting State**:
    - **TASK**: Does not mention resetting the state.
    - **CODE_FUNC**: Includes resetting the task to its initial state.

14. **Completion Check**:
    - **TASK**: No completion check is described.
    - **CODE_FUNC**: Includes checks to determine if the task is completed.

15. **Robotic Actions**:
    - **TASK**: Focuses on the action of pulling a drawer and disposing of rubbish.
    - **CODE_FUNC**: Involves multiple robotic actions, including rotating, moving, picking, and placing.

16. **Contextual Information**:
    - **TASK**: Provides context for a specific action.
    - **CODE_FUNC**: Provides a broader context for a series of actions within a simulation.

17. **Implementation Language**:
    - **TASK**: Written in a domain-specific language (PDDL).
    - **CODE_FUNC**: Written in a programming language (implied to be a general-purpose language).

18. **Task Complexity**:
    - **TASK**: Simple, single-step instruction.
    - **CODE_FUNC**: Complex, multi-step function with various actions and checks.

19. **Focus on Objects**:
    - **TASK**: Focuses on the interaction with a drawer and rubbish.
    - **CODE_FUNC**: Focuses on multiple objects and their interactions throughout the simulation.

20. **Action Naming**:
    - **TASK**: Uses action names relevant to the domain (e.g., pull).
    - **CODE_FUNC**: Uses function names and steps that describe the actions in detail.

In summary, the semantic differences between TASK and CODE_FUNC are significant, with TASK being a high-level directive and CODE_FUNC being a detailed implementation of a robotic simulation task.

Refined Code Generated:
-------------------
import numpy as np
from env import setup_environment, shutdown_environment
from skill_code import *
from video import init_video_writers, recording_step, recording_get_observation
from object_positions import get_object_positions

def run_skeleton_task():
    '''Generic skeleton for running any task in your simulation.'''
    print("===== Starting Skeleton Task =====")
    
    # === Environment Setup ===
    env, task = setup_environment()
    try:
        # Reset the task to its initial state
        _, obs = task.reset()

        # (Optional) Initialize video writers for capturing your simulation
        init_video_writers(obs)

        # Wrap the task steps for recording (if needed)
        original_step = task.step
        task.step = recording_step(original_step)
        original_get_obs = task.get_observation
        task.get_observation = recording_get_observation(original_get_obs)

        # === Retrieve Object Positions ===
        positions = get_object_positions()

        # Define object positions
        rubbish_pos = positions['rubbish']
        bin_pos = positions['bin']
        bottom_anchor_pos = positions['bottom_anchor_pos']

        # === Execute the Plan ===
        # Step 1: Rotate the gripper to ninety degrees
        print("[Task] Rotating gripper to ninety degrees.")
        obs, reward, done = rotate(env, task, target_quat=np.array([0, 0, 1, 0]), max_steps=100, threshold=0.05, timeout=10.0)
        if done:
            print("[Task] Task ended after rotating the gripper!")
            return

        # Step 2: Move to the side position of the bottom drawer
        print("[Task] Moving to side position of the bottom drawer.")
        obs, reward, done = move(env, task, target_pos=positions['bottom_side_pos'], max_steps=100, threshold=0.01, timeout=10.0)
        if done:
            print("[Task] Task ended after moving to side position!")
            return

        # Step 3: Move to the anchor position of the bottom drawer
        print("[Task] Moving to anchor position of the bottom drawer.")
        obs, reward, done = move(env, task, target_pos=bottom_anchor_pos, max_steps=100, threshold=0.01, timeout=10.0)
        if done:
            print("[Task] Task ended after moving to anchor position!")
            return

        # Step 4: Pick the bottom drawer
        print("[Task] Picking the bottom drawer.")
        obs, reward, done = pick(env, task, target_pos=bottom_anchor_pos, approach_distance=0.15, max_steps=100, threshold=0.01, approach_axis='z', timeout=10.0)
        if done:
            print("[Task] Task ended after picking the drawer!")
            return

        # Step 5: Pull the bottom drawer open
        print("[Task] Pulling the bottom drawer open.")
        obs, reward, done = pull(env, task, pull_distance=0.1, pull_axis='y', max_steps=100, threshold=0.01, timeout=10.0)
        if done:
            print("[Task] Task ended after pulling the drawer!")
            return

        # Step 6: Pick the rubbish
        print("[Task] Picking the rubbish.")
        obs, reward, done = pick(env, task, target_pos=rubbish_pos, approach_distance=0.15, max_steps=100, threshold=0.01, approach_axis='z', timeout=10.0)
        if done:
            print("[Task] Task ended after picking the rubbish!")
            return

        # Step 7: Place the rubbish into the bin
        print("[Task] Placing the rubbish into the bin.")
        obs, reward, done = place(env, task, target_pos=bin_pos, approach_distance=0.15, max_steps=100, threshold=0.01, approach_axis='z', timeout=10.0)
        if done:
            print("[Task] Task completed successfully! Reward:", reward)
        else:
            print("[Task] Task not completed yet (done=False).")

    finally:
        # Always ensure the environment is properly shutdown
        shutdown_environment(env)

    print("===== End of Skeleton Task =====")

if __name__ == "__main__":
    run_skeleton_task()
-------------------

=== Instruction 3 ===
Is Correct: False
Syntax Pass: False
Code Function: The code defines a function that simulates a robotic task in an environment. It begins by setting up the environment and resetting the task to its initial state. It optionally initializes video recording for the simulation. The function retrieves the positions of various objects needed for the task.

The task consists of several key steps: first, the robot rotates its gripper to a specific angle. Next, it moves to the side position of a bottom drawer, followed by moving to the anchor position of the same drawer. The robot then picks up the bottom drawer and pulls it out. After that, it picks up some rubbish from a designated position and finally places the rubbish into a bin.

Throughout the process, the function checks if each step is completed successfully and prints messages indicating the progress. If any step is completed, the function exits early. At the end of the task, the environment is properly shut down. The function is executed when the script is run as the main program.
Similarity: {'ok': False, 'reason': 'LLM JSON parsing failed.'}
Differences: 1. **Nature of Content**: 
   - TASK is a detailed instruction set for a specific robotic action, while CODE_FUNC describes a function that simulates a robotic task in a programming context.

2. **Format**: 
   - TASK is presented in a structured format (PDDL) that defines actions, predicates, and the environment, whereas CODE_FUNC is a narrative description of a function's behavior and steps.

3. **Level of Abstraction**: 
   - TASK provides a low-level, formal representation of actions and conditions, while CODE_FUNC offers a high-level overview of the task execution process without specific implementation details.

4. **Purpose**: 
   - TASK is designed to define the rules and actions for a robotic system, while CODE_FUNC aims to describe the execution of those rules in a programming environment.

5. **Execution Context**: 
   - TASK is meant to be interpreted by a planner or robotic system, while CODE_FUNC is intended to be executed as part of a software program.

6. **Detail on Actions**: 
   - TASK specifies actions with preconditions and effects, while CODE_FUNC summarizes actions without detailing the underlying conditions or effects.

7. **Feedback Mechanism**: 
   - TASK does not mention feedback or progress reporting, while CODE_FUNC includes checks and messages indicating the progress of the task.

8. **Initialization and Shutdown**: 
   - TASK does not include any initialization or shutdown procedures, whereas CODE_FUNC explicitly mentions setting up the environment and shutting it down after task completion.

9. **Object Interaction**: 
   - TASK describes interactions with objects in terms of predicates and actions, while CODE_FUNC describes these interactions in a more narrative form without formal predicates.

10. **Error Handling**: 
    - TASK does not address error handling, while CODE_FUNC implies that the function checks for successful completion of steps and may exit early if a step fails.

11. **Recording**: 
    - CODE_FUNC mentions optional video recording for the simulation, which is not present in TASK.

12. **Execution Trigger**: 
    - CODE_FUNC specifies that it is executed when the script is run as the main program, while TASK does not mention any execution context or trigger.

13. **Terminology**: 
    - TASK uses specific PDDL terminology (e.g., predicates, actions), while CODE_FUNC uses more general programming terminology (e.g., function, steps, environment).

14. **Focus on Simulation**: 
    - CODE_FUNC emphasizes the simulation aspect of the task, while TASK focuses on the logical structure of the task without reference to simulation.

15. **Object Types**: 
    - TASK defines specific object types and their relationships, while CODE_FUNC does not delve into object types but rather focuses on their roles in the task.

16. **Sequential Steps**: 
    - TASK outlines actions in a formal manner, while CODE_FUNC describes the sequence of actions in a more fluid narrative.

17. **Clarity of Intent**: 
    - TASK clearly defines the intent of each action through preconditions and effects, while CODE_FUNC conveys intent through a descriptive narrative without formal definitions.

18. **Complexity**: 
    - TASK is more complex in terms of formal logic and structure, while CODE_FUNC is simpler and more accessible to a general audience.

19. **Use of Variables**: 
    - TASK uses variables in a formal way to represent objects and conditions, while CODE_FUNC uses them in a more informal, descriptive manner.

20. **Focus on Implementation**: 
    - TASK is focused on the theoretical implementation of actions, while CODE_FUNC is focused on the practical execution of those actions in a programming context.

Refined Code Generated:
-------------------
import numpy as np
from pyrep.objects.shape import Shape
from pyrep.objects.proximity_sensor import ProximitySensor

from env import setup_environment, shutdown_environment
from skill_code import *
from video import init_video_writers, recording_step, recording_get_observation
from object_positions import get_object_positions

def run_skeleton_task():
    '''Generic skeleton for running any task in your simulation.'''
    print("===== Starting Skeleton Task =====")
    
    # === Environment Setup ===
    env, task = setup_environment()
    try:
        # Reset the task to its initial state
        descriptions, obs = task.reset()

        # (Optional) Initialize video writers for capturing your simulation
        init_video_writers(obs)

        # Wrap the task steps for recording (if needed)
        original_step = task.step
        task.step = recording_step(original_step)
        original_get_obs = task.get_observation
        task.get_observation = recording_get_observation(original_get_obs)

        # === Retrieve Object Positions ===
        positions = get_object_positions()

        # Define object positions
        bottom_anchor_pos = positions['bottom_anchor_pos']
        bottom_side_pos = positions['bottom_side_pos']
        rubbish_pos = positions['rubbish']
        bin_pos = positions['bin']

        # === Execute the Plan ===
        # Step 1: Rotate the gripper to ninety degrees
        print("[Task] Rotating gripper to ninety degrees.")
        obs, reward, done = rotate(env, task, target_quat=np.array([0, 0, 1, 0]), 
                                   max_steps=100, threshold=0.05, timeout=10.0)
        if done:
            print("[Task] Task ended after rotating!")
            return

        # Step 2: Move to the side position of the bottom drawer
        print("[Task] Moving to side position of the bottom drawer.")
        obs, reward, done = move(env, task, target_pos=bottom_side_pos, 
                                 max_steps=100, threshold=0.01, timeout=10.0)
        if done:
            print("[Task] Task ended after moving to side position!")
            return

        # Step 3: Move to the anchor position of the bottom drawer
        print("[Task] Moving to anchor position of the bottom drawer.")
        obs, reward, done = move(env, task, target_pos=bottom_anchor_pos, 
                                 max_steps=100, threshold=0.01, timeout=10.0)
        if done:
            print("[Task] Task ended after moving to anchor position!")
            return

        # Step 4: Pick the bottom drawer
        print("[Task] Picking the bottom drawer.")
        obs, reward, done = pick_drawer(env, task, gripper='gripper', 
                                         d='bottom', p=bottom_anchor_pos)
        if done:
            print("[Task] Task ended after picking the drawer!")
            return

        # Step 5: Pull the bottom drawer
        print("[Task] Pulling the bottom drawer.")
        obs, reward, done = pull(env, task, pull_distance=0.2, pull_axis='x', 
                                 max_steps=100, threshold=0.01, timeout=10.0)
        if done:
            print("[Task] Task ended after pulling the drawer!")
            return

        # Step 6: Pick up the rubbish
        print("[Task] Picking up the rubbish.")
        obs, reward, done = pick(env, task, target_pos=rubbish_pos, 
                                 approach_distance=0.15, max_steps=100, 
                                 threshold=0.01, approach_axis='z', timeout=10.0)
        if done:
            print("[Task] Task ended after picking up the rubbish!")
            return

        # Step 7: Place the rubbish in the bin
        print("[Task] Placing the rubbish in the bin.")
        obs, reward, done = place(env, task, target_pos=bin_pos, 
                                  approach_distance=0.15, max_steps=100, 
                                  threshold=0.01, approach_axis='z', timeout=10.0)
        if done:
            print("[Task] Task completed successfully! Reward:", reward)
        else:
            print("[Task] Task not completed yet (done=False).")

    finally:
        # Always ensure the environment is properly shutdown
        shutdown_environment(env)

    print("===== End of Skeleton Task =====")

if __name__ == "__main__":
    run_skeleton_task()
-------------------

=== Instruction 4 ===
Is Correct: False
Syntax Pass: False
Code Function: The code defines a function that simulates a robotic task in an environment. It begins by setting up the environment and resetting the task to its initial state. It optionally initializes video recording for the simulation. The function retrieves the positions of various objects in the environment, such as drawers and rubbish.

The task consists of a series of steps: first, the robot rotates its gripper, then it moves to specific positions to interact with a bottom drawer. It picks up the drawer, pulls it open, and then picks up rubbish from a table. Finally, it places the rubbish into a bin. After each step, the function checks if the task is completed and prints a message accordingly. The environment is properly shut down at the end of the task, regardless of whether it was completed successfully.
Similarity: {'ok': False, 'reason': 'LLM JSON parsing failed.'}
Differences: 1. **Purpose**: 
   - TASK describes a specific sequence of actions to be performed by a robot in a natural language format, while CODE_FUNC outlines a function that simulates the execution of those actions in a programming context.

2. **Format**: 
   - TASK is presented in a structured format (PDDL) that defines a domain and problem, whereas CODE_FUNC is described in a narrative format that explains the function's behavior and logic.

3. **Detail Level**: 
   - TASK includes detailed definitions of actions, predicates, and types relevant to the robotic task, while CODE_FUNC provides a high-level overview of the task without delving into the specifics of the implementation.

4. **Execution**: 
   - TASK is a formal representation meant for planning and execution by a planner or robot, while CODE_FUNC describes a procedural approach to simulating the task, including initialization and shutdown processes.

5. **State Management**: 
   - TASK defines the initial state and conditions for actions explicitly in PDDL, while CODE_FUNC mentions resetting the environment and checking task completion in a more abstract manner.

6. **Output**: 
   - TASK does not specify output messages or feedback, focusing instead on the actions and their effects, whereas CODE_FUNC explicitly states that it prints messages regarding task completion.

7. **Environment Interaction**: 
   - TASK focuses on the logical representation of actions and their preconditions/effects, while CODE_FUNC describes the interaction with the environment in a procedural way, including video recording and shutdown processes.

8. **Action Sequence**: 
   - TASK specifies actions in a logical order with preconditions and effects, while CODE_FUNC describes the sequence of actions in a narrative format without formal preconditions or effects.

9. **Robotic Control**: 
   - TASK is designed for a robotic planning system to interpret and execute, while CODE_FUNC is intended for a programming environment where the function is executed as part of a simulation.

10. **Flexibility**: 
    - TASK is rigid in its structure, adhering to PDDL standards, while CODE_FUNC may allow for more flexibility in implementation and adaptation to different scenarios.

Refined Code Generated:
-------------------
import numpy as np
from env import setup_environment, shutdown_environment
from skill_code import *
from video import init_video_writers, recording_step, recording_get_observation
from object_positions import get_object_positions

def run_skeleton_task():
    '''Generic skeleton for running any task in your simulation.'''
    print("===== Starting Skeleton Task =====")
    
    # === Environment Setup ===
    env, task = setup_environment()
    try:
        # Reset the task to its initial state
        _, obs = task.reset()

        # (Optional) Initialize video writers for capturing your simulation
        init_video_writers(obs)

        # Wrap the task steps for recording (if needed)
        original_step = task.step
        task.step = recording_step(original_step)
        original_get_obs = task.get_observation
        task.get_observation = recording_get_observation(original_get_obs)

        # === Retrieve Object Positions ===
        positions = get_object_positions()

        # Define object positions
        bottom_anchor_pos = positions['bottom_anchor_pos']
        bottom_side_pos = positions['bottom_side_pos']
        rubbish_pos = positions['rubbish']
        bin_pos = positions['bin']

        # === Execute the Plan ===
        # Step 1: Rotate the gripper to ninety degrees
        obs, reward, done = rotate(env, task, target_quat=np.array([0, 0, 1, 0]), max_steps=100, threshold=0.05, timeout=10.0)
        if done:
            print("[Task] Task ended after rotating!")
            return

        # Step 2: Move to the side position of the bottom drawer
        obs, reward, done = move(env, task, target_pos=bottom_side_pos, max_steps=100, threshold=0.01, timeout=10.0)
        if done:
            print("[Task] Task ended after moving to side position!")
            return

        # Step 3: Move to the anchor position of the bottom drawer
        obs, reward, done = move(env, task, target_pos=bottom_anchor_pos, max_steps=100, threshold=0.01, timeout=10.0)
        if done:
            print("[Task] Task ended after moving to anchor position!")
            return

        # Step 4: Pick the bottom drawer
        obs, reward, done = pick_drawer(env, task, gripper='gripper', d='bottom', p=bottom_anchor_pos)
        if done:
            print("[Task] Task ended after picking the drawer!")
            return

        # Step 5: Pull the bottom drawer to open it
        obs, reward, done = pull(env, task, pull_distance=0.1, pull_axis='x', max_steps=100, threshold=0.01, timeout=10.0)
        if done:
            print("[Task] Task ended after pulling the drawer!")
            return

        # Step 6: Pick the rubbish from the table
        obs, reward, done = pick(env, task, target_pos=rubbish_pos, approach_distance=0.15, max_steps=100, threshold=0.01, approach_axis='z', timeout=10.0)
        if done:
            print("[Task] Task ended after picking the rubbish!")
            return

        # Step 7: Place the rubbish in the bin
        obs, reward, done = place(env, task, target_pos=bin_pos, approach_distance=0.15, max_steps=100, threshold=0.01, approach_axis='z', timeout=10.0)
        if done:
            print("[Task] Task completed successfully! Reward:", reward)
        else:
            print("[Task] Task not completed yet (done=False).")

    finally:
        # Always ensure the environment is properly shutdown
        shutdown_environment(env)

    print("===== End of Skeleton Task =====")

if __name__ == "__main__":
    run_skeleton_task()
-------------------

=== Instruction 5 ===
Is Correct: False
Syntax Pass: False
Code Function: The code defines a function to run a simulation task involving a robotic system. It begins by setting up the environment and resetting the task to its initial state. The task captures video recordings of the simulation for later review. 

The robot then follows a series of steps: it rotates its gripper, moves to specific positions near a bottom drawer, picks up the drawer, pulls it open, picks up rubbish from a table, and finally places the rubbish into a bin. After each step, the code checks if the task has been completed and prints a message indicating the status. 

Regardless of the outcome, the environment is shut down at the end of the task. The function is executed when the script is run directly.
Similarity: {'ok': False, 'reason': 'LLM JSON parsing failed.'}
Differences: 1. **Purpose**: 
   - **TASK**: Provides a specific instruction for a robotic action involving opening a drawer and disposing of rubbish.
   - **CODE_FUNC**: Describes a function that simulates a series of robotic actions, including setup, execution, and cleanup.

2. **Detail Level**:
   - **TASK**: Contains a concise instruction without detailed procedural steps.
   - **CODE_FUNC**: Outlines a complete sequence of actions, including setup, execution, and status checks.

3. **Execution Context**:
   - **TASK**: Represents a single instruction to be executed.
   - **CODE_FUNC**: Represents a function that encompasses multiple instructions and manages the overall task execution.

4. **Output Handling**:
   - **TASK**: Does not specify any output or feedback mechanism.
   - **CODE_FUNC**: Includes status messages and checks for task completion.

5. **Environment Management**:
   - **TASK**: Does not mention any setup or teardown of the environment.
   - **CODE_FUNC**: Explicitly mentions resetting the environment and shutting it down after task completion.

6. **Video Recording**:
   - **TASK**: Does not mention capturing video or any form of logging.
   - **CODE_FUNC**: Includes capturing video recordings of the simulation for later review.

7. **Action Sequence**:
   - **TASK**: Focuses on the action of opening a drawer and disposing of rubbish.
   - **CODE_FUNC**: Describes a detailed sequence of actions including rotating the gripper, moving to positions, picking up the drawer, and placing rubbish in a bin.

8. **Functionality**:
   - **TASK**: Aimed at a specific goal (disposing of rubbish).
   - **CODE_FUNC**: A broader functionality that includes multiple steps and checks, indicating a more complex operation.

9. **Direct Execution**:
   - **TASK**: Implies a direct action without context of execution.
   - **CODE_FUNC**: Specifies that the function is executed when the script is run directly, indicating a programming context.

10. **Robotic Actions**:
    - **TASK**: Implies actions but does not detail them.
    - **CODE_FUNC**: Clearly outlines the robotic actions involved in the simulation.

In summary, the semantic differences between TASK and CODE_FUNC are significant, as TASK is a simple instruction while CODE_FUNC is a comprehensive function that includes setup, execution, and management of a robotic simulation task.

Refined Code Generated:
-------------------
import numpy as np
from env import setup_environment, shutdown_environment
from skill_code import *
from video import init_video_writers, recording_step, recording_get_observation
from object_positions import get_object_positions

def run_skeleton_task():
    '''Generic skeleton for running any task in your simulation.'''
    print("===== Starting Skeleton Task =====")
    
    # === Environment Setup ===
    env, task = setup_environment()
    try:
        # Reset the task to its initial state
        _, obs = task.reset()

        # (Optional) Initialize video writers for capturing your simulation
        init_video_writers(obs)

        # Wrap the task steps for recording (if needed)
        original_step = task.step
        task.step = recording_step(original_step)
        original_get_obs = task.get_observation
        task.get_observation = recording_get_observation(original_get_obs)

        # === Retrieve Object Positions ===
        positions = get_object_positions()

        # Define object positions
        rubbish_pos = positions['rubbish']
        bottom_anchor_pos = positions['bottom_anchor_pos']

        # === Execute the Plan ===
        # Step 1: Rotate the gripper to ninety degrees
        obs, reward, done = rotate(env, task, target_quat=np.array([0, 0, 1, 0]), max_steps=100, threshold=0.05, timeout=10.0)
        if done:
            print("[Task] Task ended after rotating!")
            return

        # Step 2: Move to the side position of the bottom drawer
        obs, reward, done = move(env, task, target_pos=positions['side_pos-bottom'], max_steps=100, threshold=0.01, timeout=10.0)
        if done:
            print("[Task] Task ended after moving to side position!")
            return

        # Step 3: Move to the anchor position of the bottom drawer
        obs, reward, done = move(env, task, target_pos=bottom_anchor_pos, max_steps=100, threshold=0.01, timeout=10.0)
        if done:
            print("[Task] Task ended after moving to anchor position!")
            return

        # Step 4: Pick the bottom drawer
        obs, reward, done = pick(env, task, target_pos=bottom_anchor_pos, approach_distance=0.15, max_steps=100, threshold=0.01, approach_axis='z', timeout=10.0)
        if done:
            print("[Task] Task ended after picking the drawer!")
            return

        # Step 5: Pull the bottom drawer open
        obs, reward, done = pull(env, task, pull_distance=0.2, pull_axis='x', max_steps=100, threshold=0.01, timeout=10.0)
        if done:
            print("[Task] Task ended after pulling the drawer!")
            return

        # Step 6: Pick the rubbish from the table
        obs, reward, done = pick(env, task, target_pos=rubbish_pos, approach_distance=0.15, max_steps=100, threshold=0.01, approach_axis='z', timeout=10.0)
        if done:
            print("[Task] Task ended after picking the rubbish!")
            return

        # Step 7: Place the rubbish in the bin
        bin_pos = positions['bin']
        obs, reward, done = place(env, task, target_pos=bin_pos, approach_distance=0.15, max_steps=100, threshold=0.01, approach_axis='z', timeout=10.0)
        if done:
            print("[Task] Task completed successfully! Reward:", reward)
        else:
            print("[Task] Task not completed yet (done=False).")

    finally:
        # Always ensure the environment is properly shutdown
        shutdown_environment(env)

    print("===== End of Skeleton Task =====")

if __name__ == "__main__":
    run_skeleton_task()
-------------------

