Skip to content

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

@felipemohr

Description

@felipemohr

Describe the bug

When using clip_actions in the rsl-rl wrapper (introduced in #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: b663ad1
  • Isaac Sim Version: 4.5.0
  • OS: Ubuntu 24.04
  • GPU: RTX 4070
  • CUDA: 12.4
  • GPU Driver: 550.120

Additional context

None.

Checklist

  • I have checked that there is no similar issue in the repo (required)
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions