ros-perception / opencv_apps

http://wiki.ros.org/opencv_apps
65 stars 70 forks source link

[face_detection] Fix arg condition when launching with opencv4 in noetic #142

Open tkmtnt7000 opened 1 year ago

tkmtnt7000 commented 1 year ago

On noetic with opencv4, the following error occurs because arg face_cascade_name declares twice.

$ roslaunch opencv_apps face_detection.launch use_opencv4:=true image:=/usb_cam/image_raw debug_view:=false 
... logging to /home/tsukamoto/.ros/log/816f6d2e-9c7e-11ed-a041-270d6101f3c5/roslaunch-tsukamoto-desktop-ryzen-471330.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

RLException: Invalid <arg> tag: arg 'face_cascade_name' has already been declared. 

Arg xml is <arg unless="$(arg use_opencv3)" name="face_cascade_name" default="/usr/share/opencv/haarcascades/haarcascade_frontalface_alt.xml" doc="Face dtection cascade Filename"/>
The traceback for the exception was written to the log file

I think I fixed it in this PR, but this may not be the best solution because it contains breaking changes. So, could you tell me if anyone have another solution?

And I also fixed typo.

k-okada commented 1 year ago

thank you. can you add test code for opencv4? https://github.com/ros-perception/opencv_apps/blob/74fad3a6f7d52ee6de61cfc1461fdfaebf12534f/test/CMakeLists.txt#L83-L86

◉ Kei Okada

2023年1月25日(水) 18:46 Naoto Tsukamoto @.***>:

On noetic with opencv4, the following error occurs because arg face_cascade_name declares twice.

$ roslaunch opencv_apps face_detection.launch use_opencv4:=true image:=/usb_cam/image_raw debug_view:=false ... logging to /home/tsukamoto/.ros/log/816f6d2e-9c7e-11ed-a041-270d6101f3c5/roslaunch-tsukamoto-desktop-ryzen-471330.log Checking log directory for disk usage. This may take a while. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.

RLException: Invalid tag: arg 'face_cascade_name' has already been declared.

Arg xml is The traceback for the exception was written to the log file

I think I fixed it in this PR, but this may not be the best solution because it contains breaking changes. So, could you tell me if anyone have another solution?

And I also fixed typo.

You can view, comment on, or merge this pull request online at:

https://github.com/ros-perception/opencv_apps/pull/142 Commit Summary

File Changes

(1 file https://github.com/ros-perception/opencv_apps/pull/142/files)

Patch Links:

— Reply to this email directly, view it on GitHub https://github.com/ros-perception/opencv_apps/pull/142, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADYNXGAFJG6KUPGJTMRLVTWUDY5RANCNFSM6AAAAAAUGDB6NQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>