# Obtain vehicleCostMap from drivingScenario

1 ビュー (過去 30 日間)
redwan 2018 年 4 月 28 日
コメント済み: FP24 2018 年 7 月 23 日
Hello,
Is there any way to obtain vehicleCostmap object from drivingScenario object. I've added one ego Car and one barrier in my driving scenario. I would like to obtain a vehicleCostmap which only assumes that the only cost to drive is the barrier in the road. I'm using a straight road with no lanes. Without vehicleCostMap, plan, pathplannerRRT will not work, according to the document.

サインインしてコメントする。

### 回答 (1 件)

Anand 2018 年 6 月 4 日
There is no direct ability to do this. There are two ways to accomplish this however:
1. Create a 2D matrix with the values in your map and create a vehicleCostmap object.
2. Create a 'blank' vehicleCostmap object and populate it with the barriers using the setCosts function.
% Create a 2D matrix with the barricades.
C = 0.1*ones(100, 100);
C(30:35,50:90) = 0.8;
% Construct a vehicleCostmap object
costmap1 = vehicleCostmap(C);
% Plot created costmap
figure, plot(costmap1)
% Create a vehicleCostmap object 100m-by-100m
costmap2 = vehicleCostmap(100, 100, 'CellSize', 1);
% Mark a rectangular obstacle
[xx,yy] = meshgrid(50:90, 65:70);
xyPoints = [xx(:),yy(:)];
setCosts(costmap2, xyPoints, 0.8);
% Plot created costmap
figure, plot(costmap2)
##### 1 件のコメント表示非表示 なし
FP24 2018 年 7 月 23 日
I don't think this answers the question, in which I'm interested too

サインインしてコメントする。

### Community Treasure Hunt

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

Start Hunting!

Translated by