-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Controlling Crazyflie through RPMs (PWM) #244
Comments
The relation between RPMs and thrust in gym-pybullet-drones/gym_pybullet_drones/envs/BaseAviary.py Lines 693 to 694 in 3d7b12e
There assumption of linearly between RPMs and PWM (that don't fully hold away from a hover range) in |
I understand that training using RPMs as actions space the conversion to PWM doesn't play a role. Nevertheless, transferring a policy trained to produce RPMs to a real Crazyflie, requires translating the RPM to PWM because the lowest control signal received by the Crazyflie firmware is PWM.
Then, to obtain the PWM should be applied: Is it correct? |
In
If you want to go by the system identification in https://www.bitcraze.io/documentation/repository/crazyflie-firmware/master/functional-areas/pwm-to-thrust/ you should modify
so that thrust = 1.0942e-07rpm^2 - 2.1059e-04rpm + 1.5417e-01 instead and then consider that thrust = 0.409e-03rpm^2 - 140.5e-03rpm - 0.099 when you want to derive the corresponding PWM command |
Hello, I have successfully trained a policy for setpoint tracking using RPM as action space. Now I'm trying to deploy it to a real Crazyflie using a ROS2 package (Crazywarm and Vicon system). As you refer to in #118, exists an empirical study of the relation between PWM and RPMs for Crazyflie (https://www.bitcraze.io/documentation/repository/crazyflie-firmware/master/functional-areas/pwm-to-thrust/). My question, is that using the data from that study and comparing with the transformation used by GymPybullet I found high discrepancies as is shown in the plot. The black line corresponds with the linear transformation used by GymPybyllet.
Could you help me to understand this and how can affect the transferability of the trained policy to a real drone?
Thank you so much
The text was updated successfully, but these errors were encountered: