Interacting with SARndbox source code

Home Forums AR Sandbox Forum Interacting with SARndbox source code

This topic contains 5 replies, has 4 voices, and was last updated by  Franzzzzzzzz 3 weeks, 4 days ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #103707

    Franzzzzzzzz
    Participant

    I’ve been trying to integrate a slope stability analysis in the sandbox but I am running into issues to get and display the data from the SARndbox code.
    Basically I want to be able to extract the corrected elevation data from the SARndbox software in some kind of array or buffer, do some processing, and display a map of values with a certain scale (eg. between 0 and 90 to display slope angle for example) and a certain colorbar. All that would be done in an additional c++ class to the SARndbox software. The problem is that I can’t manage to get a meaningful elevation data that would be calibrated (I only manage to get the raw informations from the kinect buffer, which I can rescale and offset manually but it is not ideal), and I can’t manager to get the projector to display an array of arbitrary value.
    I should probably indicate that although I know c++ I don’t know anything about OpenGL programming or graphic card programming. At the same time I don’t really mind if the computations runs slow, I can leave with a 1 fps or less update rate.

    I hope my questions make some sense and that you’ll be able to help me. In any case, thanks for your great work in developing the Sandbox!

    #103727

    benjymarks
    Participant

    This sounds great. I would also like to be able to show something other than height on the sand surface.

    #103730

    mishafarms
    Participant

    There are probably a few ways to do this. One is that there is a DEM saver for the elevation data. You can go find that code and use it to get the projected and calibrated elevation. This would
    probably be the easiest.

    If you learn more OpenGL you can actually have a buffer that gets filled in with the fixed-up elevations from the processing that is done in OpenGL to fic the data. This is pretty quick and the Host CPU
    does very little work, you can get the elevation for every update frame. You would then have to process the data and then feed the info back into OpenGL. You would still need some OpenGL coding, but probably
    not too bad.

    The other technique is to really learn the graphics shaders and add a new shader that would take the elevation data in the OpenGL engines and process it and color the output with your data instead.
    this is the fastest to run, probably the hardest to do if you don’t know OpenGL and shaders.

    I once did something with the get the OpenGL to process the buffers and then hand the buffers to the Host, so that the Host could then save them out. I may be able to find that code. It isn’t clean, but I did get what appeared to be corrected elevation data.

    Michael

    #103731

    Franzzzzzzzz
    Participant

    Thanks for your answer.
    I guess one of the first 2 methods are probably the way to go for me, I don’t have that much time to spare to learn OpenGL for this project.

    If you can find the code you are talking about, even if it is not clean it would probably be very helpful in pointing me in the right direction to grab the elevation data.

    #108243

    niklaskp
    Participant

    Did you ever figure this out? I’m trying to do the same thing.

    #108244

    Franzzzzzzzz
    Participant

    Well kind off, I ended up with a quite dirty hack but that works good enough for my (current) purpose. This is what we ended up doing:
    – map a key shortcut for the sandbox software to output the elevation data into a file
    – run at the same time the sandbox software and my own software (let’s call it SlopeStab).
    – Every so often SlopeStab use a system call to simulate a key press on the sandbox window (with xdotool)
    – SlopeStab reads the elevation data from the created file, do come computation, and then display the result in a completely separate window, that is displayed above the sandbox window.

    Things that are not working great:
    – this is slow, the output framerate is at about 1fps. But it’s not really an issue since I don’t have anything flowing
    – it relies on some initial calibration for SlopeStab to get realistic elevation and region of interest
    – the elevation data is offset in the plane, so a ~5cm band of sand cannot be used. I have no idea wgt?
    – sometimes the sandbox window pop back in focus and covers the SlopeStab window. I’m sure it’s possible to avoid that but haven’t been able to dedicate enough time to figure it out.

    So all in all, a very dirty trick but that works good enough. I can send you the codes I am using if you are interested.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

Comments are closed.