Closed IanTheEngineer closed 7 years ago
There are ways around it, but the creating a unique pointer from a raw pointer in a robust manner requires C++14:
std::make_unique<KDL::ChainIdSolver_RNE>(kin.chain, gravity);
As for auto
, there's a large discussion in the C++ community about its usage. I have a book references that recommend it be used by default, unless you have a reason not to (Item 5 in Effective Modern C++, by Scott Meyers), but this stackexchange answer summarizes the rational nicely:
https://softwareengineering.stackexchange.com/a/180616/112028
To be honest, since this is a library targeting Ubuntu 16.04 and later, which ships with gcc 5.04 and has full C++14 capabilities, I see no reason to avoid using the more recent version of the language.
I defer to following the Google style guide for when to use auto: https://google.github.io/styleguide/cppguide.html#auto
I agree with you there:
When to 'auto':
(Allowed) When the type is clear from local context (in the same expression or within a few lines). Initialization of a pointer or smart pointer with calls to new commonly falls into this category, as does use of auto in a range-based loop over a container whose type is spelled out nearby.
(Allowed) When the type doesn't matter because it isn't being used for anything other than equality comparison.
This adds Kinematics functionality to the Sawyer Simulator:
/robot/limb/right/endpoint_state