RoboticsAcademy icon indicating copy to clipboard operation
RoboticsAcademy copied to clipboard

[Computer Vision exercises] Unable to launch Computer vision exercises that rely on webcam for input

Open pawanw17 opened this issue 2 years ago • 8 comments

Hi, I am unable to launch Computer vision exercises that require user webcam (/dev/videoX) for input. I don't see the camera output on the web UI.

Command used to run: docker run --rm -it -p 8000:8000 -p 2303:2303 -p 1905:1905 -p 8765:8765 -p 6080:6080 -p 1108:1108 --device /dev/video0:/dev/video0 jderobot/robotics-academy

I have tried with /dev/video1 and /dev/video0 with no luck.

image

pawanw17 avatar Mar 15 '23 23:03 pawanw17

i face the same issue

codezerro avatar Mar 22 '23 21:03 codezerro

I have the same issue. You could run v4l2-ctl --list-devices and see a list of your video devices, make sure the camera you use is listed as /dev/video0

Qi-Zha0 avatar Mar 27 '23 16:03 Qi-Zha0

It looks like you are running a Docker container for the Robotics Academy, and trying to use the webcam as an input to some Computer Vision exercises. However, you are not able to see the camera output on the web UI.

Here are some steps you can try to fix this issue:

Check if the webcam is working: Make sure that the webcam is properly connected and working. You can try running the webcam outside the Docker container to verify this.

Check if the webcam is being detected by Docker: Verify that the Docker container has access to the webcam by running the following command: ls -l /dev/video*. This should show the list of video devices available in the container. If the webcam is not listed, you might need to modify the Docker run command to include the correct device path.

Check if the exercise requires camera input: Verify that the Computer Vision exercise you are trying to run actually requires webcam input. Some exercises might work with pre-recorded video or image input instead of live camera input.

Check the web UI settings: Make sure that the web UI settings are configured to use the webcam as the input source. Check the settings of the exercise and make sure that the camera is selected as the input source.

Try running the container with elevated privileges: Some Docker containers require elevated privileges to access hardware devices such as webcams. You can try running the container with the --privileged flag to see if this resolves the issue.

Check for errors: Check the console or error logs for any errors or warnings related to the webcam. Fix any issues that might be preventing the webcam from working properly.

If none of the above steps work, try providing more details about the specific Computer Vision exercise you are trying to run, the webcam model and brand, and any error messages or warnings you receive. This will help in identifying the specific issue and providing a more targeted solution.

saurabhmj11 avatar Apr 04 '23 11:04 saurabhmj11

Hi @saurabhmj11 Can you verify if the exercise "Color filter" working for you?

pawanw17 avatar Apr 04 '23 12:04 pawanw17

That exercise heavily depends on the user machine's OS. It should work fine for Linux machines, but I have not seen it working on Windows machines due to problems in the access to USB ports of the host machine from the Robotics Academy Docker Image (RADI).

jmplaza avatar Apr 04 '23 12:04 jmplaza

Hi @jmplaza I am using ubuntu at the moment, I can give a shot to @saurabhmj11 's suggestions

pawanw17 avatar Apr 04 '23 12:04 pawanw17

@jmplaza Still unable to view the user's camera in the UI. An interesting thing is, post the exercise launch the camera does get busy, i.e I am unable to use it on the host machine (the camera light is not on yet). After exiting the exercise, I am able to use it again. I am also able to run the camera in the RADI using a test script (with camera light on).

pawanw17 avatar Apr 06 '23 10:04 pawanw17

@jmplaza The exercise seems to run fine in melodic RADI, Looking more into this.

EDIT: Unfortunately I am not seeing any logs that indicate a problem :/

pawanw17 avatar Apr 10 '23 11:04 pawanw17