Skip to content

Commit

Permalink
Merge pull request #332 from lihqi/feat/pointcloud-fisheye-polygon-lhq
Browse files Browse the repository at this point in the history
fix: Dont display results without groundHeight
  • Loading branch information
Glenfiddish authored Oct 16, 2023
2 parents e92fc8c + f0b38e6 commit b6977f3
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import EscSvg from '@/assets/annotation/common/icon_esc.svg';
import LeftSquareOutlined from '@/assets/annotation/common/icon_left_squareOutlined.svg';
import RightSquareOutlined from '@/assets/annotation/common/icon_right_squareOutlined.svg';
import { IMappingImg } from '@/types/data';
import { isNumber } from 'lodash';

// TODO, It will be deleted when the exported type of lb-annotation is work.
export interface IAnnotationDataTemporarily {
Expand All @@ -29,8 +30,6 @@ export interface IAnnotationDataTemporarily {
};
}

const DEFAULT_GROUND_HEIGHT = -1.345;

interface ITransferViewData {
type: string;
pointList: {
Expand Down Expand Up @@ -195,13 +194,15 @@ const PointCloud2DView = ({

const imageSize = imageSizes[mappingData?.path ?? ''];

if (imageSize) {
if (imageSize && isNumber(mappingData?.calib?.groundHeight)) {
polygonList.forEach((polygon) => {
// eslint-disable-next-line
const polygonPoints = polygon.pointList.map((v) => ({
...v,
z: mappingData?.calib?.groundHeight ?? DEFAULT_GROUND_HEIGHT,
z: mappingData?.calib?.groundHeight,
}));
// 上面用isNumber确保z的值是number,但是ts还是报错,所以这里用//@ts-ignore忽略
// @ts-ignore
const result = pointListLidar2Img(polygonPoints, mappingData?.calib, imageSize);

if (result) {
Expand Down

0 comments on commit b6977f3

Please sign in to comment.