Overview

The Bridge Interface provides access to the bridge that runs on P3 and connects the on-board USB (access to the embedded systems) to the wireless network (access to higher control systems). It is summarised in the diagram below.

Downstream

Configuration

ROS stream specification
stream descriptionconfiguration data
topic namebridge/config
message typemiro_msgs/bridge_config

The configuration stream allows the bridge configuration to be modified on-the-fly. All configuration options available here are also available as command-line options when the bridge is started on P3.

Flags
MIRO_BRIDGE_UPDATEUnless this flag is set, all other flags are ignored; if this flag is set, flags in bridge are updated to match the passed set.
MIRO_BRIDGE_NO_PUBLISH_MICSIf set, do not publish the upstream signal platform/mics. Equivalent to bridge=m on the bridge command-line.
MIRO_BRIDGE_NO_PUBLISH_CAMSIf set, do not publish the upstream signals platform/caml and platform/camr. Equivalent to bridge=c on the bridge command-line.

Stream

ROS stream specification
stream descriptionaudio streaming commands
topic namebridge/stream
message typemiro_msgs/bridge_stream

When the bridge is started it can be pointed at a directory containing streamable sound samples using the command-line option sound. The available sounds will be loaded into memory, and are then available to be streamed from the bridge down into the embedded system. This signal stream triggers streaming.

The directory passed to the command-line option of the bridge sound should contain a file, sound.ini, which contains a number of lines, one for each sound file that is present and to be loaded from the same directory. For instance, the sound.ini that ships with the MDK looks like this.

sound.1 sound.2 sound.3 sound.4 sound.5

The file above will cause the bridge to attempt to load five sounds, each with the filename given. They are assigned identifiers by their order of appearance in the file, so sound.1 will be identified as sound number 1, and so on.

Each sound file should be a raw (unencoded) stream of mono int8 samples (i.e. signed values between -128 and 127), recorded at 8kHz. Thus, a file representing a one second sound will be 8000 bytes in length. Some example sounds are included in the MDK at ~/mdk/image/P3/home/root/sound (also on the SD card at /home/root/sound).

Flags
sound_index_P3To trigger a sound playing, send a non-zero integer up to and including the number of sounds loaded in the bridge (this value is available as number_of_loaded_sounds in the platform/state message). Sending zero has no effect, sending -1 will cancel an ongoing sound.