UT-Austin-RPL / deoxys_control

A modular, real-time controller library for Franka Emika Panda robots
Apache License 2.0
140 stars 20 forks source link

Bug in OSC Impedance Controller (without delta) #3

Closed sherilan closed 1 year ago

sherilan commented 1 year ago

I think there is a bug in the method that computes the goal pose of the OCS impedance controller.

In line 92-94, the current end effector position is added to the action. This is in the section of code that is executed if is_delta == false, so it appears to be an error.

Testing the controller on a robot verifies this notion. Even though I specify a fixed target pose from the python side, the end-effector keeps drifting. Removing the term with the current end-effector position fixes this.

PS: Thanks for making this library.

zhuyifengzju commented 1 year ago

Thanks for the issue and your interest in the library! I personally don't use is_delta=false, so sorry for the bug here. Do you mind creating a pull request here if you've tested it out already? Otherwise, I'll probably need to find time to integrate the bug fix several days later.

sherilan commented 1 year ago

I'll make a pull request once I get back to the lab next week.

One more thing: It might be sensible/safer to have a separate default config for the is_delta=false case. The default config right now includes scaling of translation actions by a factor of 0.05. This is harmless for relative translations, but if you disable is_delta without also setting the action scale to 1.0, then it will radically scale down absolute positions which makes the end-effector shoot towards the robot base.

sherilan commented 1 year ago

PR open: #4

zhuyifengzju commented 1 year ago

I verified the changes on my end, and things look good to me. Thanks for the contribution!