Migrating from Rosbuild to Catkin can be accomplished using the ros-industrial catkinize script as described in Quickly migrating from Rosbuild to Catkin. Although this script attempts to replace rosbuild commands with catkin ones, some errors arise when compiling using the catkin_make
command. This troubleshooting guide covers steps to take after catkinizing a package.
Update messages and services
- If your package contains custom messages, update the
add_msg_files(...)
andgenerate_messages(...)
commands in the CMakeLists.txt file. Ensure that themessage_generation
package is included in yourfind_package(...)
call and that themessage_runtime
package is includes in thecatkin_package()
call in your CMakeLists.txt file. Finally, update the associated package.xml file, ensuring that message_generation and message_runtime dependencies are listed. - If your package includes services, update the
add_service_files(...)
command in the CMakeLists.txt file.
Update maintainers, dependencies and libraries
- Ensure that all maintainers in the package.xml file have a valid email address.
- Install any missing package dependencies.
- Ensure that you first call
add_executable(...)
thentarget_link_libraries(...)
in the CMakeLists.txt file. - Make sure the catkin path can be found by adding
include_directories(include ${catkin_INCLUDE_DIRS})
to the CMakeLists.txt file. - Make sure the catkin libraries can be found by adding
target_link_libraries(${catkin_LIBRARIES})
to the CMakeLists.txt file. - Add any missing library paths in the CMakeLists.txt file Eg.
link_directories(/usr/local/lib)
. Similarly, add any missing include paths i.e.include_directories(. /usr/local/include)
.