ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

swordsgnat's profile - activity

2019-05-20 02:08:39 -0500 marked best answer Service Header Files Missing Error

I'm a ROS beginner working on a custom controller for a UUV using Gazebo to simulate the environment and ROS to control everything. I'm using the uuv_simulator package, which does a lot of the heavy lifting for me. Currently, when certain conditions are met (i.e. the sonar reads a certain depth) I want the sub to stop moving. Fortunately, there's a service for that, /rexrov/hold_vehicle. Here's the results of a rosservice info request on it:

$ rosservice info /rexrov/hold_vehicle

Node:
/rexrov/plane_search_standard_controller

URI:
rosrpc://ncopeSub-VirtualBox:35331

Type: uuv_control_msgs/Hold 

Args:

I've read all the tutorials I can find, and I'm working heavily with the services chapter of Jason O'Kane's book, but even when everything's how I think it should be I keep getting this error when I run catkin_make:

/home/catkin_ws/src/plane_search_standard/plane_detect_anomaly.cpp:4:35:
fatal error: uuv_control_msgs/Hold.h:
No such file or directory 

compilation terminated.

plane_search_standard/CMakeFiles/subscribe_and_publish.dir/build.make:62:
recipe for target
'plane_search_standard/CMakeFiles/subscribe_and_publish.dir/plane_detect_anomaly.cpp.o'
failed make[2]: ***
[plane_search_standard/CMakeFiles/subscribe_and_publish.dir/plane_detect_anomaly.cpp.o]
Error 1 CMakeFiles/Makefile2:586:
recipe for target
'plane_search_standard/CMakeFiles/subscribe_and_publish.dir/all'
failed make[1]: ***
[plane_search_standard/CMakeFiles/subscribe_and_publish.dir/all]
Error 2 Makefile:138: recipe for
target 'all' failed make: *** [all]
Error 2 Invoking "make -j6 -l6" failed

Which seems to say that catkin_make doesn't know about the service header file for /rexrov/hold_vehicle. But by everything I've read, it should.

Here're my inclusions in the node file doing the service call:

#include <sstream>
#include <cmath>
#include <uuv_control_msgs/Hold.h>
#include "ros/ros.h"
#include "std_msgs/String.h"
#include "sensor_msgs/LaserScan.h"

Here's the line where I create the service client:

ros::ServiceClient stopSubCaller = n.serviceClient<uuv_control_msgs::Hold>("/rexrov/hold_vehicle");

Here're the lines where I actually call the service:

uuv_control_msgs::Hold::Request req;
uuv_control_msgs::Hold::Response resp;
bool success = stopSubCaller.call(req, resp);

And here's my messy CMakeLists.txt file:

 cmake_minimum_required(VERSION 2.8.3)
project(plane_search_standard)

## Find catkin and any catkin packages
find_package(catkin REQUIRED COMPONENTS rospy roscpp std_msgs sensor_msgs uuv_control_msgs)



catkin_package()

catkin_install_python(PROGRAMS scripts/plane_search_standard_controller.py DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})

install(DIRECTORY launch
        DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
PATTERN "*~" EXCLUDE)


include_directories(include ${catkin_INCLUDE_DIRS})



add_executable(subscribe_and_publish plane_detect_anomaly.cpp)
target_link_libraries(subscribe_and_publish ${catkin_LIBRARIES})

add_dependencies(subscribe_and_publish ${catkin_EXPORTED_TARGETS})

Does anyone have an idea as to how I'm going wrong here? I'd really appreciate it - I'm about at my wit's end.


More info:

Running rossrv show uuv_control_msgs/Hold simply returns:

---
bool success

If I put uuv_control_msgs in the find_package command, catkin_make generates four errors like this, just with different endings where the _cpp is:

CMake Error at /home/ncope/catkin_ws/build/uuv_simulator/uuv_control/uuv_control_msgs/cmake/uuv_control_msgs-genmsg.cmake:321 (add_custom_target):
  add_custom_target cannot create target
  "uuv_control_msgs_generate_messages_cpp" because another target with the
  same name already exists.  The existing target is a custom target created
  in source directory "/home/ncope/catkin_ws/src/plane_search_standard".  See
  documentation for policy CMP0002 for more details.
Call Stack (most recent ...
(more)
2018-03-08 20:26:46 -0500 received badge  Famous Question (source)
2017-09-27 14:21:18 -0500 commented answer Service Header Files Missing Error

Reattempted after the rm lines, and I got a new error. I edited it in. I've never touched package.xml - is that the iss

2017-09-27 14:19:27 -0500 edited question Service Header Files Missing Error

Service Header Files Missing Error I'm a ROS beginner working on a custom controller for a UUV using Gazebo to simulate

2017-09-27 14:18:26 -0500 edited question Service Header Files Missing Error

Service Header Files Missing Error I'm a ROS beginner working on a custom controller for a UUV using Gazebo to simulate

2017-09-27 14:18:05 -0500 edited question Service Header Files Missing Error

Service Header Files Missing Error I'm a ROS beginner working on a custom controller for a UUV using Gazebo to simulate

2017-09-27 14:17:41 -0500 received badge  Notable Question (source)
2017-09-27 14:16:45 -0500 edited question Service Header Files Missing Error

Service Header Files Missing Error I'm a ROS beginner working on a custom controller for a UUV using Gazebo to simulate

2017-09-27 14:13:11 -0500 received badge  Editor (source)
2017-09-27 14:13:11 -0500 edited question Service Header Files Missing Error

Service Header Files Missing Error I'm a ROS beginner working on a custom controller for a UUV using Gazebo to simulate

2017-09-27 13:52:23 -0500 commented answer Service Header Files Missing Error

Yes sir - and that error crops up even if I remove the whole generate_messages() line.

2017-09-27 13:41:49 -0500 received badge  Supporter (source)
2017-09-27 13:40:43 -0500 received badge  Popular Question (source)
2017-09-27 13:38:18 -0500 commented answer Service Header Files Missing Error

Just read @gvdhoorn's replies (and thank you for the reply): when I add uuv_control_msgs to the find_package(catkin REQU

2017-09-27 13:28:33 -0500 commented answer Service Header Files Missing Error

Hi, thanks for the reply! There wasn't enough space in the comment here so I edited that additional information into the

2017-09-27 13:28:33 -0500 edited question Service Header Files Missing Error

Service Header Files Missing Error I'm a ROS beginner working on a custom controller for a UUV using Gazebo to simulate

2017-09-27 12:35:21 -0500 asked a question Service Header Files Missing Error

Service Header Files Missing Error I'm a ROS beginner working on a custom controller for a UUV using Gazebo to simulate