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

Move more of the videosource code to the videosourcewrappers file #4366

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

randhid
Copy link
Member

@randhid randhid commented Sep 16, 2024

This pr simply moves code around so that the structs implementing videosources are all in one file.

@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label Sep 16, 2024
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

Copy link
Member

@hexbabe hexbabe left a comment

Choose a reason for hiding this comment

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

No weird build flag interference here?

@randhid
Copy link
Member Author

randhid commented Sep 16, 2024

No weird build flag interference here?

Not according to my tests, but we'll see what CI says.

logging.Logger
}

func (vs *sourceBasedCamera) SubscribeRTP(
Copy link
Member

Choose a reason for hiding this comment

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

[q] Trying to figure out why we define SubscribeRTP and Unsubscribe for both sourceBasedCamera and videoSource.

Copy link
Member Author

Choose a reason for hiding this comment

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

They're both implementing a VideoSource go interface interface/class, which can optionally have a SubscribeRTP method. There are other implementations of the VideoSource interface, for example filesource which is used in image_file. All of these structs implement the Camera/VideoSource methods, and can optionally implement Subscribe/UnsubscribeRTP to allow the RTP packet pass-through that @nicksanford wrote to be used by a camera's implementation.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is also why in the constructors for different go cameras, we use the helper functions in this file to make one of the video sources that implements all of these methods. It's an example of trying ot use single point of truth/dry.

@randhid randhid merged commit 1171dcf into viamrobotics:main Sep 17, 2024
20 checks passed
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