You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
X1_SENSOR_CONFIG_3 is supposed to contain a 3D Lidar, and the output looks like
There's clearly no noise even though the stddev defined in the sdf specifies 0.01 noise. This does not occur for the 2D Lidars which output a LaserScan message instead. GpuLidar internally publishes both LaserScan and PointCloud messages, via the GpuLidarSensor::Update method which calls this->PublishLidarScan(_now); from the Lidar base class.
The solution here is probably to separate out an ApplyNoise function in Lidar that will properly alter the this->laserBuffer and call it before both this->PublishLidarScan(_now); and this->dataPtr->FillPointCloudMsg(); so it can be accessed by both classes.
The text was updated successfully, but these errors were encountered:
I think the the visualization in ign-gazebo shows lidar scan data which has noise correctly applied but the issue is that the point cloud data that are published over the ~/<topic_name>/points topic doesn't have any noise applied.
On a high level this can be replicated by running the SubT virtual course. The command used is:
X1_SENSOR_CONFIG_3
is supposed to contain a 3D Lidar, and the output looks likeThere's clearly no noise even though the stddev defined in the sdf specifies 0.01 noise. This does not occur for the 2D Lidars which output a LaserScan message instead. GpuLidar internally publishes both LaserScan and PointCloud messages, via the
GpuLidarSensor::Update
method which callsthis->PublishLidarScan(_now);
from the Lidar base class.The issue here is that the noise is only applied to the range data in the Lidar base class, in https://github.com/ignitionrobotics/ign-sensors/blob/8ee625a405264ca697fbefc0e8a9b1ae6d1b53dd/src/Lidar.cc#L229 which is called here https://github.com/ignitionrobotics/ign-sensors/blob/8ee625a405264ca697fbefc0e8a9b1ae6d1b53dd/src/GpuLidarSensor.cc#L233 That interior call doesn't update the laser buffer itself, merely taking a copy here https://github.com/ignitionrobotics/ign-sensors/blob/8ee625a405264ca697fbefc0e8a9b1ae6d1b53dd/src/Lidar.cc#L234 so the actual laser buffer remains unchanged. As a result the outer
GpuLidarSensor::Update
only has access to the original clean lidar ranges, hence why it publishes point clouds with no noise.The solution here is probably to separate out an
ApplyNoise
function inLidar
that will properly alter thethis->laserBuffer
and call it before boththis->PublishLidarScan(_now);
andthis->dataPtr->FillPointCloudMsg();
so it can be accessed by both classes.The text was updated successfully, but these errors were encountered: