Closed miguelriemoliveira closed 1 year ago
Taging @Kazadhum , @brunofavs , @manuelgitgomes for visibility.
We traced the problem into the aruco detector, in particular here:
Its possible to create the params, but the editing such as:
params.adaptiveThreshConstant = 2
fails with:
[1] 12512 segmentation fault (core dumped) /home/mike/workspaces/catkin_ws/devel/lib/atom_calibration/collect_data -s 0.
This seems to be a reported issue:
https://github.com/opencv/opencv-python/issues/735
Will try to adjust as suggested ...
I was able to make it work. The new version of opencv used a slightly different name for the functions, in particular
cv2.aruco.CharucoBoard() -> cv2.aruco.CharucoBoard_create()
and
cv2.aruco.DetectorParameters() -> cv2.aruco.DetectorParameters_create()
amonst other minor details. Now its working from my side.
One thing that puzzles me is how @manuelgitgomes and @danifpdra are using this without having the same problems.
Because I am not sure what is happenging here, its better is @manuelgitgomes or @danifpdra first test this branch just to make sure it works, before I merge it into the main branch.
@manuelgitgomes , @danifpdra can you try please?
Instructions for testing:
https://github.com/lardemua/atom/tree/miguelriemoliveira/issue629
rgb_rgb_system should already be installed in the repo.
See if the collector runs without crashing:
roslaunch rgb_rgb_system_calibration collect_data.launch output_folder:=$ATOM_DATASETS/rgb_rgb_system/dataset1 overwrite:=true
I can test but I don't have this system, where is it?
It is included in the atom repo ...
On Fri, Oct 6, 2023, 11:10 AM Daniela Rato @.***> wrote:
I can test but I don't have this system, where is it?
— Reply to this email directly, view it on GitHub https://github.com/lardemua/atom/issues/629#issuecomment-1750337303, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACWTHVTU4DUTEWKG4T6KFTDX57KHRAVCNFSM6AAAAAA5RU7B7GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJQGMZTOMZQGM . You are receiving this because you authored the thread.Message ID: @.***>
I don't know why but your branch doesn't show here
Where is here? Pycharm?
Perhaps a pull or a fecth are needed.
It shows on the github site
Hi @miguelriemoliveira ,
I managed to run this and it doesn't crash
But I don't see the interactive marker to save a collection. Was I supposed to?
Also, the labelers don't appear?
Hello @miguelriemoliveira!
I am running to the exact same error as @danifpdra!
Hi @danifpdra and @manuelgitgomes ,
My bad. I was trying out the labeler and to make it easier I deleted from the collect_data.launch the collector node, and ran it in a different terminal.
So to test you should:
Run the collect_data.launch just to bringup rviz
roslaunch rgb_rgb_system_calibration collect_data.launch output_folder:=$ATOM_DATASETS/rgb_rgb_system/dataset1 overwrite:=true
Run the collect node in a different terminal
rosrun atom_calibration collect_data -s 0.5 -o /home/mike/datasets/rgb_rgb_system/dataset1 -c /home/mike/workspaces/catkin_ws/src/calibration/atom/atom_examples/rgb_rgb_system/rgb_rgb_system_calibration/calibration/config.yml --overwrite
Let me know if it works.
Thanks to both
Hello @miguelriemoliveira
Everything runs smoothly from my side:
When running rosrun atom_calibration collect_data -s 0.5 -o /home/daniela/datasets/rgb_rgb_system/dataset1 -c /home/daniela/catkin_ws/src/calibration/atom/atom_examples/rgb_rgb_system/rgb_rgb_system_calibration/calibration/config.yml --overwrite
I get the error
Creating an InteractiveDataLabeler for sensor left_camera
Getting aruco dict
Traceback (most recent call last):
File "/home/daniela/catkin_ws/devel/lib/atom_calibration/collect_data", line 15, in <module>
exec(compile(fh.read(), python_script, 'exec'), context)
File "/home/daniela/catkin_ws/src/calibration/atom/atom_calibration/scripts/collect_data", line 145, in <module>
data_collector = DataCollectorAndLabeler(args, server, menu_handler)
File "/home/daniela/catkin_ws/src/calibration/atom/atom_calibration/src/atom_calibration/collect/data_collector_and_labeler.py", line 144, in __init__
sensor_labeler = InteractiveDataLabeler(self.server, self.menu_handler, sensor_dict,
File "/home/daniela/catkin_ws/src/calibration/atom/atom_calibration/src/atom_calibration/collect/interactive_data_labeler.py", line 137, in __init__
self.pattern = patterns.CharucoPattern(calib_pattern['dimension'], calib_pattern['size'],
File "/home/daniela/catkin_ws/src/calibration/atom/atom_calibration/src/atom_calibration/collect/patterns.py", line 85, in __init__
self.dictionary = cv2.aruco.Dictionary_get(cdictionary)
AttributeError: module 'cv2.aruco' has no attribute 'Dictionary_get'
What's your cv2 version? I think this is the problem
I have 4.7.0
Hi @danifpdra ,
I was working on that during the weekend.
Lets do a zoom call this afternoon to fix it once and for all ok?
I will call you when available, to see if its ok for you.
Hello @miguelriemoliveira! It's running correctly for me as well!
Hi @Kazadhum and @manuelgitgomes ,
thanks. Please confirm that your opencv version is 4.6.0.
We thing this is the problem.
Yes!
Do you have opencv-contrib-python
instead of only opencv
@danifpdra?
This ties with issue #541, where similar issues were presented.
Should we all update to 4.8.0 and adapt the code?
Hi @manuelgitgomes ,
right, I forgot we bumped into this problem before. I think we should stick to opencv 4.6.0 because its the default for Ubuntu 20.04, ros focal.
In any case, I am not sure why, @danifpdra has Ubuntu 20.04 and opencv 4.7.0.
We will try to do some ifs to make it work with both opencv versions.
In any case, I am not sure why, @danifpdra has Ubuntu 20.04 and opencv 4.7.0.
I believe if it's installed from pip
it installs the must updated version, if no specific version is defined.
If it is installed via the package manager apt
, it goes to that default.
We will try to do some ifs to make it work with both opencv versions.
We can do the both versions but it seems to me like extra work, and I am not certain it will work. I think python verifies syntax before running, so running deprecated functions will result in errors.
If we define it on our requirements.txt
that the user should have 4.7.0 or 4.8.0, when running our setup steps, the user will have the must updated opencv, guaranteeing the same version for everyone.
Hi @manuelgitgomes ,
@danifpdra already fixed it. I think its best not to enforce one specific version of opencv, as even inside our group we have several ... I will close for now as it seems to be working, if we run into problems again we'll use your method.
Thanks for the input @manuelgitgomes
Just merged PR. Should be fixed in the main branch now.
Using rgb_rgb_system with command
We get an error like this:
We traced the error here:
https://github.com/lardemua/atom/blob/ebde5c8bb7e76983760f91381f52cdceb547ff2a/atom_calibration/src/atom_calibration/collect/data_collector_and_labeler.py#L100-L102
but that does not make sense because its a ros function ...