Skip to content

Commit

Permalink
If material CSV file is empty or contains only empty line it will ski…
Browse files Browse the repository at this point in the history
…p the creation. Fixed #33

(cherry picked from commit 52e3989)
  • Loading branch information
WouterJansen committed Oct 4, 2024
1 parent 20d2d74 commit 8769c93
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Unreal/Plugins/AirSim/Source/LidarCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,10 @@ void ALidarCamera::InitializeSettingsFromAirSim(const msr::airlib::GPULidarSimpl
while (std::getline(ss, word, ',')) {
row.push_back(word);
}
material_map_.emplace(stencil_index, std::stof(row[1]));
stencil_index = stencil_index + 1;
if (row.size() > 1) {
material_map_.emplace(stencil_index, std::stof(row[1]));
stencil_index = stencil_index + 1;
}
}

// Set the sensor in the Unreal world at the right position and rotation by transforming the coordinate system to that of Unreal from AirSim NED
Expand Down

0 comments on commit 8769c93

Please sign in to comment.