How can I add a moving cuboid (vehicle) in siteviewer (OSM map) and make it affect raytrace calculations in MATLAB 2024b?

조회 수: 4 (최근 30일)
My Goal
  • Add a movable cuboid (vehicle) in MATLAB siteviewer (OSM map).
  • Use raytrace to analyze the impact of the vehicle on signal propagation, observing: Propagation Delay (changes in signal delay),Path Loss (changes in signal power loss)
  • Ensure that raytrace considers the vehicle as an obstruction, affecting signal paths when it blocks the rays.
Issues I'm Facing
  1. Unable to place a cuboid (vehicle) in siteviewer (OSM map)—even as a static object, it does not appear.
  2. Tried cuboid, drawcuboid, and addMesh, but none of them display in siteviewer.
  3. Attempted to merge a geopolyshape with readgeotable("map.osm"), but encountered the following error:
Error using tabular/vertcat (line 207)
An error occurred when concatenating the table variable 'BuildingID' using vertcat.

답변 (1개)

Shishir Reddy
Shishir Reddy 2025년 6월 26일
The 'siteviewer' tied to OSM maps does not natively support dynamic or arbitrary 3D geometry like cuboid using 'drawCuboid'.These functions are used for standalone 3D scenes.
Kindly refer to the following steps to add a cuboid (vehicle) to 'siteviewer' -
1. Create a local coordinate mesh for your cuboid (vehicle) using 'collisionBox' or a similar 3D shape.
2. Convert it to a mesh with position and orientation.
3. Use addMesh as follows -
viewer = siteviewer('Basemap','openstreetmap');
position = [lat, lon, alt]; % position of your vehicle
[localX, localY, localZ] = latlon2local(position(1), position(2), position(3), viewer.CoordinateSystemReference);
addMesh(viewer, 'Name', 'Vehicle', ...
'Vertices', transformedVertices, ...
'Faces', faces, ...
'Color', [1 0 0]);
The 'transformedVertices' must be in the local coordinate system aligned with the site viewer.
The error you encountered when trying to merge readgeotable("map.osm") and your geopolyshape is likely because OSM data loaded via readgeotable has specific table variables (like BuildingID) that can’t be concatenated directly with your custom geopolyshape.
So, Instead of merging tables, handle your vehicle as a separate mesh object in the scene.
For more information regarding 'addMesh' kindly refer the following documentation - https://www.mathworks.com/help/uav/ref/uavscenario.addmesh.html
I hope this helps.

카테고리

Help CenterFile Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기

제품


릴리스

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by