@@ -4,8 +4,12 @@ use color_eyre::Result;
4
4
use coordinate_systems:: Pixel ;
5
5
use eframe:: egui:: { Align2 , Color32 , FontId , Stroke } ;
6
6
use linear_algebra:: point;
7
- use types:: pose_detection:: {
8
- HumanPose , Keypoint , OVERALL_KEYPOINT_INDEX_MASK , VISUAL_REFEREE_KEYPOINT_INDEX_MASK ,
7
+ use types:: {
8
+ filtered_game_controller_state:: FilteredGameControllerState ,
9
+ filtered_game_state:: FilteredGameState ,
10
+ pose_detection:: {
11
+ HumanPose , Keypoint , OVERALL_KEYPOINT_INDEX_MASK , VISUAL_REFEREE_KEYPOINT_INDEX_MASK ,
12
+ } ,
9
13
} ;
10
14
11
15
use crate :: {
@@ -41,6 +45,7 @@ const DETECTION_IMAGE_START_X: f32 = (IMAGE_WIDTH - DETECTION_IMAGE_WIDTH) / 2.0
41
45
pub struct PoseDetection {
42
46
accepted_human_poses : BufferHandle < Vec < HumanPose > > ,
43
47
rejected_human_poses : BufferHandle < Vec < HumanPose > > ,
48
+ filtered_game_controller_state : BufferHandle < Option < FilteredGameControllerState > > ,
44
49
}
45
50
46
51
impl Overlay for PoseDetection {
@@ -55,9 +60,12 @@ impl Overlay for PoseDetection {
55
60
nao. subscribe_value ( format ! ( "{cycler}.main_outputs.accepted_human_poses" ) ) ;
56
61
let rejected_human_poses =
57
62
nao. subscribe_value ( format ! ( "{cycler}.main_outputs.rejected_human_poses" ) ) ;
63
+ let filtered_game_controller_state =
64
+ nao. subscribe_value ( "Control.main_outputs.filtered_game_controller_state" . to_string ( ) ) ;
58
65
Self {
59
66
accepted_human_poses,
60
67
rejected_human_poses,
68
+ filtered_game_controller_state,
61
69
}
62
70
}
63
71
@@ -84,7 +92,13 @@ impl Overlay for PoseDetection {
84
92
Color32 :: from_rgb ( 100 , 100 , 255 ) ,
85
93
) ?;
86
94
87
- paint_detection_dead_zone ( painter) ;
95
+ if let Some ( Some ( FilteredGameControllerState {
96
+ game_state : FilteredGameState :: Standby ,
97
+ ..
98
+ } ) ) = self . filtered_game_controller_state . get_last_value ( ) ?
99
+ {
100
+ paint_detection_dead_zone ( painter) ;
101
+ } ;
88
102
89
103
Ok ( ( ) )
90
104
}
0 commit comments