因此,我有这个多包 ros 项目,我想使用 snapcraft 构建它,以便我可以将其分发到客户端并更轻松地更新它。但是,我设法构建了它,但由于某种原因,应用程序找不到 roslaunch 命令。我使用脚本 (ros_start_script) 来选择要启动的节点。以下是 snapcraft.yaml 文件,我从中获取包含整个 ros 项目的 git,启动脚本(因为否则找不到它),诗歌(因为项目使用它并创建了一个应用程序来启动脚本):
name: ss-delivery-robot
version: '1.0'
summary: ROS software for Sirsteward delivery robots
description: |
This snap package provides the SS Delivery Robot ROS repository.
confinement: devmode
base: core20
parts:
ss-delivery-robot:
plugin: catkin
source-type: git
source: https://[email protected]/sirsteward/ss_delivery_robot.git
#source: [email protected]:sirsteward/ss_delivery_robot.git
source-branch: feature/snapcraft
stage-packages:
- ros-noetic-rosbash # for rosrun
- ros-noetic-roslaunch # for roslaunch
start-script:
plugin: dump
source: https://[email protected]/sirsteward/ss_delivery_robot.git
source-branch: feature/snapcraft
organize:
ros_start_script.sh: bin/
poetry:
plugin: python
python-packages: [poetry]
stage-packages:
- libyaml-cpp-dev
apps:
ros-start-script:
command: bin/ros_start_script.sh
plugs: [network, network-bind]
extensions: [ ros1-noetic ]
下面是导致错误的 roslaunch 行脚本内容:
#!/bin/bash
set -e
#sleep 90
# setup ros environment
source "/home/$USER/ROS_PROJECT/devel/setup.bash"
cd "/home/$USER/ROS_PROJECT/src/ss_delivery_robot/"
source ".env"
if [[ "$MODULES_SELECTOR" == "True" ]]; then
source "robot_modules_selection.sh"
fi
source ".env"
dt=$(date '+%Y-%m-%d_%H:%M:%S')
if [[ "$ENVIRONMENT" != *"DEBUG"* ]]; then
poetry run roslaunch node_manager_pkg node_manager.launch timestamp:=$dt
fi
exec "$@"
成功构建 snap 项目、安装并使用以下命令执行后,即可启动后者ss-delivery-robot.ros-start-script
我发现这个有用的网站,但即使浏览了它,我也无法修复我的错误:https://ubuntu.com/robotics/docs/faq-and-troubleshooting