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 call first):
/opt/ros/kinetic/share/genmsg/cmake/genmsg-extras.cmake:307 (include)
uuv_simulator/uuv_control/uuv_control_msgs/CMakeLists.txt:41 (generate_messages)
If I'm reading it right, it's saying genmsg already builds those files? And cutting genmsg of course cuts the generate_messages command entirely.
package.xml contents:
<?xml version="1.0"?>
<package>
<name>plane_search_standard</name>
<version>0.0.0</version>
<description>The plane_search_standard package</description>
<maintainer email="[email protected]">ncope</maintainer>
<license>TODO</license>
<buildtool_depend>catkin</buildtool_depend>
<export>
</export>
</package>
I now get an error that looks like this:
Could not find the required component 'uuv_control_msgs'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "uuv_control_msgs"
with any of the following names:
uuv_control_msgsConfig.cmake
uuv_control_msgs-config.cmake
Add the installation prefix of "uuv_control_msgs" to CMAKE_PREFIX_PATH or
set "uuv_control_msgs_DIR" to a directory containing one of the above
files. If "uuv_control_msgs" provides a separate development package or
SDK, be sure it has been installed.
Call Stack (most recent call first):
plane_search_standard/CMakeLists.txt:5 (find_package)
Originally posted by swordsgnat on ROS Answers with karma: 1 on 2017-09-27
Post score: 0