ros-perception / ros-perception/perception_pcl

ProjectInliers receives outdated inputs

Open
#116 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
482
Forks
372
PR merge metrics
No merged PRs in 30d

Description

Hi,
I'm using the SacSegmentation and ProjectInliers nodelets to find planes. There are times when we want to stop the plane finder for a while (for example by stopping the camera node) and restart it after say 10 seconds. When the camera is restarted, the first output from ProjectInliers has a timestamp corresponding to the pointclouds from the first point cloud inputs.

Here is a sample launch file I'm using. What I'm describing can be reproduced by the following:

  1. launch camera pointed at a vertical wall
  2. launch plane finder (sample.launch)
  3. echo header of ProjectInliers output (rostopic echo /perception/project_plane_inliers/output/header)
  4. kill the camera launch file
  5. Note the last timestamp of ProjectInliers output
  6. Wait for a while and restart camera launch file
  7. Note the first and second timestamp of ProjectInliers output

For example, the timestamps I get are:
From (5):

seq: 219
stamp: 
  secs: 1459428523
  nsecs: 205892078
frame_id: camera_rgb_optical_frame

---

From (7):

seq: 220
stamp: 
  secs: 1459428523
  nsecs: 305999271
frame_id: camera_rgb_optical_frame

---
seq: 221
stamp: 
  secs: 1459428542
  nsecs: 418833725
frame_id: camera_rgb_optical_frame

---

I've dug into the problem a bit and found that it's caused by the time synchronized subscriber (for input, indices and model) in ProjectInliers. The time synchronizer is triggered after a new set of indices are published here but before the model is published in the next line. When that happens, the best set available to the synchronizer consists of the old model, inliers and input pointcloud, so ProjectInliers receives this old set instead of the new model and inliers. This is happening with both the exact time synchronizer (in hydro) and the approximate time synchronizer (in indigo). The approximate time synchronizer is used in indigo because of #115.
A minimum queue size (as specified by the parameter max_queue_size) of 2 is required to get any output at all from ProjectInliers. But because of this, the queue contains old data.

Is there a way to fix this or get around this problem? I realize this issue is partially related to the time synchronizer.
Thanks

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the sequence in the issue using the sample launch file, stopping and restarting the camera while observing ProjectInliers output headers. Read pcl_ros/src/pcl_ros/segmentation/sac_segmentation.cpp around line 335 and inspect the ProjectInliers time-synchronized inputs; done means restarted output no longer uses the old model, inliers, or pointcloud timestamp.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
robotics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.