How can I add a moving cuboid (vehicle) in siteviewer (OSM map) and make it affect raytrace calculations in MATLAB 2024b?
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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
- Unable to place a cuboid (vehicle) in siteviewer (OSM map)—even as a static object, it does not appear.
- Tried cuboid, drawcuboid, and addMesh, but none of them display in siteviewer.
- 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.
0 Commenti
Risposte (1)
Shishir Reddy
il 26 Giu 2025
Hi @chung
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.
0 Commenti
Vedere anche
Categorie
Scopri di più su Linear and Nonlinear Regression in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!