minisam
minisam copied to clipboard
Iterator over Variables and FactorGraph in Python
Hi Jing/Zhaoyang,
Great work with the library especially the Python wrapper. I was playing with it and I was not able to iterate over Variables. I could iterate over FactorGraph but I was not able to extract anything out of each factor.
I tried iterating like this:
for key in initials:
print(key)
And I get an error:
Traceback (most recent call last):
File "gps_factor_example.py", line 109, in <module>
for key in initials:
KeyError: '[python::Variables] key does not exist'
Wondering if I am doing something wrong or this is not supported yet.
Hi Sidd @itzsid ! I don't think the key iterator is implemented now. I will have a look, and if you want to have a look ahead, the location of the python binding of Variables
is at python/minisam_wrapper/variables.cpp
, which needs some pybind11 knowledge to understand :)