Skip to content

Conversation

@penguinland
Copy link
Member

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.

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

Warning your change may break code samples. If your change modifies any of the following functions please contact @viamrobotics/fleet-management. Thanks!

component function
base IsMoving
board GPIOPinByName
camera Properties
encoder Properties
motor IsMoving
sensor Readings
servo Position
arm EndPosition
audio MediaProperties
gantry Lengths
gripper IsMoving
input_controller Controls
movement_sensor LinearAcceleration
power_sensor Power
pose_tracker Poses
motion GetPose
vision GetProperties

@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

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.

@penguinland
Copy link
Member Author

Github_actions_bot is overzealous: although I touched the file that defines vision.GetProperties(), I did not modify that function itself.

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.

This all looks fine, and since it is just a move over of files without logic changes I think it s good to go.

Copy link
Member

@kharijarrett kharijarrett left a comment

Choose a reason for hiding this comment

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

Yeah sure

@penguinland penguinland merged commit 3715f4c into viamrobotics:main Jun 30, 2025
18 checks passed
penguinland added a commit that referenced this pull request Jul 1, 2025
#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!
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