I could hardly find any reinforcement learning examples from isaac lab. I wanted to implement a reinforcement learning environment with a robot arm at a specific location (the target ball), but I ran into many problems, such as how to get the coordinates of the taregt ball, how to implement its initialization, reward function, etc
This has all the environments shipped with Isaac Lab:
https://isaac-sim.github.io/IsaacLab/source/features/environments.html
The Lift one with the Frank arm sounds similar to what you want.
Initialization for this task is mostly here:
# Copyright (c) 2022-2024, The Isaac Lab Project Developers.
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
from dataclasses import MISSING
import omni.isaac.lab.sim as sim_utils
from omni.isaac.lab.assets import ArticulationCfg, AssetBaseCfg, RigidObjectCfg
from omni.isaac.lab.envs import ManagerBasedRLEnvCfg
from omni.isaac.lab.managers import CurriculumTermCfg as CurrTerm
from omni.isaac.lab.managers import EventTermCfg as EventTerm
from omni.isaac.lab.managers import ObservationGroupCfg as ObsGroup
from omni.isaac.lab.managers import ObservationTermCfg as ObsTerm
from omni.isaac.lab.managers import RewardTermCfg as RewTerm
from omni.isaac.lab.managers import SceneEntityCfg
from omni.isaac.lab.managers import TerminationTermCfg as DoneTerm
from omni.isaac.lab.scene import InteractiveSceneCfg
from omni.isaac.lab.sensors.frame_transformer.frame_transformer_cfg import FrameTransformerCfg
from omni.isaac.lab.sim.spawners.from_files.from_files_cfg import GroundPlaneCfg, UsdFileCfg
This file has been truncated. show original
You can find rewards here:
# Copyright (c) 2022-2024, The Isaac Lab Project Developers.
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import torch
from typing import TYPE_CHECKING
from omni.isaac.lab.assets import RigidObject
from omni.isaac.lab.managers import SceneEntityCfg
from omni.isaac.lab.sensors import FrameTransformer
from omni.isaac.lab.utils.math import combine_frame_transforms
if TYPE_CHECKING:
from omni.isaac.lab.envs import ManagerBasedRLEnv
def object_is_lifted(
This file has been truncated. show original
In the observations.py, you can see how they get the position of an object:
# Copyright (c) 2022-2024, The Isaac Lab Project Developers.
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import torch
from typing import TYPE_CHECKING
from omni.isaac.lab.assets import RigidObject
from omni.isaac.lab.managers import SceneEntityCfg
from omni.isaac.lab.utils.math import subtract_frame_transforms
if TYPE_CHECKING:
from omni.isaac.lab.envs import ManagerBasedRLEnv
def object_position_in_robot_root_frame(
env: ManagerBasedRLEnv,
This file has been truncated. show original
I’m just a user, but my suggestion is to copy the Lift task folder, add to the list of environments and modify as per your task.