You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[RSDK-11093] Make a vision.NewService() function that isn't deprecated (#5096)
Adwait and I pair programmed this; thanks for his help!
The main changes are:
- The `vizModel` struct no longer stores a `robot.Robot` within it. Instead, it stores a `logging.Logger` and a function that takes camera names and returns camera objects.
- The old `NewService()` function has been renamed `DeprecatedNewService()`. Like before, it takes a `robot.Robot` as an argument, and can be used with `DeprecatedRobotConstructor` when registering a service.
- There is a new function now named `NewService()`. It takes a `resource.Dependencies` as an object, and can be used with `Constructor` when registering a service.
- The file `deprecated_vision_service_builder.go` (created in #5094) has been renamed to non-deprecated `vision_service_builder.go`
This compiles and the tests pass, and the mlmodel vision service still works. However, nothing (yet) uses the new, non-deprecated `NewService()`. That can happen in future PRs.
We have created a new function with a new type signature using an old name. However, we don't need to worry about someone outside of RDK using this function in their module and having the module break when they upgrade RDK versions: the reason RSDK-11093 was filed in the first place was that the old code was not usable in modules at all, because `DeprecatedNewService()` doesn't play well with modules!
0 commit comments