0
$\begingroup$

Rosanswers logo

/home/mayankfirst/catkin_ws/src/beginner_tutorials/src/add_two_ints_client.cpp:2:43: fatal error: beginner_tutorials/AddTwoInts.h: No such file or directory
 #include "beginner_tutorials/AddTwoInts.h"
                                           ^
compilation terminated.
/home/mayankfirst/catkin_ws/src/beginner_tutorials/src/add_two_ints_server.cpp:2:43: fatal error: beginner_tutorials/AddTwoInts.h: No such file or directory
 #include "beginner_tutorials/AddTwoInts.h"
                                           ^
compilation terminated.
make[2]: *** [beginner_tutorials/CMakeFiles/add_two_ints_client.dir/src/add_two_ints_client.cpp.o] Error 1
make[2]: Leaving directory `/home/mayankfirst/catkin_ws/build'
make[1]: *** [beginner_tutorials/CMakeFiles/add_two_ints_client.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: *** [beginner_tutorials/CMakeFiles/add_two_ints_server.dir/src/add_two_ints_server.cpp.o] Error 1
make[2]: Leaving directory `/home/mayankfirst/catkin_ws/build'
make[1]: *** [beginner_tutorials/CMakeFiles/add_two_ints_server.dir/all] Error 2
make[1]: Leaving directory `/home/mayankfirst/catkin_ws/build'
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

#############################################################################################

CMAKE list

cmake_minimum_required(VERSION 2.8.3)
project(beginner_tutorials)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
  genmsg
)

## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)


## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()

################################################
## Declare ROS messages, services and actions ##
################################################

## To declare and build messages, services or actions from within this
## package, follow these steps:
## * Let MSG_DEP_SET be the set of packages whose message types you use in
##   your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
## * In the file package.xml:
##   * add a build_depend and a run_depend tag for each package in MSG_DEP_SET
##   * If MSG_DEP_SET isn't empty the following dependencies might have been
##     pulled in transitively but can be declared for certainty nonetheless:
##     * add a build_depend tag for "message_generation"
##     * add a run_depend tag for "message_runtime"
## * In this file (CMakeLists.txt):
##   * add "message_generation" and every package in MSG_DEP_SET to
##     find_package(catkin REQUIRED COMPONENTS ...)
##   * add "message_runtime" and every package in MSG_DEP_SET to
##     catkin_package(CATKIN_DEPENDS ...)
##   * uncomment the add_*_files sections below as needed
##     and list every .msg/.srv/.action file to be processed
##   * uncomment the generate_messages entry below
##   * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)

## Generate messages in the 'msg' folder
# add_message_files(
#   FILES
#   Message1.msg
#   Message2.msg
# )

## Generate services in the 'srv' folder
add_message_files(DIRECTORY msg FILES Num.msg)
add_service_files(DIRECTORY srv FILES AddTwoInts.srv)

## Generate actions in the 'action' folder
# add_action_files(
#   FILES
#   Action1.action
#   Action2.action
# )

## Generate added messages and services with any dependencies listed here
generate_messages(DEPENDENCIES std_msgs)

###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if you package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(CATKIN_DEPENDS roscpp rospy std_msgs genmsg)
#  INCLUDE_DIRS include
#  LIBRARIES beginner_tutorials
#  CATKIN_DEPENDS roscpp rospy std_msgs
#  DEPENDS system_lib
#)

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
# include_directories(include)
#include_directories(
#  ${catkin_INCLUDE_DIRS}
#)

## Declare a cpp library
# add_library(beginner_tutorials
#   src/${PROJECT_NAME}/beginner_tutorials.cpp
# )

## Declare a cpp executable
# add_executable(beginner_tutorials_node src/beginner_tutorials_node.cpp)

## Add cmake target dependencies of the executable/library
## as an example, message headers may need to be generated before nodes
# add_dependencies(beginner_tutorials_node beginner_tutorials_generate_messages_cpp)

## Specify libraries to link a library or executable target against
# target_link_libraries(beginner_tutorials_node
#   ${catkin_LIBRARIES}
# )

#############
## Install ##
#############

# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html

## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
# install(PROGRAMS
#   scripts/my_python_script
#   DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark executables and/or libraries for installation
# install(TARGETS beginner_tutorials beginner_tutorials_node
#   ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
#   LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
#   RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark cpp header files for installation
# install(DIRECTORY include/${PROJECT_NAME}/
#   DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
#   FILES_MATCHING PATTERN "*.h"
#   PATTERN ".svn" EXCLUDE
# )

## Mark other files for installation (e.g. launch and bag files, etc.)
# install(FILES
#   # myfile1
#   # myfile2
#   DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# )

#############
## Testing ##
#############

## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_beginner_tutorials.cpp)
# if(TARGET ${PROJECT_NAME}-test)
#   target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
# endif()

## Add folders to be run by python nosetests
# catkin_add_nosetests(test)

include_directories(include ${catkin_INCLUDE_DIRS})

add_executable(talker src/talker.cpp)
target_link_libraries(talker ${catkin_LIBRARIES})
add_dependencies(talker beginner_tutorials_generate_messages_cpp)

add_executable(listener src/listener.cpp)
target_link_libraries(listener ${catkin_LIBRARIES})
add_dependencies(listener beginner_tutorials_generate_messages_cpp)



add_executable(add_two_ints_server src/add_two_ints_server.cpp)
target_link_libraries(add_two_ints_server ${catkin_LIBRARIES})
add_dependencies(add_two_ints_server beginner_tutorials_gencpp)

add_executable(add_two_ints_client src/add_two_ints_client.cpp)
target_link_libraries(add_two_ints_client ${catkin_LIBRARIES})
add_dependencies(add_two_ints_client beginner_tutorials_gencpp)

After running rossrv show beginner_tutorials/AddTwoInts I get the following

mayankfirst@mayankfirst-Aspire-V5-571:~/catkin_ws/beginner_tutorials$ rossrv show beginner_tutorials/AddTwoInts Unknown srv type [beginner_tutorials/AddTwoInts]: Cannot locate message [AddTwoInts]: unknown package [beginner_tutorials] on search path [{'rosconsole': ['/opt/ros/indigo/share/rosconsole/srv'], 'hector_quadrotor_pose_estimation': ['/opt/ros/indigo/share/hector_quadrotor_pose_estimation/srv'], 'catkin': ['/opt/ros/indigo/share/catkin/srv'], 'qt_dotgraph': ['/opt/ros/indigo/share/qt_dotgraph/srv'], 'image_view': ['/opt/ros/indigo/share/image_view/srv'], 'hector_gazebo_worlds': ['/opt/ros/indigo/share/hector_gazebo_worlds/srv'], 'urdf': ['/opt/ros/indigo/share/urdf/srv'], 'rosgraph': ['/opt/ros/indigo/share/rosgraph/srv'], 'rqt_py_console': ['/opt/ros/indigo/share/rqt_py_console/srv'], 'nodelet_topic_tools': ['/opt/ros/indigo/share/nodelet_topic_tools/srv'], 'rqt_graph': ['/opt/ros/indigo/share/rqt_graph/srv'], 'nodelet_tutorial_math': ['/opt/ros/indigo/share/nodelet_tutorial_math/srv'], 'qt_gui': ['/opt/ros/indigo/share/qt_gui/srv'], 'filters': ['/opt/ros/indigo/share/filters/srv'], 'hector_quadrotor_controller_gazebo': ['/opt/ros/indigo/share/hector_quadrotor_controller_gazebo/srv'], 'hector_map_tools': ['/opt/ros/indigo/share/hector_map_tools/srv'], 'controller_manager_tests': ['/opt/ros/indigo/share/controller_manager_tests/srv'], 'pointcloud_to_laserscan': ['/opt/ros/indigo/share/pointcloud_to_laserscan/srv'], 'smclib': ['/opt/ros/indigo/share/smclib/srv'], 'roslib': ['/opt/ros/indigo/share/roslib/srv'], 'roscpp_serialization': ['/opt/ros/indigo/share/roscpp_serialization/srv'], 'diagnostic_msgs': ['/opt/ros/indigo/share/diagnostic_msgs/srv'], 'rosbuild': ['/opt/ros/indigo/share/rosbuild/srv'], 'rosclean': ['/opt/ros/indigo/share/rosclean/srv'], 'ps3joy': ['/opt/ros/indigo/share/ps3joy/srv'], 'tf': ['/opt/ros/indigo/share/tf/srv'], 'rqt_publisher': ['/opt/ros/indigo/share/rqt_publisher/srv'], 'roswtf': ['/opt/ros/indigo/share/roswtf/srv'], 'hector_uav_msgs': ['/opt/ros/indigo/share/hector_uav_msgs/srv'], 'smach_ros': ['/opt/ros/indigo/share/smach_ros/srv'], 'genlisp': ['/opt/ros/indigo/share/genlisp/srv'], 'shape_msgs': ['/opt/ros/indigo/share/shape_msgs/srv'], 'trajectory_msgs': ['/opt/ros/indigo/share/trajectory_msgs/srv'], 'hector_pose_estimation_core': ['/opt/ros/indigo/share/hector_pose_estimation_core/srv'], 'diagnostic_aggregator': ['/opt/ros/indigo/share/diagnostic_aggregator/srv'], 'robot_state_publisher': ['/opt/ros/indigo/share/robot_state_publisher/srv'], 'smach_msgs': ['/opt/ros/indigo/share/smach_msgs/srv'], 'resource_retriever': ['/opt/ros/indigo/share/resource_retriever/srv'], 'rqt_topic': ['/opt/ros/indigo/share/rqt_topic/srv'], 'smach': ['/opt/ros/indigo/share/smach/srv'], 'rqt_action': ['/opt/ros/indigo/share/rqt_action/srv'], 'control_toolbox': ['/opt/ros/indigo/share/control_toolbox/srv'], 'rqt_top': ['/opt/ros/indigo/share/rqt_top/srv'], 'random_numbers': ['/opt/ros/indigo/share/random_numbers/srv'], 'rqt_rviz': ['/opt/ros/indigo/share/rqt_rviz/srv'], 'rosgraph_msgs': ['/opt/ros/indigo/share/rosgraph_msgs/srv'], 'rosboost_cfg': ['/opt/ros/indigo/share/rosboost_cfg/srv'], 'genmsg': ['/opt/ros/indigo/share/genmsg/srv'], 'xacro': ['/opt/ros/indigo/share/xacro/srv'], 'turtle_tf2': ['/opt/ros/indigo/share/turtle_tf2/srv'], 'rqt_robot_dashboard': ['/opt/ros/indigo/share/rqt_robot_dashboard/srv'], 'pluginlib': ['/opt/ros/indigo/share/pluginlib/srv'], 'rqt_msg': ['/opt/ros/indigo/share/rqt_msg/srv'], 'rqt_service_caller': ['/opt/ros/indigo/share/rqt_service_caller/srv'], 'xmlrpcpp': ['/opt/ros/indigo/share/xmlrpcpp/srv'], 'rqt_logger_level': ['/opt/ros/indigo/share/rqt_logger_level/srv'], 'rosmaster': ['/opt/ros/indigo/share/rosmaster/srv'], 'rosnode': ['/opt/ros/indigo/share/rosnode/srv'], 'rqt_pose_view': ['/opt/ros/indigo/share/rqt_pose_view/srv'], 'hector_quadrotor_description': ['/opt/ros/indigo/share/hector_quadrotor_description/srv'], 'bond': ['/opt/ros/indigo/share/bond/srv'], 'self_test': ['/opt/ros/indigo/share/self_test/srv'], 'pr2_description': ['/opt/ros/indigo/share/pr2_description/srv'], 'hector_imu_attitude_to_tf': ['/opt/ros/indigo/share/hector_imu_attitude_to_tf/srv'], 'rospack': ['/opt/ros/indigo/share/rospack/srv'], 'hector_nav_msgs': ['/opt/ros/indigo/share/hector_nav_msgs/srv'], 'hector_gazebo_plugins': ['/opt/ros/indigo/share/hector_gazebo_plugins/srv'], 'actionlib_msgs': ['/opt/ros/indigo/share/actionlib_msgs/srv'], 'image_rotate': ['/opt/ros/indigo/share/image_rotate/srv'], 'hector_quadrotor_teleop': ['/opt/ros/indigo/share/hector_quadrotor_teleop/srv'], 'rqt_image_view': ['/opt/ros/indigo/share/rqt_image_view/srv'], 'hector_geotiff': ['/opt/ros/indigo/share/hector_geotiff/srv'], 'polled_camera': ['/opt/ros/indigo/share/polled_camera/srv'], 'rqt_console': ['/opt/ros/indigo/share/rqt_console/srv'], 'joint_state_publisher': ['/opt/ros/indigo/share/joint_state_publisher/srv'], 'pr2_position_scripts': ['/opt/ros/indigo/share/pr2_position_scripts/srv'], 'hector_pose_estimation': ['/opt/ros/indigo/share/hector_pose_estimation/srv'], 'depth_image_proc': ['/opt/ros/indigo/share/depth_image_proc/srv'], 'tf2_msgs': ['/opt/ros/indigo/share/tf2_msgs/srv'], 'message_to_tf': ['/opt/ros/indigo/share/message_to_tf/srv'], 'laser_geometry': ['/opt/ros/indigo/share/laser_geometry/srv'], 'rviz': ['/opt/ros/indigo/share/rviz/srv'], 'gencpp': ['/opt/ros/indigo/share/gencpp/srv'], 'rqt_gui_cpp': ['/opt/ros/indigo/share/rqt_gui_cpp/srv'], 'rqt_bag': ['/opt/ros/indigo/share/rqt_bag/srv'], 'rqt_gui': ['/opt/ros/indigo/share/rqt_gui/srv'], 'hector_compressed_map_transport': ['/opt/ros/indigo/share/hector_compressed_map_transport/srv'], 'qt_gui_py_common': ['/opt/ros/indigo/share/qt_gui_py_common/srv'], 'eigen_conversions': ['/opt/ros/indigo/share/eigen_conversions/srv'], 'roscpp_traits': ['/opt/ros/indigo/share/roscpp_traits/srv'], 'driver_base': ['/opt/ros/indigo/share/driver_base/srv'], 'rosout': ['/opt/ros/indigo/share/rosout/srv'], 'diagnostic_common_diagnostics': ['/opt/ros/indigo/share/diagnostic_common_diagnostics/srv'], 'rostopic': ['/opt/ros/indigo/share/rostopic/srv'], 'visualization_msgs': ['/opt/ros/indigo/share/visualization_msgs/srv'], 'message_generation': ['/opt/ros/indigo/share/message_generation/srv'], 'pr2_tuck_arms_action': ['/opt/ros/indigo/share/pr2_tuck_arms_action/srv'], 'camera_calibration': ['/opt/ros/indigo/share/camera_calibration/srv'], 'rqt_runtime_monitor': ['/opt/ros/indigo/share/rqt_runtime_monitor/srv'], 'node_example': ['/home/mayankfirst/node_example/srv'], 'pr2_mechanism_diagnostics': ['/opt/ros/indigo/share/pr2_mechanism_diagnostics/srv'], 'collada_parser': ['/opt/ros/indigo/share/collada_parser/srv'], 'gazebo_msgs': ['/opt/ros/indigo/share/gazebo_msgs/srv'], 'joy': ['/opt/ros/indigo/share/joy/srv'], 'rostime': ['/opt/ros/indigo/share/rostime/srv'], 'urdf_tutorial': ['/opt/ros/indigo/share/urdf_tutorial/srv'], 'kdl_conversions': ['/opt/ros/indigo/share/kdl_conversions/srv'], 'rqt_nav_view': ['/opt/ros/indigo/share/rqt_nav_view/srv'], 'roslint': ['/opt/ros/indigo/share/roslint/srv'], 'rosservice': ['/opt/ros/indigo/share/rosservice/srv'], 'rospy': ['/opt/ros/indigo/share/rospy/srv'], 'rosunit': ['/opt/ros/indigo/share/rosunit/srv'], 'hector_marker_drawing': ['/opt/ros/indigo/share/hector_marker_drawing/srv'], 'roscpp_tutorials': ['/opt/ros/indigo/share/roscpp_tutorials/srv'], 'gmapping': ['/opt/ros/indigo/share/gmapping/srv'], 'turtle_actionlib': ['/opt/ros/indigo/share/turtle_actionlib/srv'], 'python_orocos_kdl': ['/opt/ros/indigo/share/python_orocos_kdl/srv'], 'pr2_controllers_msgs': ['/opt/ros/indigo/share/pr2_controllers_msgs/srv'], 'geographic_msgs': ['/opt/ros/indigo/share/geographic_msgs/srv'], 'visualization_marker_tutorials': ['/opt/ros/indigo/share/visualization_marker_tutorials/srv'], 'tf2_bullet': ['/opt/ros/indigo/share/tf2_bullet/srv'], 'rosconsole_bridge': ['/opt/ros/indigo/share/rosconsole_bridge/srv'], 'pluginlib_tutorials': ['/opt/ros/indigo/share/pluginlib_tutorials/srv'], 'camera_info_manager': ['/opt/ros/indigo/share/camera_info_manager/srv'], 'camera_calibration_parsers': ['/opt/ros/indigo/share/camera_calibration_parsers/srv'], 'hector_sensors_description': ['/opt/ros/indigo/share/hector_sensors_description/srv'], 'roslz4': ['/opt/ros/indigo/share/roslz4/srv'], 'rqt_dep': ['/opt/ros/indigo/share/rqt_dep/srv'], 'rosmsg': ['/opt/ros/indigo/share/rosmsg/srv'], 'actionlib_tutorials': ['/opt/ros/indigo/share/actionlib_tutorials/srv'], 'turtlesim': ['/opt/ros/indigo/share/turtlesim/srv'], 'rqt_robot_monitor': ['/opt/ros/indigo/share/rqt_robot_monitor/srv'], 'gazebo_plugins': ['/opt/ros/indigo/share/gazebo_plugins/srv'], 'rosparam': ['/opt/ros/indigo/share/rosparam/srv'], 'controller_interface': ['/opt/ros/indigo/share/controller_interface/srv'], 'diagnostic_analysis': ['/opt/ros/indigo/share/diagnostic_analysis/srv'], 'stereo_msgs': ['/opt/ros/indigo/share/stereo_msgs/srv'], 'pr2_mechanism_msgs': ['/opt/ros/indigo/share/pr2_mechanism_msgs/srv'], 'pcl_msgs': ['/opt/ros/indigo/share/pcl_msgs/srv'], 'interactive_markers': ['/opt/ros/indigo/share/interactive_markers/srv'], 'object_recognition_msgs': ['/opt/ros/indigo/share/object_recognition_msgs/srv'], 'diagnostic_updater': ['/opt/ros/indigo/share/diagnostic_updater/srv'], 'laser_assembler': ['/opt/ros/indigo/share/laser_assembler/srv'], 'pcl_conversions': ['/opt/ros/indigo/share/pcl_conversions/srv'], 'app_manager': ['/opt/ros/indigo/share/app_manager/srv'], 'rviz_python_tutorial': ['/opt/ros/indigo/share/rviz_python_tutorial/srv'], 'tf2': ['/opt/ros/indigo/share/tf2/srv'], 'hector_quadrotor_gazebo_plugins': ['/opt/ros/indigo/share/hector_quadrotor_gazebo_plugins/srv'], 'rqt_gui_py': ['/opt/ros/indigo/share/rqt_gui_py/srv'], 'rosbash': ['/opt/ros/indigo/share/rosbash/srv'], 'rqt_reconfigure': ['/opt/ros/indigo/share/rqt_reconfigure/srv'], 'pr2_controller_interface': ['/opt/ros/indigo/share/pr2_controller_interface/srv'], 'rqt_bag_plugins': ['/opt/ros/indigo/share/rqt_bag_plugins/srv'], 'hector_geotiff_plugins': ['/opt/ros/indigo/share/hector_geotiff_plugins/srv'], 'hector_trajectory_server': ['/opt/ros/indigo/share/hector_trajectory_server/srv'], 'rqt_plot': ['/opt/ros/indigo/share/rqt_plot/srv'], 'topic_tools': ['/opt/ros/indigo/share/topic_tools/srv'], 'rostest': ['/opt/ros/indigo/share/rostest/srv'], 'control_msgs': ['/opt/ros/indigo/share/control_msgs/srv'], 'hector_sensors_gazebo': ['/opt/ros/indigo/share/hector_sensors_gazebo/srv'], 'interactive_marker_tutorials': ['/opt/ros/indigo/share/interactive_marker_tutorials/srv'], 'stage': ['/opt/ros/indigo/share/stage/srv'], 'nodelet': ['/opt/ros/indigo/share/nodelet/srv'], 'transmission_interface': ['/opt/ros/indigo/share/transmission_interface/srv'], 'stage_ros': ['/opt/ros/indigo/share/stage_ros/srv'], 'pr2_msgs': ['/opt/ros/indigo/share/pr2_msgs/srv'], 'rqt_robot_steering': ['/opt/ros/indigo/share/rqt_robot_steering/srv'], 'roslaunch': ['/opt/ros/indigo/share/roslaunch/srv'], 'hardware_interface': ['/opt/ros/indigo/share/hardware_interface/srv'], 'tf2_geometry_msgs': ['/opt/ros/indigo/share/tf2_geometry_msgs/srv'], 'compressed_image_transport': ['/opt/ros/indigo/share/compressed_image_transport/srv'], 'controller_manager_msgs': ['/opt/ros/indigo/share/controller_manager_msgs/srv'], 'rqt_shell': ['/opt/ros/indigo/share/rqt_shell/srv'], 'std_msgs': ['/opt/ros/indigo/share/std_msgs/srv'], 'realtime_tools': ['/opt/ros/indigo/share/realtime_tools/srv'], 'image_transport': ['/opt/ros/indigo/share/image_transport/srv'], 'rqt_launch': ['/opt/ros/indigo/share/rqt_launch/srv'], 'pr2_teleop_general': ['/opt/ros/indigo/share/pr2_teleop_general/srv'], 'angles': ['/opt/ros/indigo/share/angles/srv'], 'cv_bridge': ['/opt/ros/indigo/share/cv_bridge/srv'], 'gazebo_ros': ['/opt/ros/indigo/share/gazebo_ros/srv'], 'rosbag_storage': ['/opt/ros/indigo/share/rosbag_storage/srv'], 'bondcpp': ['/opt/ros/indigo/share/bondcpp/srv'], 'roslang': ['/opt/ros/indigo/share/roslang/srv'], 'std_srvs': ['/opt/ros/indigo/share/std_srvs/srv'], 'geometric_shapes': ['/opt/ros/indigo/share/geometric_shapes/srv'], 'willow_maps': ['/opt/ros/indigo/share/willow_maps/srv'], 'joint_limits_interface': ['/opt/ros/indigo/share/joint_limits_interface/srv'], 'mk': ['/opt/ros/indigo/share/mk/srv'], 'cpp_common': ['/opt/ros/indigo/share/cpp_common/srv'], 'octomap': ['/opt/ros/indigo/share/octomap/srv'], 'stereo_image_proc': ['/opt/ros/indigo/share/stereo_image_proc/srv'], 'bondpy': ['/opt/ros/indigo/share/bondpy/srv'], 'collada_urdf': ['/opt/ros/indigo/share/collada_urdf/srv'], 'pr2_controller_manager': ['/opt/ros/indigo/share/pr2_controller_manager/srv'], 'tf2_kdl': ['/opt/ros/indigo/share/tf2_kdl/srv'], 'rqt_web': ['/opt/ros/indigo/share/rqt_web/srv'], 'class_loader': ['/opt/ros/indigo/share/class_loader/srv'], 'tf2_py': ['/opt/ros/indigo/share/tf2_py/srv'], 'genpy': ['/opt/ros/indigo/share/genpy/srv'], 'kdl_parser': ['/opt/ros/indigo/share/kdl_parser/srv'], 'hector_quadrotor_gazebo': ['/opt/ros/indigo/share/hector_quadrotor_gazebo/srv'], 'cmake_modules': ['/opt/ros/indigo/share/cmake_modules/srv'], 'uuid_msgs': ['/opt/ros/indigo/share/uuid_msgs/srv'], 'pr2_tuckarm': ['/opt/ros/indigo/share/pr2_tuckarm/srv'], 'pcl_ros': ['/opt/ros/indigo/share/pcl_ros/srv'], 'nav_msgs': ['/opt/ros/indigo/share/nav_msgs/srv'], 'rosmake': ['/opt/ros/indigo/share/rosmake/srv'], 'rqt_srv': ['/opt/ros/indigo/share/rqt_srv/srv'], 'roscpp': ['/opt/ros/indigo/share/roscpp/srv'], 'rqt_moveit': ['/opt/ros/indigo/share/rqt_moveit/srv'], 'theora_image_transport': ['/opt/ros/indigo/share/theora_image_transport/srv'], 'rqt_py_common': ['/opt/ros/indigo/share/rqt_py_common/srv'], 'rviz_plugin_tutorials': ['/opt/ros/indigo/share/rviz_plugin_tutorials/srv'], 'actionlib': ['/opt/ros/indigo/share/actionlib/srv'], 'hector_slam_launch': ['/opt/ros/indigo/share/hector_slam_launch/srv'], 'qt_gui_cpp': ['/opt/ros/indigo/share/qt_gui_cpp/srv'], 'eigen_stl_containers': ['/opt/ros/indigo/share/eigen_stl_containers/srv'], 'tf2_ros': ['/opt/ros/indigo/share/tf2_ros/srv'], 'librviz_tutorial': ['/opt/ros/indigo/share/librviz_tutorial/srv'], 'moveit_msgs': ['/opt/ros/indigo/share/moveit_msgs/srv'], 'roslisp': ['/opt/ros/indigo/share/roslisp/srv'], 'image_geometry': ['/opt/ros/indigo/share/image_geometry/srv'], 'message_runtime': ['/opt/ros/indigo/share/message_runtime/srv'], 'message_filters': ['/opt/ros/indigo/share/message_filters/srv'], 'python_qt_binding': ['/opt/ros/indigo/share/python_qt_binding/srv'], 'sensor_msgs': ['/opt/ros/indigo/share/sensor_msgs/srv'], 'hector_map_server': ['/opt/ros/indigo/share/hector_map_server/srv'], 'pr2_common_action_msgs': ['/opt/ros/indigo/share/pr2_common_action_msgs/srv'], 'roscreate': ['/opt/ros/indigo/share/roscreate/srv'], 'rospy_tutorials': ['/opt/ros/indigo/share/rospy_tutorials/srv'], 'hector_quadrotor_demo': ['/opt/ros/indigo/share/hector_quadrotor_demo/srv'], 'hector_quadrotor_model': ['/opt/ros/indigo/share/hector_quadrotor_model/srv'], 'laser_filters': ['/opt/ros/indigo/share/laser_filters/srv'], 'image_proc': ['/opt/ros/indigo/share/image_proc/srv'], 'octomap_msgs': ['/opt/ros/indigo/share/octomap_msgs/srv'], 'map_msgs': ['/opt/ros/indigo/share/map_msgs/srv'], 'dynamic_reconfigure': ['/opt/ros/indigo/share/dynamic_reconfigure/srv'], 'compressed_depth_image_transport': ['/opt/ros/indigo/share/compressed_depth_image_transport/srv'], 'rqt_tf_tree': ['/opt/ros/indigo/share/rqt_tf_tree/srv'], 'gazebo_ros_control': ['/opt/ros/indigo/share/gazebo_ros_control/srv'], 'turtle_tf': ['/opt/ros/indigo/share/turtle_tf/srv'], 'controller_manager': ['/opt/ros/indigo/share/controller_manager/srv'], 'pr2_hardware_interface': ['/opt/ros/indigo/share/pr2_hardware_interface/srv'], 'pr2_app_manager': ['/opt/ros/indigo/share/pr2_app_manager/srv'], 'openslam_gmapping': ['/opt/ros/indigo/share/openslam_gmapping/srv'], 'tf2_sensor_msgs': ['/opt/ros/indigo/share/tf2_sensor_msgs/srv'], 'hector_quadrotor_controller': ['/opt/ros/indigo/share/hector_quadrotor_controller/srv'], 'media_export': ['/opt/ros/indigo/share/media_export/srv'], 'geometry_msgs': ['/opt/ros/indigo/share/geometry_msgs/srv'], 'urdf_parser_plugin': ['/opt/ros/indigo/share/urdf_parser_plugin/srv'], 'tf2_tools': ['/opt/ros/indigo/share/tf2_tools/srv'], 'tf_conversions': ['/opt/ros/indigo/share/tf_conversions/srv'], 'orocos_kdl': ['/opt/ros/indigo/share/orocos_kdl/srv'], 'rosbag': ['/opt/ros/indigo/share/rosbag/srv'], 'rosbag_migration_rule': ['/opt/ros/indigo/share/rosbag_migration_rule/srv'], 'hector_mapping': ['/opt/ros/indigo/share/hector_mapping/srv'], 'pr2_mechanism_model': ['/opt/ros/indigo/share/pr2_mechanism_model/srv']}]


Originally posted by mayankfirst on ROS Answers with karma: 31 on 2015-07-12

Post score: 2


Original comments

Comment by BennyRe on 2015-07-13:
Please post your CMakeLists.txt

Comment by dornhege on 2015-07-13:
...and the workspace layout.

$\endgroup$

3 Answers 3

0
$\begingroup$

Rosanswers logo

It looks like the headers for your service files are not being generated before the programs that use them are compiled.

You can declare this build dependency using the add_dependencies() cmake command. Try adding the following to your CMakeLists.txt:

add_dependencies(add_two_ints_server ${beginner_tutorials_EXPORTED_TARGETS})
add_dependencies(add_two_ints_client ${beginner_tutorials_EXPORTED_TARGETS})

Originally posted by ahendrix with karma: 47576 on 2015-07-15

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by mayankfirst on 2015-07-15:
But even after adding the above dependencies it gives the same error

Comment by mayankfirst on 2015-07-15:
There may be some problem in SRV when I try to execute rossrv show beginner_tutorials/AddTwoInts It gives the following message Unknown srv type [beginner_tutorials/AddTwoInts]: Cannot locate message [AddTwoInts]: unknown package [beginner_tutorials] on search path [{'rosconsole': ['/opt/ros/ind

Comment by ahendrix on 2015-07-15:
it looks like your rossrv show error is because you haven't sourced your workspace.

Comment by mayankfirst on 2015-07-18:
Sir, I do not have rossrv show error. I am having the compilation error and getting the following message fatal error: beginner_tutorials/AddTwoInts.h: No such file or directory #include "beginner_tutorials/AddTwoInts.h

Comment by mayankfirst on 2015-07-18:
I have also sourced my workspace using . ~/catkin_ws/devel/setup.bash

Comment by UserK on 2015-08-10:
I added what you suggested and I get:

 -- Using these message generators: gencpp;genlisp;genpy
    -- beginner_tutorial: 1 messages, 1 services
    CMake Error at beginner_tutorial/CMakeLists.txt:182 (add_dependencies):
      add_dependencies called with incorrect number of arguments

Comment by ahendrix on 2015-08-10:
@UserK: It looks like your variable name and your package name don't match; your package name is beginner_tutorial but the variable name you're using is beginner_tutorials.

Comment by user23fj239 on 2016-04-27:
It would be great to have ompl renamed. These warning msgs keep popping up, even in rqt_graph. argsl

~/catkin_ws1/bags$ WARNING: Package "ompl" does not follow the version conventions. It should not contain leading zeros (unless the number is 0).
WARNING: Package "ompl" does not follow...

Comment by ahendrix on 2016-04-27:
@user23fj239 you can find ompl's bug tracker and file an issue for them to change their version numbering scheme. Ohterwise this isn't really the appropriate place to complain (and I don't even see an ompl warning in this particular question)

Comment by user23fj239 on 2016-04-28:
oh ok, I will send ompl a short note: Issue link to github

$\endgroup$
0
$\begingroup$

Rosanswers logo

I had the same problem and I solved It by doing a previous tutorial. The file "beginner_tutorials/AddTwoInts.h" is created in tutorial "Creating a ROS msg and srv".


Originally posted by tekin with karma: 86 on 2016-03-18

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by Pikachu on 2016-06-16:
I have gone through "Creating a ROS msg and srv" tutorial but I didn't get how to build this .h header file. Can you explain here, how you did it?

Comment by raghunitin on 2016-07-26:
I think the error is probably because you might not have compiled the srv with catkin to generate the header file 'AddTwoInts.h'. Simply comment out any additional code for adding executable, dependencies or library links in CMakeLists.txt & run 'catkin_make install'. Now uncomment and 'catkin_make'

$\endgroup$
0
$\begingroup$

Rosanswers logo

the same error. but in my case, I forgot the following change in the CMakeList.txt;

## Generate added messages and services with any dependencies listed here
 generate_messages(
   DEPENDENCIES
   std_msgs
 )

once I did it, catkin_make worked fine.


Originally posted by MuratAhmetGenc with karma: 21 on 2017-01-12

This answer was NOT ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.