-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds Anymal-C navigation rsl_rl example with obstacle and camera in the scene #2027
base: main
Are you sure you want to change the base?
Conversation
ac9d8b0
to
6f78579
Compare
base_lin_vel = ObsTerm(func=mdp.base_lin_vel) | ||
projected_gravity = ObsTerm(func=mdp.projected_gravity) | ||
pose_command = ObsTerm(func=mdp.generated_commands, params={"command_name": "pose_command"}) | ||
camera_data = ObsTerm(func=mdp.image_flatten, params={"sensor_cfg": SceneEntityCfg("tiled_camera")}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This implementation flattens and concatenates all the observations components (propio and image) in one vector (a flattened observation_space
), leading the definition of the image shape to use in the model to the agent configuration image_input_shape
, right?
Agent configuration must be agnostic to any environment information except those specified by the environment spaces (observation_space
, state_space
and action_space
). Currently, this is only possible with the direct workflow and using composite spaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that understanding is correct. And I use a check to ensure the image_input_shape
is consistent with the tiled camera configuration: train.py#L132-L140
from rsl_rl.modules.actor_critic import get_activation | ||
|
||
|
||
class ResidualBlock(nn.Module): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is RSL-RL library related, I would recommend making an MR there for this actor critic structure :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I can do that. Then I suppose this PR can only be merged after the RSL-RL accepts my changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of the modifications in this MR should be handled by RSL-RL library and not IsaacLab. It would be good to keep the two separated to keep IsaacLab mainly as simulation infrastructure.
Would it be possible to make an MR to RSL-RL instead? We can review it there and deal with this usecase accordingly. It shouldn't be hard for us to support a dictionary of observations and avoid an ugly hack here to deal with it.
@Mayankm96 thanks for the suggestions. Basically, only Regarding |
As I commented previously, agent configuration must be agnostic to any environment information except those specified by the environment spaces ( So, the current task implementation is a hacky and particular hard-code solution for one RL library that doesn't follow the convention to express highly structured space specification, and it is not generalizable/usable for other RL libraries. Since only Direct workflow support heterogeneous observations currently, the task implementation must be migrated to that workflow. |
Asking the user here to migrate their environment to direct workflow isn't really the solution. We need to properly support heterogenous observation/action spaces to the manager-based environments. This is in the release plan for 2.2 of IsaacLab. We should probably prioritize it more as it is something doable. @KingsleyLiu-NV An intermediate solution is that you have a separate observation group for the images similar to how we define the group called 'policy'. If this group is called 'images', you can access it from RSL-RL side through the dictionary: @kellyguo11 for visibility. |
For sure, adding to the Manager-based workflow the ability to work with different space specifications is something to be prioritized. However, while that happens, we should indicate the appropriate workflows to create well-done tasks according to the agreed interface (that allow the project to be used by any RL library) and stop proposing/encouraging hard-code solution (that although it is not as "ugly" as the previous one, still hacky hard-code) tied to specific implementations that do not promote code reusability and compromise the robust, maintainable, and flexible codebase of the project. Therefore, for the time being, the way forward should be through Direct workflow by defining composite observation_space. |
Hi @Mayankm96 , I get your point of using |
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
List any dependencies that are required for this change.
This PR adds the anymal-c navigation rsl_rl example with obstacle and camera in the scene:
Type of change
It can be run with the following command:
Screenshots
The training results are as below:

Memory footprint: (num_envs=4096, image_input_shape=(3, 64, 64))

Training speed:

Play with
model_1300.pt
:e68abcd97722111e219462e88599bcba.mp4
Checklist
pre-commit
checks with./isaaclab.sh --format
config/extension.toml
fileCONTRIBUTORS.md
or my name already exists there