Skip to content
This repository has been archived by the owner on Dec 30, 2020. It is now read-only.

Updated PD Controller and included example Policy 17717 Iterations #15

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

haloted
Copy link
Contributor

@haloted haloted commented Oct 3, 2019

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.


torque_B += fbtorque_B; /// sum of torque inputs

force_B(2) += mass_ * 9.81; /// Sum of thrust inputs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you add gravity? this should be done by raisim

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, the original implementation has this as action scaling. Since we already have it in a different place, you don't need it

raisim_gym/env/env/hummingbird/Environment.hpp Outdated Show resolved Hide resolved

torque_B += fbtorque_B; /// sum of torque inputs

force_B(2) += mass_ * 9.81; /// Sum of thrust inputs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, the original implementation has this as action scaling. Since we already have it in a different place, you don't need it

@haloted
Copy link
Contributor Author

haloted commented Oct 8, 2019

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
Copy link
Contributor Author

haloted commented Oct 8, 2019

This is the policy run for 14256 iterations.
PolicyRun

@haloted
Copy link
Contributor Author

haloted commented Oct 8, 2019

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
Copy link
Contributor Author

haloted commented Oct 18, 2019

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants