catkin build error
I Downloaded Phantomx_gazebo Package from github and then cloned Phantomx_Description from Github. The page says i need to have Hector_gazebo in my workspace to use the above package. I cloned this as well in my workspace.
After this I used Catkin Build then it gave me some plugin missing error which I the solved by installing the Plugin.
Now after this when I tried to Build the workspace again I get the following error which i have uploaded on gist.
This is the link for the gist https://gist.github.com/impaidk/3ad89.... Example error:
Errors << combined_robot_hw:make /home/paidevikiran/wzl_ws/logs/combined_robot_hw/build.make.005.log
In file included from /home/paidevikiran/wzl_ws/src/ros_control/combined_robot_hw/include/combined_robot_hw/combined_robot_hw.h:37:0,
from /home/paidevikiran/wzl_ws/src/ros_control/combined_robot_hw/src/combined_robot_hw.cpp:29:
/home/paidevikiran/wzl_ws/src/ros_control/hardware_interface/include/hardware_interface/robot_hw.h:168:14: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
typedef std::shared_ptr<RobotHW> RobotHWSharedPtr;
^
In file included from /home/paidevikiran/wzl_ws/src/ros_control/combined_robot_hw/src/combined_robot_hw.cpp:29:0:
/home/paidevikiran/wzl_ws/src/ros_control/combined_robot_hw/include/combined_robot_hw/combined_robot_hw.h:107:15: error: ‘RobotHWSharedPtr’ is not a member of ‘hardware_interface’
std::vector<hardware_interface::RobotHWSharedPtr> robot_hw_list_;
^
/home/paidevikiran/wzl_ws/src/ros_control/combined_robot_hw/include/combined_robot_hw/combined_robot_hw.h:107:15: error: ‘RobotHWSharedPtr’ is not a member of ‘hardware_interface’
/home/paidevikiran/wzl_ws/src/ros_control/combined_robot_hw/include/combined_robot_hw/combined_robot_hw.h:107:51: error: template argument 1 is invalid
std::vector<hardware_interface::RobotHWSharedPtr> robot_hw_list_;
^
/home/paidevikiran/wzl_ws/src/ros_control/combined_robot_hw/include/combined_robot_hw/combined_robot_hw.h:107:51: error: template argument 2 is invalid
/home/paidevikiran/wzl_ws/src/ros_control/combined_robot_hw/include/combined_robot_hw/combined_robot_hw.h:116:49: error: ‘hardware_interface::RobotHWSharedPtr’ has not been declared
hardware_interface::RobotHWSharedPtr robot_hw);
My System specs are:
- Ubuntu 16.04
- Ros-kinetic built from source
- cmake version 3.5.1
- gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11)
From your link I understand that you are running on Kinetic. However the "combined_robot_hw" you are using uses std's smart pointers and, AFAIK, before Melodic most of ROS packages used smart pointers from Boost. It might be that you cloned some repositories that are meant for Melodic and some that are meant for Kinetic (that could just explain why they do not work "out of the box"). When you get an error like https://gist.github.com/impaidk/3ad89... you should make sure that you are compiling with C++11 (add add_definitions(-std=c++11) into your CMakeLists.txt). You might also need to add #include<memory> in the file(s) that use std::shared_ptr. I would also suggest you to include the link to the repositories you mention (including which branch you cloned) so that it will be easier to provide help!</memory>
Hi,
https://github.com/ros-controls/ros_c... This is the link to the repository and the branch that I cloned is kinetic devel. #include <memory> is already there in those files but I'm not able to understand where to add add_definitions(-std=c++11) in the CMakeLists.txt file. (I'm really very new to ROS) Could you help me with this?</memory>
Just to check: your link points to the branch melodic-devel, which uses
std::shared_ptr
(see https://github.com/ros-controls/ros_c... ). Instead, the kinetic-devel branch usesboost::shared_ptr
(see https://github.com/ros-controls/ros_c... ). Can you check that you cloned the correct branch?Also, to answer your other question: in general you can put
add_definitions
right after thecmake_minimum_required
andproject
commands in the CMakeLists.txt file. However, I suggest to change it only if really required, ROS control is a very well established package and I am pretty sure you can compile it without changing anything ;)