catkin build error
I Downloaded Phantomxgazebo Package from github and then cloned PhantomxDescription 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/3ad8902c7501dca1044af360d209ac74. 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)
Asked by impaidk on 2019-08-22 14:24:11 UTC
Answers
did you see if there are missing dependencies?
from catkin_ws/ run rosdep install --from-paths src --ignore-src -r -y
this parses the package.xml files of those in your workspace and installs them for you if they are missing.
Asked by prefpkg21 on 2019-08-26 07:29:57 UTC
Comments
I tried doing this but even though it updated some dependencies I'm having the same error.
Asked by impaidk on 2019-08-27 04:42:34 UTC
Can you post your CMakeLists file?
Asked by prefpkg21 on 2019-08-27 10:52:05 UTC
Comments
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/3ad8902c7501dca1044af360d209ac74#file-gistfile1-txt-L60 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 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!
Asked by ffusco on 2019-08-23 09:56:01 UTC
Hi,
https://github.com/ros-controls/ros_control This is the link to the repository and the branch that I cloned is kinetic devel. #include 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?
Asked by impaidk on 2019-08-27 05:11:00 UTC
Just to check: your link points to the branch melodic-devel, which uses
std::shared_ptr
(see https://github.com/ros-controls/ros_control/blob/cc4b2aa117c27a4f29dcd673f9ee96a9158262aa/hardware_interface/include/hardware_interface/robot_hw.h#L168 ). Instead, the kinetic-devel branch usesboost::shared_ptr
(see https://github.com/ros-controls/ros_control/blob/44cf68aab6cb1293e91f69ef7efe30b80195356b/hardware_interface/include/hardware_interface/robot_hw.h#L167 ). Can you check that you cloned the correct branch?Asked by ffusco on 2019-09-03 06:43:47 UTC
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 ;)Asked by ffusco on 2019-09-03 06:47:24 UTC