IsaacLab icon indicating copy to clipboard operation
IsaacLab copied to clipboard

[Question] Question about changing joint's drive type

Open sizsJEon opened this issue 1 year ago • 3 comments

Question

Hi, I'm immigrating from IssacGymEnvs(Gym) and have a question about joint's drive mode,

In Gym, I was able to set the joints drive mode myself. for example, I could make a torque-commanded robot arm attacted to velocity-commanded 4 wheel car like

dof_props['driveMode'][1:6] = gymapi.DOF_MODE_POS
dof_props['driveMode'][7:10] = gymapi.DOF_MODE_VEL

and If I could set pos/vel cmd by

self.gym.set_dof_position_target_tensor(self.sim, gymtorch.unwrap_tensor(targets))
self.gym.set_dof_velocity_target_tensor(self.sim, gymtorch.unwrap_tensor(targets))

but in Isaac Lab(Lab), I have to make a usd from urdf and it seems to be joint drive mode is determined at there.

I looked the cartpole, unitree, universal_robots in lab_assets but could not find the difference between torque (cartpole) and position (unitree, universal_robots)

the point is, How could I change the drive mode of the joint manually(in code)?

https://isaac-sim.github.io/IsaacLab/source/how-to/import_new_asset.html#using-urdf-importer it says I could change the drive configuration, but I can't find any information about it.

sizsJEon avatar Aug 07 '24 06:08 sizsJEon

Hello! The way you can inform IsaacLab of your desired articulation type (e.g. position, velocity, force or some combination thereof) is by setting up an associated JointActionTerm in your environment config's ActionCfg. Before that configuration step, actuators can support the various modes of control.

Here's an example with Cartpole, where we're using effort-based control: https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/classic/cartpole/cartpole_env_cfg.py#L75

Here's an example with a locomotion environment where we're using position-based control: https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/locomotion/velocity/velocity_env_cfg.py#L112

And lastly, here's an example with a manipulation environment where we're also using position-based control: https://github.com/isaac-sim/IsaacLab/blob/6451d235785780167f80c14bb9d635d20aff9b29/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/manipulation/lift/lift_env_cfg.py#L91-L92

Not you can also modify the paramaters you wish to observe via the ObservationCfg.

Hope this helps!

jsmith-bdai avatar Aug 09 '24 09:08 jsmith-bdai

Hello! The way you can inform IsaacLab of your desired articulation type (e.g. position, velocity, force or some combination thereof) is by setting up an associated JointActionTerm in your environment config's ActionCfg. Before that configuration step, actuators can support the various modes of control.

Here's an example with Cartpole, where we're using effort-based control: https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/classic/cartpole/cartpole_env_cfg.py#L75

Here's an example with a locomotion environment where we're using position-based control: https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/locomotion/velocity/velocity_env_cfg.py#L112

And lastly, here's an example with a manipulation environment where we're also using position-based control:

https://github.com/isaac-sim/IsaacLab/blob/6451d235785780167f80c14bb9d635d20aff9b29/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/manager_based/manipulation/lift/lift_env_cfg.py#L91-L92

Not you can also modify the paramaters you wish to observe via the ObservationCfg.

Hope this helps!

since I use direct rl configuration, I have to do something else, but It's good to know that there are some way.

thanks for the information and wait for other advices!

sizsJEon avatar Aug 09 '24 13:08 sizsJEon

CC: @kellyguo11 might have more info here

jsmith-bdai avatar Aug 09 '24 15:08 jsmith-bdai

The all actutor they provide seems to be essentially torque control, and the position control provided is also calculated through kp and kd to obtain torque for delivery. It's not like the dof_mode_pos in Isaac Gym. Do you have any solutions?

Yinghui-Lee avatar Aug 27 '24 08:08 Yinghui-Lee

for now, I'd back to gym env unfortunately. If anything is progress, I'll share here.

sizsJEon avatar Aug 27 '24 10:08 sizsJEon

The team has been adding to this, and we have an updated doc on actuators. Let us know if we can be of further help.

RandomOakForest avatar Jan 06 '25 16:01 RandomOakForest