Request: Allow Auto-Connection for rosbot (shm, raw-usb, gpio, serial)

Hi guys,

We have just tried to upload a new version of rosbot snap to the store. The target OS for this snap is Ubuntu Server. rosbot snap runs ROS 2 driver for our smallest mobile robot for research:

We have 3 interfaces that need human review: gpiochip-slot, serial-slot and shm-slot. Here is a part of our snapcraft.yaml:

slots:
  shm-slot:
    interface: shared-memory
    write: ['*'] # paths are relative to /dev/shm
  gpiochip-slot:
    interface: custom-device
    custom-device: gpiochip
    devices:
      # Raspberry Pi 4
      - /dev/gpiochip0
      # Raspberry Pi 5
      - /dev/gpiochip4
    files:
      read:
        - /sys/devices/platform/soc/*.gpio/gpiochip0/dev
        - /sys/devices/platform/axi/*.pcie/*.gpio/gpiochip4/dev
  serial-slot:
    interface: custom-device
    custom-device: ttyserial
    devices:
      - /dev/ttyAMA0
      - /dev/ttyS4
        
plugs:
  shm-plug:
    interface: shared-memory
    shared-memory: shm-slot
    private: false
  gpiochip-plug:
    interface: custom-device
    custom-device: gpiochip
  serial-plug:
    interface: custom-device
    custom-device: ttyserial

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, serial-plug, gpiochip-plug]
    slots: [shm-slot, serial-slot, gpiochip-slot]
    extensions: [ros2-humble-ros-base]

  rosbot:
    command: usr/bin/launcher.sh
    command-chain: [usr/bin/check_daemon_running.sh, usr/bin/ros_setup.sh]
    plugs: [network, network-bind, shm-plug, raw-usb, serial-plug, gpiochip-plug]
    slots: [shm-slot, serial-slot, gpiochip-slot]
    extensions: [ros2-humble-ros-base]

  flash:
    command: usr/bin/flash_launcher.sh
    plugs: [raw-usb, network-bind, gpiochip-plug, serial-plug]
    slots: [gpiochip-slot, serial-slot]
    extensions: [ros2-humble-ros-base]

And here are the reasons why we need those interfaces:

  1. shm-slot: used for shared memory communication between ROS 2 nodes. The same interface was permitted in the rosbot-xl snap
  2. gpiochip-slot: ROSbot 2R is powered by Raspberry Pi 4. GPIO interface is needed for entering the STM32F4 microcontroller into the bootloader mode (controlling BOOT0 and RST signals from a Raspberry Pi pin header). This slot is done in a similar way as in matter-pi-gpio-commander snap by Canonical
  3. serial-slot: The same STM32F4 microcontroller is connected with RaspberryPi 4 over the /dev/ttyAMA0 interface available over the RPi4 pin header. Access to this interface is not possible with raw-usb or serial-port interfaces. We’re accessing /dev/ttyAMA0 the similar way as here: Allow installation and auto-connection of mulitple interfaces for console-conf snap

Additionally I would be grateful for auto-connection for the following interfaces:

sudo snap connect rosbot:raw-usb
sudo snap connect rosbot:shm-plug rosbot:shm-slot
sudo snap connect rosbot:gpiochip-plug rosbot:gpiochip-slot
sudo snap connect rosbot:serial-plug rosbot:serial-slot

Thanks a lot!

Best,

Dominik from Husarion

Inline with the previously submitted similar requests, this one as well make sense to me, therefore +1 from me. Thanks

1 Like

+1 from me as well for auto-connecting shared-memory, raw-usb and custome-device as it is inline with previous requests

thanks

1 Like