Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added QualisysTab #355

Merged
merged 33 commits into from
Nov 20, 2018
Merged

Added QualisysTab #355

merged 33 commits into from
Nov 20, 2018

Conversation

mgejke
Copy link
Contributor

@mgejke mgejke commented Sep 25, 2018

Adds the Qualisys Tab to cfclient.
Add dependencies of two pure python packages, qtm & quamash.
quamash is used to create an eventloop that works with both Qt and asyncio

Will raise the required Python version to 3.5.2

@ataffanel
Copy link
Member

Thanks for the PR!
We found one bug while testing the tab: the tab did not discover the QTM server if it is not running on the same machine, we had the client on a Linux machine and QTM on a Windows one on the same network. This should be either fixed or/and a field to set manually the IP of the QTM server should be added. I am planning to run more test later in the week to find out where the problem could be.

@mgejke
Copy link
Contributor Author

mgejke commented Oct 9, 2018

Yeah, I heard that from Martin. (from what I can see, the tab had the same issues before my changes)
The issue is that we have to send out the QTM discovery packet on all interfaces, there's no built in solution to iterate those in Python, but I've tried with netifaces and with that it's easily solvable. But that adds another dependency.

The other option(in my opinion, less desirable) is to simply add an input box for the qtm ip.

Which path would you prefer?

@ataffanel
Copy link
Member

I though this was the reason why the discovery was not working. Interfaces have quite random name in Linux nowadays.

A box with the IP would be good enough for me. Discovery is nice but when working with this kind of system we usually know about the IP or hostname (it is needed for crazyswarm for example).

Refactored discovery
Added Scan button
@tobbeanton
Copy link
Member

I've quickly tested the pull request and some initial feedback.

  • For the position in the CF to work it needs to be flying using the kalman estimator. This could be changed by the Qualisys tab by setting the parameter stabilizer.estimator = 2.
  • Pretty often the cfclient dies with a segmentation fault. We think this is because the Qualisys tab is modified outside the UI thread? This can only be done using signals and slots.
  • On Ubuntu the position and orientation boxes are to small so the figures can not really be read.

@mgejke
Copy link
Contributor Author

mgejke commented Oct 12, 2018

@tobbeanton

  1. I know nothing about the flight control part, where and how would I do that?
    cf.param.set_value('stabilizer.estimator', '2') ?
  2. Alright, works fine on windows. I guess it the flight_controller-thread...
  3. Could you supply a screenshot? Have nothing to test on here...

@mgejke
Copy link
Contributor Author

mgejke commented Oct 24, 2018

Alright, all UI modification should be done on the UI thread now. Haven't got any ubuntu machines to test on here, so when you got the time...

I think you said you could/had already solved the other two issues?

@mgejke
Copy link
Contributor Author

mgejke commented Nov 15, 2018

@tobbeanton, @ataffanel
Any news on this?

@krichardsson
Copy link
Contributor

Sorry for the late reply!

We tested a bit and found some problems that must be fixed before we can merge.

  1. The IP address can not be set when the QTM dropdown is empty. On my machine no QTM server is found and if I enter the IP address manually nothing happens when I click connect. I suppose the if on line 740 must be extended.
  2. The Kalman filter should be enabled in the Crazyflie. It is possible to switch estimator at run time by setting a parameter now as opposed to the re-compiling of the firmware that used to be required. Call cf.param.set_value('stabilizer.estimator', '2')
  3. The UI is updated from `on_packet()' which is called from another thread (I think)
  4. The UI is updated very frequently (on every packet from QTM). This and the previous point could for instance be solved by writing position data to memory and drive the UI updated with a timer.
  5. On linux it seems as importing the Qualisys tab is preventing the plotter tab from working. We have no idea of why right now, we will continue to investigate this. Any input is welcome.

The first 4 should be fairly easy to fix while the 5th is a bit more fuzzy. Please let us know if you need any help.

  • Kristoffer

@ataffanel
Copy link
Member

We found a fix for 5. (not that we understand it), it was caused by the line _flight_path_set_model = pyqtSignal(QStandardItemModel). If the line is changed to _flight_path_set_model = pyqtSignal(object), the tab still works fine but there is not problem anymore with pyQtGraph and the plotting tab!

@mgejke
Copy link
Contributor Author

mgejke commented Nov 20, 2018

Think I've fixed all the issues.
on_packet is not called from a thread, it's called asynchronously from the main ui-loop.

@krichardsson krichardsson merged commit 8447868 into bitcraze:master Nov 20, 2018
@krichardsson
Copy link
Contributor

Merged! Thanks!

@krichardsson krichardsson added this to the net_version milestone Nov 20, 2018
krichardsson added a commit that referenced this pull request Nov 20, 2018
* Removed unnecessary SyncCrazyflie
* Using correct function to send position to CF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants