Goby3 3.2.3
2025.05.13
|
goby_liaison
is a C++ web server based on the Wt toolkit. It has several built-in "tabs" and users can write their own tabs and load them using shared libraries (dlopen). Each tab runs in its own thread and can be selected from a menu that runs along the left side of the web page.
The built-in tabs include:
goby zeromq subscribe
.Several configuration values can be set regardless of the tabs in use:
http_address
: IP address or hostname to bind on, e.g., '127.0.0.1' for IPv4 localhost or '0::0' for all addresses.http_port
: Port to bind on, defaults to 54321. Set to 80
for the default HTTP port (but this usually requires root privileges and won't work if any other server such as Apache is running on that port).docroot
: Path to Liaison static objects directory. This can typically be omitted unless you've installed goby_liaison somewhere non-standard.load_shared_library
, load_proto_file
, load_proto_dir
: Three ways to specify Protobuf message definitions to load, which is required to decode any messages used by Commander or Scope.add_home_tab
: Defaults to true - set false to omit the Home tab.add_scope_tab
: Defaults to true - set false to omit the Scope tab.add_commander_tab
: Defaults to true - set false to omit the Commander tab.To access goby_liaison
from the client side, open a web browser to http://<http_address>:<http_port>
The following image shows the Liaison Commander using the USVCommand protobuf message from the Goby3 Course, before filling in the message:
After filling in your message and sending it, your window will look something like this:
The relevant configuration for creating the Commander UI shown above is:
The pb_commander_config
block informs goby_liaison
of the messages to load and how to publish them after they are filled out and sent by the user:
package.message
). This Protobuf message must be "known" to goby_liaison
using load_shared_library
, load_proto_file
, or load_proto_dir
.intervehicle
layer). 0
is the "broadcast" groupWhen using the LAYER_INTERPROCESS version of goby_liaison
's Commander, this is equivalent to a GUI version of the command line tool goby zeromq publish
.
The goby_liaison
Scope gives a live view of all the messages in the connected interprocess
layer:
The default configuration is usually sufficient, but you can customize many of the settings to optimize for your own uses:
You can create and load your own tab in goby_liaison
using the Wt toolbox and a shared library plugin (.so).
These open source examples will be helpful to explore while creating your own tab:
Each tab is a subclass of goby::zeromq::LiaisonContainer
(which is a Wt::WContainerWidget
), which is defined in:
If your tab needs to publish/subscribe, you should subclass from goby::zeromq::LiaisonContainerWithComms
(which is a goby::zeromq::LiaisonContaine
) and pass your subclass of goby::zeromq::LiaisonCommsThread
(which is a goby::middleware::SimpleThread
) as a template parameter.
Your plugin library must define a C function goby3_liaison_load
that is called by goby_liaison
to load your tab(s). This function must have the following signature:
The usual parsed configuration file / command line parameters are available in cfg
. You can extend the goby::apps::zeromq::protobuf::LiaisonConfig
message (goby/zeromq/protobuf/liaison_config.proto) to allow your application to have specialized configuration. If you wish to use a public extension, create an Issue on Github and we will assign one. For private projects, simply choose any extension values in the range 10000-11000.
Finally to load your plugin, you need to define the environmental variable GOBY_LIAISON_PLUGINS
with a comma, semicolon or colon delimited set of path(s) to shared libraries for goby_liaison
to load. These shared libraries must be fully qualified paths or on the ld
load path (e.g., using LD_LIBRARY_PATH
).
A shell script can easily be defined to do all this for you (e.g., name the script goby_liaison_myproject
so you can just run goby_liaison_myproject
like you run goby_liaison
and your tab(s) will always be loaded):
(This figure excludes dynamic subscriptions / publications, which is the majority of what goby_liaison
uses)