The function of reading pose.json will return one more pose than the actual file contains.
This caused by fstream::eof() in the while statement, which only returns false when your fstream::get() fucntion return false.
In the original code, it will always enter the code block once even your file has come to its end. So, it will append one more pose vector (which is identical to the last pose) every time.
The function of reading pose.json will return one more pose than the actual file contains.
This caused by fstream::eof() in the while statement, which only returns false when your fstream::get() fucntion return false.
In the original code, it will always enter the code block once even your file has come to its end. So, it will append one more pose vector (which is identical to the last pose) every time.