Feature #98

Openni capture service.

Added by Libor Wagner about 5 years ago. Updated about 5 years ago.

Status:ClosedStart date:09/26/2012
Priority:NormalDue date:
Assignee:Libor Wagner% Done:

100%

Category:VisionSpent time:-
Target version:Calibration
Related Partner Organisation:CTU

Description

Implement node with one service to capture a rgb and depth images and save them to specified folder.

History

#1 Updated by Libor Wagner about 5 years ago

The time stamps of rgb and depth images are not exactly the same. Therefore, we are using ApproximateSynchronizer from camera_calibration package. There was a bug:

Traceback (most recent call last):
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/topics.py", line 678, in _invoke_callback
    cb(msg)
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/message_filters/__init__.py", line 72, in callback
    self.signalMessage(msg)
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/message_filters/__init__.py", line 55, in signalMessage
    cb(*(msg + args))
  File "/home/wagnelib/Source/ROS/camera_calibration/src/camera_calibration/approxsync.py", line 70, in add
    msgs = [q[t] for q,t in zip(self.queues, vv)]
KeyError: genpy.Time[1348642984378149363]

which I have fixed:

diff --git a/src/approxsync.py b/src/approxsync.py
index 7d588c9..4ca6703 100644
--- a/src/approxsync.py
+++ b/src/approxsync.py
@@ -69,7 +69,7 @@ class ApproximateSynchronizer(message_filters.SimpleFilter):
                 if ((max(vv) - min(vv)) < self.slop):
                     msgs = [q[t] for q,t in zip(self.queues, vv)]
                     self.signalMessage(*msgs)
-                    for q in self.queues:
+                    for q,t in zip(self.queues,vv):
                         try:
                             del q[t]
                         except KeyError:

#2 Updated by Libor Wagner about 5 years ago

The error still occurs, this is a fast fix:

diff --git a/src/approxsync.py b/src/approxsync.py
index 7d588c9..a11ab28 100644
--- a/src/approxsync.py
+++ b/src/approxsync.py
@@ -67,11 +67,11 @@ class ApproximateSynchronizer(message_filters.SimpleFilter):
         else:
             for vv in itertools.product(*[q.keys() for q in self.queues]):
                 if ((max(vv) - min(vv)) < self.slop):
-                    msgs = [q[t] for q,t in zip(self.queues, vv)]
-                    self.signalMessage(*msgs)
-                    for q in self.queues:
-                        try:
+                    try:
+                        msgs = [q[t] for q,t in zip(self.queues, vv)]
+                        self.signalMessage(*msgs)
+                        for q,t in zip(self.queues,vv):
                             del q[t]
-                        except KeyError:
-                            pass # TODO: why can del q[t] fail?
+                    except KeyError, e:
+                        rospy.logwarn("KeyError: %s", e)
         self.lock.release()

#3 Updated by Libor Wagner about 5 years ago

  • Status changed from New to In Progress

I have dropped the implementation of Python node as the C++ implementation has better support.

#4 Updated by Libor Wagner about 5 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

The openni_capture node is implemented and short description is given in clopema_calibration.

However, there is one drawback. The depth image captured should be saved as 11 bit PGM, but is saved as 16 bit PGM.

Also available in: Atom PDF