Skip to content

Commit

Permalink
Fix #58 incorrect points count in PCD output
Browse files Browse the repository at this point in the history
  • Loading branch information
dmandrioli authored Sep 17, 2019
1 parent 653cbce commit 266ba89
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ function generatePCDOutput(req, res, next) {
const pcdContent = loader.parse(content.toString(), "");

const head = pcdContent.header;

const count = parseInt(pcdContent.position.length / 3);
let out = "VERSION .7\n";
out += "FIELDS x y z label object\n";
out += "SIZE 4 4 4 4 4\n";
out += "TYPE F F F I I\n";
out += "COUNT 1 1 1 1 1\n";
out += "WIDTH " + pcdContent.position.length + "\n";
out += "WIDTH " + count + "\n";
out += "HEIGHT 1\n";
out += "POINTS " + pcdContent.position.length + "\n";
out += "POINTS " + count + "\n";
out += "VIEWPOINT " + head.viewpoint.tx;
out += " " + head.viewpoint.ty;
out += " " + head.viewpoint.tz;
Expand Down Expand Up @@ -135,4 +135,4 @@ function generatePCDOutput(req, res, next) {
})
});
});
}
}

0 comments on commit 266ba89

Please sign in to comment.