driving.scenario.bicycleMesh
Mesh representation of bicycle in driving scenario
Description
Examples
Generate Lidar Point Cloud by Using Bicycle Mesh
Add a prebuilt bicycle mesh to a driving scenario. Then, use a lidarPointCloudGenerator
System object™ to generate a point cloud of the bicycle mesh.
Create and show the prebuilt bicycle mesh.
mesh = driving.scenario.bicycleMesh; egoMesh = driving.scenario.carMesh; figure show(mesh)
ans = Axes with properties: XLim: [-0.5000 0.5000] YLim: [-0.2000 0.2000] XScale: 'linear' YScale: 'linear' GridLineStyle: '-' Position: [0.1300 0.1100 0.7750 0.8150] Units: 'normalized' Show all properties
Create a driving scenario.
s = drivingScenario;
Add a straight road to the driving scenario. The road has one lane traveling in each direction.
road(s,[0 0 0; 30 0 0],'Lanes',lanespec([1 1]));
Add a car as an ego vehicle and a bicycle as a non-ego actor.
egoVehicle = vehicle(s,'ClassID',1,'Mesh',egoMesh); bicycle = vehicle(s,'Position',[15 2 0],'Yaw',180,'ClassID',3,'Mesh',mesh); smoothTrajectory(egoVehicle,[1 -2 0; 21.3 -2 0],20);
Plot the driving scenario. Set name-value pair 'Meshes','on'
to show the meshes of the actors in the plot.
figure; plot(s,'Meshes','on');
Create a lidarPointCloudGenerator
System object. Set the actor profiles of the System object to those in the driving scenario.
lidar = lidarPointCloudGenerator; lidar.ActorProfiles = actorProfiles(s);
Generate a lidar point cloud of the driving scenario.
player = pcplayer([-20 20],[-10 10],[0 4]); while advance(s) tgts = targetPoses(egoVehicle); rdmesh = roadMesh(egoVehicle); [ptCloud,isValidTime] = lidar(tgts,rdmesh,s.SimulationTime); if isValidTime view(player,ptCloud); end end
Output Arguments
mesh
— Mesh representation of bicycle
extendedObjectMesh
object
Mesh representation of bicycle, returned as an extendedObjectMesh
object. The origin of the mesh is located at its geometric center.
You can develop your own meshes by using this prebuilt bicycle mesh as a starting point. At the MATLAB® command line, enter:
edit driving.scenario.bicycleMesh
Version History
Introduced in R2020a
See Also
Objects
Functions
Ouvrir l'exemple
Vous possédez une version modifiée de cet exemple. Souhaitez-vous ouvrir cet exemple avec vos modifications ?
Commande MATLAB
Vous avez cliqué sur un lien qui correspond à cette commande MATLAB :
Pour exécuter la commande, saisissez-la dans la fenêtre de commande de MATLAB. Les navigateurs web ne supportent pas les commandes MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)