Skip to main content
. 2024 Oct 30;24(21):6986. doi: 10.3390/s24216986
Algorithm 1: Pseudo code for Hardware-Based human localization
  1.   Initialize sensory fusion distance data

  2.   always @ (posedge clk) begin

  3.   {PIR, Human available, Position values, Two Positions, Sleep posture, sitting posture, one hot} = 0.

  4.   state = INIT.

  5.   Case (state)

  6.   State_1: (PIR = 1)? Human available: state.

  7.    Case (Human available)

  8.    State_11: (Position values > Two Positions) Sleep posture: Sitting posture.

  9.     Case (Sleep posture)

  10.     State_1a: (Posture = 6′b111111)? Supine: State_1b.

  11.     State_1b: (Posture = 6′bxx0101)? Right side posture: Left side posture.

  12.     Case (Sitting posture)

  13.      State_1as: (((Position && Time) = Static)? State static: Adaptive.

  14.       Case (State static)

  15.         State_a1: (Position = one hot)? State_a2: Aliasing_pose.

  16.         State_a2: (Position = 6′dx)? Position Binary Classifier: state.

  17.       Case (Aliasing_pose)

  18.         State_b1: (Position = 6′dy)? Position Binary Classifier: state.

  19.      Case (Adaptive)

  20.         State_b11: if (count && CP == end position) begin

  21.             count && CP <= start position.

  22.              else {count <= count + 1, CP <= CP + 1}, {PP_n = CP}.

  23.         State_b12: (count = 0)? State static: State_b14.

  24.         State_b13: (CP = PP)? State static: State_b14.

  25.         State_b14: (CP = PP_n)? Position Binary Classifier: State b15.

  26.   default: state = INIT.

  27.   end case, End.