Environment Setup and Validation#
On this page we briefly describe the environment used in this example workflow and validate that we can load it in Isaac Lab.
Prepare the Arena runtime from the repository root, using either a native uv environment or the
base Docker container (see Installation for the full setup):
uv sync --extra dev
source .venv/bin/activate
export OMNI_KIT_ACCEPT_EULA=YES ACCEPT_EULA=Y
./docker/run_docker.sh
Environment Description#
The Galileo G1 Locomanip Pick and Place Environment
@dataclass
class GalileoG1LocomanipPickAndPlaceEnvironmentCfg(ArenaEnvironmentCfg):
"""Configure the Galileo G1 locomotion-and-manipulation environment."""
object: str = "brown_box"
destination: str = "blue_sorting_bin"
embodiment: str = "g1_wbc_pink"
teleop_device: str | None = None
task_description: str | None = None
mimic: bool = False
auto: bool | None = None
"""Legacy auto-annotation flag; ``None`` records that the caller did not define it."""
@register_environment
class GalileoG1LocomanipPickAndPlaceEnvironment(ArenaEnvironmentFactory[GalileoG1LocomanipPickAndPlaceEnvironmentCfg]):
name: str = "galileo_g1_locomanip_pick_and_place"
def build(self, cfg: GalileoG1LocomanipPickAndPlaceEnvironmentCfg) -> IsaacLabArenaEnvironment:
"""Build the environment from its typed configuration."""
from isaaclab_arena.environments.isaaclab_arena_environment import IsaacLabArenaEnvironment
from isaaclab_arena.environments.isaaclab_arena_manager_based_env_cfg import set_control_rate_50hz
from isaaclab_arena.scene.scene import Scene
from isaaclab_arena.tasks.pick_and_place_task import G1PickAndPlaceMimicEnvCfg, PickAndPlaceTask
from isaaclab_arena.utils.pose import Pose, PoseRange
background = self.asset_registry.get_asset_by_name("galileo_locomanip")()
pick_up_object = self.asset_registry.get_asset_by_name(cfg.object)()
destination = self.asset_registry.get_asset_by_name(cfg.destination)()
embodiment = self.asset_registry.get_asset_by_name(cfg.embodiment)(enable_cameras=cfg.enable_cameras)
if cfg.teleop_device is not None:
teleop_device = self.device_registry.get_device_by_name(cfg.teleop_device)()
else:
teleop_device = None
XY_RANGE_M = 0.025
pick_up_object.set_initial_pose(
PoseRange(
position_xyz_min=(0.5785 - XY_RANGE_M, 0.18 - XY_RANGE_M, 0.0707),
position_xyz_max=(0.5785 + XY_RANGE_M, 0.18 + XY_RANGE_M, 0.0707),
rpy_min=(math.pi, 0.0, math.pi),
rpy_max=(math.pi, 0.0, math.pi),
)
)
destination.set_initial_pose(
Pose(
position_xyz=(-0.2450, -1.6272, -0.2641),
rotation_xyzw=(0.0, 0.0, 1.0, 0.0),
)
)
embodiment.set_initial_pose(Pose(position_xyz=(0.0, 0.18, 0.0), rotation_xyzw=(0.0, 0.0, 0.0, 1.0)))
if cfg.embodiment == "g1_wbc_pink" and cfg.mimic and cfg.auto is None:
# Set navigation p-controller for locomanip use case
action_cfg = embodiment.get_action_cfg()
action_cfg.g1_action.use_p_control = True
# Set nav subgoals (x,y,heading) and turning_in_place flag for G1 WBC Pink navigation p-controller
action_cfg.g1_action.navigation_subgoals = [
([0.18, 0.18, 0.0], False),
([0.18, 0.18, -1.78], True),
([-0.0955, -1.1070, -1.78], False),
([-0.0955, -1.1070, -1.78], False),
]
if cfg.task_description is not None:
task_description = cfg.task_description
elif _is_legacy_pair(cfg.object, cfg.destination):
task_description = _LEGACY_BROWN_BOX_TO_BLUE_BIN_DESCRIPTION
else:
object_label = cfg.object.replace("_", " ")
destination_label = cfg.destination.replace("_", " ")
task_description = (
f"Pick up the {object_label} from the shelf, and place it on the {destination_label} on the table"
" located at the right of the shelf."
)
def env_cfg_callback(env_cfg):
env_cfg = _apply_legacy_datagen_name_override(
env_cfg,
pick_up_object_name=pick_up_object.name,
destination_name=destination.name,
)
# 50 Hz control, required by the whole-body controller (WBC).
return set_control_rate_50hz(env_cfg)
def _build_g1_pick_and_place_mimic_cfg(arm_mode):
return G1PickAndPlaceMimicEnvCfg(
pick_up_object_name=pick_up_object.name,
destination_location_name=destination.name,
arm_mode=arm_mode,
)
scene = Scene(assets=[background, pick_up_object, destination])
isaaclab_arena_environment = IsaacLabArenaEnvironment(
name=self.name,
embodiment=embodiment,
scene=scene,
task=PickAndPlaceTask(
pick_up_object,
destination,
background,
episode_length_s=30.0,
task_description=task_description,
force_threshold=0.5,
velocity_threshold=0.1,
mimic_env_cfg_factory=_build_g1_pick_and_place_mimic_cfg,
),
teleop_device=teleop_device,
env_cfg_callback=env_cfg_callback,
)
return isaaclab_arena_environment
See the complete source.
Step-by-Step Breakdown#
1. Interact with the Asset and Device Registry
background = self.asset_registry.get_asset_by_name("galileo_locomanip")()
pick_up_object = self.asset_registry.get_asset_by_name(cfg.object)()
destination = self.asset_registry.get_asset_by_name(cfg.destination)()
embodiment = self.asset_registry.get_asset_by_name(cfg.embodiment)(enable_cameras=cfg.enable_cameras)
if cfg.teleop_device is not None:
teleop_device = self.device_registry.get_device_by_name(cfg.teleop_device)()
else:
teleop_device = None
Here, we’re selecting the specific pieces we need for our locomanipulation task: the Galileo arena as our background environment,
an object to pick up, a destination (a blue sorting bin by default) as our goal location, and the G1 embodiment.
The AssetRegistry and DeviceRegistry have been initialized in the ArenaEnvironmentFactory class.
See Assets for details on asset architecture.
2. Position the Objects
XY_RANGE_M = 0.025
pick_up_object.set_initial_pose(
PoseRange(
position_xyz_min=(0.5785 - XY_RANGE_M, 0.18 - XY_RANGE_M, 0.0707),
position_xyz_max=(0.5785 + XY_RANGE_M, 0.18 + XY_RANGE_M, 0.0707),
rpy_min=(math.pi, 0.0, math.pi),
rpy_max=(math.pi, 0.0, math.pi),
)
)
destination.set_initial_pose(
Pose(
position_xyz=(-0.2450, -1.6272, -0.2641),
rotation_xyzw=(0.0, 0.0, 1.0, 0.0),
)
)
embodiment.set_initial_pose(Pose(position_xyz=(0.0, 0.18, 0.0), rotation_xyzw=(0.0, 0.0, 0.0, 1.0)))
Before we create the scene, we need to place our objects and the robot in the right locations. These initial poses are currently set manually to create an achievable task.
3. Compose the Scene
scene = Scene(assets=[background, pick_up_object, destination])
Now we bring everything together into a IsaacLab-Arena scene. See Scene for scene composition details.
4. Create the Pick and Place Task
def _build_g1_pick_and_place_mimic_cfg(arm_mode):
return G1PickAndPlaceMimicEnvCfg(
pick_up_object_name=pick_up_object.name,
destination_location_name=destination.name,
arm_mode=arm_mode,
)
task=PickAndPlaceTask(
pick_up_object,
destination,
background,
episode_length_s=30.0,
task_description=task_description,
force_threshold=0.5,
velocity_threshold=0.1,
mimic_env_cfg_factory=_build_g1_pick_and_place_mimic_cfg,
),
The task is passed to the IsaacLabArenaEnvironment in step 5.
PickAndPlaceTask encapsulates the task’s goal of the environment: pick up the specified object
and place it in the destination. The locomanip-specific Mimic config (3-subtask arm sequences
plus a 4-phase nav body) is injected via mimic_env_cfg_factory rather than via a task subclass,
because the cfg shape diverges from the parent PickPlaceMimicEnvCfg defaults.
The task knows about the key objects involved (what to pick, where to place it, and the environment context) and will provide rewards, compute observations, and determine when the episode should end. See Task for task creation details.
5. Create the IsaacLab Arena Environment
isaaclab_arena_environment = IsaacLabArenaEnvironment(
name=self.name,
embodiment=embodiment,
scene=scene,
task=PickAndPlaceTask(
pick_up_object,
destination,
background,
episode_length_s=30.0,
task_description=task_description,
force_threshold=0.5,
velocity_threshold=0.1,
mimic_env_cfg_factory=_build_g1_pick_and_place_mimic_cfg,
),
teleop_device=teleop_device,
env_cfg_callback=env_cfg_callback,
)
Finally, we assemble all the pieces into a complete, runnable environment. The IsaacLabArenaEnvironment is the
top-level container that connects your embodiment (the robot), the scene (the world) and the task (the objective).
It also passes the task description and env_cfg_callback, which sets the 50 Hz control rate that the
whole-body controller needs.
See Environment for environment composition details.
Step 1: Download a test dataset#
To run a robot in the environment we need some recorded demonstration data that can be fed to the robot to control its actions. We download a pre-recorded dataset from Hugging Face:
hf download \
nvidia/Arena-G1-Loco-Manipulation-Task \
arena_g1_loco_manipulation_dataset_generated_small.hdf5 \
--repo-type dataset \
--revision arena_v0.2_lab_v3.0 \
--local-dir $DATASET_DIR
Step 2: Validate Environment with Demo Replay#
Replay the downloaded dataset to verify the environment setup
python submodules/IsaacLab/scripts/tools/replay_demos.py \
--viz kit \
--device cpu \
--enable_cameras \
--dataset_file ${DATASET_DIR}/arena_g1_loco_manipulation_dataset_generated_small.hdf5 \
--external_callback isaaclab_arena.environments.isaaclab_interop.environment_registration_callback \
--task galileo_g1_locomanip_pick_and_place \
--object brown_box \
--embodiment g1_wbc_pink
Note
The downloaded dataset was generated using CPU device physics, therefore the replay uses --device cpu to ensure reproducibility.
You should see the G1 robot replaying the generated demonstrations, performing box pick and place task in the Galileo lab environment.
IsaacLab Arena G1 Locomanip Pick and Place Task View#