Robot based scanning system with TCP plug-in development problems

Questions related to plugins development
Pepek
Posts: 9
Joined: Thu Mar 26, 2015 9:57 am

Robot based scanning system with TCP plug-in development problems

Post by Pepek »

Hello.

I am developing program for robot based scanning system. CloudCompare would be perfect environment for our project, it helps with 3D cloud of points a lot. I am trying to develop plug-in for CC that would help us, but I am only intermediate programmer and I have problems with QT, dll and so on..

The basic functionality of plug-in should be:

1. Connect to robot server over TCP.
2. Send code for fast and inaccurate measurement (no other data).
3. Receive cloud of point and insert it into CC.
4. Select next scan position in space (x, y, z) and 2 vectors – robot camera vector and up vector (how?).
5. Send accurate scan code and it's parameters over TCP.
6. Receive accurate cloud of points and insert it into CC.
7. Return to 4 if needed.

I am using Visual Studio, and I decided to use QtWebSockets in order to communicate with robot server (I'll write it to). Unfortunately I cannot force my plug-in to load QtWebSockets.dll (or QtWebSocketsd.dll) properly. Is there way to do that? If not is there any alternative already in CC?

Second thing is adding vectors in 3D, is there any function to do that and visualise it in CC?

And I guess that there have to be way to insert cloud of points from plug-in.

So far I've added actions in CC user interface for my plug-in, and I've made basic window for setting up TCP connection. I work with VS (with Qt Add-in) solution I generated with cmake.

I would be grateful if someone could point some articles or solutions realated to my problems...
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Robot based scanning system with TCP plug-in development problems

Post by daniel »

Interesting.

Regarding your issues with Qt

Are you using Qt 4 or 5? Look at the 'CMakeExternalLibs.cmake' file in the root directory. You'll see how Qt packages are retrieved (with the find_package command of CMake). Then you have to explicitly link your plugin with the corresponding library:

Code: Select all

include_directories( ${XXX_INCLUDE_DIR} )
target_link_libraries( ${PROJECT_NAME} ${XXX_LIBRARY_FILE} )
You can even tell CMake to copy the corresponding DLL to CC's install folder (with the 'install_ext' command). You can see how the other plugins depending on external libraries do this: qSRA, qPCL, qCork, etc.

Regarding the other questions
- for 3D vectors, you can create simple 'polylines' (ccPolyline) with 2 points. You could also create your own graphic entity but it's a little more complicated
- to add new point clouds, you have to create ccPointCloud instances and then register them via the 'm_app' member of the plugin (should be always valid when you are running the code of a plugin's action). The method is 'addToDB'.

Don't hesitate to ask for more information.
Daniel, CloudCompare admin
Pepek
Posts: 9
Joined: Thu Mar 26, 2015 9:57 am

Re: Robot based scanning system with TCP plug-in development problems

Post by Pepek »

Thank for support.
I am using QT 5 on windows. I queses that I need to add this library in CMakeInclude.cmake too? I found some examples as ExportPLCDlls.cmake. I will test it as soon I will return from spring break.
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Robot based scanning system with TCP plug-in development problems

Post by daniel »

The basic Qt 5 libraries (DLLs) will already be used and imported by CC. You only have to add the non standard ones (QtWebSocket here).
Daniel, CloudCompare admin
Pepek
Posts: 9
Joined: Thu Mar 26, 2015 9:57 am

Re: Robot based scanning system with TCP plug-in development problems

Post by Pepek »

I managed to write basic plugin version and it works. Now I want to compile it, so that I will just give people my plugin dll, and Qt network dll and they can download CC from internet. The problem is when I copied my plugin dll and Qt's network into CC folder/plugin folder and I started CC I got "The specified procedure could not be found." (Windows error code 127) and plugin loading failed. I used Dependency Walker to see what's the deal. It looks like Qt5Network.dll failed to use Qt's dlls from CC. So I guess I need to compile my plugin with the same Qt version as you do. I tried to find any info about it but I did not find anything in documentation and wiki. Can someone help me?

I am using currently Visual Studio 2013 and Qt 5.4 - msvc2013_64_opengl.
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Robot based scanning system with TCP plug-in development problems

Post by daniel »

Indeed, you have to stick to a version of Qt equivalent or newer than ours.

Currently (v2.6.1) the Windows versions are based on:
  • Qt 5.4 for the 64 bits version (Visual 2012)
  • Qt 4.8 for the 32 bits version (I need to verify this) (Visual 2010)
We have several problems with Qt 5.4 (mainly OpenGL/display issues) so we might either upgrade to Qt 5.5 (if it fixes those issues) or fall back to the 4.8 version for the next release (v2.6.2).
Daniel, CloudCompare admin
Pepek
Posts: 9
Joined: Thu Mar 26, 2015 9:57 am

Re: Robot based scanning system with TCP plug-in development problems

Post by Pepek »

Where did you found 64 bit version of Qt for VS 2012? Official site has only 32 bit version. I found 5.4.1 x64 for VS 2012 version on this site http://tver-soft.org/qt64 but their repo with previous versions is dead. And 5.4.1 version is not compatible with CC 2.6.1. Do you compile your own version?
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Robot based scanning system with TCP plug-in development problems

Post by daniel »

It seems the qt64 project is disabled, but there are some replicas (for instance here: http://sourceforge.net/projects/qt64ng/ ... -64/5.4.0/).
Daniel, CloudCompare admin
Pepek
Posts: 9
Joined: Thu Mar 26, 2015 9:57 am

Re: Robot based scanning system with TCP plug-in development problems

Post by Pepek »

Thanks a lot, everything works as intended! Robot scans objects and sends data to CC via my plug-in. One more thing for now. It would be nice to see compiler that was used to build current CC version. In QT Creator there is "About" in help menu and there is info "Based on Qt 5.4.1 (MSVC 2010, 32 bit)". That way I would know which QT version I need for my plugin.
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Robot based scanning system with TCP plug-in development problems

Post by daniel »

Okay, from now on, the Windows version will display in the 'about' dialog:
- the version of the Visual compiler (see Microsoft's documentation about _MSC_VER for instance: VS2012 = MSC_VER 1700)
- the version of Qt

I confirm that the next version will probably use Qt 4.8 as we have many issues with Qt 5.4 (by the way it seems that http://tver-soft.org/qt64 is on again).
Daniel, CloudCompare admin
Post Reply