rosparam_shortcuts
rosparam_shortcuts copied to clipboard
Support loading lists of booleans from parameter server
Something I needed and might be of use to others.
This PR also changes getDebugArrayString(..) to a templated function, so as to avoid having to create versions for all the different types of std::vector<..> that NodeHandle::getParam(..) supports.
NodeHandle::getParam(..) supports a lot of overloads, many more than rosparam_shortcuts exposes through get(..).
Would it make sense to use templating for get(..) as well to be able to pass that through to NodeHandle::getParam(..) or would that not be of interest?
Oh and target branch is melodic-devel, but I've only tested this on Kinetic. Seeing as kinetic-devel == melodic-devel, I figured you'd want to target PRs against the newest branch.
@gavanderhoorn, when I switched to using the master branch of MoveIt (from melodic-devel), using the add_vector_of_bool branch broke compiling moveit for me with this error (see below). I fixed it by moving the template specialization to the .cpp file instead of the .h file (PR to our fork here) -- let me know if you'd like me to make a PR to your branch here as well.
CMakeFiles/jog_arm_server.dir/src/jog_arm/jog_ros_interface.cpp.o: In function std::__cxx11::basic_string<char, std::char_traitsstd::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > rosparam_shortcuts::getDebugArrayString<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)' CMakeFiles/jog_arm_server.dir/src/jog_arm/jog_arm_server.cpp.o:jog_arm_server.cpp:(.text+0x0): first defined here collect2: error: ld returned 1 exit status moveit/moveit_experimental/jog_arm/CMakeFiles/jog_arm_server.dir/build.make:342: recipe for target '/home/bhomberg/ws/iron-ox/devel/lib/moveit_experimental/jog_arm_server' failed make[2]: *** [/home/bhomberg/ws/iron-ox/devel/lib/moveit_experimental/jog_arm_server] Error 1 CMakeFiles/Makefile2:56880: recipe for target 'moveit/moveit_experimental/jog_arm/CMakeFiles/jog_arm_server.dir/all' failed make[1]: *** [moveit/moveit_experimental/jog_arm/CMakeFiles/jog_arm_server.dir/all] Error 2 Makefile:140: recipe for target 'all' failed
Seems I forgot to add inline on all templated methods.
I'd love to merge this in, if we can update the README and address the inline issue