![]() |
open_sound_control_ros repositoryopen_sound_control open_sound_control_bridge open_sound_control_msgs |
|
Repository Summary
Checkout URI | https://github.com/chrisib/open_sound_control_ros.git |
VCS Type | git |
VCS Version | jazzy |
Last Updated | 2025-03-19 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Packages
Name | Version |
---|---|
open_sound_control | 0.0.2 |
open_sound_control_bridge | 0.0.2 |
open_sound_control_msgs | 0.0.2 |
README
Open Sound Control ROS
This repository contains several packages for ROS 2 Jazzy intended to interact with Open Sound Control.
What is Open Sound Control?
Open Sound Control (OSC) is an open-source data transport specification for realtime communication between applications and hardware. Similar to MIDI, OSC is indended for use with electronic musical instruments primarily, but can have other applications.
OSC, by default, uses UDP packets to transmit encoded data from one application to another. Each packet consists of an address (similar in principle to a ROS topic) and one or more variables of specific types.
For details on the OSC 1.0 and 1.1 specifications, see the official documentation at the links below:
OSC to/from ROS
The open_sound_control_msgs
package contains the ROS message definitions needed
for handling OSC packets in ROS.
The open_sound_control_bridge
package contains a ROS node that will accept OSC
messages and translate them into the corresponding ROS messages, or accept ROS
messages and translate them into their corresponding OSC messages.
The open_sound_control_bridge
node publishes all received OSC messages as
open_sound_control_msgs/msg/OscMessage
messages on its osc_raw
topic.
Additionally, the brige node will publish each individual variable inside the
OSC payload on an individual ROS topic whose name corresponds to the OSC
address followed by the type and a numbered suffix.
For example, this OSC message
2f (/) 66 (f) 6f (o) 6f (o)
00 () 00 () 00 () 00 ()
2c (,) 69 (i) 69 (i) 73 (s)
66 (f) 66 (f) 00 () 00 ()
00 () 00 () 03 () e8 (è)
ff (ÿ) ff (ÿ) ff (ÿ) ff (ÿ)
68 (h) 65 (e) 6c (l) 6c (l)
6f (o) 00 () 00 () 00 ()
3f (?) 9d () f3 (ó) b6 (¶)
40 (@) b5 (µ) b2 (”) 2d (-)
containing the address /foo
, the integer -1
, the string hello
, the
float 1.234
, and the float 5.678
would be republished as the following
topics:
-
osc_raw
:open_sound_control_msgs/msg/OscMessage
– the raw OSC data re-encoded as a ROS message -
/foo/int_0
:std_msgs/msg/Integer
containing the value-1
-
/foo/str_0
:std_msgs/msg/String
containing the valuehello
-
/foo/float_0
:std_msgs/msg/Float32
containing the value1.234
-
/foo/float_1
:std_msgs/msg/Float32
containing the value5.678
The following table shows the OSC types, the ROS topic name, and ROS message type:
OSC type (character) | Topic name | ROS type |
---|---|---|
blob (b ) |
blob_N |
open_sound_control_msgs/msg/OscBlob |
boolean (T , F ) |
bool_N |
std_msgs/msg/Bool |
char (c ) |
char_N |
std_msgs/msg/String |
double (d ) |
double_N |
std_msgs/msg/Float64 |
float (f ) |
float_N |
std_msgs/msg/Float32 |
integer (i ) |
int_N |
std_msgs/msg/Int32 |
impulse (I ) |
trig_N |
std_msgs/msg/Empty |
midi (m ) |
midi_N |
std_msgs/msg/ByteMultiArray |
null (N ) |
null_N |
std_msgs/msg/Empty |
rgba (r ) |
rgba_N |
std_msgs/msg/ColorRGBA |
string (s ) |
string_N |
std_msgs/msg/String |
symbols (S ) |
symbol_N |
std_msgs/msg/String |
timetag (t ) |
time_N |
std_msgs/msg/Header |
where _N
is a 0-based index indicating the relative order of variables of that type.
To configure ROS -> OSC conversions, the bridge node must be properly configured. See bridge configuration, below.
OSC address and ROS topic naming standards
OSC does not strictly enforce many standards on the address. ROS topic namespaces on the other hand follow stricter conventions:
- topic names may only contain lower-case letters, numbers, and underscore (
_
) characters - no portion of the namespace may have a leading integer
- leading
_
characters cause the ROS topic to become hidden
When generating the ROS topic name from the OSC address, the following modifications will
File truncated at 100 lines see the full file