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-8885] Allow DiscoverComponents API to play well with modules #4410

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

hexbabe
Copy link
Member

@hexbabe hexbabe commented Oct 1, 2024

RSDK-8885

This PR solves the bug listed in the above ticket by extending Module to serve robot level APIs. We implement DiscoverComponents and consume it by making each module in manager.go have a client object that can make robot level API calls.

Added a simple unit test that tests that a Discover func was registered for the complex module example

Tested locally by giving a local version of all the models in viamrtsp a foo Discover func. Used a Go SDK client to query DiscoverComponents for the models, and got back

2024-10-01T14:29:01.252-0400    DEBUG   client.networking.webrtc        zap/options.go:212      finished client unary call      {"system": "grpc", "span.kind": "client", "grpc.service": "viam.robot.v1.RobotService", "grpc.method": "StartSession", "grpc.code": "OK", "grpc.time_ms": 0.337}
2024-10-01T14:29:01.252-0400    DEBUG   client.networking.webrtc        zap/options.go:212      finished client unary call      {"system": "grpc", "span.kind": "client", "grpc.service": "viam.robot.v1.RobotService", "grpc.method": "DiscoverComponents", "grpc.code": "OK", "grpc.time_ms": 1.038}
2024-10-01T18:29:01.252Z        INFO    client  go-sdk-client/client.go:64      map[discovery:[map[query:map[model:viam:viamrtsp:rtsp-mjpeg subtype:rdk:component:camera] results:map[fields:map[foo:map[Kind:map[StringValue:bar]]]]]]]

@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label Oct 1, 2024
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Oct 1, 2024
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Oct 1, 2024
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test This pull request is marked safe to test from a trusted zone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants