0
$\begingroup$

Rosanswers logo

I've been created a package (named "stereo") that uses dynamic reconfigure for some stereo matching parameters and it has been working fine until i tried to catkin install them instead of just catkin build without the install flag.

I have a file called "stereo_params.cfg" inside a cfg folder. The corresponding header file is autogenerated successfully in "cfg/cpp/stereo/stereo_paramsConfig.h", and a python file is autogenerated in "src/stereo/cfg/stereo_paramsConfig.py".

When I run catkin build I get the following error:

CMake Error at cmake_install.cmake:132 (file): file INSTALL cannot find "/home/eirik/catkin_ws/devel/.private/stereo/include/stereo/stereo_paramsConfig.h".

I've been trying to get this working for hours now but with no succsess.

My CMakeList looks like this:

cmake_minimum_required(VERSION 2.8.3)
project(stereo)

add_compile_options(-std=c++11)


find_package(catkin REQUIRED COMPONENTS
  cv_bridge
  image_transport
  roscpp
  rospy
  sensor_msgs
  std_msgs
  dynamic_reconfigure
  tf
)

find_package(OpenCV REQUIRED)

find_package(realsense2 2.23.0)
if (NOT realsense2_FOUND)
    message(FATAL_ERROR "REALSENSE ERROR")
endif()



## Generate dynamic reconfigure parameters in the 'cfg' folder
generate_dynamic_reconfigure_options(
   cfg/stereo_params.cfg
)


catkin_package(
  INCLUDE_DIRS include cfg/cpp
  CATKIN_DEPENDS cv_bridge image_transport roscpp rospy sensor_msgs std_msgs dynamic_reconfigure
)


include_directories(
  include
  cfg/cpp/${PROJECT_NAME}
  ${catkin_INCLUDE_DIRS}
  ${realsense2_INCLUDE_DIRS}
)



add_executable(publish_ROS_Y16
  src/publish_ROS_Y16.cpp
  src/stereo_calc.cpp
)

add_executable(publish_ROS_ROV
  src/publish_ROS_ROV.cpp
  src/capture.cpp
  src/measure.cpp
)

add_executable(verify_calibration_node
  src/verify_calibration_node.cpp
  src/stereo_calc.cpp
)

target_link_libraries(publish_ROS_Y16
  ${catkin_LIBRARIES}
  ${OpenCV_LIBS}
  ${realsense2_LIBRARY}
  yaml-cpp
)

target_link_libraries(publish_ROS_ROV
  ${catkin_LIBRARIES}
  ${OpenCV_LIBS}
  ${realsense2_LIBRARY}
  yaml-cpp
)

target_link_libraries(verify_calibration_node
  ${catkin_LIBRARIES}
  ${OpenCV_LIBS}
   yaml-cpp
)

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


install(DIRECTORY include/${PROJECT_NAME}
  DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
  FILES_MATCHING PATTERN "*.h" PATTERN "*hpp"
  PATTERN ".svn" EXCLUDE
)

Build log with error message is displayed here:

[ 26%] Built target stereo
[ 46%] Built target verify_calibration_node
[ 53%] [34m[1mGenerating dynamic reconfigure files from cfg/stereo_params.cfg: /home/eirik/catkin_ws/devel/.private/stereo/include/stereo/stereo_paramsConfig.h /home/eirik/catkin_ws/devel/.private/stereo/lib/python2.7/dist-packages/stereo/cfg/stereo_paramsConfig.py[0m
Generating reconfiguration files for stereo_params in stereo
[ 53%] Built target stereo_gencfg
[ 80%] Built target publish_ROS_ROV
[100%] Built target publish_ROS_Y16
[36mInstall the project...[0m
-- Install configuration: ""
-- Installing: /home/eirik/catkin_ws/install/_setup_util.py
-- Installing: /home/eirik/catkin_ws/install/env.sh
-- Installing: /home/eirik/catkin_ws/install/setup.bash
-- Installing: /home/eirik/catkin_ws/install/local_setup.bash
-- Installing: /home/eirik/catkin_ws/install/setup.sh
-- Installing: /home/eirik/catkin_ws/install/local_setup.sh
-- Installing: /home/eirik/catkin_ws/install/setup.zsh
-- Installing: /home/eirik/catkin_ws/install/local_setup.zsh
-- Installing: /home/eirik/catkin_ws/install/.rosinstall
CMake Error at cmake_install.cmake:132 (file):
  file INSTALL cannot find
  "/home/eirik/catkin_ws/devel/.private/stereo/include/stereo/stereo_paramsConfig.h".


Makefile:61: recipe for target 'install' failed
make: *** [install] Error 1

I've found someone with a similar error here, but I do not have discrepancies in my naming as was the issue in that post.


Originally posted by eirikaso on ROS Answers with karma: 108 on 2020-02-06

Post score: 0


Original comments

Comment by mgruhler on 2020-02-06:
This seems to be a duplicate of #q285772. Could you check if this resolves your issue?

Comment by eirikaso on 2020-02-06:
That was not it, but finally found the error. Will update with an answer

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

At last found the error which was related to the .cfg file where i had imported some old method that seems to be used for rosbuild and not catkin

I imported

from dynamic_reconfigure.parameter_generator import *

while the correct import is

from dynamic_reconfigure.parameter_generator_catkin import *

Now it seems to be working fine


Originally posted by eirikaso with karma: 108 on 2020-02-06

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

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