isaac-sim / IsaacGymEnvs

Isaac Gym Reinforcement Learning Environments
Other
1.94k stars 412 forks source link

Factory Controllers steady state error #154

Closed ismarou closed 11 months ago

ismarou commented 1 year ago

After testing the Low-Level Controllers (OSC, Joint-Space IK, ID etc.) in the Factory open-source implementation (even for the Pick and Place tasks where RL is eventually working), none of the aforementioned controllers tracks the desired target poses at every timestep (namely provided in the ctrl_target_fingertipmidpoint{pos,quat} variables.

In fact, this behaviour is even more evident in the _randomize_gripper_pose function, where those errors have been propagated. As a result, the task files do indeed randomize the initial EE pose, but not at the desired pose every time.

As a result, as I am trying to build another application on top of them and apply a hand-crafted policy at the reset stage, I cannot reach any of my desired planned poses.

Is this a desired behaviour or a bug? Should I be tuning the controlllers' K parameters? If so, is there any systematic way of doing so? Is there any systematic way (besides experimentation) for selecting one of the provided controllers over the others?

ynarang commented 1 year ago

Hi @ismarou,

Generally speaking, it's normal for controllers to not perfectly track their targets at every timestep. Improved tracking behavior can usually be achieved by selecting a different controller or tuning the gains for a given controller, among other methods.

Re: choosing one controller over another, the lecture notes from the Robotic Systems Lab at ETH Zurich are a very useful reference. Modern Robotics by Lynch and Park is also great for a deeper dive.

There's no general solution that I'm aware of to tuning the controllers' parameters, as there are usually trade-offs (rise time, overshoot, settling time, steady-state error, etc.) For classical PID-style controllers, the Ziegler-Nichols method is often a starting point. There are quite a few papers on tuning controllers, as well as auto-tuning software for industrial-level applications. You might also consider writing code to explore or optimize gains for your specific use-case.

If sim-to-real transfer is your goal, we also recently wrote a paper called IndustReal, which used Factory for simulation and deployed the policies on a real-world robot. Task success was our primary goal, though, as opposed to precise tracking.