Usage of C++ API in CMake Project
See original GitHub issueHi, I am trying to use C++ API in a ROS project, because it’s a CMake project we can directly use it in the ROS project through find_package(toppra).
After building, I tried to use it in the ROS package but CMake Could not find a package configuration file provided by “toppra” with any of the following names:
toppraConfig.cmake
toppra-config.cmake
Now, for that I have to append the config files path into the CMAKE_PREFIX_PATH. But when I look for the directory of config files I am unable to find it. If we looked at the following portion of CMakeLists.txt present in the cpp folder
set(CONFIG_INSTALL_DIR "lib/cmake/${PROJECT_NAME}")
set(GENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated")
set(VERSION_CONFIG "${GENERATED_DIR}/${PROJECT_NAME}ConfigVersion.cmake")
set(PROJECT_CONFIG "${GENERATED_DIR}/${PROJECT_NAME}Config.cmake")
write_basic_package_version_file(
"${VERSION_CONFIG}" VERSION ${PROJECT_VERSION} COMPATIBILITY SameMajorVersion
)
configure_package_config_file(
"cmake/Config.cmake.in"
"${PROJECT_CONFIG}"
INSTALL_DESTINATION "${CONFIG_INSTALL_DIR}"
)
install(FILES "${PROJECT_CONFIG}" "${VERSION_CONFIG}"
DESTINATION "${CONFIG_INSTALL_DIR}")
install(EXPORT toppra::toppra
NAMESPACE toppra::
FILE toppraTargets.cmake
DESTINATION "${CONFIG_INSTALL_DIR}")
Config files directory is set to lib/cmake/toppra what I am deducing is that project cmake files are going to install under /lib/cmake
right? or its in the build directory of the project because I only found the cmake-config files under the generated folder and cmake-Target file under Export directory but these should ideally be present in one directory toppra under the following path /lib/cmake
. But I am not able to find any config files under this path, no files are installed there.
Issue Analytics
- State:
- Created 10 months ago
- Comments:7 (1 by maintainers)
In
sudo make install
,sudo
is generally a bad idea. What you should do instead is install it an custom install directory and make your environment variable points to it. This reason is good enough for me not to suggest people to usesudo
when installing.@jmirabel I agree with you @hungpham2511 and @jmirabel I have a question to ask, So I trying to develop a trajectory optimization model which can optimize a recorded set of waypoints. In the pipeline, I am thinking to use STOMP for the optimization of an initial recorded set of waypoints, but for now, I am trying parameterizing the recorded set of waypoints using toppra with velocity(3.14,-3.14) and acceleration(-1,1) bounds. So when I try to run toppra with the recorded points I am getting a parameterized path but viewing it in the plot shows that acceleration is going out of bounds. The parametrized used is “ParametrizeConstAccel”. Here is the plot
So, What am trying to ask is, Is this because of nonuniform recorded waypoints? because for parameterizing we need a smooth geometric path right? This means we can’t do parameterization of a raw sequence of waypoints while satisfying the constraints properly like the recorded ones. I am currently exploring new things So don’t have much in-depth experience and knowledge of it. But I love to have some guidance that gives me some in-depth insight.