Fix conversion of missing attributes (due to being optional?) and handling depth32/cv::Mat data
Using the aron types of https://git.h2t.iar.kit.edu/sw/playground/demo-mp-library/-/tree/test-vmp-memory/source/demo_mp_library/armem_movement_primitive/aron and https://git.h2t.iar.kit.edu/sw/armarx/skills/programming-by-demonstration/-/tree/dev/source/programming_by_demonstration/record_demonstration/aron, these fixes were required to convert the received ice data into dtos.
Especially the conversion of the depth32 data looks strange and should be checked by someone who is more familiar with the types underlying Aron at this point. @plewnia, could you please have a look, and/or do you have a suggestion on who else might be knowledgeable in these aspects?
Merge request reports
Activity
requested review from @plewnia
assigned to @daab
Might be solved by !73 (diffs), once this is completed and merged.
The above mentioned depth32 conversion might need information from @peller.
If we want to keep the fix for the datatype '14' info needs to be added to https://git.h2t.iar.kit.edu/sw/armarx/python3-armarx/-/blob/adfd5b960e6f476358f1d2b876436921d4133e44/armarx_memory/aron/conversion/ndarray/common.py
The following info dicts need to be adjusted (best with info what type this is, see example for type '16'):
# In aron objects, the data type is denoted as a string. # dtypes_dict_to_python serves as a lookup table for aron's data type string to the python type. dtypes_dict_to_python = { "float": np.float32, "float32": np.float32, "double": np.float64, "float64": np.float64, "16": dtype_rgb, # "16" == OpenCV 8UC3 = RGB image # "16": np.float32, # "16" == OpenCV F1C1 = Depth image } # dtypes_dict_to_aron serves as a lookup table for the python type to aron's data type string. # As the mapping is not bijective, querying dtypes_dict_to_python in a reverse direction is not suitable. # The python types are converted to string, as it may happen that they are unhashable (like dtype_rgb, being a list) dtypes_dict_to_aron = { str(np.dtype(np.int32)): "int", str(np.dtype(np.float32)): "float", str(np.dtype(np.float64)): "double", # alternative: "float64" str(np.dtype(dtype_rgb)): "16", }
From my side this seems fine.
@peller might have more insight, so I switched reviewers.
@uxiic_schaub : please add a comment as to what data type this actually encodes, similar to the already given types
added 1 commit
- 6da940ea - for discussion: made ndarray in aron compatible with all opencv types, but...