-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
56 changed files
with
630 additions
and
791 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#[[ | ||
core | ||
]] | ||
|
||
add_subdirectory(linalg) | ||
add_subdirectory(lie) | ||
add_subdirectory(image) | ||
add_subdirectory(sensor) | ||
add_subdirectory(geometry) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
farm_ng_add_library(farm_ng_core_proto_conv_geometry | ||
NAMESPACE farm_ng_core | ||
INCLUDE_DIR ../../.. | ||
HEADERS | ||
conv.h | ||
SOURCES | ||
conv.cpp | ||
) | ||
|
||
target_link_libraries(farm_ng_core_proto_conv_geometry PUBLIC | ||
sophus_lie | ||
protobuf::libprotobuf | ||
farm_ng_core::farm_ng_core_prototools | ||
farm_ng_core_proto_defs | ||
farm_ng_core::farm_ng_core_proto_conv_linalg) | ||
|
||
if(${BUILD_SOPHUS_TESTS}) | ||
farm_ng_add_test(conv | ||
PARENT_LIBRARY farm_ng_core_proto_conv_geometry | ||
LINK_LIBRARIES farm_ng_core_proto_conv_geometry | ||
LABELS small) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright 2022, farm-ng inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include "farm_ng/core/proto_conv/geometry/conv.h" | ||
|
||
#include "farm_ng/core/proto_conv/linalg/conv.h" | ||
|
||
namespace farm_ng::core { | ||
|
||
Expected<sophus::UnitVector3F64> fromProto(proto::UnitVec3F64 const& proto) { | ||
return sophus::UnitVector3F64::tryFromUnitVector(fromProto(proto.vec3())); | ||
} | ||
|
||
proto::UnitVec3F64 toProto(sophus::UnitVector3F64 const& uvec) { | ||
proto::UnitVec3F64 proto; | ||
*proto.mutable_vec3() = toProto(uvec.params()); | ||
return proto; | ||
} | ||
|
||
Expected<Eigen::Hyperplane<double, 3>> fromProto( | ||
proto::Hyperplane3F64 const& proto) { | ||
SOPHUS_TRY(sophus::UnitVector3F64, normal, fromProto(proto.normal())); | ||
return Eigen::Hyperplane<double, 3>{normal.params(), proto.offset()}; | ||
} | ||
|
||
proto::Hyperplane3F64 toProto(Eigen::Hyperplane<double, 3> const& plane) { | ||
proto::Hyperplane3F64 proto; | ||
*proto.mutable_normal() = | ||
toProto(sophus::UnitVector3F64::fromVectorAndNormalize(plane.normal())); | ||
proto.set_offset(plane.offset()); | ||
return proto; | ||
} | ||
|
||
} // namespace farm_ng::core |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright 2022, farm-ng inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#pragma once | ||
|
||
#include "farm_ng/core/geometry.pb.h" | ||
#include "sophus/geometry/ray.h" | ||
|
||
namespace farm_ng::core { | ||
|
||
Expected<sophus::UnitVector3F64> fromProto(proto::UnitVec3F64 const& proto); | ||
proto::UnitVec3F64 toProto(sophus::UnitVector3F64 const& uvec); | ||
|
||
Expected<Eigen::Hyperplane<double, 3>> fromProto( | ||
proto::Hyperplane3F64 const& proto); | ||
proto::Hyperplane3F64 toProto(Eigen::Hyperplane<double, 3> const& plane); | ||
|
||
} // namespace farm_ng::core |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright 2022, farm-ng inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include "farm_ng/core/proto_conv/lie/conv.h" | ||
|
||
#include <gtest/gtest.h> | ||
|
||
using namespace sophus; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
farm_ng_add_library(farm_ng_core_proto_conv_image | ||
NAMESPACE farm_ng_core | ||
INCLUDE_DIR ../../.. | ||
HEADERS | ||
conv.h | ||
SOURCES | ||
conv.cpp | ||
) | ||
|
||
target_link_libraries(farm_ng_core_proto_conv_image PUBLIC | ||
Sophus::sophus_linalg | ||
protobuf::libprotobuf | ||
farm_ng_core::farm_ng_core_proto_defs | ||
farm_ng_core::farm_ng_core_prototools | ||
farm_ng_core::farm_ng_core_proto_conv_linalg | ||
sophus_image | ||
) | ||
|
||
if(${BUILD_SOPHUS_TESTS}) | ||
farm_ng_add_test(conv | ||
PARENT_LIBRARY farm_ng_core_proto_conv_image | ||
LINK_LIBRARIES farm_ng_core_proto_conv_image | ||
LABELS small) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 13 additions & 7 deletions
20
cpp/sophus/image/proto/conv_test.cpp → ...rm_ng/core/proto_conv/image/conv_test.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
farm_ng_add_library(farm_ng_core_proto_conv_lie | ||
NAMESPACE farm_ng_core | ||
INCLUDE_DIR ../../.. | ||
HEADERS | ||
conv.h | ||
SOURCES | ||
conv.cpp | ||
) | ||
|
||
target_link_libraries(farm_ng_core_proto_conv_lie PUBLIC | ||
Sophus::sophus_lie | ||
protobuf::libprotobuf | ||
farm_ng_core::farm_ng_core_proto_conv_linalg | ||
farm_ng_core::farm_ng_core_prototools | ||
) | ||
|
||
|
||
if(${BUILD_SOPHUS_TESTS}) | ||
farm_ng_add_test(conv | ||
PARENT_LIBRARY farm_ng_core_proto_conv_lie | ||
LINK_LIBRARIES farm_ng_core_proto_conv_lie | ||
LABELS small) | ||
endif() |
Oops, something went wrong.