Skip to content
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

Depth image renderer #89

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
776bfe2
feat: Added depth extraction functionality
Divelix Oct 18, 2024
ce0d9dc
Merge remote-tracking branch 'origin/feature/add_py_typed_marker_file…
victorreijgwart Oct 24, 2024
c352f73
Run pre-commit and address warnings
victorreijgwart Oct 24, 2024
fea5914
Draft support for multi-threading
victorreijgwart Oct 24, 2024
97525ec
Group parallel ray casts into tiles to reduce job dispatch overhead
victorreijgwart Oct 28, 2024
b342a2f
Merge pull request #81 from Divelix/raycast
victorreijgwart Nov 18, 2024
b6a10c9
Cleaner handling of features provided by optional dependencies in CMake
victorreijgwart Dec 5, 2024
385961c
Refactor param loaders and converters for consistency and extensibility
victorreijgwart Dec 5, 2024
d4e8edb
Add optional yaml parsing support
victorreijgwart Dec 5, 2024
ddbab43
Communicate failure using std::optional
victorreijgwart Dec 5, 2024
b2d1f4f
Add tests for param loading from yaml files
victorreijgwart Dec 5, 2024
7e39068
Fix outdated include path
victorreijgwart Dec 5, 2024
1fc20a8
Add an example on how to run the mapping pipeline through the C++ API
victorreijgwart Dec 5, 2024
43d1a50
Update the documentation
victorreijgwart Dec 5, 2024
f3846f9
Address GCC CI warnings
victorreijgwart Dec 5, 2024
9d5df86
Merge branch 'main' into feature/depth_image_renderer
victorreijgwart Dec 5, 2024
8f28aad
Update factories to consistently pass subconfigs to subfactories
victorreijgwart Dec 5, 2024
60983e7
Merge branch 'feature/cpp_api_yaml_support' into feature/depth_image_…
victorreijgwart Dec 5, 2024
21a6143
Move code to C++ library and add support for other projection models
victorreijgwart Dec 5, 2024
730cb28
Remove option to use a non-zero min_range in the ray casting renderer
victorreijgwart Dec 6, 2024
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
Prev Previous commit
Next Next commit
Update factories to consistently pass subconfigs to subfactories
victorreijgwart committed Dec 5, 2024
commit 8f28aad72ed314e4e99fd181bf20fe027673ae3a
23 changes: 18 additions & 5 deletions library/cpp/src/core/integrator/integrator_factory.cc
Original file line number Diff line number Diff line change
@@ -60,10 +60,16 @@ std::unique_ptr<IntegratorBase> IntegratorFactory::create(
}

// Create the projection model
const auto projector_params = params.getChild("projection_model");
if (!projector_params) {
LOG(ERROR) << "No params with key \"projection_model\". "
"Projection model could not be created.";
return nullptr;
}
std::shared_ptr<ProjectorBase> projection_model =
ProjectorFactory::create(params);
ProjectorFactory::create(projector_params.value());
if (!projection_model) {
LOG(ERROR) << "Projection model could not be created.";
LOG(ERROR) << "Creating projection model failed.";
return nullptr;
}

@@ -75,11 +81,18 @@ std::unique_ptr<IntegratorBase> IntegratorFactory::create(
std::make_shared<Image<Vector2D>>(projection_model->getDimensions());

// Create the measurement model
const auto measurement_params = params.getChild("measurement_model");
if (!measurement_params) {
LOG(ERROR) << "No params with key \"measurement_model\". "
"Measurement model could not be created.";
return nullptr;
}
std::shared_ptr<MeasurementModelBase> measurement_model =
MeasurementModelFactory::create(params, projection_model,
posed_range_image, beam_offset_image);
MeasurementModelFactory::create(measurement_params.value(),
projection_model, posed_range_image,
beam_offset_image);
if (!measurement_model) {
LOG(ERROR) << "Measurement model could not be created.";
LOG(ERROR) << "Creating measurement model failed.";
return nullptr;
}

Original file line number Diff line number Diff line change
@@ -11,8 +11,7 @@ std::unique_ptr<MeasurementModelBase> wavemap::MeasurementModelFactory::create(
const param::Value& params, ProjectorBase::ConstPtr projection_model,
Image<>::ConstPtr range_image, Image<Vector2D>::ConstPtr beam_offset_image,
std::optional<MeasurementModelType> default_measurement_model_type) {
if (const auto type = MeasurementModelType::from(params, "measurement_model");
type) {
if (const auto type = MeasurementModelType::from(params); type) {
return create(type.value(), std::move(projection_model),
std::move(range_image), std::move(beam_offset_image), params);
}
@@ -36,9 +35,7 @@ std::unique_ptr<MeasurementModelBase> wavemap::MeasurementModelFactory::create(
Image<Vector2D>::ConstPtr beam_offset_image, const param::Value& params) {
switch (measurement_model_type) {
case MeasurementModelType::kContinuousRay: {
if (const auto config =
ContinuousRayConfig::from(params, "measurement_model");
config) {
if (const auto config = ContinuousRayConfig::from(params); config) {
return std::make_unique<ContinuousRay>(config.value(),
std::move(projection_model),
std::move(range_image));
@@ -49,9 +46,7 @@ std::unique_ptr<MeasurementModelBase> wavemap::MeasurementModelFactory::create(
}
}
case MeasurementModelType::kContinuousBeam: {
if (const auto config =
ContinuousBeamConfig::from(params, "measurement_model");
config) {
if (const auto config = ContinuousBeamConfig::from(params); config) {
return std::make_unique<ContinuousBeam>(
config.value(), std::move(projection_model), std::move(range_image),
std::move(beam_offset_image));
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ namespace wavemap {
std::unique_ptr<ProjectorBase> wavemap::ProjectorFactory::create(
const param::Value& params,
std::optional<ProjectorType> default_projector_type) {
if (const auto type = ProjectorType::from(params, "projection_model"); type) {
if (const auto type = ProjectorType::from(params); type) {
return create(type.value(), params);
}

@@ -28,28 +28,23 @@ std::unique_ptr<ProjectorBase> wavemap::ProjectorFactory::create(
ProjectorType projector_type, const param::Value& params) {
switch (projector_type) {
case ProjectorType::kSphericalProjector: {
if (const auto config =
SphericalProjectorConfig::from(params, "projection_model");
config) {
if (const auto config = SphericalProjectorConfig::from(params); config) {
return std::make_unique<SphericalProjector>(config.value());
} else {
LOG(ERROR) << "Spherical projector config could not be loaded.";
return nullptr;
}
}
case ProjectorType::kOusterProjector: {
if (const auto config =
OusterProjectorConfig::from(params, "projection_model");
config) {
if (const auto config = OusterProjectorConfig::from(params); config) {
return std::make_unique<OusterProjector>(config.value());
} else {
LOG(ERROR) << "Ouster projector config could not be loaded.";
return nullptr;
}
}
case ProjectorType::kPinholeCameraProjector: {
if (const auto config =
PinholeCameraProjectorConfig::from(params, "projection_model");
if (const auto config = PinholeCameraProjectorConfig::from(params);
config) {
return std::make_unique<PinholeCameraProjector>(config.value());
} else {
Loading