-
Notifications
You must be signed in to change notification settings - Fork 126
split vizModel to a separate file #5094
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
Conversation
|
Warning your change may break code samples. If your change modifies any of the following functions please contact @viamrobotics/fleet-management. Thanks!
|
|
When this is merged, we'll change penguinland#1 to be a PR into the main fork, and it'll be easier to review than jumbling it all together in here. |
|
Github_actions_bot is overzealous: although I touched the file that defines |
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.
This all looks fine, and since it is just a move over of files without logic changes I think it s good to go.
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.
Yeah sure
#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!
vision.go was super long, and half of it was unrelated to the other half. So, it's now 2 files. This will make it easier to think about fixing RDSK-11093, which is about updating
vision.NewService()to not use the deprecated constructor.No changes to functionality are intended: I just took a file and split it in half.