Commit 61c4fd9d authored by Mayank Mittal's avatar Mayank Mittal

Fixes import of terrain-based 2d-pose command term

parent c7f42931
...@@ -8,12 +8,12 @@ ...@@ -8,12 +8,12 @@
from .commands_cfg import ( from .commands_cfg import (
NormalVelocityCommandCfg, NormalVelocityCommandCfg,
NullCommandCfg, NullCommandCfg,
TerrainBasedPose2dCommandCfg,
UniformPose2dCommandCfg, UniformPose2dCommandCfg,
UniformPoseCommandCfg, UniformPoseCommandCfg,
UniformTerrainBasedPose2dCommandCfg,
UniformVelocityCommandCfg, UniformVelocityCommandCfg,
) )
from .null_command import NullCommand from .null_command import NullCommand
from .pose_2d_command import UniformPose2dCommand, UniformTerrainBasedPose2dCommandCfg from .pose_2d_command import TerrainBasedPose2dCommand, UniformPose2dCommand
from .pose_command import UniformPoseCommand from .pose_command import UniformPoseCommand
from .velocity_command import NormalVelocityCommand, UniformVelocityCommand from .velocity_command import NormalVelocityCommand, UniformVelocityCommand
...@@ -12,7 +12,7 @@ from omni.isaac.orbit.managers import CommandTermCfg ...@@ -12,7 +12,7 @@ from omni.isaac.orbit.managers import CommandTermCfg
from omni.isaac.orbit.utils import configclass from omni.isaac.orbit.utils import configclass
from .null_command import NullCommand from .null_command import NullCommand
from .pose_2d_command import UniformPose2dCommand, UniformTerrainBasedPose2dCommand from .pose_2d_command import TerrainBasedPose2dCommand, UniformPose2dCommand
from .pose_command import UniformPoseCommand from .pose_command import UniformPoseCommand
from .velocity_command import NormalVelocityCommand, UniformVelocityCommand from .velocity_command import NormalVelocityCommand, UniformVelocityCommand
...@@ -130,8 +130,7 @@ class UniformPose2dCommandCfg(CommandTermCfg): ...@@ -130,8 +130,7 @@ class UniformPose2dCommandCfg(CommandTermCfg):
asset_name: str = MISSING asset_name: str = MISSING
"""Name of the asset in the environment for which the commands are generated.""" """Name of the asset in the environment for which the commands are generated."""
rel_standing_envs: float = MISSING
"""Probability threshold for environments where the robots that are standing still."""
simple_heading: bool = MISSING simple_heading: bool = MISSING
"""Whether to use simple heading or not. """Whether to use simple heading or not.
...@@ -157,10 +156,10 @@ class UniformPose2dCommandCfg(CommandTermCfg): ...@@ -157,10 +156,10 @@ class UniformPose2dCommandCfg(CommandTermCfg):
@configclass @configclass
class UniformTerrainBasedPose2dCommandCfg(UniformPose2dCommandCfg): class TerrainBasedPose2dCommandCfg(UniformPose2dCommandCfg):
"""Configuration for the terrain-based position command generator.""" """Configuration for the terrain-based position command generator."""
class_type = UniformTerrainBasedPose2dCommand class_type = TerrainBasedPose2dCommand
@configclass @configclass
class Ranges: class Ranges:
......
...@@ -21,7 +21,7 @@ from omni.isaac.orbit.utils.math import quat_from_euler_xyz, quat_rotate_inverse ...@@ -21,7 +21,7 @@ from omni.isaac.orbit.utils.math import quat_from_euler_xyz, quat_rotate_inverse
if TYPE_CHECKING: if TYPE_CHECKING:
from omni.isaac.orbit.envs import BaseEnv from omni.isaac.orbit.envs import BaseEnv
from .commands_cfg import UniformPose2dCommandCfg, UniformTerrainBasedPose2dCommandCfg from .commands_cfg import TerrainBasedPose2dCommandCfg, UniformPose2dCommandCfg
class UniformPose2dCommand(CommandTerm): class UniformPose2dCommand(CommandTerm):
...@@ -64,8 +64,7 @@ class UniformPose2dCommand(CommandTerm): ...@@ -64,8 +64,7 @@ class UniformPose2dCommand(CommandTerm):
def __str__(self) -> str: def __str__(self) -> str:
msg = "PositionCommand:\n" msg = "PositionCommand:\n"
msg += f"\tCommand dimension: {tuple(self.command.shape[1:])}\n" msg += f"\tCommand dimension: {tuple(self.command.shape[1:])}\n"
msg += f"\tResampling time range: {self.cfg.resampling_time_range}\n" msg += f"\tResampling time range: {self.cfg.resampling_time_range}"
msg += f"\tStanding probability: {self.cfg.rel_standing_envs}"
return msg return msg
""" """
...@@ -148,7 +147,7 @@ class UniformPose2dCommand(CommandTerm): ...@@ -148,7 +147,7 @@ class UniformPose2dCommand(CommandTerm):
) )
class UniformTerrainBasedPose2dCommand(UniformPose2dCommand): class TerrainBasedPose2dCommand(UniformPose2dCommand):
"""Command generator that generates pose commands based on the terrain. """Command generator that generates pose commands based on the terrain.
This command generator samples the position commands from the valid patches of the terrain. This command generator samples the position commands from the valid patches of the terrain.
...@@ -157,7 +156,10 @@ class UniformTerrainBasedPose2dCommand(UniformPose2dCommand): ...@@ -157,7 +156,10 @@ class UniformTerrainBasedPose2dCommand(UniformPose2dCommand):
It expects the terrain to have a valid flat patches under the key 'target'. It expects the terrain to have a valid flat patches under the key 'target'.
""" """
def __init__(self, cfg: UniformTerrainBasedPose2dCommandCfg, env: BaseEnv): cfg: TerrainBasedPose2dCommandCfg
"""Configuration for the command generator."""
def __init__(self, cfg: TerrainBasedPose2dCommandCfg, env: BaseEnv):
# initialize the base class # initialize the base class
super().__init__(cfg, env) super().__init__(cfg, env)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment