Trouble mixing position and velocity control

Hello there. I have been using the Isaac Gym for the past few weeks and I am very satisfied with it. However, I’ve been running into some problems in one of our simulation environments and was hoping to get some help with it.

I am working on a two-wheeled vehicle (TWD) simulation. In one of my environments (the simplest one) I want to train the agent to control the steering joint with position control (set to DOF_MODE_POS). I have another joint for the rear wheel of the TWD which is used for velocity control (set to DOF_MODE_VEL). Previously, I had success setting a constant speed when the actor was created (using .set_actor_dof_velocity_targets). This agent only had one action, changing the position of the steering bar, and worked really well. Now, I want the agent to have two actions: controlling the speed of the rear wheel joint, in addition to controlling the position of the steering bar. This is where I’m running into some trouble.

In the screenshot, I show my pre_physics_step function. If I comment out setting either position targets or velocity targets (lines 249 and 251) the simulation works fine, except for missing the other control. That is, I can control the steering if I don’t set the velocities, and I can control the velocity target if I don’t set the DOF position targets. My understanding was that these functions would only affect the DOF that were set to the analogous mode, i.e. set_dof_velocity_target_tensor only affects joints set to DOF_MODE_VEL, and set_dof_position_target_tensor only affects joints set to DOF_MODE_POS. However, if I set both target tensors then other joints besides the steering joint start moving around.

Can anybody help shed some light on this issue? Is there another way (i.e. some other functions) to perform this kind of control?

Thanks for your help.

Hi @guichristmann,

Thanks very much for your post. It’s entirely possible that we have a bug in our tensor APIs that is causing this. We do have examples with the older non-tensor API that combine position and velocity control, but these won’t work well in a high performance RL setup.

If you’re willing to share more of your code, we can look into this more directly in the new year (most of the team is out on vacation right now). If you’d prefer to do that only privately, let me know and I can contact you offline.

Take care,
-Gav

Hi @guichristmann,

We have a fix for this which will be in our upcoming release.

Thanks!
-Gav

2 Likes