IsaacLab icon indicating copy to clipboard operation
IsaacLab copied to clipboard

[Bug Report] 'RslRlVecEnvWrapper' object has no attribute 'num_actions' when using new clip_actions from #2019

Open felipemohr opened this issue 1 year ago • 0 comments

Describe the bug

When using clip_actions in the rsl-rl wrapper (introduced in https://github.com/isaac-sim/IsaacLab/pull/2019), I get the error 'RslRlVecEnvWrapper' object has no attribute 'num_actions'

Steps to reproduce

To reproduce the error, include the clip_actions in the configuration of an agent, and try to start the training process.

For example, add clip_actions=100.0 in the line 38 of source/isaaclab_tasks/isaaclab_tasks/manager_based/locomotion/velocity/config/anymal_c/agents/rsl_rl_ppo_cfg.py, and try to run the trainning:

$ ./isaaclab.sh -p scripts/reinforcement_learning/rsl_rl/train.py --task=Isaac-Velocity-Rough-Anymal-C-v0 --headless

You will see the following error:

.
.
.
[INFO]: Completed setting up the environment...
Error executing job with overrides: []
Traceback (most recent call last):
  File "/home/felipe/workspaces/IsaacLab/source/isaaclab_tasks/isaaclab_tasks/utils/hydra.py", line 101, in hydra_main
    func(env_cfg, agent_cfg, *args, **kwargs)
  File "/home/felipe/workspaces/IsaacLab/scripts/reinforcement_learning/rsl_rl/train.py", line 129, in main
    env = RslRlVecEnvWrapper(env, clip_actions=agent_cfg.clip_actions)
  File "/home/felipe/workspaces/IsaacLab/source/isaaclab_rl/isaaclab_rl/rsl_rl/vecenv_wrapper.py", line 62, in __init__
    self._modify_action_space()
  File "/home/felipe/workspaces/IsaacLab/source/isaaclab_rl/isaaclab_rl/rsl_rl/vecenv_wrapper.py", line 205, in _modify_action_space
    low=-self.clip_actions, high=self.clip_actions, shape=(self.num_actions,)
AttributeError: 'RslRlVecEnvWrapper' object has no attribute 'num_actions'

System Info

Describe the characteristic of your environment:

  • Commit: https://github.com/isaac-sim/IsaacLab/commit/b663ad172f3ee57f16f31f3f54c2d5e221947db2
  • Isaac Sim Version: 4.5.0
  • OS: Ubuntu 24.04
  • GPU: RTX 4070
  • CUDA: 12.4
  • GPU Driver: 550.120

Additional context

None.

Checklist

  • [X] I have checked that there is no similar issue in the repo (required)
  • [X] I have checked that the issue is not in running Isaac Sim itself and is related to the repo

Acceptance Criteria

  • [ ] One can use clip_actions in an RSL-RL agent without errors

felipemohr avatar Mar 29 '25 23:03 felipemohr