Skip to content
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

[RSDK-7151] Update analog reader responses to include accuracy data #237

Merged
merged 9 commits into from
May 20, 2024

Conversation

penguinland
Copy link
Member

Surprisingly, we don't need a protobuf update (from viamrobotics/api#492) because we're already using the new protobufs and have just been ignoring the extra data they hold!

Everything compiles and the tests all pass, though I haven't tried it out more than that.

@penguinland penguinland requested a review from a team as a code owner May 14, 2024 19:14
@penguinland penguinland requested review from njooma and purplenicole730 and removed request for a team May 14, 2024 19:14
Copy link
Member

@acmorrow acmorrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wandering by, do with these comments what you like.

src/viam/sdk/components/board.cpp Outdated Show resolved Hide resolved
src/viam/sdk/components/board.cpp Outdated Show resolved Hide resolved
src/viam/sdk/components/private/board_client.cpp Outdated Show resolved Hide resolved
src/viam/sdk/components/board.cpp Outdated Show resolved Hide resolved
Copy link
Member

@purplenicole730 purplenicole730 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drew's comments can clean up the code a bit, but otherwise, LGTM!

Copy link
Member Author

@penguinland penguinland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've resolved my tension between statuses holding just an int32 while the analog responses now hold 4 pieces of data: keep statuses as just an int32, and only change the return type when reading analogs! This got rid of half the things Drew suggested needed fixing, and I like the design better. Take another look!

@@ -103,8 +103,11 @@ ::grpc::Status BoardServer::ReadAnalogReader(
extra = struct_to_map(request->extra());
}

const Board::analog_value result = board->read_analog(request->analog_reader_name(), extra);
response->set_value(result);
const Board::analog_response result = board->read_analog(request->analog_reader_name(), extra);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I named the type analog_response, but named all the variables result. Should the type be analog_result instead? I'm unsure...

@penguinland
Copy link
Member Author

The CI build is failing with Failure: decode buf.lock: no digest specified for module buf.build/googleapis/googleapis, and retrying the tests leads to the same error. Any idea what changed? I didn't think I had touched that. and it builds fine on my local machine (mkdir build; cd build; cmake .. -G Ninja; ninja -j 5 all), so I can't reproduce the problem.

@stuqdog
Copy link
Member

stuqdog commented May 20, 2024

The CI build is failing with Failure: decode buf.lock: no digest specified for module buf.build/googleapis/googleapis, and retrying the tests leads to the same error. Any idea what changed? I didn't think I had touched that. and it builds fine on my local machine (mkdir build; cd build; cmake .. -G Ninja; ninja -j 5 all), so I can't reproduce the problem.

@penguinland not sure what's going on with this but it's not a problem on your end; it's popping up in other PRs as well. I'll investigate.

Edit: okay I'm pretty sure I have a fix, confirming now then will merge it into main.

@penguinland
Copy link
Member Author

Yup, I rebased off of main and everything works now! Thanks for looking into it.

@penguinland penguinland merged commit ea566a0 into viamrobotics:main May 20, 2024
3 checks passed
@penguinland penguinland deleted the analog_reader_accuracy branch May 20, 2024 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants