Hi so I’m trying to package my ROS1 noetic project with snapcraft but I just cannot get it to work. Heres the snapcraft.yaml file :
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: local
#source: https://christopherlajoie@bitbucket.org/sirsteward/ss_delivery_robot.git
#source: git@bitbucket.org:sirsteward/ss_delivery_robot.git
source: .
#source-branch: feature/snapcraft
stage-packages:
- ros-noetic-rosbash # for rosrun
- ros-noetic-roslaunch # for roslaunch
start-script:
plugin: dump
source-type: local
source: .
#source-branch: feature/snapcraft
organize:
ros_start_script.sh: bin/
poetry:
plugin: python
python-packages: [poetry]
build-packages:
- python3-pip
stage-packages:
- libyaml-cpp-dev
- python3-pip
- python3
override-build: |
pip install poetry
export POETRY_HOME=/home/sirsteward/for_pr/ss_delivery_robot/.venv:/home/sirsteward/ROS_PROJECT/src/ss_delivery_robot/.venv
apps:
ros-start-script:
command: bin/ros_start_script.sh
plugs: [network, network-bind]
#environment:
#PATH: $SNAP/opt/ros/noetic/bin:$PATH
#PYTHONPATH: $SNAP/opt/ros/noetic/lib/python3/dist-packages:$PYTHONPATH
extensions: [ros1-noetic]
So basically, it’s a multiple-node ros project and I have it cloned in the same folder as the snapcraft.yaml file. As you can see, I import poetry which is used in the project (or at least I try, it seems that the installation doesn’t work even though I put the commands in override-build) and I also import ros_start_script.sh which is used to launch all the nodes wanted, heres what the file look like:
#!/bin/bash
set -e
#sleep 90
# setup ros environment
source "/home/sirsteward/ROS_PROJECT/devel/setup.bash"
#source /var/lib/snapd/hostfs/opt/ros/noetic/setup.bash
#source /snap/ss-delivery-robot/x1/opt/ros/noetic/setup.bash
#cd "/var/lib/snapd/hostfs/home/sirsteward/ROS_PROJECT/src/ss_delivery_robot"
cd "/home/sirsteward/ROS_PROJECT/src/ss_delivery_robot"
source ".env"
if [[ "$MODULES_SELECTOR" == "True" ]]; then
printf "Modules selector is enabled\n"
source "robot_modules_selection.sh"
fi
source ".env"
dt=$(date '+%Y-%m-%d_%H:%M:%S')
if [[ "$ENVIRONMENT" != *"DEBUG"* ]]; then
printf "Starting node manager\n"
poetry run roslaunch node_manager_pkg node_manager.launch timestamp:=$dt
fi
exec "$@"
Honestly, im not sure where I should source my ROS environment cause from the debugging I have done it seems that the line that isnt commented doesn’t work. When I finish building, install and then launch it with ss-delivery-robot.ros-start-script
I get roslaunch not found error.
Im new to using snapcraft and I dont get why Im having such a hard time making it work. I tried shelling into my build and from there I was able to manually install poetry and source roslaunch but even then it couldnt find the node_manager.launch file.
Obviously there is something wrong with the way Im building my app and I want to know what it is