Skip to content

Commit 7ba50e0

Browse files
authoredApr 14, 2025··
[RSDK-10385] Don't enforce compiler minima or complain about warnings for conan builds (#411)
1 parent dd78a44 commit 7ba50e0

File tree

5 files changed

+19
-24
lines changed

5 files changed

+19
-24
lines changed
 

‎conanfile.py

+9
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@ def generate(self):
6565
tc.cache_variables["VIAMCPPSDK_OFFLINE_PROTO_GENERATION"] = self.options.offline_proto_generation
6666
tc.cache_variables["VIAMCPPSDK_USE_DYNAMIC_PROTOS"] = True
6767

68+
# We don't want to constrain these for conan builds because we
69+
# don't know the context where we might be being built. We
70+
# should permit the build if it works. Also, even the C++ SDK
71+
# is warnings clean on the modern compilers we use in CI, it,
72+
# or headers from its dependencies, might throw warnings with
73+
# older compilers, and we should still allow a build there.
74+
tc.cache_variables["VIAMCPPSDK_ENFORCE_COMPILER_MINIMA"] = False
75+
tc.cache_variables["VIAMCPPSDK_USE_WALL_WERROR"] = False
76+
6877
tc.cache_variables["VIAMCPPSDK_BUILD_TESTS"] = False
6978
tc.cache_variables["VIAMCPPSDK_BUILD_EXAMPLES"] = False
7079

‎src/viam/sdk/services/motion.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ bool operator==(const obstacle_detector& lhs, const obstacle_detector& rhs) {
2222
return lhs.vision_service == rhs.vision_service && lhs.camera == rhs.camera;
2323
}
2424

25-
bool operator==(const Motion::steps& lhs, const Motion::steps& rhs) {
26-
return lhs.steps == rhs.steps;
27-
}
28-
2925
bool operator==(const Motion::plan_status& lhs, const Motion::plan_status& rhs) {
3026
return std::tie(lhs.reason, lhs.state, lhs.timestamp) ==
3127
std::tie(rhs.reason, rhs.state, rhs.timestamp);

‎src/viam/sdk/services/motion.hpp

+4-13
Original file line numberDiff line numberDiff line change
@@ -113,19 +113,10 @@ class Motion : public Service {
113113
friend bool operator==(const plan_status_with_id& lhs, const plan_status_with_id& rhs);
114114
};
115115

116-
/// @struct steps
117-
/// @brief An ordered list of plan steps.
116+
/// @brief An individual "step", representing the state each component (keyed as a fully
117+
/// qualified component name) should reach while executing that step of the plan.
118118
/// @ingroup Motion
119-
struct steps {
120-
/// @brief An individual "step", representing the state each component (keyed as a fully
121-
/// qualified component name) should reach while executing that step of the plan.
122-
typedef std::unordered_map<std::string, pose> step;
123-
124-
/// @brief The ordered list of steps.
125-
std::vector<step> steps;
126-
127-
friend bool operator==(const struct steps& lhs, const struct steps& rhs);
128-
};
119+
using step = std::unordered_map<std::string, pose>;
129120

130121
/// @struct plan
131122
/// @brief Describes a motion plan.
@@ -142,7 +133,7 @@ class Motion : public Service {
142133
std::string execution_id;
143134

144135
/// @brief An ordered list of plan steps.
145-
struct steps steps;
136+
std::vector<step> steps;
146137

147138
friend bool operator==(const plan& lhs, const plan& rhs);
148139
};

‎src/viam/sdk/services/private/motion_client.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -137,19 +137,18 @@ Motion::plan_status_with_id from_proto(const service::motion::v1::PlanStatusWith
137137
return pswi;
138138
}
139139

140-
Motion::steps steps_from_proto(
140+
std::vector<Motion::step> steps_from_proto(
141141
const google::protobuf::RepeatedPtrField<service::motion::v1::PlanStep>& proto) {
142-
using step = Motion::steps::step;
143-
std::vector<step> steps;
142+
std::vector<Motion::step> steps;
144143
for (const auto& ps : proto) {
145-
step step;
144+
Motion::step step;
146145
for (const auto& component : ps.step()) {
147146
step.emplace(component.first, from_proto(component.second.pose()));
148147
}
149148
steps.push_back(std::move(step));
150149
}
151150

152-
return {steps};
151+
return steps;
153152
}
154153

155154
Motion::plan plan_from_proto(const service::motion::v1::Plan& proto) {

‎src/viam/sdk/services/private/motion_server.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ service::motion::v1::PlanStatus to_proto(const Motion::plan_status& ps) {
5151
return proto;
5252
}
5353

54-
service::motion::v1::PlanStep to_proto(const Motion::steps::step& step) {
54+
service::motion::v1::PlanStep to_proto(const Motion::step& step) {
5555
service::motion::v1::PlanStep proto;
5656
for (const auto& kv : step) {
5757
service::motion::v1::ComponentState cs;
@@ -67,7 +67,7 @@ service::motion::v1::Plan to_proto(const Motion::plan& plan) {
6767
*proto.mutable_id() = plan.id;
6868
*proto.mutable_component_name() = to_proto(plan.component_name);
6969
*proto.mutable_execution_id() = plan.execution_id;
70-
for (const auto& step : plan.steps.steps) {
70+
for (const auto& step : plan.steps) {
7171
*proto.mutable_steps()->Add() = to_proto(step);
7272
}
7373

0 commit comments

Comments
 (0)
Please sign in to comment.