Expand description
Shared plumbing for the moqros bridge binaries.
Structs§
- Bridges
- What a bridge node does: ROS topics to publish to the relay, and broadcasts to republish on ROS.
- Broadcast
Spec - A broadcast for
moqros-sub:BROADCAST[,topic=…][,type=…][,frame_id=…]. - Encoder
Args - Video encoder flags.
- PubTopic
- What
moqros-pubdoes with one topic. - QosArgs
- ROS QoS flags.
- Relay
- The relay connection of a bridge node: a publisher for its topics, a subscriber for its broadcasts, or both over one connection.
- Relay
Args - Relay connection flags.
- Shared
Node - A node shared between
spawn_spinnerand code that adds subscriptions while it spins. - Spinner
- Stops the
spawn_spinnerthread when dropped. - SubBroadcast
- What
moqros-subdoes with one broadcast. - Topic
Spec - A topic for
moqros-pub:TOPIC[,format=…][,type=…][,mode=…][,broadcast=…].
Enums§
- Format
- What
moqros-pubsends.
Constants§
- DEFAULT_
SUB_ TOPIC - Topic of a lone broadcast that neither
topic=nor--topicnames.
Functions§
- check_
no_ loop - Refuse a bridge that would feed its own output back in: a broadcast or a ROS topic that both directions use. Every message would go round the loop forever.
- init
- Create the ROS node and parse
Tfrom the command line and the node’s ROS parameters. - init_
logging - pub_
topics - Fill in each topic’s options from the flags:
formatandmodeapply to every topic, whileros_typeandbroadcastname one topic, so they need exactly one. - run_
bridges - Run
bridgesuntil one of them ends, the relay connection gives up, or SIGINT or SIGTERM arrives (which closes the connection first, so the relay ends this node’s broadcasts and subscriptions right away). - shutdown_
signal - Resolves with the signal’s name on the first SIGINT (Ctrl-C) or SIGTERM (
docker stop, systemd), so the bridges can close their relay connection before exiting. - spawn_
spinner - Spin
nodeon a blocking thread until the returned guard is dropped. - strip_
ros_ args - Drop the ROS arguments (
--ros-args … [--], possibly repeated) fromargs. - sub_
broadcasts - Fill in each broadcast’s options from the flags.
topicandros_typename one broadcast, so they need exactly one. Without eithertopic=or--topic, a lone broadcast goes toDEFAULT_SUB_TOPIC, and each of several to/moqros/<broadcast>.