diff --git a/CMakeLists.txt b/CMakeLists.txt index 5852d8c..56669be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,3 +15,8 @@ add_subdirectory(gui) add_subdirectory(python-wrapper) +if (WITH_TESTS) + +#add_subdirectory(tests) + +endif() diff --git a/api/CMakeLists.txt b/api/CMakeLists.txt index ff5fe37..a916b27 100644 --- a/api/CMakeLists.txt +++ b/api/CMakeLists.txt @@ -9,7 +9,7 @@ SET(CMAKE_AUTOMOC ON) SET(CMAKE_AUTOUIC ON) find_package(Qt6 COMPONENTS Core REQUIRED) -find_package(Eigen3 3.3 REQUIRED NO_MODULE) +find_package(Eigen3 3.3 REQUIRED) find_package(cppitertools) if(DEFINED GEOMETRY_API) @@ -85,7 +85,7 @@ set_target_properties(dsr_api PROPERTIES # set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address") # set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address") -target_compile_options(dsr_api PUBLIC -O1 -O3 -fmax-errors=5 -std=c++20 -fno-char8_t) +target_compile_options(dsr_api PUBLIC -g -O3 -fmax-errors=5 -std=c++20 -fno-char8_t) # 'make install' to the correct locations (provided by GNUInstallDirs). diff --git a/api/dsr_rt_api.cpp b/api/dsr_rt_api.cpp index 97b9658..1966975 100644 --- a/api/dsr_rt_api.cpp +++ b/api/dsr_rt_api.cpp @@ -252,7 +252,7 @@ void RT_API::insert_or_assign_edge_RT(Node &n, uint64_t to, const std::vector from: IDL::MvregEdge, to: vector std::tie(r1, node1_insert, std::ignore) = G->insert_or_assign_edge_(std::move(e), n.id(), to); @@ -373,7 +373,7 @@ void RT_API::insert_or_assign_edge_RT(Node &n, uint64_t to, std::vector & to_n = G->get_(to).value(); if (auto x = G->get_crdt_attrib_by_name(to_n.value()); x.has_value()) { - if ( x.value() != n.id()) + if (x.value() != n.id()) { no_send = !G->modify_attrib_local(to_n.value(), n.id()); } @@ -396,7 +396,7 @@ void RT_API::insert_or_assign_edge_RT(Node &n, uint64_t to, std::vector & } //Check if RT edge exist. - if (n.fano().find({to, "RT"}) == n.fano().end()) + if (!n.fano().contains({to, "RT"})) { //Create -> from: IDL::MvregEdge, to: vector std::tie(r1, node1_insert, std::ignore) = G->insert_or_assign_edge_(std::move(e), n.id(), to); diff --git a/api/include/dsr/api/dsr_agent_info_api.h b/api/include/dsr/api/dsr_agent_info_api.h index 63038e9..a8ea00d 100644 --- a/api/include/dsr/api/dsr_agent_info_api.h +++ b/api/include/dsr/api/dsr_agent_info_api.h @@ -5,12 +5,13 @@ #ifndef DSR_AGENTINFO_API_H #define DSR_AGENTINFO_API_H -#include +#include #include #include #include #include #include +#include namespace DSR { diff --git a/api/include/dsr/api/dsr_eigen_defs.h b/api/include/dsr/api/dsr_eigen_defs.h index 0488f0d..8da8199 100644 --- a/api/include/dsr/api/dsr_eigen_defs.h +++ b/api/include/dsr/api/dsr_eigen_defs.h @@ -2,8 +2,8 @@ // Created by pbustos on 1/10/20. // -#ifndef CACA_DSR_EIGEN_DEFS_H -#define CACA_DSR_EIGEN_DEFS_H +#ifndef DSR_EIGEN_DEFS_H +#define DSR_EIGEN_DEFS_H #include @@ -20,4 +20,4 @@ namespace Mat using Mat44d = Eigen::Matrix; }; -#endif //CACA_DSR_EIGEN_DEFS_H +#endif //DSR_EIGEN_DEFS_H diff --git a/api/include/dsr/api/dsr_rt_api.h b/api/include/dsr/api/dsr_rt_api.h index efbae37..ab696e5 100644 --- a/api/include/dsr/api/dsr_rt_api.h +++ b/api/include/dsr/api/dsr_rt_api.h @@ -23,7 +23,8 @@ namespace DSR void insert_or_assign_edge_RT(Node &n, uint64_t to, const std::vector &trans, const std::vector &rot_euler); void insert_or_assign_edge_RT(Node &n, uint64_t to, std::vector &&trans, std::vector &&rot_euler); - std::optional get_edge_RT(const Node &n, uint64_t to); + + static std::optional get_edge_RT(const Node &n, uint64_t to); std::optional get_RT_pose_from_parent(const Node &n); std::optional get_edge_RT_as_rtmat(const Edge &edge, std::uint64_t timestamp = 0); std::optional get_translation(const Node &n, uint64_t to, std::uint64_t timestamp = 0); diff --git a/python-wrapper/CMakeLists.txt b/python-wrapper/CMakeLists.txt index 83bb3a6..392f86d 100644 --- a/python-wrapper/CMakeLists.txt +++ b/python-wrapper/CMakeLists.txt @@ -6,8 +6,14 @@ project(python_wrapper find_package(Qt6 COMPONENTS Core REQUIRED) find_package(Eigen3 3.3 REQUIRED NO_MODULE) -find_package(PythonLibs REQUIRED) -find_package(Python3) +#find_package(PythonLibs REQUIRED) +#find_package(Python3) + + +set(Python3_SITEARCH "/usr/local/lib/python3.10/dist-packages") +set(PYTHON_LIBRARIES "/usr/lib/x86_64-linux-gnu/libpython3.10.so") +set(PYTHON_INCLUDE_DIRS "/usr/include/python3.10") + find_package(pybind11 CONFIG REQUIRED) add_library(pydsr MODULE) diff --git a/python-wrapper/python_api.cpp b/python-wrapper/python_api.cpp index e18df44..2baa09f 100644 --- a/python-wrapper/python_api.cpp +++ b/python-wrapper/python_api.cpp @@ -654,7 +654,7 @@ PYBIND11_MODULE(pydsr, m) { ) { self.insert_or_assign_edge_RT(n, to, translation, rotation_euler); }, "node"_a, "to"_a, "trans"_a, "rot_euler"_a) - .def("get_edge_RT", &RT_API::get_edge_RT, "node"_a, "to"_a) + .def_static("get_edge_RT", &RT_API::get_edge_RT, "node"_a, "to"_a) .def("get_RT_pose_from_parent", [](RT_API &self, Node &e) -> std::optional> { auto tmp = self.get_RT_pose_from_parent(e); if (tmp.has_value()) {