florianblume / 6d-pat

6D - Pose Annotation Tool (6D-PAT) - is a tool that allows the user to load a set of images and also a set of 3D models and annotate where in the 2D image the 3D object ist placed.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bugfix for the persist of poses

tobiapoppi opened this issue · comments

Hi, i think i found a bug: after some days using the tool i wasn't able to save the poses. I press save, bot nothing was written in the gt.json file.
I'm using the program in the "Default Json" mode.
The gt.json file path is correctly set in the settings.

Everytime jus the first pose was saved, but never more than one.

So, i checked the file https://github.com/florianblume/6d-pat/blob/3b42914d0a347d24d87de25e27d562ccaaf8ad15/src/model/jsonloadandstorestrategy.cpp and changed at line 43.

from: if (jsonDocument.isNull()) {
to: if (!jsonDocument.isNull()) {

This corrected the problem, i re-built the program and now i can save more than one poses in the json file.
Reading your comment at line 115, in the ELSE: // TODO JsonDocument is null, ie an error occured i thought that you wanted to write "if jsonDocument is not null, then ...", and not "if null, then ..."

Hey, thanks for the bug report. If I had written proper tests that would've never happened haha ;) You can either create a pull request and I'll merge it or I'll fix it in a couple of days, I'm currently on vacation.

So I will try to make a pull request, even if the edit is literally of one character 😅

Fixed in the latest version.