@@ -557,15 +557,46 @@ def reid_hit_counter_is_positive(self):
557
557
return self .reid_hit_counter is None or self .reid_hit_counter >= 0
558
558
559
559
@property
560
- def estimate (self ):
561
- positions = self .filter .x .T .flatten ()[: self .dim_z ].reshape (- 1 , self .dim_points )
560
+ def estimate_velocity (self ) -> np .ndarray :
561
+ """Get the velocity estimate of the object from the Kalman filter. This velocity is in the absolute coordinate system.
562
+
563
+ Returns
564
+ -------
565
+ np.ndarray
566
+ An array of shape (self.num_points, self.dim_points) containing the velocity estimate of the object on each axis.
567
+ """
568
+ return self .filter .x .T .flatten ()[self .dim_z :].reshape (- 1 , self .dim_points )
562
569
563
- if self .abs_to_rel is not None :
564
- return self .abs_to_rel (positions )
565
- return positions
570
+ @property
571
+ def estimate (self ) -> np .ndarray :
572
+ """Get the position estimate of the object from the Kalman filter.
573
+
574
+ Returns
575
+ -------
576
+ np.ndarray
577
+ An array of shape (self.num_points, self.dim_points) containing the position estimate of the object on each axis.
578
+ """
579
+ return self .get_estimate ()
566
580
567
- def get_estimate (self , absolute = False ):
568
- positions = self .filter .x .T .flatten ()[: self .dim_z ].reshape (- 1 , 2 )
581
+ def get_estimate (self , absolute = False ) -> np .ndarray :
582
+ """Get the position estimate of the object from the Kalman filter in an absolute or relative format.
583
+
584
+ Parameters
585
+ ----------
586
+ absolute : bool, optional
587
+ If true the coordinates are returned in absolute format, by default False, by default False.
588
+
589
+ Returns
590
+ -------
591
+ np.ndarray
592
+ An array of shape (self.num_points, self.dim_points) containing the position estimate of the object on each axis.
593
+
594
+ Raises
595
+ ------
596
+ ValueError
597
+ Alert if the coordinates are requested in absolute format but the tracker has no coordinate transformation.
598
+ """
599
+ positions = self .filter .x .T .flatten ()[: self .dim_z ].reshape (- 1 , self .dim_points )
569
600
if self .abs_to_rel is None :
570
601
if not absolute :
571
602
return positions
0 commit comments