This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DLP2000: Structured Light Code

Part Number: DLP2000

Hello, 

I'm working with the DLP2000 EVM and the DLP2600. What I'm looking to accomplish is use 40 bmp images that represent a mask that I would like to load up onto the DMD. Like others, I came across  Kyle Rakos' code for doing this. I am, however, having some issues I can't seem to figure out. 

I'm hoping to integrate this into the code I've already been writing via Visual studio, so I'll need to build it out specificly for that, but I can't seem to build it stand alone via Visual Studio, I keep getting this error. T

1>C:\Users\mascenzi\source\repos\DMDMask\DMDMask\display_core.c(73,72): error : ‘MAP_ANONYMOUS’ undeclared (first use in this function)
1>C:\Users\mascenzi\source\repos\DMDMask\DMDMask\display_core.c(73,72): error :   *buffer = mmap (0, *screensize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, (off_t)0); // Second buffer
1>C:\Users\mascenzi\source\repos\DMDMask\DMDMask\display_core.c(73,72): error :  

I'm also getting a lot of warnings. 

Obviously, because I'm using VS, I'm not in the opt/scripts/device/bone/capes/DLPDLCR200/structure_light folder. Correct me if I'm wrong, but this shouldn't matter as there are no other references to any of the other directories. 

I'm assuming that it has something to do with how its being built. 

First thing I noticed was that the make file is using gcc instead of g++ that VS is using. The 2nd thing that I noticed was the CFLAG. Could someone point me in the right direction for building this via Visual Studio?

In regards to my VS setup, I'm using VS2017. I created the project as an Empty Linux project, under the Cross Platform > Linux template. Added each of the header and source files into the project under a "Headers" and "Source" folders. 

Thank you in advance. 

Michael

  • Hello Michael,

    Were you planning to run this on a Windows PC? If so I am not sure if this is possible as the specific display method I used is particular to Linux. While it may be possible to port to Windows, I am not personally sure how it would be done.

    Thanks,

    Kyle

  • Kyle, 

    Hello, First off I'm glad I get to say thanks for the code. This has saved me a ton of time. 

    to answer your question, no I'm not using this on Windows. I'm using the built-in linux support in VS to develop an overall application that will run on the BBB. I'm able to configure the IDE to load the software directly onto the BBB while I develop my software on windows using VS. 

    Because my main application has already been written using VS, I wanted to integrate your code, into mine for the application of loading the images to the DMD. But when I'm using VS, I get those errors from above. I'm probably going to have to just integrate directly on the BBB. I don't want to waste to much time. 

    I have two questions for you.  1) whats the FPS this current setup will run at, It seems to be maxing out fairly low. Anything over 40 just seems the same. If I wanted to increase the FPS say up to 120, what do you suggest.  Also with 40 images, after a few the default screen loops into the mix several times. Have you seen this before?

    Thank you for your time. 

  • Hello Michael,

    Thanks, I'm glad to hear you are finding the code useful! I found this tutorial which would allow you to compile the code directly on the BeagleBone instead of crosscompiling. Perhaps this would fix the error. I'm assuming there are some additional Beagle specific dependencies that the typical MS Linux compiler doesn't have.

    The FPS maxing out at 40 seems about right. Unfortunately the BeagleBone is fairly limited in it's video output. A Raspberry Pi has been used for increased speeds in the past but I have not personally run this code on a Raspberry Pi.

    Could you clarify what you mean by the default screen looping in as well? I have personally not seen this behavior before.

    Thanks,
    Kyle

  • Sorry, I couldn't see it before. But when the program isn't running it shows the Linux desktop. When I run the program, it ends up running a few frames then shows the linux desktop, then some more frames, and randomly the linux desktop. I end up seeing the desktop 4 or 5 times during a batch of 40 masks, sometimes a few more. 

    Also I threw a timer in for when its running through the images. it does the 40 images in 2.3 seconds, so thats roughly 17hz that its running. Seems slow. 

    I found that the the biggest bottle neck for time is opening the image each time. I was thinking that if I collect the names, I could open them all up in some sort of array. Do you have any suggestions as to what I could store the images in? I thought a vector would be an idea, but this is in C and I attempted to build it with C++11 and I couldn't fix the errors. so there's that. 

    Sorry for the questions. I don't work much in C++. 

  • I just threw a userinput <getchar()> function in there while it loops. And it seems the desktop takes over if a new image isn't pushed out to it. Which is strange, cause if I set the persist flag, the last mask will hold strong. What am I missing that would keep the desktop from loading back into the dmds register?