Embedded Real Time Plot Gui with Qt - qt

I am new at Qt. I have embedded system that has sensors. Basically, I want to make a gui that plot sensor datas. I read other topics in this site. I did not found usefull topic.
How can I do this ? Which library, class, etc. I should use? Which is easier to implement.
To sum up, I want to know what should I use for
1- To plot
2- Use sensor data in Qt Creator
Thanks for help.
I looked QChart, Qwt, QCustomPlot for plot.
I do not know how to read port for read sensor data.

Related

Qt6 circular gauge issue

I am developing a qml app in qt5 with circular gauge. I want to port application qt 6. But in qt 6 qtquick extras is missing, so circular gauge is not available. Is qt planning to make it available in next releases of qt6? What can I do instead of using circular gauge in qt6?
Is there anyone who knows about it?
As far as I know there are no plans yet to port it to Qt 6. You could create a suggestion on Jira to express your interest in having it.
The code is here and here if you want to try to port it yourself or just use parts of it (keeping in mind the license, which is LGPL).
As you stated in the question, CircularGauge is not available in Qt6. So what can you do?
As a minimal effort, you can substitute CircularGauge with a functional similar component, for instance, RangeSlider. Of course, a RangeSlider looks nothing like a CircularGauge, but, it will, at least, allow you to compile and run your application. It will give you an application to test whilst you decide your options.
Then, as others have stated, you need to spend more effort allocated to porting. If you refer to the source code of CircularGauge, you see that they're using Canvas with a custom onPaint implementation. You could do the same in your port, or, you can find an alternative, e.g. Shape with ShapePath, etc. These efforts are non-trivial, and it boils down to the level of effort you wish to invest.

How to display points with QT3D?

Qt3D makes it very easy to display some mesh primitives:
m_torus = new Qt3DExtras::QTorusMesh();
but I would just like to display a collection of points. I haven't seen anything like
m_points = new Qt3DExtras::QPoints();
Is there a way to do this without writing lower level OpenGL?
Don't know if this is what you're looking for but check out Qt3DRender::QGeometryRenderer. I use it in a project to display map lines in a 3D scene.
There is a method to define how the vertex buffer data shall be rendered (where I use Qt3DRender::QGeometryRenderer::LineStrip instead of Qt3DRender::QGeometryRenderer::Points):
Qt3DRender::QGeometryRenderer::setPrimitiveType(Qt3DRender::QGeometryRenderer::Points);
AFAIK, There are no simple primitives like lines or points available in Qt3D 2.0, because there is just no one-size-fits-it-all solution. If you are lucky, someone will step up and add something to extras, else you have to write your solution yourself.
Qt Interest Mailing List Nov 2016 - Lines in Qt3D
There is however, a pcl point cloud renderer project on github!

Share rendered texture between Unity and Qt

I have a 3D environment done in Unity which I wan't to have as an Item in Qt (QML). I've tried a few different paths, but none has proved to be efficient enough or I'm unable to get it to work.
My current working solution is to do the following each frame
In Unity, use ReadPixels of my RenderTexture (GPU) to get a regular Texture (RAM).
Encode to JPG and send bytearray through TCP socket.
In Qt, instantiate a QImage from the data and save it for later use.
In the render function of QQuickFramebufferObject::Renderer, use glTexImage2D to render the image to my active texture.
Obviously this is not an optimal solution. This performs maybe 10 fps with a 128x64 texture size (for testing). My understanding is that the bottleneck is transferring data from gpu and back.
In my latest attempts I have tried to get the ID of the RenderTexture using renderTexture.GetNativeTexturePtr(). Then in Qt I'm trying to get the pixel data through glGetTexImage, but I keep getting 0's in the data. When later using glDrawPixels, the Qt application crashes.
So my question now is, do anyone know if it's possible to share the texture between processes and if so, how?

How to get started with drawing robot

I am a beginner to robotics, and I wanted to program a robot arm to draw a picture on arbitrary objects I present to him.
I do have an Intel Realsense camera, will receive a dobot.cc robot arm next days, and thought about using ROS as a base, moveit for movements and the PCL library for object detection.
How do I connect all of these together? Are there any particulary interesting tutorials that you would recommend? Anything I should try out up front?
Also, I suppose I will need to build custom code for detecting the target object in the point cloud and calculate how the picture should be placed on the object and then use moveit to follow the target path. Where would this code go?
Any help would be appreciated.
Thanks,
Gregor
Meanwhile, I found an excellent book on the topic:
http://www.amazon.de/Learning-ROS-Robotics-Programming-Second/dp/B00YSIL6VM/

Using libsndfile to play sound real time c++ in qt

I am using using libsndfile read and manipulate sound files.
I am wandering what whould be the simplest way to play these sounds in real time
in Qt.
I have tried to look at QtAudioOutput, however has to use QtAudioFormat, which is
quite cumbersome to configure.
All i want is to
1) Read data using libsndfile
2) manipulate the data
3) send the buffer to an audio output library.
Try using sndfile-play to play audio files using libsndfile, or a library based on libsndfile such as ALURE
http://kcat.strangesoft.net/alure.html
You could load the audio file yourself manually using libsndfile and play the file using OpenAL. This is essentially what ALURE is doing.
You can output the audio using Phonon. Here is the piece of the docu from Phonon module
The type of the source is set by the media source itself, and is dependent on the constructor used to create it. Note that it is possible to provide data from any source by implementing a QIODevice.
Basically you have to implement your own QIODevice if you want to do it Qt way

Resources