Login | Register 
FEATURES
APPLICATIONS
DOWNLOADS
EDUCATION
BLOG
WIKI
FORUM
STORE

RealSenseTOP D435, let's make it on GitHub!

General discussion about anything TouchDesigner

RealSenseTOP D435, let's make it on GitHub!

Postby DavidBraun » Mon Jan 29, 2018 6:06 pm

https://github.com/DBraun/RealSenseTOP/

Update 2018-03-06:
It works! Check out the repo for the most up-to-date information.

-----------------------------------------------------------

This visual studio project compiles and creates a dll, but the dll fails to load in TouchDesigner (follow the README instructions). For reference I'm looking at this example https://github.com/IntelRealSense/libre ... es/capture

Here's an overview of the modifications from the OpenGLTOP in C:\Program Files\Derivative\TouchDesigner099\Samples\CPlusPlus\OpenGLTOP

OpenGLTOP.h
Code: Select all
bool hasStarted = false; // declare a private variable

OpenGLTOP.cpp
Code: Select all
// at the very top of the file
#include <librealsense2/rs.hpp> // Include RealSense Cross Platform API
rs2::pipeline pipe;

Code: Select all
// inside the execute function
   if (!hasStarted) {
      hasStarted = true;

      pipe.start();
   }

Later, the missing pieces would involve
Code: Select all
    rs2::frameset data = pipe.wait_for_frames();
    data.get_depth_frame();
// and rendering into the context


Teach a man to fish so that I can do this for the 100 other "Kinect replacements" coming out :D
Last edited by DavidBraun on Tue Mar 06, 2018 7:04 pm, edited 1 time in total.
DavidBraun
 
Posts: 311
Joined: Wed Feb 25, 2015 1:35 pm
Location: Chicago

Re: RealSenseTOP D435, let's make it on GitHub!

Postby malcolm » Thu Feb 08, 2018 2:35 pm

If it's failing to load the .dll it's likely because there are other .dlls it depends on that it can't find. You can use the Dependency Walker took you can download from microsoft to help determine what .dll it needs. They should usually be placed in the same directory as your .dll.
User avatar
malcolm
Staff
 
Posts: 4197
Joined: Tue Nov 13, 2007 1:11 am

Re: RealSenseTOP D435, let's make it on GitHub!

Postby DavidBraun » Tue Feb 27, 2018 8:12 pm

Thanks for the tip. Things got better once I pasted the dlls. Now I'm stuck because the inner section never gets executed.
Code: Select all
rs2::frameset frames;
if (pipe.poll_for_frames(&frames)) {
    // get the data and render into TD...
}

There's an alternative way of getting the data with
Code: Select all
rs2::frameset data = pipe.wait_for_frames();

but that errors out with RS2_EXCEPTION_TYPE_DEVICE_IN_RECOVERY_MODE. That error doesn't make sense to me because I think the firmware is the latest (05.08.15.00)

I know realsense will be supported in a future build of TD. I'm just trying to get familiar with the realsense library and c++ so that I can combine it with a skeleton tracking API soon.
DavidBraun
 
Posts: 311
Joined: Wed Feb 25, 2015 1:35 pm
Location: Chicago

Re: RealSenseTOP D435, let's make it on GitHub!

Postby malcolm » Thu Mar 01, 2018 5:02 pm

I just finished my work on this, next posted 2018.20000 series will have it. I'm not sure about that error, sorry. I didn't run into anything like that.
User avatar
malcolm
Staff
 
Posts: 4197
Joined: Tue Nov 13, 2007 1:11 am

Re: RealSenseTOP D435, let's make it on GitHub!

Postby DavidBraun » Wed Sep 12, 2018 4:30 pm

The reason I'm still trying out a C++ version is to use the point cloud with the IR emitter disabled.

It would be a quick modification around here
https://github.com/DBraun/RealSenseTOP/ ... P.cpp#L145
Code: Select all
dpt.set_option(RS2_OPTION_EMITTER_ENABLED, 0);


This C++ version works well with one or two cameras, but I have 8 cameras going into a PC via fast USB controllers, and in that situation some of the C++ RealSense TOPS cook at 4ms/frame. Even with 8 cameras, the built-in RealSense TOP isn't slow like this, but it has the IR emitter always enabled. So, I'm hoping someone might have a tip on speeding up this C++ version.
DavidBraun
 
Posts: 311
Joined: Wed Feb 25, 2015 1:35 pm
Location: Chicago

Re: RealSenseTOP D435, let's make it on GitHub!

Postby malcolm » Wed Sep 12, 2018 7:38 pm

I'll add this feature to the TOP today.

The main reason the TOP is faster than your .dll is because the TOP does all of it's image capturing and even memcpy operations in another thread. The main reason outputFormat->cpuPixelData has multiple buffers available to you is because this gives you the ability to update one or more buffers in another thread, and have the main thread that calls execute() just hand off already filled buffer to be output.
User avatar
malcolm
Staff
 
Posts: 4197
Joined: Tue Nov 13, 2007 1:11 am

Re: RealSenseTOP D435, let's make it on GitHub!

Postby malcolm » Thu Sep 13, 2018 2:11 pm

Ok the IR emitter control will be in builds 2018.25950 or later.
User avatar
malcolm
Staff
 
Posts: 4197
Joined: Tue Nov 13, 2007 1:11 am


Return to General TouchDesigner Discussion

Who is online

Users browsing this forum: Bing [Bot] and 17 guests