rclcpp parameter build fail
I was trying to build the laserproc repo for ros2 found here, but I am getting these errors. However it used to build properly until a couple days ago, I am guessing before this PR was merged : https://github.com/ros2/rclcpp/pull/4... because the errors pertain to changes made in this PR, however when I include rclcpp header file and use parameters in other codes it builds and works fine, for example talker code from demonodescpp works fine with parameters callbacks and everything, so what is going wrong in this laserproc package?
Scanning dependencies of target laser_publisher
[ 25%] Building CXX object CMakeFiles/laser_publisher.dir/src/LaserPublisher.cpp.o
In file included from /home/batman/ros2_ws/install/include/rclcpp/node_interfaces/node_parameters_interface.hpp:26:0,
from /home/batman/ros2_ws/install/include/rclcpp/node.hpp:48,
from /home/batman/ros2_ws/install/include/rclcpp/executors/single_threaded_executor.hpp:28,
from /home/batman/ros2_ws/install/include/rclcpp/executors.hpp:22,
from /home/batman/ros2_ws/install/include/rclcpp/rclcpp.hpp:144,
from /home/batman/ros2_ws/src/urg_package/laser_proc/include/laser_proc/LaserPublisher.h:37,
from /home/batman/ros2_ws/src/urg_package/laser_proc/src/LaserPublisher.cpp:34:
/home/batman/ros2_ws/install/include/rclcpp/parameter.hpp:65:12: error: expected primary-expression before ‘auto’
decltype(auto)
^
/home/batman/ros2_ws/install/include/rclcpp/parameter.hpp:65:12: error: expected ‘)’ before ‘auto’
/home/batman/ros2_ws/install/include/rclcpp/parameter.hpp:65:3: error: expected unqualified-id before ‘decltype’
decltype(auto)
^
/home/batman/ros2_ws/install/include/rclcpp/parameter.hpp:73:12: error: expected primary-expression before ‘auto’
decltype(auto)
^
/home/batman/ros2_ws/install/include/rclcpp/parameter.hpp:73:12: error: expected ‘)’ before ‘auto’
/home/batman/ros2_ws/install/include/rclcpp/parameter.hpp:73:3: error: expected unqualified-id before ‘decltype’
decltype(auto)
^
In file included from /home/batman/ros2_ws/install/include/rclcpp/node.hpp:449:0,
from /home/batman/ros2_ws/install/include/rclcpp/executors/single_threaded_executor.hpp:28,
from /home/batman/ros2_ws/install/include/rclcpp/executors.hpp:22,
from /home/batman/ros2_ws/install/include/rclcpp/rclcpp.hpp:144,
from /home/batman/ros2_ws/src/urg_package/laser_proc/include/laser_proc/LaserPublisher.h:37,
from /home/batman/ros2_ws/src/urg_package/laser_proc/src/LaserPublisher.cpp:34:
/home/batman/ros2_ws/install/include/rclcpp/node_impl.hpp: In member function ‘bool rclcpp::Node::get_parameter(const string&, ParameterT&) const’:
/home/batman/ros2_ws/install/include/rclcpp/node_impl.hpp:233:23: error: ‘class rclcpp::Parameter’ has no member named ‘get_value’
value = parameter.get_value<ParameterT>();
^
/home/batman/ros2_ws/install/include/rclcpp/node_impl.hpp:233:43: error: expected primary-expression before ‘>’ token
value = parameter.get_value<ParameterT>();
^
/home/batman/ros2_ws/install/include/rclcpp/node_impl.hpp:233:45: error: expected primary-expression before ‘)’ token
value = parameter.get_value<ParameterT>();
^
In file included from /home/batman/ros2_ws/install/include/rclcpp/rclcpp.hpp:148:0,
from /home/batman/ros2_ws/src/urg_package/laser_proc/include/laser_proc/LaserPublisher.h:37,
from /home/batman/ros2_ws/src/urg_package/laser_proc/src/LaserPublisher.cpp:34:
/home/batman/ros2_ws/install/include/rclcpp/parameter_client.hpp: In member function ‘T rclcpp::SyncParametersClient::get_parameter_impl(const string&, std::function<T()>)’:
/home/batman/ros2_ws/install/include/rclcpp/parameter_client.hpp:207:37: error: ‘__gnu_cxx::__alloc_traits<std::allocator<rclcpp::Parameter> >::value_type {aka class rclcpp::Parameter}’ has no member named ‘get_value’
return static_cast<T>(vars[0].get_value<T>());
^
/home/batman/ros2_ws/install/include/rclcpp/parameter_client.hpp:207:48: error: expected primary-expression before ‘>’ token
return static_cast<T>(vars[0].get_value<T>());
^
/home/batman/ros2_ws/install/include/rclcpp/parameter_client.hpp:207:50: error: expected primary-expression before ‘)’ token
return static_cast<T>(vars[0].get_value<T>());
^
CMakeFiles/laser_publisher.dir/build.make:62: recipe for target 'CMakeFiles/laser_publisher.dir/src/LaserPublisher.cpp.o' failed
make[2]: *** [CMakeFiles/laser_publisher.dir/src/LaserPublisher.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/laser_publisher.dir/all' failed
make[1]: *** [CMakeFiles/laser_publisher.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
<== Command '. /home/batman/ros2_ws/build/laser_proc/cmake__build.sh && /usr/bin/make' failed in '/home/batman/ros2_ws/build/laser_proc' with exit code '2'
<== Command '. /home/batman/ros2_ws/build/laser_proc/cmake__build.sh && /usr/bin/make' failed in '/home/batman/ros2_ws/build/laser_proc' with exit code '2'
Asked by aarushg on 2018-06-20 17:58:29 UTC
Answers
The CMake code of that package sets the compiler flag -std=c++11
. If you are using the current ROS 2 code base you will need C++ 14.
Asked by Dirk Thomas on 2018-06-20 18:00:34 UTC
Comments