leggedrobotics / raisimGym

Other
140 stars 45 forks source link

Updated PD Controller and included example Policy 17717 Iterations #15

Open haloted opened 5 years ago

haloted commented 5 years ago

This updates the Environmental.hpp with PD controller. The policy is trained overnight and it greatly reduced the tracking error in the vertical axis. I found the cause of the vertical tracking error could be due to the original code not including the mass of the quadrotor as sum to the Z-axis force vector. Though there is still a little bit of horizontal translation error. If you have time, please suggest improvement and feedback to how to better optimise this. ReducedTrackingError

Not sure whether it's to do with learning rate, a learning rate decay could be implemented later to see if it would help reduce the tracking error.

About the quadrotor_position_tracking.py, if it is merged please delete the code you don't need such as action2thrust function. I know there is the git cherry pick function but I have other priorities than learning how to use it.

haloted commented 5 years ago

Jemin this code needs to be debugged before you approve of the merge. Please check if it works well before merging. Sorry for the inconvenience but I haven't really got time to learn how to use Clion.

haloted commented 5 years ago

This is the policy run for 14256 iterations. PolicyRun

haloted commented 5 years ago

It only seems to be slightly better at 11000 iterations. Is there a way to rotate the camera angle to see if it actually is just below the red dot? There seems to be some translational error but it's hard to see if the camera angle cannot be panned or rotated. 11000Policy

haloted commented 5 years ago

I had a look at my code again as I found there are errors in compiling now. I wasn't sure why there weren't errors previously. I found that rot_ as defined is a raisim object class. To convert it to quaternion, there is a quaternion class inside the Ogre::Quaternion though there isn't a method inside raisimOgre so it may need to be added. This involves quite a significant change.