Skip to content

Conversation

@penguinland
Copy link
Member

@AGanguly13 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 split vizModel to a separate file #5094) has been renamed to non-deprecated vision_service_builder.go

This compiles and the tests pass, but I haven't tried it out in more detail than that. In particular, nothing (yet) uses the non-deprecated NewService(). That can happen in future PRs, unless you want me to migrate some of the services over immediately.

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!

@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label Jun 30, 2025
Copy link
Contributor

@AGanguly13 AGanguly13 left a comment

Choose a reason for hiding this comment

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

Made small comments, otherwise LGTM!

@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 Jun 30, 2025
@penguinland
Copy link
Member Author

Very good feedback! I've done all 3 suggestions.

Copy link
Member

@bhaney bhaney left a comment

Choose a reason for hiding this comment

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

One thing I'd like you to test out is making sure that the mlmodel vision service (our most used vision service) still work as expected.

If you could locally compile and run a viam-server instance and check that our vision service runs as expected (both mlmodel and color-detector) then it will look good to me

@penguinland
Copy link
Member Author

Tried locally: yes, the mlmodel vision service still appears to work normally!

@penguinland penguinland merged commit e5940ec into viamrobotics:main Jul 1, 2025
18 checks passed
@penguinland penguinland deleted the deprecate_vision_service branch July 1, 2025 19:50
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.

4 participants