Closed rikba closed 6 years ago
Or is this even necessary to access getOffset()
and getSkew()
from time_translator = SwitchingOwt(3600, ConvexHullOwt())
?
Oh sorry, yes I've overlooked that problem. It is necessary and even requires a cast to ConvexHullOwt
because that type gets lost on the way. Yes, the const overload should be the problem. The correct way is to do static casting to the expected function type to pick the overload.
Something like
static_cast<OneWayTranslator & (SwitchingOwt::*)()>(&SwitchingOwt::getCurrentOwt)
should do the trick.
Also, there is the issue of lifetime of the object referenced by the returned reference.
I'd suggest using the non const method (like in my example above) and add the , return_internal_reference<>()
argument to the .def
call, like here.
I can also do that soon.
We would like to access the current OWT to get information about the current offset and skew estimation https://github.com/ethz-asl/leica_totalstation_interface/pull/18. When adding getCurrentOwt() to the python bindings, i.e.,
we get the error:
I assume this is related to python not having function overloads. Others suggest creating an intermediate class to interface the code in python. Any suggestions @HannesSommer ?