Skip to content

Commit

Permalink
Merge pull request #46 from tier4/revert-44-fix/labeling_tool_set_height
Browse files Browse the repository at this point in the history
Revert "Fix set_height in labeling tool"
  • Loading branch information
Monjisan authored Dec 18, 2019
2 parents 47f6060 + 4ebc5c5 commit 3e73507
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions front/app/labeling_tool/pcd_label_tool.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,10 @@ export default class PCDLabelTool extends React.Component {
}
// button actions
setHeight = () => {
let bboxes;
const tgt = this._controls.getTargetLabel();
if (tgt !== null) {
bboxes = [tgt.bbox[this.candidateId]];
} else {
bboxes = Array.from(this.pcdBBoxes);
}
const bboxes = Array.from(this.pcdBBoxes);
const posArray = this._currentPointMesh.geometry.getAttribute('position').array;
let changedLabel = null;
let existIncludePoint = false;
for (let i=0; i<bboxes.length; ++i) {
const bbox = bboxes[i];
let maxZ = -Infinity, minZ = Infinity;
Expand All @@ -216,12 +211,13 @@ export default class PCDLabelTool extends React.Component {
const x = Math.abs( dx*Math.cos(yaw) + dy*Math.sin(yaw)),
y = Math.abs(-dx*Math.sin(yaw) + dy*Math.cos(yaw));
if (2*x < boxsx && 2*y < boxsy) {
existIncludePoint = true;
const z = posArray[j+2];
maxZ = Math.max(maxZ, z);
minZ = Math.min(minZ, z);
}
}
if (maxZ <= minZ) {
if (!existIncludePoint) {
continue;
}

Expand Down

0 comments on commit 3e73507

Please sign in to comment.