HomeForum Home → Software → Development → Thread

   

Failed SetDense3DImageInfo

Rank

Total Posts: 3

Joined 2018-10-19

PM

Hi everyone.

I am having trouble debugging connectivity issues with the Duo MLX, and am wondering if anyone has some wisdom on what would cause SetDense3DImageInfo and other Setter methods to fail. Please see the code snippet included at the bottom.


The Dense3DMT sample project in the SDK compiles and runs as expected with the MLX connected on VS2015 v140. I extracted the body of the main program into my own program to try and get this thing to work, but run into initialization problems.


Here is what I have done differently from the sample project:
1. The code is running in an initialization method from within a C++ constructor, soon to be broken into smaller chunks.
2. The main program is running on a separate thread from which the object is created (part of a larger service-oriented architecture).


The SetDense3DImageInfo fails on my program, but I am struggling to determine why. All of the print statements print “╠╠╠╠╠ ... “, but I get the DUOLib and Dense3DMT version as v1.1.0.30. The image parameters I am providing are the same as from the sample. I suspect there may be problems with the threading aspect.


Normally I would dig deeper into how the method is defined and step through with the debugger. But the API is closed up. Tried multiple USB ports, too.


End objective: Grab XYZ values from each frame as quickly as possible without disturbing the operations of other worker threads.


Any insight into why SetDense3DImageInfo (or any other setter) might fail would be appreciated. Thank you.

...
 
// Open Dense3D
 
Dense3DMTInstance dense3d;
 if (!
Dense3DOpen(&dense3d;)){
  printf
("Could not open Dense3DMT library\n");
  return 
1;
 
}

 DUOInstance duo 
GetDUOInstance(dense3d);

 
char tmp[260];
 
GetDUODeviceName(duotmp);
 
printf("DUO Device Name:      '%s'\n"tmp);
 
// some other print statements
 
printf("DUOLib Version:       v%s\n"GetDUOLibVersion());
 
printf("Dense3DMT Version:    v%s\n"Dense3DGetLibVersion());

 
// Set the Dense3D license (visit https://duo3d.com/account)
 
if (!SetDense3DLicense(dense3d"MY WORKING LICENSE"))// <-- Put your Dense3D license
  
printf("Invalid or missing Dense3D license. To get your license visit https://duo3d.com/account\n");
  
Dense3DClose(dense3d);  // Close Dense3D library
  
return 1;
 
}

 
// Set the image size
 
if (!SetDense3DImageInfo(dense3dWIDTHHEIGHTFPS))
 
{
  printf
("Invalid image size\n");
  
Dense3DClose(dense3d); // Close Dense3D library
  
return 1;
 
}
... 
     
Rank

Total Posts: 3

Joined 2018-10-19

PM

Hi everyone,

FYI—I found the solution.

I overlooked the fact that I have been linking both the Dense3DMT and Dense3D libraries. Removing Dense3D and keeping Dense3DMT from the list solved the problem!

Hopefully this helps someone in the future.