Open WreckItTim opened 1 year ago
Found that a better stop-gap is to either sleep until oscillations stop (expensive) or force the velocity of the drone to 0 in all dims, by adding something like this to where it is needed in your code:
# stabalize drone
if stabelize:
self._airsim._client.rotateByYawRateAsync(0, 0.1)
self._airsim._client.moveByVelocityAsync(0, 0, 0, 0.1).join()
@WreckItTim Can you please share how you set the different PID gains? Is it using the API calls or directly in AirSim/AirLib/include/vehicles/multirotor/firmwares/simple_flight/firmware/Params.hpp?
Bug report
What's the issue you encountered?
I was doing some RL training, and noticed a drift in some of the episodes. I wrote some test script to isolate the problem and found that there is some odd behavior that happens only along the Y-axis. This is causing the drift, but not apparent along the X-axis.
I added a YouTube video showing the problem: https://youtu.be/Nwjk_-ua3K4 Also below is the test script you can use to repeat the isolated problem and tinker with it yourself.
Settings
{ 'ClockSpeed': 8, "SimMode": "Multirotor", "ViewMode": "SpringArmChase", "SubWindows": [] }
How can the issue be reproduced?
I made this script to just plug and play and repeat error. Run this python script (replacing as needed to launch configuration). I used the v1.8.1 Blocks release on Windows and dropped the parent folder in the same folder as the bellow python script file, along with setup_path.py. After launching, you can use the terminal to input commands.
Note that reducing the clock speed will have the same bug but it will be slower and harder to see, but trust me it is still there if you look close enough.
Include full error message in text form
no error message
What's better than filing an issue? Filing a pull request :).
edit* (did some debugging and found a stop-gap / narrowed down the problem) I am trying to get some results for my RL research from this asap (have a paper deadline). So I'd be thrilled to just find a stop-gap for the moment, even until a full fix is found. So I did some trial and error tonight....
I have tried the following, but get the same bug:
Number 10 gave me the stop-gap I needed! Rotate yaw to face the x-axis, move to desired position, rotate back to original yaw. Works for the moment, LOL!