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

PointCloud2Callback not called #257

Closed
dujeong opened this issue Mar 24, 2023 · 8 comments
Closed

PointCloud2Callback not called #257

dujeong opened this issue Mar 24, 2023 · 8 comments

Comments

@dujeong
Copy link
Contributor

dujeong commented Mar 24, 2023

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
Copy link
Owner

SteveMacenski commented Mar 24, 2023

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

Note: ros-navigation/navigation2#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
Copy link
Contributor Author

dujeong commented Mar 27, 2023

I am sorry for not providing enough information.

  • Operating System:
    • Ubuntu 22.04
  • ROS2 Version:
    • Humble binaries
  • navigation2 Version or commit hash:
    • source build: ca8c4c5f40b6fb852e198b6507e1ca186bce84c6
  • DDS implementation:
    • cyclonedds

  • If you use the normal Voxel Layer do you see this problem?

    • when I set like observation_sources: scan pointcloud in voxel layer, costmap was applied only to scan data.
  • /scan topic information (Type: sensor_msgs/msg/LaserScan)

    <<< publisher >>>
    Node name: scan_merger_1
    Node namespace: /
    Topic type: sensor_msgs/msg/LaserScan
    Endpoint type: PUBLISHER
    GID: 01.10.13.7c.3f.aa.49.d1.7b.32.14.a2.00.00.4a.03.00.00.00.00.00.00.00.00
    QoS profile:
      Reliability: BEST_EFFORT
      History (Depth): KEEP_LAST (5)
      Durability: VOLATILE
      Lifespan: Infinite
      Deadline: Infinite
      Liveliness: AUTOMATIC
      Liveliness lease duration: Infinite
    
    <<< subscriber >>>
    Node name: local_costmap
    Node namespace: /local_costmap
    Topic type: sensor_msgs/msg/LaserScan
    Endpoint type: SUBSCRIPTION
    GID: 01.10.c8.68.70.d7.71.88.26.fa.40.fc.00.00.6f.04.00.00.00.00.00.00.00.00
    QoS profile:
      Reliability: BEST_EFFORT
      History (Depth): KEEP_LAST (50)
      Durability: VOLATILE
      Lifespan: Infinite
      Deadline: Infinite
      Liveliness: AUTOMATIC
      Liveliness lease duration: Infinite
    
  • /realsense2_camera_1/depth/color/points topic information

    Type: sensor_msgs/msg/PointCloud2
    
    <<< publisher >>>
    Node name: realsense2_camera_1
    Node namespace: /
    Topic type: sensor_msgs/msg/PointCloud2
    Endpoint type: PUBLISHER
    GID: 01.10.04.4f.8c.a2.e6.a4.8f.37.64.81.00.00.16.03.00.00.00.00.00.00.00.00
    QoS profile:
      Reliability: RELIABLE
      History (Depth): KEEP_LAST (10)
      Durability: VOLATILE
      Lifespan: Infinite
      Deadline: Infinite
      Liveliness: AUTOMATIC
      Liveliness lease duration: Infinite
      
    <<< subscriber >>>
    Node name: local_costmap
    Node namespace: /local_costmap
    Topic type: sensor_msgs/msg/PointCloud2
    Endpoint type: SUBSCRIPTION
    GID: 01.10.c8.68.70.d7.71.88.26.fa.40.fc.00.00.70.04.00.00.00.00.00.00.00.00
    QoS profile:
      Reliability: BEST_EFFORT
      History (Depth): KEEP_LAST (50)
      Durability: VOLATILE
      Lifespan: Infinite
      Deadline: Infinite
      Liveliness: AUTOMATIC
      Liveliness lease duration: Infinite

@dujeong
Copy link
Contributor Author

dujeong commented Mar 27, 2023

@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
Copy link
Contributor Author

dujeong commented Mar 27, 2023

but enabled parameter is still not working.

@GPrathap
Copy link

GPrathap commented Jan 29, 2024

I had the same issue solution was to install cyclone dds, #250

@GPrathap
Copy link

GPrathap commented Feb 8, 2024

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
Copy link
Contributor Author

dujeong commented Feb 12, 2024

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

@GPrathap
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants