borglab / GTDynamics

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

Need for shared pointers as arguments? #320

Closed varunagrawal closed 2 years ago

varunagrawal commented 2 years ago

Great stuff on the new updates.

However I had a question about using shared pointers as function and constructor args. Is there a reason we're doing Optimizer(const boost::shared_ptr<const OptimizationParameters>& parameters) instead of Optimizer(const OptimizationParameters& parameters)?

Seems like unnecessary verbosity to me especially when OptimizationParameters is a simple struct (aka an encapsulation of various parameters).

dellaert commented 2 years ago

ShareD Pointers are great for noise models, which could be used in thousands of factors or even millions. If we only create a handful or one optimizer ever, I agree it is not needed here.

varunagrawal commented 2 years ago

That's what I figured as well. Highly unlikely we'll need hundreds of optimizer parameters ever.