osrf / ovc

the Open Vision Computer
Apache License 2.0
198 stars 42 forks source link

Dynamic Parameters #61

Closed gbalke closed 3 years ago

gbalke commented 3 years ago

Enables live parameter updates for cameras via host-provided values. Currently applies to all connected cameras but it should be possible to select a camera in particular that will be modified (add a camera number to the header).

If we go with that solution down the road, it will only allow for one camera to be modified at a time but I think that's acceptable?

luca-della-vedova commented 3 years ago

If we go with that solution down the road, it will only allow for one camera to be modified at a time but I think that's acceptable?

Agreed! Looking at the current solution I wonder if we should have a way to specify whether the various parameter fields in the packet are valid or not. It seems in the current implementation all (really only one for now) parameters are applied to the camera while I envision a use case of having N parameters but the user really only wanting to update one or two. So I guess at the bare minimum a "valid" boolean for each parameter, but I also wonder in the bigger picture if we should skip the whole "binary shared header" approach at least for this direction of communication, since it is not bandwidth critical, and just adopt something like JSON where we can just have arbitrary key value pairs for all the parameters that we want to be updated. In this way we would be able to have a lot of flexibility over which camera is updated and what parameter is.

gbalke commented 3 years ago

Yeah, I agree! I think we can easily switch over to something like JSON which would offer a lot more flexibility. I was also trying to figure out the best approach to passing per-camera configs (that was highly performant) but, on second thought, I don't think there's really a reason to have something more performant than JSON. Also avoids the implementation headache of something more complicated :smile:

gbalke commented 3 years ago

Added frame rate support. Captured dynamically adjusting the frame rate and seeing the trigger change with my logic analyzer (1Hz -> 15Hz). image image

gbalke commented 3 years ago

Since this is more focused on the functional aspect, I'm going to rework the messaging in a follow-up PR based off of #62.