Request: Allow Auto-Connection for husarion-depthai (shm and raw-usb)

Hi guys,

I have almost 1:1 the same request as before for husarion-astra but for a different model of a RGB-D camera.

I would like to request for the auto-connection for raw-usb and shared-memory interfaces permissions for: husarion-depthai. This snap operates the ROS driver for a camera connected via USB to the ROSbot XL mobile robot. This is why it requires the raw-usb interface.

I would need:

1. A “human review” for shm-slot.

That’s 1:1 the same “shm design pattern” as previously granted for rosbot-xl snap:

slots:
  shm-slot:
    interface: shared-memory
    write: ['*'] # paths are relative to /dev/shm

plugs:
  shm-plug:
    interface: shared-memory
    shared-memory: shm-slot
    private: false

apps:
  daemon:
    command: usr/bin/launcher.sh
    command-chain: [usr/bin/ros_setup.sh]
    daemon: simple
    install-mode: enable
    plugs: [network, network-bind, shm-plug, raw-usb]
    slots: [shm-slot]
    extensions: [ros2-humble-ros-base]

2. Auto-connection for both shm and raw-usb interfaces:

sudo snap connect husarion-depthai:raw-usb
sudo snap connect husarion-depthai:shm-plug husarion-depthai:shm-slot 

Thank you again!

Dominik from Husarion

given the reasoning in topics 1, 2 and 3, +1 for auto-connecting the requested interfaces.

1 Like

As @cav said, +1 from me for the same reasons already discussed in Request: allow auto-connection for rosbot-xl

1 Like

2 votes for, 0 against. Granting auto-connect of raw-usb and shared-memory interfaces to husarion-depthai snap. This is now live.

Thanks.

1 Like

Hi guys,

As you can see from this forum thread shm-plug <> shm-slot connection should be automatic after the installation. And it was, but in the recent release of the husarion-depthai snap I see, that this interface is not connected after the fresh installation:

$ sudo snap connections husarion-depthai 
Interface                    Plug                                 Slot                                   Notes
content[ros-jazzy-ros-base]  husarion-depthai:ros-jazzy-ros-base  ros-jazzy-ros-base:ros-jazzy-ros-base  -
hardware-observe             husarion-depthai:hardware-observe    :hardware-observe                      manual
network                      husarion-depthai:network             :network                               -
network-bind                 husarion-depthai:network-bind        :network-bind                          -
raw-usb                      husarion-depthai:raw-usb             :raw-usb                               -
shared-memory                -                                    husarion-depthai:shm-slot              -
shared-memory                husarion-depthai:shm-plug            -                                      -

Could you try to enable the auto-connection for the shm interface once again, so I don’t need to run:

sudo snap connect husarion-depthai:shm-plug husarion-depthai:shm-slot

Thanks,

Dominik

hi @Husarion - I just did a fresh installation of the snap on my machine and it seems it was auto-connected:

$ snap install husarion-depthai
husarion-depthai (humble/stable) 2.10.0+githumble from Husarion✓ installed
$ snap connections husarion-depthai 
Interface                     Plug                                  Slot                                     Notes
content[ros-humble-ros-base]  husarion-depthai:ros-humble-ros-base  ros-humble-ros-base:ros-humble-ros-base  -
hardware-observe              husarion-depthai:hardware-observe     -                                        -
network                       husarion-depthai:network              :network                                 -
network-bind                  husarion-depthai:network-bind         :network-bind                            -
raw-usb                       husarion-depthai:raw-usb              :raw-usb                                 -
shared-memory                 husarion-depthai:shm-plug             husarion-depthai:shm-slot                -

@jslarraz - do you know why this might be happening?

Hey @Husarion

The problem here appears when more than one installed snap is providing the same slot (a shared memory slot named shm-slot). In this situation snapd does not know where to plug husarion-depthai:shm-plug.

The best solution here would possibly be to rename the plugs and slots to be unique to the snap (e.g. shm-plug-depthai, shm-slot-depthai).

Alternatively, if and only if the slot is expected to be always connected exclusively by the plug defined in the same snap we could possibly introduce a snap-id constraint in the snap-declarations. However, I’m not sure that’s a pattern we can/want support.

@alexmurray @pedronis ideas?