diff --git a/recipes-ros/ros-comm/roslaunch/roscore-default b/recipes-ros/ros-comm/roslaunch/roscore-default new file mode 100644 index 0000000000000000000000000000000000000000..71df34edf149f53f478ec26e70ca421c1a91cbde --- /dev/null +++ b/recipes-ros/ros-comm/roslaunch/roscore-default @@ -0,0 +1,4 @@ +ROS_ROOT=/usr +ROS_PORT=11311 +ROS_MASTER_URI=http://localhost:$ROS_PORT +CMAKE_PREFIX_PATH=$ROS_ROOT diff --git a/recipes-ros/ros-comm/roslaunch/roscore.service b/recipes-ros/ros-comm/roslaunch/roscore.service new file mode 100644 index 0000000000000000000000000000000000000000..49496e563cc20cc29e00201524e41c8ed3097840 --- /dev/null +++ b/recipes-ros/ros-comm/roslaunch/roscore.service @@ -0,0 +1,12 @@ +[Unit] +Description=Launcher for the ROS master, parameter server and rosout logging node +After=network.target ros-set-cmake-prefix + +[Service] +EnvironmentFile=/etc/default/roscore +ExecStartPre=/bin/touch ${CMAKE_PREFIX_PATH}/.catkin +ExecStart=/usr/bin/roscore -p $ROS_PORT +Restart=on-abort + +[Install] +WantedBy=multi-user.target diff --git a/recipes-ros/ros-comm/roslaunch_1.10.2.bb b/recipes-ros/ros-comm/roslaunch_1.10.2.bb index 6776f9fe7e295fc14d11c14dbe10c81a3b62916a..38e6de20052f25be9d649ef89cae28e4bcf5f62d 100644 --- a/recipes-ros/ros-comm/roslaunch_1.10.2.bb +++ b/recipes-ros/ros-comm/roslaunch_1.10.2.bb @@ -4,9 +4,14 @@ SECTION = "devel" LICENSE = "BSD" LIC_FILES_CHKSUM = "file://package.xml;beginline=16;endline=16;md5=d566ef916e9dedc494f5f793a6690ba5" +PR = "r1" + require ros-comm.inc -SRC_URI += "file://0001-increase-rosmaster-timeout.patch" +SRC_URI += "file://0001-increase-rosmaster-timeout.patch \ + file://roscore.service \ + file://roscore-default \ +" ROS_PKG_SUBDIR = "tools" @@ -27,3 +32,24 @@ RDEPENDS_${PN} = "\ rosout \ rosparam \ " + +do_install_append() { + install -d ${D}/${sysconfdir}/default + install -m 0644 ${WORKDIR}/roscore-default ${D}/${sysconfdir}/default/roscore + + # Install systemd unit file + install -d ${D}${systemd_unitdir}/system/ + install -m 0644 ${WORKDIR}/roscore.service ${D}${systemd_unitdir}/system/roscore.service +} + +FILES_${PN}-systemd += "${sysconfdir}/default/roscore \ +" + +CONFFILES_${PN}-systemd += "${sysconfdir}/default/roscore \ +" + +inherit systemd +PACKAGES += "${PN}-systemd" +SYSTEMD_PACKAGES = "${PN}-systemd" +SYSTEMD_SERVICE = "roscore.service \ +"