don't create optimization objectives in python. this leads to crashes with multithreaded planners like SPARS and SPARStwo. instead, use a little C++ help function.