I'm struggling compiling a catkin package with a Python node using dynamic_reconfigure.
This is my CMakeLists.txt:
cmake_minimum_required(VERSION 2.8.3)
project(motors)
find_package(catkin REQUIRED COMPONENTS
rospy
std_msgs
message_generation
dynamic_reconfigure
)
add_message_files(
FILES
MotorPower.msg
)
generate_messages(
DEPENDENCIES
std_msgs
)
generate_dynamic_reconfigure_options(
cfg/pig.cfg
)
catkin_package(
CATKIN_DEPENDS rospy std_msgs
)
add_dependencies(pid ${PROJECT_NAME}_gencfg)
And this is my package.xml:
<?xml version="1.0"?>
<package>
<name>motors</name>
<version>0.0.0</version>
<description>The motors package</description>
<maintainer email="[email protected]">ubuntu</maintainer>
<license>todo</license>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>rospy</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>dynamic_reconfigure</build_depend>
<run_depend>rospy</run_depend>
<run_depend>std_msgs</run_depend>
<run_depend>dynamic_reconfigure</run_depend>
<export>
</export>
</package>
Unfortunately I'm getting the error:
CMake Error at motors/CMakeLists.txt:29 (add_dependencies): Cannot add target-level dependencies to non-existent target "pid".
The add_dependencies works for top-level logical targets created by the add_executable, add_library, or add_custom_target commands. If you want to add file-level dependencies see the DEPENDS option of the add_custom_target and add_custom_command commands.
How can I introduce the "pid" node (located in the file scripts/pid.py) as a target? add_executable and add_library only seem to work for C nodes.
Or is there any self-containing example project or tutorial? Currently I'm following the default ROS tutorial on dynamic_reconfigure.
Originally posted by Falko on ROS Answers with karma: 268 on 2016-03-10
Post score: 3