Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lidar sensor possibly wrongly modeled in carla #1018

Closed
anshulpaigwar opened this issue Dec 6, 2018 · 4 comments
Closed

Lidar sensor possibly wrongly modeled in carla #1018

anshulpaigwar opened this issue Dec 6, 2018 · 4 comments
Labels
stale Issue has not had recent activity

Comments

@anshulpaigwar
Copy link

While using Carla 0.91 (and also in previous versions) I observed that there are always some dead angles in the Lidar data as shown in the image below from pygame window (manual_control.py):

image29

Others have also noticed the problem as in #995.

I tried to configure the settings parameters of Lidar sensor but could not resolve it. But I noticed that keeping the rotation frequency constant (10Hz) if I increased points_per_second the dead angle reduces while it is more if the points_per_second are low.
Also dead angles varies on different system with same configuration.

Upon checking the code RayCastLidar.cpp:

  const float CurrentHorizontalAngle = LidarMeasurement.GetHorizontalAngle();
  const float AngleDistanceOfTick = Description.RotationFrequency * 360.0f * DeltaTime;
  const float AngleDistanceOfLaserMeasure = AngleDistanceOfTick / PointsToScanWithOneLaser;

  LidarMeasurement.Reset(ChannelCount * PointsToScanWithOneLaser);

  for (auto Channel = 0u; Channel < ChannelCount; ++Channel)
  {
    for (auto i = 0u; i < PointsToScanWithOneLaser; ++i)
    {
      FVector Point;
      const float Angle = CurrentHorizontalAngle + AngleDistanceOfLaserMeasure * i;
      if (ShootLaser(Channel, Angle, Point))
      {
        LidarMeasurement.WritePoint(Channel, Point);
      }
    }
}

The for loop is from 0 to PointsToScanWithOneLaser which explains the cause of dead angle varying with points_per_second. (number of points get over before we complete 360 degree angle)

It should be something like:

delta_angle = 360/PointsToScanWithOneLaser

  for (auto Channel = 0u; Channel < ChannelCount; ++Channel)
  {
    for (auto i = 0u; i < PointsToScanWithOneLaser; ++i)
    {
      FVector Point;
      const float Angle = CurrentHorizontalAngle + delta_angle;
      if (ShootLaser(Channel, Angle, Point))
      {
        LidarMeasurement.WritePoint(Channel, Point);
      }
    }
}

I kindly request to fix this issue as many of us (autonomous vehicle researchers) are using carla because of it's support of lidar sensor.

@YashBansod
Copy link

@anshulpaigwar are you running your simulation in benchmark mode?
You should run the simulation in multiples of your Lidar Frequency to get a full 360 degree in one reading.
Alternatively, you could cache the Lidar reading to get a full 360 degree view.

The speed at which the server runs in non benchmark mode can vary a lot on a variety of factors.

@anshulpaigwar
Copy link
Author

@nsubiron could you help with this issue of lidar sensor I still haven't been able to find a solution?

@nsubiron
Copy link
Collaborator

Hi @anshulpaigwar, as @YashBansod proposed you should run the simulator at fixed time-step ("benchmark" mode: ./CarlaUE4.sh -benchmark -fps=X). Check out #835 for more info.

@stale
Copy link

stale bot commented Feb 11, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issue has not had recent activity label Feb 11, 2019
@stale stale bot closed this as completed Feb 18, 2019
@v-prgmr v-prgmr mentioned this issue Jun 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issue has not had recent activity
Projects
None yet
Development

No branches or pull requests

3 participants