Skip to content

Implement ROS services using SDK#369

Merged
ericmlujan merged 9 commits intomainfrom
eric/sdk-services
Jul 22, 2025
Merged

Implement ROS services using SDK#369
ericmlujan merged 9 commits intomainfrom
eric/sdk-services

Conversation

@ericmlujan
Copy link
Contributor

Changelog

None

Docs

None

Description

Migrate service functionality to use the Foxglove SDK.

GenericClient code was updated to use foxglove::Responder directly instead of storing std::function instances for callbacks, as move-only Responder objects now handle responding to the client, and lambdas that capture them are not convertible to std::function. This also obviated the need to handle futures/promises in the GenericClient, and now-dead future code was removed.

Services unit tests now pass, which means all unit tests are now enabled and passing 🎉

Fixes: FG-12234

@linear
Copy link

linear bot commented Jul 21, 2025

@ericmlujan ericmlujan requested a review from achim-k July 21, 2025 21:07
Copy link
Collaborator

@achim-k achim-k left a comment

Choose a reason for hiding this comment

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

Services unit tests now pass, which means all unit tests are now enabled and passing 🎉

🎉🎉


if (j.find("request") != j.end() && j["request"].find("schema") != j["request"].end()) {
p.requestSchema = j["request"]["schema"].get<std::string>();
} else if (j.find("requestSchema") != j.end()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should no longer support the deprecated requestSchema and responseSchema fields

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will update to throw an error

}
for (auto serviceId : servicesToRemove) {
_advertisedServices.erase(serviceId);
for (auto serviceName : servicesToRemove) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
for (auto serviceName : servicesToRemove) {
for (const auto& serviceName : servicesToRemove) {

otherwise you are making a copy of every string

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch

@ericmlujan ericmlujan enabled auto-merge (squash) July 22, 2025 16:10
@ericmlujan ericmlujan merged commit d25009a into main Jul 22, 2025
14 checks passed
@ericmlujan ericmlujan deleted the eric/sdk-services branch July 22, 2025 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants