Skip to main content

robot_bus/
lib.rs

1//! ZeroMQ message bus: broker routing and participant SDK.
2
3pub mod action_bus;
4pub mod broker;
5pub mod console_topics;
6pub mod discovery;
7pub mod errors;
8pub mod lazy_subscribe;
9pub mod message_bus;
10pub mod runtime;
11pub mod service_bus;
12pub mod shutdown;
13#[cfg(feature = "demo-tank")]
14pub mod tank;
15pub mod transports;
16pub mod typed;
17pub mod worker_thread;
18pub mod zmq_helpers;
19
20// Keep packages under a private module so prost `super::…` paths resolve;
21// re-export at crate root as `robot_bus::sensor_msgs::…`.
22mod generated;
23
24pub use generated::{
25    ackermann_msgs, action, action_msgs, apriltag_msgs, builtin_interfaces, control_msgs,
26    diagnostic_msgs, example_interfaces, foxglove_msgs, geometry_msgs, lifecycle_msgs, map_msgs,
27    nav_msgs, nav2_msgs, robot_bus_interfaces, sensor_msgs, shape_msgs, std_msgs, std_srvs,
28    stereo_msgs, tf2_msgs, trajectory_msgs, unique_identifier_msgs, vision_msgs,
29    visualization_msgs,
30};
31pub use typed::{Action, ActionOutcome, Service};
32
33#[cfg(feature = "ws")]
34pub mod ws;
35
36#[cfg(feature = "console-api")]
37pub mod console;
38
39#[cfg(feature = "ros2")]
40pub mod ros2_bridge;
41
42#[cfg(feature = "extension-module")]
43mod python_api;
44
45pub use action_bus::{ActionClient, ActionKind, ActionMessage, ActionWorker};
46pub use broker::{
47    ActionPeer, DiscoveryConfig, FederationPeerEndpoints, MessagePeer, RobotBusBroker,
48    RobotBusConfig, ServicePeer, apply_api_peers, apply_federation_opts, parse_robot_bus_config,
49    resolve_peer_from_api, robot_bus_broker_help,
50};
51pub use discovery::{
52    BrokerAnnouncement, DEFAULT_API_DISCOVER_PATH, DEFAULT_WS_RPC_PATH, DiscoverOpts,
53    DiscoverResponse, MAGIC as DISCOVERY_MAGIC, SCHEMA_VERSION as DISCOVERY_SCHEMA_VERSION,
54    decode_announce, encode_announce, fetch_discover, wait as discover_wait, with_ws_rpc_path,
55};
56#[cfg(feature = "demo-tank")]
57pub use tank::{
58    CMD_VEL_TOPIC, MULTI_WAYPOINT_NAV_ACTION, POINT_NAV_ACTION, POSE_TOPIC, RESET_SERVICE,
59    TankEndpoints, TankHandle, TankManager, TankSession, TankStatus, WORLD_SIZE,
60};
61
62#[allow(deprecated)]
63pub use discovery::{DEFAULT_DISCOVERY_PORT, DEFAULT_MULTICAST_ADDR};
64
65#[cfg(feature = "ws")]
66pub use broker::WsConfig;
67
68#[cfg(feature = "console-api")]
69pub use broker::ConsoleBrokerConfig;
70pub use errors::{BusError, Result, parse_error_body};
71pub use lazy_subscribe::{CONSOLE_DETECT_TIMEOUT, should_enable_ros_subscription};
72pub use message_bus::{Publisher, Subscriber};
73pub use runtime::{
74    ActionGoalContext, ActionGoalHandler, ActionGoalLiveHandler, CallbackGroup, CallbackGroupType,
75    ConnectionState, Context, Executor, ExecutorHandle, GoalHandle, ListParametersResult,
76    MessageCallback, MultiThreadedExecutor, Node, NodeActionClient, NodeActionClientRaw,
77    NodeActionServer, NodeOptions, NodeService, NodeServiceClient, NodeServiceClientRaw,
78    PARAMETER_DEPTH_RECURSIVE, Parameter, ParameterValue, QOS_PROFILE_DEFAULT, QosProfile,
79    RawActionFeedbackCallback, RawGoalHandle, ServiceHandler, ShutdownHandle,
80    SingleThreadedExecutor, SubscriptionHandle, SubscriptionOverflowPolicy, TimerCallback,
81    TimerHandle, TopicPublisher, TopicPublisherRaw,
82};
83pub use service_bus::{ServiceClient, ServiceWorker};
84pub use transports::{
85    BindAllOpts, DEFAULT_API_PORT, action_backend_endpoint, action_frontend_endpoint, bind_all,
86    bind_tcp, format_endpoints, inproc_endpoint, ipc_endpoint, message_xpub_endpoint,
87    message_xsub_endpoint, service_backend_endpoint, service_frontend_endpoint,
88};
89pub use zmq_helpers::HighWaterMark;