Skip to content

Use new libfreenect2 API #189

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

Merged
merged 1 commit into from
Dec 9, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions kinect2_bridge/src/kinect2_bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ class Kinect2Bridge

initCompression(jpeg_quality, png_level, use_png);

if(!initPipeline(depth_method, depth_dev, bilateral_filter, edge_aware_filter, minDepth, maxDepth))
if(!initPipeline(depth_method, depth_dev))
{
return false;
}
Expand All @@ -286,6 +286,8 @@ class Kinect2Bridge
return false;
}

initConfig(bilateral_filter, edge_aware_filter, minDepth, maxDepth);

initCalibration(calib_path, sensor);

if(!initRegistration(reg_method, reg_dev, maxDepth))
Expand Down Expand Up @@ -350,7 +352,7 @@ class Kinect2Bridge
return true;
}

bool initPipeline(const std::string &method, const int32_t device, const bool bilateral_filter, const bool edge_aware_filter, const double minDepth, const double maxDepth)
bool initPipeline(const std::string &method, const int32_t device)
{
if(method == "default")
{
Expand Down Expand Up @@ -390,13 +392,17 @@ class Kinect2Bridge
return false;
}

libfreenect2::DepthPacketProcessor::Config config;
return true;
}

void initConfig(const bool bilateral_filter, const bool edge_aware_filter, const double minDepth, const double maxDepth)
{
libfreenect2::Freenect2Device::Config config;
config.EnableBilateralFilter = bilateral_filter;
config.EnableEdgeAwareFilter = edge_aware_filter;
config.MinDepth = minDepth;
config.MaxDepth = maxDepth;
packetPipeline->getDepthPacketProcessor()->setConfiguration(config);
return true;
device->setConfiguration(config);
}

void initCompression(const int32_t jpegQuality, const int32_t pngLevel, const bool use_png)
Expand Down