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

Camera test passes even when it fails #49

Open
chrismbirmingham opened this issue May 19, 2021 · 6 comments
Open

Camera test passes even when it fails #49

chrismbirmingham opened this issue May 19, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@chrismbirmingham
Copy link
Member

chrismbirmingham commented May 19, 2021

Camera test passed even when issuing the following error:

  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/root/harmoni_catkin_ws/src/HARMONI/harmoni_sensors/harmoni_camera/nodes/camera_service.py", line 69, in start
    self._read_stream_and_publish()  # Start the camera service at the INIT
  File "/root/harmoni_catkin_ws/src/HARMONI/harmoni_sensors/harmoni_camera/nodes/camera_service.py", line 124, in _read_stream_and_publish
    raise RuntimeError("No camera frame available. Is the configured device accessible?")
RuntimeError: No camera frame available. Is the configured device accessible?```
@chrismbirmingham chrismbirmingham added the bug Something isn't working label May 19, 2021
@chrismbirmingham
Copy link
Member Author

This may be related to threading, possibly stopping the service while the stream capture is still happening leading to reading from a closed stream. This test should also be refactored to check the images are being received.

@chrismbirmingham
Copy link
Member Author

More info from the test below, I would note that it definitely is taking and saving a picture.

[ROSUNIT] Outputting test results to /root/.ros/test_results/harmoni_camera/rostest-test_camera.xml
[INFO] [1623948209.512973]: Initializing the camera_default service
[INFO] [1623948209.513266]: Setting up the camera_default
[ WARN:0] global /tmp/opencv-4.4.0/modules/videoio/src/cap_gstreamer.cpp (935) open OpenCV | GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1
[INFO] [1623948210.111709]: Opening the video input stream
[INFO] [1623948210.114438]: Sucessfully reached camera_default
[INFO] [1623948210.114640]: Service Server camera_default has been successfully set up
[INFO] [1623948210.124570]: camera_default Service Server sending feedback at 0.2/sec
[WARN] [1623948212.203501]: (Server) The goal is available
[INFO] [1623948212.203712]: (Server) The goal is a 1
[INFO] [1623948212.203889]: The goal is: 1
[INFO] [1623948212.203993]: (Server camera_default) Received goal. Starting
[INFO] [1623948212.204179]: Start the camera_default service
[WARN] [1623948212.205048]: Your executeCallback did not set the goal to a terminal status.  This is a bug in your ActionServer implementation. Fix your code!  For now, the ActionServer will set this goal to aborted
[WARN] [1623948217.208942]: (Server) The goal is available
[INFO] [1623948217.209490]: (Server) The goal is a 0
[INFO] [1623948217.209692]: The goal is: 0
[INFO] [1623948217.209919]: (Server camera_default) Received goal. Stopping
[INFO] [1623948217.210250]: Stop the camera_default service
[WARN] [1623948217.210493]: Your executeCallback did not set the goal to a terminal status.  This is a bug in your ActionServer implementation. Fix your code!  For now, the ActionServer will set this goal to aborted
Exception in thread Thread-16:
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/root/harmoni_catkin_ws/src/HARMONI/harmoni_sensors/harmoni_camera/nodes/camera_service.py", line 69, in start
    self._read_stream_and_publish()  # Start the camera service at the INIT
  File "/root/harmoni_catkin_ws/src/HARMONI/harmoni_sensors/harmoni_camera/nodes/camera_service.py", line 124, in _read_stream_and_publish
    raise RuntimeError("No camera frame available. Is the configured device accessible?")
RuntimeError: No camera frame available. Is the configured device accessible?

[WARN] [1623948227.227114]: Inbound TCP/IP connection failed: connection from sender terminated before handshake header received. 0 bytes were received. Please check sender for additional details.
[Testcase: testtest_camera] ... ok

@emdg05
Copy link
Contributor

emdg05 commented Jul 19, 2021

Here is the output I received from the camera test. It still passes but no image is taken. When the image in temp_data is deleted, it is not replaced. @micolspitale93 can you try to run it on your setup and see if the same error occurs?

[INFO] [1626723028.231603]: Initializing the camera_default service
[INFO] [1626723028.233722]: Setting up the camera_default
[ WARN:0] global /tmp/opencv-4.4.0/modules/videoio/src/cap_gstreamer.cpp (1761) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module v4l2src0 reported: Cannot identify device '/dev/video1'.
[ WARN:0] global /tmp/opencv-4.4.0/modules/videoio/src/cap_gstreamer.cpp (888) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:0] global /tmp/opencv-4.4.0/modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
[ WARN:0] global /tmp/opencv-4.4.0/modules/videoio/src/cap_v4l.cpp (893) open VIDEOIO(V4L2:/dev/video1): can't open camera by index
[INFO] [1626723028.359306]: Opening the video input stream
[INFO] [1626723028.373426]: Sucessfully reached camera_default
[INFO] [1626723028.375055]: Service Server camera_default has been successfully set up
[INFO] [1626723028.470166]: camera_default Service Server sending feedback at 0.2/sec
[WARN] [1626723030.602111]: (Server) The goal is available
[INFO] [1626723030.605347]: (Server) The goal is a 1
[INFO] [1626723030.607551]: The goal is: 1
[INFO] [1626723030.611247]: (Server camera_default) Received goal. Starting
[INFO] [1626723030.613939]: Start the camera_default service
[WARN] [1626723030.616323]: Your executeCallback did not set the goal to a terminal status.  This is a bug in your ActionServer implementation. Fix your code!  For now, the ActionServer will set this goal to aborted
Exception in thread Thread-16:
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/root/harmoni_catkin_ws/src/HARMONI/harmoni_sensors/harmoni_camera/nodes/camera_service.py", line 69, in start
    self._read_stream_and_publish()  # Start the camera service at the INIT
  File "/root/harmoni_catkin_ws/src/HARMONI/harmoni_sensors/harmoni_camera/nodes/camera_service.py", line 124, in _read_stream_and_publish
    raise RuntimeError("No camera frame available. Is the configured device accessible?")
RuntimeError: No camera frame available. Is the configured device accessible?

[WARN] [1626723035.607401]: (Server) The goal is available
[INFO] [1626723035.610461]: (Server) The goal is a 0
[INFO] [1626723035.612089]: The goal is: 0
[INFO] [1626723035.615138]: (Server camera_default) Received goal. Stopping
[INFO] [1626723035.617918]: Stop the camera_default service
[WARN] [1626723035.619810]: Your executeCallback did not set the goal to a terminal status.  This is a bug in your ActionServer implementation. Fix your code!  For now, the ActionServer will set this goal to aborted
[Testcase: testtest_camera] ... ok

@micolspitale93
Copy link
Collaborator

Sure. I will check it and update you

@chrismbirmingham
Copy link
Member Author

@emdg05 Can you retry on the nuc? The camera is actually plugged into the nuc

@emdg05
Copy link
Contributor

emdg05 commented Jul 21, 2021

@chrismbirmingham I tried on the nuc and got the exact same output. There is also no image taken

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants