How to properly add urdf, config and launch directories to CMakeLists.txt?
I am receiving errors (below) suggesting my CMakeLists.txt
file does not properly define my launch
folder, which contains .launch
files, and my urdf
and config
folders within my src
folder, which are used for various things.
No such file or directory: /snap/robot/x1/opt/ros/melodic/share/mapping/src/urdf/clearpath_jackal.urdf.xacro
RLException: while processing /snap/robot/x1/opt/ros/melodic/share/mapping/launch/robot_simulation.launch:
Invalid <param> tag: Cannot load command parameter [robot_description]: command [['/snap/robot/x1/opt/ros/melodic/lib/xacro/xacro', '/snap/robot/x1/opt/ros/melodic/share/mapping/src/urdf/clearpath_jackal.urdf.xacro', '--inorder']] returned with code [2].
Param xml is <param command="$(find xacro)/xacro $(find mapping)/src/urdf/clearpath_jackal.urdf.xacro --inorder" name="robot_description"/>
The traceback for the exception was written to the log file
Here's my CMakeLists.txt file:
cmake_minimum_required(VERSION 2.8.3)
project(mapping)
cmake_policy(SET CMP0054 OLD)
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
gazebo_ros
cartographer_ros
rosbridge_server
jackal_control
jackal_description
gazebo_ros REQUIRED
)
catkin_package(
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS
roscpp
rospy
std_msgs
gazebo_ros
cartographer_ros
rosbridge_server
jackal_control
jackal_description
)
include_directories(
${Boost_INCLUDE_DIR} ${catkin_INCLUDE_DIRS} ${GAZEBO_INCLUDE_DIRS}
)
link_directories(
${GAZEBO_LIBRARY_DIRS}
)
catkin_install_python(PROGRAMS
src/scripts/script_a.py
src/scripts/script_b.py
src/scripts/script_c.py
src/scripts/script_d.py
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
install(DIRECTORY launch/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
PATTERN ".svn" EXCLUDE)
Can anyone point out whats wrong?
opt/ros/melodic/share/mapping/src/urdf/clearpath_jackal.urdf.xacro
seems like an odd path. Are you expecting your package to be installing that? I don't see anything in your CMakeLists.txt that indicates that you're installing any urdf files.Yeah I'm still having trouble with that. What makes it look odd to you?
Generally you don't see a
src
directory in an installed location.I have various folders within my packages
src
folder to store files used by each node, e.g. config and simulation related files. Should these be located outside thesrc
folder? Or are you saying that something needs to be done inCMakeLists.txt
to better specify their location beyond the answer below?