-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Add multirotor/thruster actuator, multirotor asset and manager-based LMF2 drone task #3760
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
base: main
Are you sure you want to change the base?
Conversation
… thrusters, new thruster actor class
…sation not visible
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.
Thanks for getting the PR up, looks already great!
Here some comments regarding but have to do a deep dive when I have more time
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.
What changed in this file that all lines are deleted and readded? They appear to be the same for me
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.
as well it was not clear to me, but maybe this change fixes that issue: fc2ff6c
| # stiffness = 0.1 # only necessary to make this conform with Isaac | ||
| # damping = 0.1 # only necessary to make this conform with Isaac |
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.
Can be removed?
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.
addressed in 3292b8d
| # stiffness = 0.1 # only necessary to make this conform with Isaac | ||
| # damping = 0.1 # only necessary to make this conform with Isaac | ||
|
|
||
| dt: float = 0.01 |
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 should probably be relative to the step time of PhysX timesteps (otherwise can intrigue infeasible cases where Physx timestamp > dt)
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, changed to set this parameter based on the sim.dt: cdb9380
| num_motors: int = 4 | ||
| """Number of motors/propulsors on the vehicle.""" |
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.
Shouldn't that not be readable from the urdf? Similar to joints?
| thrust_const_range: tuple[float, float] = (9.26312e-06, 1.826312e-05) | ||
| """Range for thrust coefficient :math:`k_f` when ``use_rps=True`` [N/(rps²)].""" |
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.
Question: where are all of these default values coming from? They seem to be very specific while the general Thruster class should be generic
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, they are platform/hardware depended (so in this case LMF2 specific). we will moved them where we load the LMF2 robot model and keep the thruster as generic as possible
| if env_ids is None: | ||
| env_ids = torch.arange(self.num_instances, device=self.device) | ||
| else: | ||
| env_ids = torch.tensor(env_ids, device=self.device) |
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.
Careful, enc ids are often a tensor already
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.
addressed in a717121
|
|
||
| # reset multirotor-specific data | ||
| if env_ids is None: | ||
| env_ids = torch.arange(self.num_instances, device=self.device) |
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.
Should generate an attr ALL_INDICIES to avoid reallocating memory here often
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.
addressed in a717121
|
|
||
| @torch.jit.script | ||
| def rand_range(lower, upper): | ||
| # type: (torch.Tensor, torch.Tensor) -> torch.Tensor |
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.
Type annotation in the function call or why is it defined as comment here?
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.
function removed, switched to the isaac lab math_utils.sample_uniform
b6d30f0
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.
We should not add a zip file to the git. Let's find a differ location if the data is crucial
Co-authored-by: Pascal Roth <[email protected]> Signed-off-by: Grzegorz Malczyk <[email protected]>
Co-authored-by: Pascal Roth <[email protected]> Signed-off-by: Grzegorz Malczyk <[email protected]>
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.
made some high level pass through,
Thanks for working on this PR! my high level comment so far would be try to use more IsaacLab predefined mdp if you find it has large overlap with custom mdp.
| from .commands_cfg import DroneUniformPoseCommandCfg | ||
|
|
||
|
|
||
| class DroneUniformPoseCommand(CommandTerm): |
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.
Can we use the UniformPoseCommand directly from IsaacLab?
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.
so this class does not change much from the original UniformPoseCommand, but it introduces changes that help to
- visualize the goal coordinate frame in the current sub-terrain: lines 153 - 155
- compute the position error in the current subterrain: line 103
These changes are especially required by drone navigation task.
| # extract euler angles (in world frame) | ||
| roll, pitch, _ = math_utils.euler_xyz_from_quat(asset.data.root_quat_w) | ||
| # normalize angle to [-pi, pi] | ||
| roll = torch.atan2(torch.sin(roll), torch.cos(roll)) |
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.
I think we have warp_to_pi from math_utils
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 didn't notice it, since the humanoid example uses also such implementation,
comment addressed in 476798d
| """ | ||
| Drone-navigation rewards. | ||
| """ | ||
|
|
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.
It is ok to define custom reward here , though I will highly suggest if you can find some predefined IsaacLab reward mdp.
For example, flat_orientation_l2 could be an good alternative to upright_posture_reward, have a read to source/isaaclab/isaaclab/envs/mdp/rewards.py
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.
Description
This PR introduces multirotor and thruster support and adds a manager-based example/task for the LMF2 drone. The change contains a new low-level thruster actuator model, a new
Multirotorarticulation asset class + configs, new thrust actions, and a manager-based drone task (LMF2) with MDP configs and RL agent configs.Motivation and context
Type of change
Files changed (high-level summary)
Dependencies
.zip) — ensure Git LFS is used if you want large assets tracked by LFS.Checklist (status)
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there