SteveMacenski / spatio_temporal_voxel_layer

A new voxel layer leveraging modern 3D graphics tools to modernize navigation environmental representations
http://wiki.ros.org/spatio_temporal_voxel_layer
GNU Lesser General Public License v2.1
616 stars 183 forks source link

PointCloud2Callback not called #257

Closed dujeong closed 1 year ago

dujeong commented 1 year ago

When I checked the voxel_grid topic with rviz2, nothing came out. So I checked through ros2 topic echo, it was coming out in an empty array ([ ]) (Actual input data(realsense depth pointcloud) came out well.)

I checked and found that stvl could not receive pointcloud data of realsense coming in through input.

As a result of checking by inserting the log as below, the callback function was suddenly not called while receiving it as soon as robot was booted.

/*****************************************************************************/
void SpatioTemporalVoxelLayer::PointCloud2Callback(
  sensor_msgs::msg::PointCloud2::ConstSharedPtr message,
  const std::shared_ptr<buffer::MeasurementBuffer> & buffer)
/*****************************************************************************/
{
  std::cout << "in callback" << std::endl;
  if (!buffer->IsEnabled()) {
    return;
  }
  std::cout << "callback middle" << std::endl;
  // buffer the point cloud
  buffer->Lock();
  buffer->BufferROSCloud(*message);
  buffer->Unlock();
  std::cout << "callback finish" << std::endl;
}

At the beginning of the boot, a few lines were printed, but after 'callback finish', it was no longer printed.

For reference, the parameter enabled also did not work (there is a possibility that the callback related to dynamic reconfiguration also did not work)

The important thing is that sometimes the problem comes out, but sometimes it doesn't. For your information, the obstacle layer (LaserScan type) used together works well.

I thought it might be an executor problem dealing with callbacks, but for that, LaserScan data is being handled well.

The source version I used is the latest version as of now.

SteveMacenski commented 1 year ago

I need to know alot more information about your setup. What distribution? What DDS vendor? How did you install / build it? What version?

Note: https://github.com/ros-planning/navigation2/issues/3014

Are you sure that the TF transforms are available? We have a message filter setup on that callback so if it can't be stamped, the callback also isn't triggered. You're welcome to take a look at how we setup the callbacks for PC2 vs LaserScans to see if you can notice a difference - since laser scans don't seem to have that problem.

If you use the normal Voxel Layer do you see this problem? I'm also curious if its a sensor source / networking delay due to the size of the PC2 on your platform.

I know that's a few different questions / topics to go through, but those are the 3 areas I'd start with to see if we can narrow down where the issue is.

dujeong commented 1 year ago

I am sorry for not providing enough information.


dujeong commented 1 year ago

@SteveMacenski As you said, I thought it might be a network problem, so I proceeded with DDS tuning.

Then I succeeded. Actually, I typed sudo sysctl -w net.core.rmem_max=2147483647, then succeeded! I set it up for both remote pc and robot.

Thank you for your insightful reply.

dujeong commented 1 year ago

but enabled parameter is still not working.

GPrathap commented 7 months ago

I had the same issue solution was to install cyclone dds, https://github.com/SteveMacenski/spatio_temporal_voxel_layer/issues/250

GPrathap commented 6 months ago

After some time, issues start even with cyclone dds. I need to restart it several times to get it working, I've set these values but it seems to still message for point clouds disappeared

    net.core.rmem_max=5147483647
    net.core.rmem_default=5147483647
dujeong commented 6 months ago

@GPrathap Why don't you put up a new issue if the issue persists?

GPrathap commented 6 months ago

Sorry, I forgot to update, whenever I start the docker, I have to run sudo sysctl -w net.core.rmem_max=2147483647 . Then it is fine. Putting in /etc/sysctl.d/10-cyclone-max.conf does not work.