N/A

Firmware/software/electronics/mechanics
RyanMco
Expert
Posts: 159
Joined: Tue Apr 09, 2019 6:15 am

Re: FLOWDECK

Post by RyanMco »

Got you ! thanks alot!!
Last edited by RyanMco on Sun Nov 17, 2019 4:31 pm, edited 1 time in total.
RyanMco
Expert
Posts: 159
Joined: Tue Apr 09, 2019 6:15 am

Re: FLOWDECK

Post by RyanMco »

Hi arnoud!
I tried to understand in brief how the flowdeck's Flowchart is going in aspect of firmware! I know it might be complex!!! but yeah I could understand in brief how it's going! , starting from detecting there's physically flowdeck placed on the crazyfly till the data goes to motors ! I mean also the data that I get from flowdeck where it's going in which functions?( I mean in aspect of firmware ), it would be much appreciated to detail what's going to the data from flowdeck's measurement till it send it to motors in order to let the crazyflie to fly..

I really tried to use debugger but can't use it everytime at every function because I want theoretically to know how firmware is structured and what's going inside the code function that are related to flowddeck's measurement till it send to motors/crazyflie chip in order to fly accordingly ..


thanks alot !
wydmynd
Member
Posts: 87
Joined: Thu Dec 06, 2018 9:25 am

Re: FLOWDECK

Post by wydmynd »

you can use external positioning message, but the coordinate systems have to match exactly.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: FLOWDECK

Post by arnaud »

There is no flowchart made for that in the firmware. I explained the different steps that happens in order to use the flow deck to control the Crazyflie in this post: viewtopic.php?f=6&t=3844&p=17701#p17701. The exact function used to push the flow sensor in the estimator is linked in that post: viewtopic.php?f=18&t=3318&p=16023#p16023.

If you need more information about the background behind the implementation you can look at Marcus Grieff's Master thesis page 93: http://lup.lub.lu.se/student-papers/rec ... 905299.pdf. In general this thesis and other papers are explaining a lot of the theory behind the Crazyflie: https://www.bitcraze.io/research/#publi ... azyflie-2x
RyanMco
Expert
Posts: 159
Joined: Tue Apr 09, 2019 6:15 am

Re: FLOWDECK

Post by RyanMco »

I understand you arnaud !
but lets assume I run script python with this instruction: cf.goto(0,1,4)
which means go to coordination x=0,y=1,z=4
this instruction will be sent to crazyflie chip, where this instruction will be entered through which function? if I use flow-deck measurement ..
to simplify more, this instruction would be sent by dongle antenna to crazyflie, and then there's specific functions that're dealing with this instruction in order to take x,y,z .. where in my firmware those functions found? thanks alot!!!

I didn't figure out by my debugger, could you help me please?
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: FLOWDECK

Post by arnaud »

The goto packet is a high-level commander packet and enters there: https://github.com/bitcraze/crazyflie-f ... vel.c#L281.

This will generate a trajectory that will be passed to the high-level commander that will generates setpoints in real-time to follow the generated trajectory.

The setpoints are then used by the PID or Mellinger controller together with the currently estimated pose to generate motor control.

The estimated pose is calculated by the Kalman filter using sensor measurement from any available sensor, that includes the IMU and the flow deck.
RyanMco
Expert
Posts: 159
Joined: Tue Apr 09, 2019 6:15 am

Re: FLOWDECK

Post by RyanMco »

Alright thanks alot arnaud! I appreciate your help to me!

now I verified that data from slam by function of crazyflie_ros publisher is sending to crazyflie and I see it by debugger, once I run my script python like cf.goto from crazyflie_ros documents, my crazyflie is getting data but the motors aren't working although I run my script python, it first take off by function take off() and then cf.goto for going to specific place .... what I verified by debugger that my crazyflie gets the data correctly, but motors aren't working and my crazyflie isn't trying to move up at all!!!

any help what could be a problem? thanks
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: FLOWDECK

Post by arnaud »

This looks like the high-level controller not being enabled. You can see an example of how to enable it in this Crazyflie ROS example script: https://github.com/whoenig/crazyflie_ro ... vel.py#L13.
RyanMco
Expert
Posts: 159
Joined: Tue Apr 09, 2019 6:15 am

Re: FLOWDECK

Post by RyanMco »

THANKS ALOT ! I will try and update you.
but before that, I've done a mechanism to turn off "implicitly" data from flowdeck by using this:
I revoked the push data from FLOWDECK to the kalman, would it work and my crazyflie will just get data from external source that I use in the same run time? I mean I didn't use the mechanism that you've told above to revoke flowdeck although he's already placed on my crazyflie .. so I said, whenever I dont have a push data to my kalman from flowdeck mesurement then there'd not be worries and my crazyflie would just get data from external source and the push measurement to kalman would just be from external source and not from flowdeck so my crazyflie at the end will just fly by the data from external source.

while (stateEstimatorHasFlowPacket(&flow))
{
I suspended this row code by "//" in order to not push measurement from flow deck to
kalman so I added "//" first of row code for not pushing data to kalman by flowdeck
//kalmanCoreUpdateWithFlow(&coreData, &flow, sensors);
doneUpdate = true;
}


will that work and my crazyflie will just fly according to measurement that he gets from external source and not from flowdeck although flowdeck is placed on(without disabling it functionality) .. will it work as I wanted?!
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: FLOWDECK

Post by arnaud »

This will work and this is essentially what setting the parameter will do (in ROS, setting the parameter do disable the flow is going use the same function as to enable the high-level commander), you will only get position/velocity data from external source AND the zranger integrated in the flow deck. You need to do a similar things in the z-ranger driver if you do not want any measurement from it (though in that case you might as well remove the flow deck from your Crazylie).
Post Reply