-
Notifications
You must be signed in to change notification settings - Fork 23
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
MovementSensor #143
MovementSensor #143
Conversation
09102ce
to
ddee5d0
Compare
// uses). | ||
struct orientation { | ||
double o_x, o_y, o_z, theta; | ||
// TODO(pre-merge) move the to/from protos in here. Nicer that way |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe? I saw you do this for some other methods? I kept the current way with everything in the component..
Not sure what the plan is
std::unordered_map<std::string, float> result = movementsensor->get_accuracy(extra); | ||
response->mutable_accuracy()->empty(); | ||
for (const auto& i : result) { | ||
response->mutable_accuracy()->emplace(i.first, i.second); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strangely this like works on my laptop but does not in CI. Different proto versions maybe?
/tmp/src/viam/sdk/components/movementsensor/server.cpp:216:39: error: no member named 'emplace' in 'google::protobuf::Map<std::basic_string<char>, float>' [clang-diagnostic-error]
response->mutable_accuracy()->emplace(i.first, i.second);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, almost certainly different proto version. I remember encountering this same issue when working on the MLModel stuff and had to stop using emplace
.
Implemented in #171 |
Howdy!
I needed MovementSensor bindings for a personal project so I created them.
I don't have time to polish this up and bring it through a PR, but I thought I would share the code in case someone wanted to take it from here. If everyone is busy, that is fine too! Just thought I should share.
There are a few things to figure out (and the linter is complaining about a few missing
const
s), but the general structure is there and the tests pass on my machine...Weirdest part of this PR is that the file is named
movementsensor/movementsensor.hpp
.Pros of
movementsensor.hpp
:movementsensor.go
movementsensor.proto
movementsensor
, notmovement_sensor
Cons of
movementsensor.hpp
:movement_sensor.hpp
would be easier to read and would make more sensemovement_sensor.py
movement-sensor.ts