提交 494998af 编写于 作者: K kiboliu 提交者: Calvin Miao

CR response

上级 27b24a8a
...@@ -189,8 +189,7 @@ void PerceptionCameraUpdater::OnImage( ...@@ -189,8 +189,7 @@ void PerceptionCameraUpdater::OnImage(
} }
current_image_timestamp_ = next_image_timestamp; current_image_timestamp_ = next_image_timestamp;
camera_update_.set_image(&(tmp_buffer[0]), tmp_buffer.size()); camera_update_.set_image(&(tmp_buffer[0]), tmp_buffer.size());
camera_update_.set_img_width(width); camera_update_.set_image_aspect_ratio((double)width / height);
camera_update_.set_img_height(height);
} }
void PerceptionCameraUpdater::OnLocalization( void PerceptionCameraUpdater::OnLocalization(
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
因为 它太大了无法显示 source diff 。你可以改为 查看blob
...@@ -789,13 +789,9 @@ ...@@ -789,13 +789,9 @@
"type": "bytes", "type": "bytes",
"id": 3 "id": 3
}, },
"imgHeight": { "imageAspectRatio": {
"type": "uint32", "type": "double",
"id": 4 "id": 4
},
"imgWidth": {
"type": "uint32",
"id": 5
} }
} }
} }
......
...@@ -28,9 +28,8 @@ class SceneView extends React.Component { ...@@ -28,9 +28,8 @@ class SceneView extends React.Component {
if (options.showCameraView) { if (options.showCameraView) {
// Set width/height same as camera image ratio to ensure scene align to image // Set width/height same as camera image ratio to ensure scene align to image
// thus the height won't change no matter whether there's menu under scene // thus the height won't change no matter whether there's menu under scene
const ASPECT_RATIO = cameraData.imageWidth / cameraData.imageHeight;
width = sceneDimension.width; width = sceneDimension.width;
height = width / ASPECT_RATIO; height = width / cameraData.imageAspectRatio;
} else { } else {
width = sceneDimension.width; width = sceneDimension.width;
height = sceneDimension.height - sceneHeightOffset; height = sceneDimension.height - sceneHeightOffset;
......
...@@ -34,8 +34,7 @@ export default class Scene extends React.Component { ...@@ -34,8 +34,7 @@ export default class Scene extends React.Component {
}}> }}>
{options.showGeo && <Geolocation />} {options.showGeo && <Geolocation />}
</div> </div>
{ (options.showCameraView && !RENDERER.routingEditor.isInEditingMode()) && { (options.showCameraView && !options.showRouteEditingBar) && <img id="camera-image" /> }
<img id="camera-image" /> }
</React.Fragment> </React.Fragment>
); );
} }
......
...@@ -155,7 +155,7 @@ class Renderer { ...@@ -155,7 +155,7 @@ class Renderer {
} }
updateDimension(width, height) { updateDimension(width, height) {
if (width < Styles.minSceneWidth) { if (width < Styles.MIN_SCENE_WIDTH) {
// Min width of main view is 600, so we need not update // Min width of main view is 600, so we need not update
// camera/renderer dimension anymore // camera/renderer dimension anymore
return; return;
......
...@@ -9,8 +9,7 @@ export default class CameraData { ...@@ -9,8 +9,7 @@ export default class CameraData {
@observable initDynamicRotation = observable.map(); @observable initDynamicRotation = observable.map();
@observable deltaDynamicRotation = observable.map(); @observable deltaDynamicRotation = observable.map();
@observable imageSrcData = null; @observable imageSrcData = null;
@observable imageWidth = null; @observable imageAspectRatio = null;
@observable imageHeight = null;
constructor() { constructor() {
['x', 'y', 'z'].forEach((axis) => { ['x', 'y', 'z'].forEach((axis) => {
...@@ -39,8 +38,7 @@ export default class CameraData { ...@@ -39,8 +38,7 @@ export default class CameraData {
this.imageSrcData = 'data:image/jpeg;base64,' + new Buffer(data.image).toString('base64'); this.imageSrcData = 'data:image/jpeg;base64,' + new Buffer(data.image).toString('base64');
} }
this.imageWidth = data.imgWidth; this.imageAspectRatio = data.imageAspectRatio;
this.imageHeight = data.imgHeight;
// Camera dynamic transformation matrix: the dynamic localization matrix // Camera dynamic transformation matrix: the dynamic localization matrix
const localizationMatrix = new THREE.Matrix4(); const localizationMatrix = new THREE.Matrix4();
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
$min-scene-width: 600; $min-scene-width: 600;
:export { minSceneWidth: $min-scene-width; } :export { MIN_SCENE_WIDTH: $min-scene-width; }
@mixin monitor-item-common-properties($text-width: calc(100% - 17px)) { @mixin monitor-item-common-properties($text-width: calc(100% - 17px)) {
display: flex; display: flex;
......
...@@ -14,7 +14,6 @@ message CameraUpdate { ...@@ -14,7 +14,6 @@ message CameraUpdate {
// Camera image data // Camera image data
optional bytes image = 3; optional bytes image = 3;
// Camera image width and height // Camera image aspect ratio = width / height
optional uint32 img_height = 4; optional double image_aspect_ratio = 4;
optional uint32 img_width = 5;
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册