Adds flip state and rotation for visualization - #168
Conversation
| ) | ||
|
|
||
|
|
||
| class DynamicForagingSpinnakerCamera(cameras.SpinnakerCamera): |
There was a problem hiding this comment.
Lets put this in a seperate model and use composition over inheritance. I
DynamicForagingSpinnakerCamera(BaseModel):
camera: SpinnakerCamera
visualizer_settings: AnotherBaseModelIf we keep the inheritance, we will have to deal with up/down casting types and this keeps it a bit cleaner in Bonsai. You may need to change some stuff in the mapper.
| class DynamicForagingSpinnakerCamera(cameras.SpinnakerCamera): | ||
| """A SpinnakerCamera for the dynamic foraging rig. This is a subclass of the SpinnakerCamera that includes camera image rotation for visualizers.""" | ||
|
|
||
| flip_state: float = Field(default=2, gt=0, le=2, description="Camera flip state", validate_default=True) |
There was a problem hiding this comment.
flip_state: None | Literal["horizontal", "vertical", "both"] = Field(default=None)
bruno-f-cruz
left a comment
There was a problem hiding this comment.
One small change and otherwise gtg
| class VisualizerSettings(BaseModel): | ||
| """Visualizer settings for the dynamic foraging rig's camera. This includes camera image rotation and flip state for visualizers.""" | ||
|
|
||
| flip_state: None | Literal["horizontal", "vertical", "both"] = Field( |
There was a problem hiding this comment.
One of those cases where I think it is probably easier to add "None" as a string to the literal and make it default so you dont have to deal with the type conversion.
There was a problem hiding this comment.
Easier to handle on bonsai too since you already need a mapper from string-> whatever the operator will receive
Adds flip state and rotation for camera preview visualization. Will need to be integrated in #139 to take effect