isaac-sim / IsaacLab

Unified framework for robot learning built on NVIDIA Isaac Sim
https://isaac-sim.github.io/IsaacLab
Other
2.34k stars 970 forks source link

[Bug Report] Bugs of body_index & skrl in Orbit #21

Closed ZeyuGao-2022 closed 1 year ago

ZeyuGao-2022 commented 1 year ago

Describe the bug

Hello, I've found two bugs in Orbit. I'm not sure that description is certainty, but I hope this Bug Report can help you fix these bugs in the next version.

  1. Bug of body_index The function _process_info_cfg which define self.ee_body_index = body_index in "source/extensions/omni.isaac.orbit/omni/isaac/orbit/robots/single_arm.py", line 156. The ee_body_index should minus 1. The effort of this var is find the ee_body's Jacobian. For example, my baxter robot has 57 links, the index of base is 0. However, the first dim of Jocabian is 56 except the base. The ee_body_index should minus 1 to Ensure one-to-one correspondence between Jacobian and index.

    def _process_info_cfg(self) -> None:
        """Post processing of configuration parameters."""
        # process parent config
        super()._process_info_cfg()
        # resolve regex expressions for indices
        # -- end-effector body
        self.ee_body_index = None
        for body_index, body_name in enumerate(self.body_names):
            if re.fullmatch(self.cfg.ee_info.body_name, body_name):
                self.ee_body_index = body_index - 1
  2. Bug of skrl This is a simple bug which was founded when I was running the demo of skrl. But I'm not sure is the version of environment causes this bug.

    Traceback (most recent call last):
    File "source/standalone/workflows/skrl/train.py", line 167, in <module>
    main()
    File "source/standalone/workflows/skrl/train.py", line 107, in main
    **convert_skrl_cfg(experiment_cfg["models"]["policy"]),
    TypeError: gaussian_model() argument after ** must be a mapping, not NoneType

I fix it by adding "return d" after "source/standalone/workflows/skrl/config.py", line 90.

def update_dict(d):
        for key, value in d.items():
            if isinstance(value, dict):
                update_dict(value)
            else:
                if key in _direct_eval:
                    d[key] = eval(value)
                elif key.endswith("_kwargs"):
                    d[key] = value if value is not None else {}
                elif key in ["rewards_shaper_scale"]:
                    d["rewards_shaper"] = reward_shaper_function(value)
        return d

System Info

Describe the characteristic of your environment:

Checklist

Mayankm96 commented 1 year ago

Thanks a lot for pointing these out! I made a PR #22 to fix the issues.

Instead of doing self.ee_body_index = body_index - 1, I feel it is better to account for the subtraction inside the Jacobian function. It prevents confusion if someone externally tries to access ee_body_index for some other reasons.

Once you approve the MR, I can merge it.