Merge remote-tracking branch 'origin/issue#290' into Optimizations
This commit is contained in:
commit
e3fb32d194
|
@ -121,7 +121,7 @@ class Lidar(Sensor):
|
|||
def __init__(self, name, **kwargs):
|
||||
super(Lidar, self).__init__(name, sensor_type="LIDAR_RAY_CAST")
|
||||
self.Channels = 32
|
||||
self.Range = 5000.0
|
||||
self.Range = 50.0
|
||||
self.PointsPerSecond = 56000
|
||||
self.RotationFrequency = 10.0
|
||||
self.UpperFovLimit = 10.0
|
||||
|
|
|
@ -77,7 +77,7 @@ def run_carla_client(args):
|
|||
lidar.set_rotation(0, 0, 0)
|
||||
lidar.set(
|
||||
Channels=32,
|
||||
Range=5000,
|
||||
Range=50,
|
||||
PointsPerSecond=100000,
|
||||
RotationFrequency=10,
|
||||
UpperFovLimit=10,
|
||||
|
|
|
@ -321,7 +321,7 @@ class CarlaGame(object):
|
|||
|
||||
if self._lidar_measurement is not None:
|
||||
lidar_data = np.array(self._lidar_measurement.data[:, :2])
|
||||
lidar_data /= 50.0
|
||||
lidar_data *= 2.0
|
||||
lidar_data += 100.0
|
||||
lidar_data = np.fabs(lidar_data)
|
||||
lidar_data = lidar_data.astype(np.int32)
|
||||
|
|
|
@ -60,7 +60,17 @@ void ALidar::ReadPoints(const float DeltaTime)
|
|||
const uint32 PointsToScanWithOneLaser =
|
||||
FMath::RoundHalfFromZero(
|
||||
Description->PointsPerSecond * DeltaTime / float(ChannelCount));
|
||||
check(PointsToScanWithOneLaser > 0);
|
||||
|
||||
if (PointsToScanWithOneLaser <= 0)
|
||||
{
|
||||
UE_LOG(
|
||||
LogCarla,
|
||||
Warning,
|
||||
TEXT("%s: no points requested this frame, try increasing the number of points per second."),
|
||||
*GetName());
|
||||
return;
|
||||
}
|
||||
|
||||
check(ChannelCount == LaserAngles.Num());
|
||||
check(Description != nullptr);
|
||||
|
||||
|
|
|
@ -75,9 +75,10 @@ public:
|
|||
{
|
||||
check(Header[1] > Channel);
|
||||
Header[2u + Channel] += 1u;
|
||||
Points.Emplace(Point.X);
|
||||
Points.Emplace(Point.Y);
|
||||
Points.Emplace(Point.Z);
|
||||
constexpr float TO_METERS = 1e-2f;
|
||||
Points.Emplace(TO_METERS * Point.X);
|
||||
Points.Emplace(TO_METERS * Point.Y);
|
||||
Points.Emplace(TO_METERS * Point.Z);
|
||||
}
|
||||
|
||||
FSensorDataView GetView() const
|
||||
|
|
Loading…
Reference in New Issue