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

Revision history [back]

click to hide/show revision 1
initial version

You have this in your CMakeLists.txt:

[..]

project(mav_recv)

[..]

catkin_package(
    [..]
    LIBRARIES ${PROJECT_NAME}
    [..]
)

[..]

add_library(mav_recv_lib src/mav_recv.cpp)

[..]

Note how you export a library target with LIBRARIES ${PROJECT_NAME} (where ${PROJECT_NAME} would be replaced with mav_recv), but then don't actually have any library target with that name.

The only library you create in this build script is mav_recv_lib.

You'll either have to change the name of the library to ${PROJECT_NAME}, or change the exported target name to mav_recv_lib.

So this should work (for mav_recv, but it would be similar for your other package):

catkin_package(
    [..]
    LIBRARIES mav_recv_lib
    [..]
)

Note that gimbal_control has the exact same problem.

You have this in your CMakeLists.txt:

[..]

project(mav_recv)

[..]

catkin_package(
    [..]
    LIBRARIES ${PROJECT_NAME}
    [..]
)

[..]

add_library(mav_recv_lib src/mav_recv.cpp)

[..]

Note how you export a library target with LIBRARIES ${PROJECT_NAME} (where ${PROJECT_NAME} would be replaced with mav_recv), but then don't actually have any library target with that name.

The only library you create in this build script is mav_recv_lib.

You'll either have to change the name of the library to ${PROJECT_NAME}, or change the exported target name to mav_recv_lib.

So this should work (for mav_recv, but it would be similar for your other package):

catkin_package(
    [..]
    LIBRARIES mav_recv_lib
    [..]
)

Note that gimbal_control has the exact same problem.

You may be interested in fkie/catkin_lint which is a tool capable of parsing your package manifests and build scripts and checking them for common errors and bad practices.

You have this in your CMakeLists.txt:

[..]

project(mav_recv)

[..]

catkin_package(
    [..]
    LIBRARIES ${PROJECT_NAME}
    [..]
)

[..]

add_library(mav_recv_lib src/mav_recv.cpp)

[..]

Note how you export a library target with LIBRARIES ${PROJECT_NAME} (where ${PROJECT_NAME} would be replaced with mav_recv), but then don't actually have any library target with that name.

The only library you create in this build script is mav_recv_lib.

You'll either have to change the name of the library to ${PROJECT_NAME}, or change the exported target name to mav_recv_lib.

So this should work (for mav_recv, but it would be similar for your other package):

catkin_package(
    [..]
    LIBRARIES mav_recv_lib
    [..]
)

Note that gimbal_control has the exact same problem.

You may be interested in fkie/catkin_lint which is a tool capable of parsing your package manifests and build scripts and checking them for common errors and bad practices.

Finally:

It seems that the find_library() function is unable to locate my packages in the current workspace, while it does find packages in the ROS workspace (I've installed ROS from source in ros_catkin_ws).

I've included both ROS workspaces in the /.bashrc file.

Please be aware that sourceing multiple workspaces may not do what you expect, as by default, sourceing a second workspace will overwrite the environment variables of the first. If ros_catkin_ws is actually an underlay, then it would work, but in that case there would be no need to source ros_catkin_ws, as it would be automatically sourced as part of your "current workspace".