File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
backend/libs/autopilot/src Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -95,9 +95,20 @@ pub(crate) async fn control_inner(
9595 }
9696 Action :: SetActuatorsConfig ( new_config) => {
9797 let mut manager = MANAGER . get ( ) . context ( "Not available" ) ?. write ( ) . await ;
98+ let mut new_config = new_config. to_owned ( ) ;
99+
100+ let base_config = & manager
101+ . settings
102+ . actuators
103+ . get ( & actuators_control. camera_uuid )
104+ . map ( api:: ActuatorsConfig :: from)
105+ . unwrap_or ( api:: ActuatorsConfig :: from ( & CameraActuators :: default ( ) ) ) ;
106+
107+ new_config = merge_struct:: merge ( base_config, & new_config. clone ( ) )
108+ . context ( "Failing to merge structs" ) ?;
98109
99110 manager
100- . update_config ( & actuators_control. camera_uuid , new_config, false )
111+ . update_config ( & actuators_control. camera_uuid , & new_config, false )
101112 . await ?;
102113
103114 let config: & api:: ActuatorsConfig = & manager
You can’t perform that action at this time.
0 commit comments