borglab / GTDynamics

Full kinodynamics constraints for arbitrary robot configurations with factor graphs.
BSD 2-Clause "Simplified" License
39 stars 10 forks source link

Add KinematicsParameters to python wrapper #285

Closed gchenfc closed 2 years ago

gchenfc commented 2 years ago

Title self-explanatory.

With @nrakoski3

gchenfc commented 2 years ago

I'm familiar with the @, *, and &, but where are you proposing to use the pointer? (btw, I think you maybe meant "at" symbol, ampersand is normal reference right?)

This is a const-reference to a boost::shared pointer of a const - so I'm not sure how to make this cleaner?

We can delete the const ref - I guess the const ref saves one counter increment/decrement that won't (?) get compiler optimized, but I doubt that makes much of a difference.

dellaert commented 2 years ago

KISS? in a .i files the symbol `` already means “shared pointer”. Usage in python should be:

p = Params(…)
Some_functionthat_takes_shared_pointer(p) 

and in .i file:

class Params{ …};
void Some_functionthat_takes_shared_pointer(Params* p);

and clean up ref/const in c++ to match:

void Some_functionthat_takes_shared_pointer(const boost::shared_ptr<Params>& p);
gchenfc commented 2 years ago

Wow thanks I'm stupid, I don't know why I thought that wouldn't work but in retrospect it should have been obvious. Thanks all!

varunagrawal commented 2 years ago

Yeah my comment wasn't super clear. Glad you managed to figure it out.