diff --git a/conanfile.py b/conanfile.py index 574ad5450..1fef0b57d 100644 --- a/conanfile.py +++ b/conanfile.py @@ -65,6 +65,15 @@ def generate(self): tc.cache_variables["VIAMCPPSDK_OFFLINE_PROTO_GENERATION"] = self.options.offline_proto_generation tc.cache_variables["VIAMCPPSDK_USE_DYNAMIC_PROTOS"] = True + # We don't want to constrain these for conan builds because we + # don't know the context where we might be being built. We + # should permit the build if it works. Also, even the C++ SDK + # is warnings clean on the modern compilers we use in CI, it, + # or headers from its dependencies, might throw warnings with + # older compilers, and we should still allow a build there. + tc.cache_variables["VIAMCPPSDK_ENFORCE_COMPILER_MINIMA"] = False + tc.cache_variables["VIAMCPPSDK_USE_WALL_WERROR"] = False + tc.cache_variables["VIAMCPPSDK_BUILD_TESTS"] = False tc.cache_variables["VIAMCPPSDK_BUILD_EXAMPLES"] = False diff --git a/src/viam/sdk/services/motion.cpp b/src/viam/sdk/services/motion.cpp index 286d8a64d..072e31065 100644 --- a/src/viam/sdk/services/motion.cpp +++ b/src/viam/sdk/services/motion.cpp @@ -22,10 +22,6 @@ bool operator==(const obstacle_detector& lhs, const obstacle_detector& rhs) { return lhs.vision_service == rhs.vision_service && lhs.camera == rhs.camera; } -bool operator==(const Motion::steps& lhs, const Motion::steps& rhs) { - return lhs.steps == rhs.steps; -} - bool operator==(const Motion::plan_status& lhs, const Motion::plan_status& rhs) { return std::tie(lhs.reason, lhs.state, lhs.timestamp) == std::tie(rhs.reason, rhs.state, rhs.timestamp); diff --git a/src/viam/sdk/services/motion.hpp b/src/viam/sdk/services/motion.hpp index 32055cdb5..8da6ee637 100644 --- a/src/viam/sdk/services/motion.hpp +++ b/src/viam/sdk/services/motion.hpp @@ -113,19 +113,10 @@ class Motion : public Service { friend bool operator==(const plan_status_with_id& lhs, const plan_status_with_id& rhs); }; - /// @struct steps - /// @brief An ordered list of plan steps. + /// @brief An individual "step", representing the state each component (keyed as a fully + /// qualified component name) should reach while executing that step of the plan. /// @ingroup Motion - struct steps { - /// @brief An individual "step", representing the state each component (keyed as a fully - /// qualified component name) should reach while executing that step of the plan. - typedef std::unordered_map step; - - /// @brief The ordered list of steps. - std::vector steps; - - friend bool operator==(const struct steps& lhs, const struct steps& rhs); - }; + using step = std::unordered_map; /// @struct plan /// @brief Describes a motion plan. @@ -142,7 +133,7 @@ class Motion : public Service { std::string execution_id; /// @brief An ordered list of plan steps. - struct steps steps; + std::vector steps; friend bool operator==(const plan& lhs, const plan& rhs); }; diff --git a/src/viam/sdk/services/private/motion_client.cpp b/src/viam/sdk/services/private/motion_client.cpp index 8dbccc13a..eddcd959e 100644 --- a/src/viam/sdk/services/private/motion_client.cpp +++ b/src/viam/sdk/services/private/motion_client.cpp @@ -137,19 +137,18 @@ Motion::plan_status_with_id from_proto(const service::motion::v1::PlanStatusWith return pswi; } -Motion::steps steps_from_proto( +std::vector steps_from_proto( const google::protobuf::RepeatedPtrField& proto) { - using step = Motion::steps::step; - std::vector steps; + std::vector steps; for (const auto& ps : proto) { - step step; + Motion::step step; for (const auto& component : ps.step()) { step.emplace(component.first, from_proto(component.second.pose())); } steps.push_back(std::move(step)); } - return {steps}; + return steps; } Motion::plan plan_from_proto(const service::motion::v1::Plan& proto) { diff --git a/src/viam/sdk/services/private/motion_server.cpp b/src/viam/sdk/services/private/motion_server.cpp index e393cfca3..9874dc604 100644 --- a/src/viam/sdk/services/private/motion_server.cpp +++ b/src/viam/sdk/services/private/motion_server.cpp @@ -51,7 +51,7 @@ service::motion::v1::PlanStatus to_proto(const Motion::plan_status& ps) { return proto; } -service::motion::v1::PlanStep to_proto(const Motion::steps::step& step) { +service::motion::v1::PlanStep to_proto(const Motion::step& step) { service::motion::v1::PlanStep proto; for (const auto& kv : step) { service::motion::v1::ComponentState cs; @@ -67,7 +67,7 @@ service::motion::v1::Plan to_proto(const Motion::plan& plan) { *proto.mutable_id() = plan.id; *proto.mutable_component_name() = to_proto(plan.component_name); *proto.mutable_execution_id() = plan.execution_id; - for (const auto& step : plan.steps.steps) { + for (const auto& step : plan.steps) { *proto.mutable_steps()->Add() = to_proto(step); }