RoboCupULaval / StrategyAI

Robocup ULaval's artificial intelligence software (team ULtron)

Home Page:http://www.robocupulaval.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix the timestamp use in the Tracker and Kalman

TwistedSim opened this issue · comments

At the moment, the timestamp of each received vision frame is set with the local time when it's received by the VisionReceiver. This timestamp is then feed to the update function of each tracked entities (robots and balls). The timestamp is then use to update the dt of the Kalman for the update step, which is NEVER use....... I think this was overlooked, since the update doesn't need to know how much time was spent since last update, it only need to be update as the measurement are made. The timestamp should only be use to discriminate the old measurement if a more recent one was made, update the last_update_time and update the first_update_time or not use at all.

For the predict step. The function calculate the time spent since the last call and use it to update the transition_model and the process_covariance. This could be change to use a fix dt provided by the config.

Furthermore, the first dt computed is the time spent since the class definition was executed (~1 second):
Add:

        if self.first_update_time is None: self.first_update_time = time()
        if self.last_update_time is None: self.last_update_time = time()

and

if self.last_predict_time is None: self.last_predict_time = time()

fixed in #472