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

Create a new folder when generate a ROS .deb package

asked 2021-02-09 14:55:50 -0500

Marcus Barnet gravatar image

updated 2021-02-09 14:56:17 -0500

Hi to all,

I usually use to build ROS debian packages starting from my catkin workspace in order to be able to install it on other ROS systems. Everything works fine even if I'm not able to specify in the CMakeList file how to create a new folder under /opt/ros/melodic/share/package_name even if I'm successfully able to copy all the package file.

I try to explain it better: I would like to create some folders like launch (to store all the launch files) and params (to store all the yaml files) under the main package folder that is created in the share folder after the installation of the debian package.

Even if I specify the folder in this way:

## Mark cpp header files for installation
 install(DIRECTORY
params/
launch/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
 )    
## Mark other files for installation (e.g. launch and bag files, etc.)
    install(FILES
       launch/base.launch
       launch/teleop.launch
       launch/mode.launch
       launch/readme
    #   # myfile2
       DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
    )

when I try to install the debian package, all the launch files are just copied into the main package name folder, so, for example, I will have:

/opt/ros/melodic/share/my_package/base.launch

instead to have:

/opt/ros/melodic/share/my_package/launch/base.launch

how can I solve this?

Thank you a lot!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2021-02-10 02:40:41 -0500

gvdhoorn gravatar image

updated 2021-02-10 02:41:06 -0500

I'm not sure I understand you, but the following works for me:

install(DIRECTORY dir0 dir1 [..] dirN
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})

this copies the complete directories (ie: dir0, dir1, etc) to CATKIN_PACKAGE_SHARE_DESTINATION as part of the install process.

So:

# which is really: /opt/ros/$ROS_DISTRO/your_package
CATKIN_PACKAGE_SHARE_DESTINATION
  dir0
  dir1
  ...
  dirN

Could you clarify why you then also list individual files for installation later?

edit flag offensive delete link more

Comments

Thank you, I will test your suggestion this afternoon! I'm sorry for my bad explaination!

Marcus Barnet gravatar image Marcus Barnet  ( 2021-02-10 02:42:39 -0500 )edit

It worked like a charm! thank you for the support!

Marcus Barnet gravatar image Marcus Barnet  ( 2021-02-11 04:12:37 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2021-02-09 14:55:50 -0500

Seen: 217 times

Last updated: Feb 09 '21