Random Behavior while hovering/flying autonoumously
Posted: Sun Apr 04, 2021 7:33 pm
Hello all,
Our research lab have decided to use Crazyflies as our platform for controlling autonomous UAVs. We have Optitrack motion capture system in our lab and I'm trying to merge our existing approach with crazyflies. In brief, the problem is that I do not get a consistent result each time I try to run my code and fly the drones. Some times the flight (e.g. hovering) is successful, but most of the time I see random behavior, in particular, the drone takes off and reach its hovering point, stays there for a couple of seconds, and suddenly it drifts off, or reduces its height significantly, and then it becomes unstable and therefore, I have to stop the experiment. In other words, to me it seems that the Crazyflie decides not to follow the control commands at some point, for some reasons that I don't understand.
I am not using the Crazyswarm, and I personally prefer not to do (I am not good with ROS ). Instead, the architecture for my approach can be briefly explained as following :
1. Thread1: Receives data from motive and computes the outer loop control commands (roll, pitch, yaw, thrust). The rate is almost 120 Hz.
2. Thread2: Sends commands to the crazyflie at a specified rate (I have tried values between 40-100 Hz, no difference)
3. Main Thread which initializes the variables and other classes, and initiates Thread1 and Thread2.
(I am using cflib and everything is implemented in Python)
The main body of my code can be found in https://github.com/AliGriv/Crazyflie_te ... in/Main.py
I know that sometimes the data received from Motive could be flawed, especially since the markers arrangements are a little bit close to each other and they form a relatively symmetric rigid-body. But I am not convinced this could be the source of my problem. The reason is that I do not observe problems such as "axis flipping" or even the plots generated from Motive data seems to be fine.
Also as I mentioned before there is a problem that I have some successful experiments now and then, and sometimes the result is astonishing in terms of position errors (it happens rarely, bit it happens!). Moreover, by monitoring the outer-loop control commands, it seems that my controller structure is also fine (which makes sense because we had used it on some other drones using SPRacingF3/Cleanflight controllers on hand-made drones).
I could not find a similar topic regarding this issue, and I would greatly appreciate if anyone can give me some hints about this problem or re-direct me to the right thread of discussions.
Thank you everyone.
Our research lab have decided to use Crazyflies as our platform for controlling autonomous UAVs. We have Optitrack motion capture system in our lab and I'm trying to merge our existing approach with crazyflies. In brief, the problem is that I do not get a consistent result each time I try to run my code and fly the drones. Some times the flight (e.g. hovering) is successful, but most of the time I see random behavior, in particular, the drone takes off and reach its hovering point, stays there for a couple of seconds, and suddenly it drifts off, or reduces its height significantly, and then it becomes unstable and therefore, I have to stop the experiment. In other words, to me it seems that the Crazyflie decides not to follow the control commands at some point, for some reasons that I don't understand.
I am not using the Crazyswarm, and I personally prefer not to do (I am not good with ROS ). Instead, the architecture for my approach can be briefly explained as following :
1. Thread1: Receives data from motive and computes the outer loop control commands (roll, pitch, yaw, thrust). The rate is almost 120 Hz.
2. Thread2: Sends commands to the crazyflie at a specified rate (I have tried values between 40-100 Hz, no difference)
3. Main Thread which initializes the variables and other classes, and initiates Thread1 and Thread2.
(I am using cflib and everything is implemented in Python)
The main body of my code can be found in https://github.com/AliGriv/Crazyflie_te ... in/Main.py
I know that sometimes the data received from Motive could be flawed, especially since the markers arrangements are a little bit close to each other and they form a relatively symmetric rigid-body. But I am not convinced this could be the source of my problem. The reason is that I do not observe problems such as "axis flipping" or even the plots generated from Motive data seems to be fine.
Also as I mentioned before there is a problem that I have some successful experiments now and then, and sometimes the result is astonishing in terms of position errors (it happens rarely, bit it happens!). Moreover, by monitoring the outer-loop control commands, it seems that my controller structure is also fine (which makes sense because we had used it on some other drones using SPRacingF3/Cleanflight controllers on hand-made drones).
I could not find a similar topic regarding this issue, and I would greatly appreciate if anyone can give me some hints about this problem or re-direct me to the right thread of discussions.
Thank you everyone.