Sorry for the delay folks, I was out of the office for a week or so and I’m still catching up on things.
My understanding of the application (@Levi-Armstrong please jump in to correct me if I’m wrong) is that the user is presented with a list of discovered 3D meshes which can be imported into the tool. Some of these meshes are shipped in tesseract itself, but the user can also have their own installed, in which case they will most likely be contained in /opt/ros
on the host. To be clear, tesseract does not own /opt/ros
, but then again, nothing really does-- that’s just where ROS workspaces are conventionally installed (e.g. all upstream ROS components gets installed there). In many cases for a ROS snap, the snap is self-sufficient and it doesn’t make sense for it to care if ROS is installed on the host. Even if it did, if it tried to load a library from there it would probably fail as it wouldn’t be able to link to other libs. In this case, this snap is a utility that operates on a given ROS workspace and only loads meshes out of it, so this seems to make sense to me.
ROS is typically installed in the /opt/ros directory so I believe classic confinement is required to ready file from this location.
I am hoping that isn’t the case. I pointed @Levi-Armstrong at system-files, but neglected to account for the fact that /opt/ros/
would actually be in /var/lib/snapd/hostfs/opt/ros/
. This means the environment variables defined by ROS that make it possible to find it will be pointing to the wrong place in the snap. We can work around that, but it’s kind of ugly. Let’s cross that bridge when we get to it though, and start with system-files.
@Levi-Armstrong, your snapcraft.yaml is close, but you need to change the read
item to use /var/lib/snapd/hostfs/opt/ros
as opposed to just /opt/ros
. You’ll probably need a better name as well, but we can deal with that later.
As soon as you build and install that snap, you need to connect the interface (sudo snap connect tesseract-ignition:ros-plug
), and then the snap will be able to access the host’s /opt/ros
by visiting /var/lib/snapd/hostfs/opt/ros
. Make sense?
Once we get there, we can deal with remapping the host’s ROS_PACKAGE_PATH into /var/lib/snapd/hostfs/opt/ros
. Also, now that we’re here, does tesseract actually support multiple ROS releases? Or should that interface actually be for a specific subdirectory of /opt/ros/
?