Firmware and python client out of sync?

Firmware/software/electronics/mechanics
Post Reply
alexeyr
Beginner
Posts: 2
Joined: Mon Apr 04, 2016 7:39 pm

Firmware and python client out of sync?

Post by alexeyr »

Hi Crazyflie community!

I have been trying to use up to date crazyflie-firmware and crazyflie-clients-python repositories. However it seems that some logging var names are out of sync because I get the following errors in the client:

WARNING:cflib.crazyflie.toc:Unable to find variable [altHold.target]

WARNING:cflib.crazyflie.toc:Unable to find variable [baro.aslLong]

I noticed that commit 4175d7a in crazyflie-firmware, renamed these variables but there is no equivalent renaming in the python client. So the errors above are understandable. However, it seems that the repositories have the altitude hold feature broken because of this. Has someone forgotten to push some commits to crazyflie-clients-python?

Thanks!

Alexey
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Firmware and python client out of sync?

Post by arnaud »

Hi,

Yes there has been changes in the Crazyflie althold code and this has broken the alt-hold display. Though the althold control in itself should still work (and actually work much better than before! :-). If you set one button of your gamepad as althold it should work, it is using the param flightmode.althold which has not changed

I pushed a ticket for you on github: https://github.com/bitcraze/crazyflie-c ... issues/246

Thanks for reporting!
alexeyr
Beginner
Posts: 2
Joined: Mon Apr 04, 2016 7:39 pm

Re: Firmware and python client out of sync?

Post by alexeyr »

Hi Arnaud!

Thank you for your reply!

The issue was solved quick and I am already using the fix, so I am a happy customer ;).

Unfortunately alt hold is not working very well. I am currently testing it at 3767 meters of altitude, so maybe it was tuned at sea level. The altitude estimation might be the problem. I was testing it in a room that is 2.5m high, but the altitude estimation readings indicated a height difference of 4.5m, and the readings did not seem linear.

Do you have tips on how to debug these issues? I am trying to get the plotter to plot multiple variables (it doesn't), alternatively I'd like to dump the values as a csv and perhaps visualising it in R. What is your workflow to output the altitude hold algorithm state and iterate on the algorithm? Thanks a lot!

Cheers,

Alexey
Mitteau
Expert
Posts: 248
Joined: Fri Jan 29, 2016 6:00 am

Re: Firmware and python client out of sync?

Post by Mitteau »

Hi everybody
I worked hard last week on altHold command. I discover some interesting questions.
I programmed xbox360 to go into altHold mode. But since the beginning, The altitude target slowly decreases if I do not push on the stisck. Whatever I did.
Further more the ASL window seems not to be in a right position.
The altHold command should be like in the initial wiki: going into altHold mode should fix the target if there is no throttle command. Then push up and down to raise or lower target.
Vey funny problem. Thanks to this question, I entered deeper in the software, both python client and in board firmware.
I will test the new versions. Mine is actually 2016-02.
Regards
Jean-Claude
Mitteau
Expert
Posts: 248
Joined: Fri Jan 29, 2016 6:00 am

Re: Firmware and python client out of sync?

Post by Mitteau »

Hi Arnaud
I worked hard 3 hours to install last python client on linux....
Only errors :
-cannot find git
-setup.py for cflib do not install complete repertory ?
-launching cfclient: cannot find mainUI...
But it is not the first time I install python client. All goes right wit setup_linux.sh of the 2016-02 version, after installation of dependencies.
I will try to solve all that.
Best regards.
Jean-Claude :?
Mitteau
Expert
Posts: 248
Joined: Fri Jan 29, 2016 6:00 am

Re: Firmware and python client out of sync?

Post by Mitteau »

Hi Arnaud
I apologize
I probably forgot to do "submoduie init" and "submodule update"
Regards
Jean-Claude ;)
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Firmware and python client out of sync?

Post by kristoffer »

The altitude is mainly calculated from the air pressure (that varies depending on weather and other factors) and is thus not absolute. The altitude hold target is initially set to -1 and depending on your location and the current air pressure the client will probably show some weird data at this point.
When you enter altitude hold mode we sample the current estimated altitude in the copter and use that as the target value and you will see the graph in the client being updated and showing a value around 0. The difference in the currently estimated altitude is continuously compared to the target value and the difference is used to control the thrust of the motors.
The altitude is mainly estimated using the air pressure, but is also fused with data from accelerometers.
The air pressure (and alt hold) is influenced by may factors, for instance doors opening in the building, and the altitude will usually not be completely stable.
Post Reply