@@ -7,7 +7,13 @@ use nalgebra::Vector3;
7
7
use parameters:: directory:: Scope ;
8
8
use serde_json:: Value ;
9
9
10
- use crate :: { log_error:: LogError , nao:: Nao , panel:: Panel , value_buffer:: BufferHandle } ;
10
+ use crate :: {
11
+ log_error:: LogError ,
12
+ nao:: Nao ,
13
+ panel:: Panel ,
14
+ panels:: { BOTTOM_CAMERA_EXTRINSICS_PATH , TOP_CAMERA_EXTRINSICS_PATH } ,
15
+ value_buffer:: BufferHandle ,
16
+ } ;
11
17
12
18
pub struct ManualCalibrationPanel {
13
19
nao : Arc < Nao > ,
@@ -19,12 +25,9 @@ impl Panel for ManualCalibrationPanel {
19
25
const NAME : & ' static str = "Manual Calibration" ;
20
26
21
27
fn new ( nao : Arc < Nao > , _value : Option < & Value > ) -> Self {
22
- let top_camera = nao. subscribe_value (
23
- "parameters.camera_matrix_parameters.vision_top.extrinsic_rotations" . to_string ( ) ,
24
- ) ;
25
- let bottom_camera = nao. subscribe_value (
26
- "parameters.camera_matrix_parameters.vision_bottom.extrinsic_rotations" . to_string ( ) ,
27
- ) ;
28
+ let top_camera = nao. subscribe_value ( format ! ( "parameters.{TOP_CAMERA_EXTRINSICS_PATH}" ) ) ;
29
+ let bottom_camera =
30
+ nao. subscribe_value ( format ! ( "parameters.{BOTTOM_CAMERA_EXTRINSICS_PATH}" ) ) ;
28
31
29
32
Self {
30
33
nao,
@@ -44,7 +47,7 @@ impl Widget for &mut ManualCalibrationPanel {
44
47
"Top Camera" ,
45
48
value,
46
49
& self . nao ,
47
- "camera_matrix_parameters.vision_top.extrinsic_rotations" ,
50
+ TOP_CAMERA_EXTRINSICS_PATH ,
48
51
) ;
49
52
}
50
53
ui. separator ( ) ;
@@ -54,7 +57,7 @@ impl Widget for &mut ManualCalibrationPanel {
54
57
"Bottom Camera" ,
55
58
value,
56
59
& self . nao ,
57
- "camera_matrix_parameters.vision_bottom.extrinsic_rotations" ,
60
+ BOTTOM_CAMERA_EXTRINSICS_PATH ,
58
61
) ;
59
62
}
60
63
} )
0 commit comments