bitcraze / crazyflie2-ios-client

The Crazyflie 2.0 iOS client
36 stars 36 forks source link

Add Button/Option for Altitude Hold #7

Open nanobot9000 opened 8 years ago

nanobot9000 commented 8 years ago

It would be nice to have an altitude hold feature in the app. Either hover at a certain level and then select that point as the hold position or if there is a way in the settings to tell it not to exceed a certain height - sort of an artificial ceiling.

EMart002 commented 8 years ago

@ataffanel do you know, is there any chance to get the tilt and accelleration data via the crazyflie-firmware via bluetooth? I'd really like to implement this feature and some others @nanobot9000 mentioned.

ataffanel commented 8 years ago

Setting altitude-hold would be fairly easy using the param setByName command: https://wiki.bitcraze.io/doc:crazyflie:crtp:param#set_by_name. Note that the alt-hold is based on pressure and so it will be hard to get an absolute altitude reading. What we have on the python client is to keep an altitude and allows for relative movement around it (ie. go up, go down).

Getting tilt and acceleration is another story because it requires a complete implementation of the log subsystem which require to fetch the log variable table of content. This would be nice and I can create a ticket for it. It is not required for altitude-hold though.

ataffanel commented 8 years ago

To enable altitude-hold you need to:

This is a bit messy and we are about to clean it up (soon we will be able to pass rising-rate in m/s directly in the commander packet), but this scheme will anyway be kept for compatibility.

nanobot9000 commented 8 years ago

I would be happy to test this out but my experience with applying code changes is just beginning. I defer to the experts for now and look forward to testing it.

nanobot9000 commented 8 years ago

I would really like to test out the alt hold functionality in the ios app, but don't have the experience in coding it. Since I am getting a lot of yaw rotation using the app it would be nice to be able to launch it and have it hold relative so I can observe what might be causing the rotation issue. Thanks!