-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
[RFC] Added simple kinectv2 grabber and viewer #1410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Nice, |
Mostly due to the short time I have worked on it and that the opengl processor outputs black windows atm - but that I is a matter at freenect2 :) And I lack implementation to choose PacketPipline and certain kinectv2 unit :) |
Hi, what is the status right now? I am pulling right now everything to have a look. |
Hi, well you can get colored pointclouds using the so far hardcoded opencl pipeline. I haven't got any spare time for the two features on the todo. Thanks for trying it out ;-) |
Also, One might need to create a findFreenect2 cmake file, as the exported cmake names of the libfreenect2 doesn't fit the PCL way of doing things... |
Ok, |
Sounds nice - looking forward to see the changes! |
done, working. |
Yeah thanks, just made a pull request on his branch. |
Yes, I guess actually it should be an enum created in libfreenect2 - as when 0.2 version is released there properly will be a CUDA packetpipline, which in turn will require updates to PCL? Anyway merged your changes :) |
yeah exactly. the biggest trouble is right now the CMake. I am not familiar with the pcl cmake structure so someone should have a look to fix it. There is the need to create a FindFreenect2.cmake I suppose. |
I fixed the cmake issue by creating a findModule for freenect2. Waiting for @larshg to merge. Next I will fix the Selectable kinectv2 unit by seriel number issue |
io/src/k4w2_grabber.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't compile if the user doesn't have OpenCL installed due to this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, will add a macro
Hi, |
@VictorLamoine could you have a look? Just to know if we are missing something. |
The grabber codes lacks documentation, it would be nice to add some. |
visualization/tools/k4w2_viewer.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should complete this explaining you can choose which Kinect to open by specifying an argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@VictorLamoine thanks.
Like this?
void
printHelp(int, char **argv)
{
std::cout << std::endl;
std::cout << "****************************************************************************" << std::endl;
std::cout << "* *" << std::endl;
std::cout << "* FREENECT2 - Usage Guide *" << std::endl;
std::cout << "* *" << std::endl;
std::cout << "****************************************************************************" << std::endl;
std::cout << "Creates a point cloud grabber for the kinect2. Accepts as constructor " << std::endl;
std::cout << "parameter a string specifying a kinect2 serial number " << std::endl;
std::cout << std::endl;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you can even make it shorter. I like this way of writing program helps, its very close to what is common on Linux program helps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PCL_INFO ("Creates a point cloud grabber for the kinect2\n");
PCL_INFO ("Accepts as constructor parameter a string specifying a kinect2 serial number\n");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this looks good!
I think the name |
Thanks @taketwo for having a look. I fixed all the things. |
Thanks for helping out with the last @giacomodabisias, @taketwo and @VictorLamoine. I'll try to make time to add the default paths for windows for finding libfreenect2 to the Cmake tonight, before its complete for testing etc. |
@larshg you can fix the second checkbox also |
AFAIK both Kinect v1 and v2 are end-of-life and are not manufactured anymore. I'm not sure if we need to merge drivers for dead hardware into PCL. |
There might still be people with that hardware around. I would simply disable its compilation by default. |
However, Kinect v2 sensor is still used by many users. Unfortunately, Kinect v2 sensor production was discontinued, But it is still representative of RGB-D sensors for consumers. I'm publishing grabber for Kinect v2 that based Kinect SDK v2 which is different from this grabber. (It is works on only Windows.) It still has a lot of demand. |
The freenect2 dependency is not being met in the CI and therefore this code is not being compiled.
Our build time does not allow us to be manually compiling third parties. I would like to have this properly compiling on our CI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My first review just focused on your CMake files.
You have a number of indentation problem to solve in the other files as well.
I recommend you have another look at the PCL style guide. http://pointclouds.org/documentation/advanced/pcl_style_guide.php#pcl-style-guide
io/CMakeLists.txt
Outdated
PCL_SUBSYS_OPTION(build "${SUBSYS_NAME}" "${SUBSYS_DESC}" ON) | ||
if(WIN32) | ||
PCL_SUBSYS_DEPEND(build "${SUBSYS_NAME}" DEPS ${SUBSYS_DEPS} OPT_DEPS openni openni2 ensenso davidSDK dssdk rssdk pcap png vtk) | ||
PCL_SUBSYS_DEPEND(build "${SUBSYS_NAME}" DEPS ${SUBSYS_DEPS} OPT_DEPS openni openni2 ensenso davidSDK dssdk rssdk pcap png vtk freenect2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On FindFreenect2.cmake, you specify paths which belong to unix style file system, but here you're only setting the decency on the windows. Was this intentional? I thought libfreenect was supported on all platforms.
io/CMakeLists.txt
Outdated
if(WITH_FREENECT2) | ||
option(WITH_OPENCL "adds opencl support for freenect2" OFF) | ||
if(${WITH_OPENCL}) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWITH_OPENCL") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- There's no find scripts in pcl which set opencl include dirs and libraries.
- OpenCL is something other modules might later use, so doesn't make sense to add this option here. It would should be moved to project root level.
- If you want to set preprocessor definitions use pcl_config.h.in and include it in your header files.
Given all these three options, I say to delete all these OpenCL related lines and include pcl_config.h in your headers, which will provide you with the definitions
io/CMakeLists.txt
Outdated
${DAVIDSDK_GRABBER_SOURCES} | ||
${DSSDK_GRABBER_SOURCES} | ||
${RSSDK_GRABBER_SOURCES} | ||
${FREENECT2_GRABBER_SOURCES} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation is messed up. Don't use tabs.
io/CMakeLists.txt
Outdated
${DAVIDSDK_GRABBER_INCLUDES} | ||
${DSSDK_GRABBER_INCLUDES} | ||
${RSSDK_GRABBER_INCLUDES} | ||
${FREENECT2_GRABBER_INCLUDES} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
io/CMakeLists.txt
Outdated
set(FREENECT2_GRABBER_SOURCES | ||
src/freenect2_grabber.cpp | ||
) | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation for this block is off
io/CMakeLists.txt
Outdated
option(WITH_CUDA "adds cuda support for freenect2" OFF) | ||
if(${WITH_CUDA}) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWITH_CUDA") | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comments as above. this time for cuda.
io/CMakeLists.txt
Outdated
else() | ||
target_link_libraries(${LIB_NAME} ${FREENECT2_LIBRARY}) | ||
endif() | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation is off again. Don't use tabs.
This pull request has been automatically marked as stale because it hasn't had Come back whenever you have time. We look forward to your contribution. |
Can this be bumped up? It is quite useful and the changes needed seem fairly minor. As for CI simply cache the dependency with travis so it is only built once. https://docs.travis-ci.com/user/caching/ |
Hey,
Bottom line. If you're interested in seeing this feature pushed, lend us a help. |
This pull request has been automatically marked as stale because it hasn't had Come back whenever you have time. We look forward to your contribution. |
This pull request has been automatically marked as stale because it hasn't had Come back whenever you have time. We look forward to your contribution. |
Cool this looks like it passes CI! Could it be merged soon now that we have passed the 3 year old PR milestone? 🥇 |
There are major review comments (besides from the indentation stuff) that have not been addressed. |
This pull request has been automatically marked as stale because it hasn't had Come back whenever you have time. We look forward to your contribution. |
However as of now you need to edit the freenect2config.cmake to add a few variables and make some of them with CAPS - why is is necessary? Or should I make a findfreenect2.cmake instead?
@VictorLamoine can you guide me here?
For some reason the pointcloud behaves flaky and the colors are acting weird also - so would like some help in localizing the error(s).Set is_dense to false seem to do the trick here.
@giacomodabisias can you have a look?
TODO: