Working with 2 analog axis (and + digital axis) controllers: is it possible? #592
Replies: 5 comments 1 reply
-
Hi,
I think max roll/pitch would be a bit violent with the default settings, but as the user can tune it down in the client, it could work.
I usually use the PS3 gamepad as it has pretty nice sticks, some other people in the office us pads from https://www.8bitdo.com/
The client is written in python so there is no need to compile anything, just clone the code and run. There are instructions in the repo if you want to try. I think the gamepad handling mainly is implemented in the input directory. Unfortenately I also have a recollection that it might be a bit messy... I hope you speak python fluently :-) inputreaderinterface.py is probably the focuspoint. You can search the code base for This is a start, let us know if you need help or want more information. |
Beta Was this translation helpful? Give feedback.
-
Still could not find the time for it, but I have looked ad the code: I can do something dirty in the first attempt :). Looking forward to some free time, then will update here, open issue, link to PR, etc. Some observations, somewhat related to this discussion (I do not want to spam the discussion board with new stuff) @krichardsson:
I have taken out the trim commands from here https://github.com/bitcraze/crazyflie-clients-python/blob/master/src/cfclient/utils/input/__init__.py#L478 up to L489 outside of the else and have put before this line https://github.com/bitcraze/crazyflie-clients-python/blob/master/src/cfclient/utils/input/__init__.py#L444, which did not do the trick I was hoping for: being able to trim pitch and roll with buttons while holding the altitude/height/z position :). Any opinions on that? Cheers, |
Beta Was this translation helpful? Give feedback.
-
Dirty is a good start :-) The code you are looking at is pretty old and might need some love, I'm not surprised if there are bugs or weird behavior. There is a bit of complexity related to what decks that are used that will enabled/disable the assistance modes.
It is very likely that the trim functionality is broken, I'm not sure we have tested it in a long time (years) :-( |
Beta Was this translation helpful? Give feedback.
-
Thank you @krichardsson for the descriptions! In "Altitude hold" mode I expected more control in altitude since baro and imu measurements are available. It first gave me the feeling that altitude hold is not working either. Then I went to the crazyflie firmware and I saw this: It is a basic first order filter to the barometer measurements. @krichardsson does that mean there is no sensor fusion (e.g. linear kalman filter) with acceleration from IMU + barometric height and some outlier detection and zero motion correction for estimating vertical state (acc bias, vertical speed, vertical height) using the onboard baro and IMU (although I see several kalman filter applications in the firmware repo, but they are not used for IMU+baro fusion I think)? Because that explains the behavior and altitude hold might actually be working as programmed, just not very good. Or I am missing stuff :) To this specific topic, I can look into. The performance can be increased dramatically. Coming back to the generic question of this discussion:
Will update here when I have something. First I need to find some time. |
Beta Was this translation helpful? Give feedback.
-
There are two different estimators available: the complimentary estimator and the kalman estimator. A Crazyflie without any decks will use the complimentary one, while if you add a positioning deck, it will automatically switch to the kalman one. It is also possible to set the estimator manually through the stabilizer.estimator parameter The code you looked at is probably used with the complimentary estimator (both the estimator and the baro code is very old), and there is no proper sensor fusion here. I think there is a barometer implementation in the kalman estimator as well, but I'm not sure how well it works. The barometer has not got the love it deserves, and there is room for improvements in both estimators :-) |
Beta Was this translation helpful? Give feedback.
-
Hi,
Although the bitcraze webpage explicitly says that you need to have a controller (gamepad) with at leas 4 analog axis controller [1], I was wondering if anyone of you have managed to fly with controllers like this [2]:
What I like to do:
What did I do so far:
I have not compiled cfclient from the source, I assume somewhere there I need to change something and recompile :).
Can anyone help me for that?
Ah my motivation:
Maybe I am trying something wrong, and there is out there robust and cheap working gamepads?
I appreciate your feedback!
Note: I had worked with crazyflie back in 2012. Amazing to get one again!!
[1] https://www.bitcraze.io/documentation/repository/crazyflie-clients-python/master/userguides/userguide_client/#create-new-mappings
[2] https://www.reichelt.de/de/de/raspberry-pi-controller-snes-design-rpi-ctrlr-snes-p211468.html?PROVID=2788&gclid=CjwKCAiAxvGfBhB-EiwAMPakqo9onREeLAYQwUKXRMPMha-aZd475QPCojFY_cj1DBCOb1TkdFzLuhoCAHMQAvD_BwE&&r=1
[3] https://github.com/orgs/bitcraze/discussions/576
Beta Was this translation helpful? Give feedback.
All reactions