Velocity control of robot wheels

Hi,

I am trying to control a robot with 4 wheels in Isaac Gym, by applying velocity control for all of the wheels of a Clearpath Husky. However, the robot does not follow the velocity commands well and there is some unexpected behaviour. I would like to know if there is a better way of controlling the wheels of a robot.

I imported the urdf file, and everything looks fine. Then, I initialize the velocity control and gains for all 4 wheels like this:

props["driveMode"] = (gymapi.DOF_MODE_VEL, gymapi.DOF_MODE_VEL, gymapi.DOF_MODE_VEL, gymapi.DOF_MODE_VEL)
props["stiffness"] = (0.0, 0.0, 0.0, 0.0)
props["damping"]=(6000.0, 6000.0, 6000.0, 6000.0)

Next I provide a target velocity for all four wheels. By giving the all wheels an input of 2*pi, it should drive around 1 m/s and go straight:

gym.set_actor_dof_velocity_targets(gym_env, robot_handle, (2*math.pi, 2*math.pi, 2*math.pi, 2*math.pi)

However, the robot does not drive in a straight line. If I run the simulation for 2000 timesteps, the robot has an offset of about 3m:

fig_robot_path

If I plot the velocities of all individual wheels, there is also a lot of noise. This was already mentioned in some previous posts (DOF Velocity Offset at Rest):

fig_robot_wheels_vel

When I give the wheels a input command of (2pi, -2pi, 2pi, -2pi), the robot should start rotating around itself. However, performance is even worse then:

fig_robot_path

fig_robot_wheels_vel

I think that due to the noises for the velocity in the DOF, I cannot control the wheels well with the PD controller and therefore the robot cannot drive straight (or follow other velocity commands accurately).

So my question is: is there a better way to control the wheels so it follows velocity commands better? Or is there some parameter tuning that can be done? I already tried setting the physx.num_position_iterations and num_velocity_iterations to high numbers (100) but that did not help much.

1 Like

I am having a similar problem to this… However, in my case, my drifting problem seems to be correlated to the force on the DOFs (either due to applied force or the mass of the robot/DOF; I still haven’t solved my issue though). What is the mass of your robot?

Also, how are the collision meshes of the wheels modeled? If you are using cylinders, can you try to replace cylinders with capsules? You can do that with:

asset_options.replace_cylinder_with_capsule = True

The mass of my robot is 46.034 kg. Could you explain why that would influence/have correlation with the drift? I am not sure I understand.

The wheel collision meshes are indeed modelled by cylinders. I tried the setting to replace the cylinder with a capsule, but the same behaviour occurs.

I also read your post Unexpected motion when using elongated cylinders for wheels and I was wondering: if you leave out the magnetic forces applied on your robot, then does the robot follow a straight path when you apply the same velocity to both wheels? Or does it only happen when applying the simulated magnetic forces?

Could you explain why that would influence/have correlation with the drift?

…then does the robot follow a straight path when you apply the same velocity to both wheels? Or does it only happen when applying the simulated magnetic forces?

Not entirely sure if the force is the culprit. But when I remove the magnetic force (set it to 0N while keeping gravity), it does follow a straight line. The magnitude of the drift is also amplified by the magnetic force I apply to the wheels. So I’m hypothesizing/assuming that the force may have some correlation to the drift.

I can provide some graphs soon.


When applying no extra forces (except gravity), there is a slight, negligent drift.


When applying 100N, there is a more sizable drift, and it is evident that the left and right wheels do not match the commanded velocity.


When applying 400N, the drift is even greater, and the velocities have an even greater error.