osiris-bridge 0.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. osiris_bridge-0.5.0/LICENSE +190 -0
  2. osiris_bridge-0.5.0/PKG-INFO +262 -0
  3. osiris_bridge-0.5.0/README.md +225 -0
  4. osiris_bridge-0.5.0/osiris_agent/__init__.py +9 -0
  5. osiris_bridge-0.5.0/osiris_agent/action_monitor.py +199 -0
  6. osiris_bridge-0.5.0/osiris_agent/agent_config.py +455 -0
  7. osiris_bridge-0.5.0/osiris_agent/agent_config_validation.py +170 -0
  8. osiris_bridge-0.5.0/osiris_agent/agent_node.py +644 -0
  9. osiris_bridge-0.5.0/osiris_agent/bag_recorder.py +297 -0
  10. osiris_bridge-0.5.0/osiris_agent/bin/graph_watcher_aarch64 +0 -0
  11. osiris_bridge-0.5.0/osiris_agent/bin/graph_watcher_aarch64_jazzy +0 -0
  12. osiris_bridge-0.5.0/osiris_agent/bin/graph_watcher_aarch64_lyrical +0 -0
  13. osiris_bridge-0.5.0/osiris_agent/bin/graph_watcher_x86_64 +0 -0
  14. osiris_bridge-0.5.0/osiris_agent/bin/graph_watcher_x86_64_jazzy +0 -0
  15. osiris_bridge-0.5.0/osiris_agent/bt_collector.py +805 -0
  16. osiris_bridge-0.5.0/osiris_agent/command_policy.py +147 -0
  17. osiris_bridge-0.5.0/osiris_agent/commands.py +478 -0
  18. osiris_bridge-0.5.0/osiris_agent/connection.py +330 -0
  19. osiris_bridge-0.5.0/osiris_agent/graph_monitor.py +621 -0
  20. osiris_bridge-0.5.0/osiris_agent/graph_watcher_launcher.py +163 -0
  21. osiris_bridge-0.5.0/osiris_agent/lifecycle.py +76 -0
  22. osiris_bridge-0.5.0/osiris_agent/nav2_bt_monitor.py +257 -0
  23. osiris_bridge-0.5.0/osiris_agent/node_parameters.py +121 -0
  24. osiris_bridge-0.5.0/osiris_agent/payload_encoding.py +226 -0
  25. osiris_bridge-0.5.0/osiris_agent/qos.py +41 -0
  26. osiris_bridge-0.5.0/osiris_agent/ros2_control_collector.py +331 -0
  27. osiris_bridge-0.5.0/osiris_agent/snapshots.py +679 -0
  28. osiris_bridge-0.5.0/osiris_agent/telemetry.py +296 -0
  29. osiris_bridge-0.5.0/osiris_agent/tf_listener.py +88 -0
  30. osiris_bridge-0.5.0/osiris_agent/tf_tree_collector.py +291 -0
  31. osiris_bridge-0.5.0/osiris_agent/topic_bridge.py +453 -0
  32. osiris_bridge-0.5.0/osiris_agent/topic_names.py +29 -0
  33. osiris_bridge-0.5.0/osiris_bridge.egg-info/PKG-INFO +262 -0
  34. osiris_bridge-0.5.0/osiris_bridge.egg-info/SOURCES.txt +64 -0
  35. osiris_bridge-0.5.0/osiris_bridge.egg-info/dependency_links.txt +1 -0
  36. osiris_bridge-0.5.0/osiris_bridge.egg-info/entry_points.txt +2 -0
  37. osiris_bridge-0.5.0/osiris_bridge.egg-info/requires.txt +8 -0
  38. osiris_bridge-0.5.0/osiris_bridge.egg-info/top_level.txt +1 -0
  39. osiris_bridge-0.5.0/setup.cfg +4 -0
  40. osiris_bridge-0.5.0/setup.py +51 -0
  41. osiris_bridge-0.5.0/tests/test_agent_config_apply.py +367 -0
  42. osiris_bridge-0.5.0/tests/test_agent_config_validation.py +121 -0
  43. osiris_bridge-0.5.0/tests/test_bag_folder.py +168 -0
  44. osiris_bridge-0.5.0/tests/test_bag_list_refresh.py +95 -0
  45. osiris_bridge-0.5.0/tests/test_bundle_capture.py +201 -0
  46. osiris_bridge-0.5.0/tests/test_command_policy.py +157 -0
  47. osiris_bridge-0.5.0/tests/test_command_routing.py +155 -0
  48. osiris_bridge-0.5.0/tests/test_gateway_refusal.py +40 -0
  49. osiris_bridge-0.5.0/tests/test_goal_replay.py +84 -0
  50. osiris_bridge-0.5.0/tests/test_graph_actions.py +121 -0
  51. osiris_bridge-0.5.0/tests/test_graph_endpoint_changes.py +124 -0
  52. osiris_bridge-0.5.0/tests/test_graph_poll_debounce.py +136 -0
  53. osiris_bridge-0.5.0/tests/test_graph_settle.py +124 -0
  54. osiris_bridge-0.5.0/tests/test_graph_watcher_launcher.py +208 -0
  55. osiris_bridge-0.5.0/tests/test_initial_state_meta.py +27 -0
  56. osiris_bridge-0.5.0/tests/test_lidar_tf_wait.py +75 -0
  57. osiris_bridge-0.5.0/tests/test_node_parameters.py +198 -0
  58. osiris_bridge-0.5.0/tests/test_pending_goal_events.py +96 -0
  59. osiris_bridge-0.5.0/tests/test_reconnect_wait.py +65 -0
  60. osiris_bridge-0.5.0/tests/test_ros2_control_collector.py +149 -0
  61. osiris_bridge-0.5.0/tests/test_send_failure.py +66 -0
  62. osiris_bridge-0.5.0/tests/test_send_queue.py +103 -0
  63. osiris_bridge-0.5.0/tests/test_telemetry_net.py +62 -0
  64. osiris_bridge-0.5.0/tests/test_tf_listener.py +119 -0
  65. osiris_bridge-0.5.0/tests/test_tf_tree_static.py +57 -0
  66. osiris_bridge-0.5.0/tests/test_topic_names.py +67 -0
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2025 nicolaselielll
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
@@ -0,0 +1,262 @@
1
+ Metadata-Version: 2.4
2
+ Name: osiris-bridge
3
+ Version: 0.5.0
4
+ Summary: Osiris bridge: connects a ROS 2 robot (Humble and later) to Osiris
5
+ Home-page: https://github.com/nicolaselielll/osiris_agent
6
+ Author: Nicolas Tuomaala
7
+ Author-email: nicolas.tuomaala00@gmail.com
8
+ License: Apache-2.0
9
+ Keywords: ros2 humble jazzy kilted lyrical robotics monitoring bridge osiris
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Operating System :: OS Independent
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: websockets
19
+ Requires-Dist: psutil
20
+ Requires-Dist: pyzmq
21
+ Requires-Dist: msgpack
22
+ Requires-Dist: Pillow
23
+ Provides-Extra: ros
24
+ Requires-Dist: rclpy; extra == "ros"
25
+ Dynamic: author
26
+ Dynamic: author-email
27
+ Dynamic: classifier
28
+ Dynamic: description
29
+ Dynamic: description-content-type
30
+ Dynamic: home-page
31
+ Dynamic: keywords
32
+ Dynamic: license
33
+ Dynamic: license-file
34
+ Dynamic: provides-extra
35
+ Dynamic: requires-dist
36
+ Dynamic: summary
37
+
38
+ # Osiris bridge
39
+
40
+ ![PyPI](https://img.shields.io/pypi/v/osiris-bridge.svg)
41
+ ![Python](https://img.shields.io/pypi/pyversions/osiris-bridge.svg)
42
+ ![License](https://img.shields.io/pypi/l/osiris-bridge.svg)
43
+ ![CI](https://github.com/nicolaselielll/osiris_agent/actions/workflows/ci.yml/badge.svg)
44
+
45
+ The Osiris bridge connects a ROS 2 robot to [Osiris](https://osirislabs.io), where you watch it live, record bags, look back through its history and ask an AI what it is doing.
46
+
47
+ It runs on the robot as one ROS 2 node, `osiris_node`. It connects out to the Osiris gateway over a WebSocket, sends up what the robot reports, and takes requests back down: subscribe to a topic, record a bag, drive or spin. The connection is outbound only, so nothing has to be opened, forwarded or exposed on the robot's network.
48
+
49
+ It is published on PyPI as `osiris-bridge` and started with the `osiris` command.
50
+
51
+ ## Requirements
52
+
53
+ - Linux on x86_64 or arm64 (aarch64).
54
+ - ROS 2 Humble, Jazzy, Kilted or Lyrical, sourced in the shell that starts the bridge.
55
+ - A robot added in Osiris, for its token.
56
+
57
+ ## Install
58
+
59
+ ```bash
60
+ pip3 install osiris-bridge
61
+ ```
62
+
63
+ On Ubuntu 24.04 and newer (ROS 2 Jazzy and later), pip refuses to install into the system's Python unless told to:
64
+
65
+ ```bash
66
+ pip3 install --break-system-packages osiris-bridge
67
+ ```
68
+
69
+ ### Upgrading from osiris-agent
70
+
71
+ Up to 0.4.0 the bridge was published as `osiris-agent`. Remove it before installing `osiris-bridge`, since both install the same files:
72
+
73
+ ```bash
74
+ pip3 uninstall -y osiris-agent && pip3 install osiris-bridge
75
+ ```
76
+
77
+ On Ubuntu 24.04 and newer, add `--break-system-packages` to both commands. Your token, settings and the `osiris` command stay the same.
78
+
79
+ ## Connect a robot
80
+
81
+ 1. In Osiris, add the robot. The **Configure bridge** popup opens with the commands below, filled in for your robot.
82
+ 2. Copy the two lines from step 2 of the popup into the shell (or service) that will run the bridge:
83
+
84
+ ```bash
85
+ export OSIRIS_WS_URL=<your Osiris install's gateway address>
86
+ export OSIRIS_AUTH_TOKEN=<this robot's token>
87
+ ```
88
+
89
+ 3. Start the bridge:
90
+
91
+ ```bash
92
+ osiris
93
+ ```
94
+
95
+ Osiris shows the robot as connected within a few seconds.
96
+
97
+ The token is shown only once, when the robot is created or its token is rotated. If it's lost, an owner of the workspace rotates it in **Configure bridge** (robot menu > Bridge) and the bridge needs the new one. Treat the token like a password.
98
+
99
+ A token only works with the Osiris install that issued it. On the hosted Osiris, `OSIRIS_WS_URL` can be left out. On a self-hosted install it's required: without it the bridge connects to the hosted Osiris, which refuses the token.
100
+
101
+ ## What it sends
102
+
103
+ With no configuration at all:
104
+
105
+ - the ROS graph: nodes, topics, actions, services, lifecycle states and QoS
106
+ - CPU, memory, disk, network and battery telemetry, and the busiest processes
107
+ - action goals: their status, feedback and outcome
108
+ - node parameters
109
+ - Nav2's behavior tree, if Nav2 runs
110
+
111
+ Topic data is sent only for the topics someone subscribes to from Osiris, within rate and size limits (see [Parameters](#parameters)). Raw images are re-encoded to JPEG and point clouds are subsampled before they leave the robot. Node logs (`/rosout`) are a topic like any other: they are sent once `/rosout` is subscribed.
112
+
113
+ Off until you turn them on: the TF tree (`tf_tree_enabled`), `ros2_control` controllers and hardware (`ros2_control_enabled`), a custom BT.CPP tree (`bt_mode: btcpp`), and robot commands (`commands_enabled`).
114
+
115
+ Everything is stamped with the robot's own clock, so keep it in sync (`timedatectl set-ntp true`).
116
+
117
+ ## Configuration
118
+
119
+ The bridge runs in one of two modes, for every setting at once:
120
+
121
+ 1. **Cloud Config** (`osiris` with no parameters): the bridge waits for the configuration saved in Osiris, in the **Cloud Config** tab of **Configure bridge**, and applies it. Changes saved there apply while the bridge runs. A setting Cloud Config leaves out uses its default.
122
+ 2. **A parameters file** (`osiris --ros-args --params-file osiris_params.yaml`, or any setting given with `-p`): the bridge applies the file at startup and ignores Cloud Config for the whole run, even for settings the file doesn't mention. Editing the file needs a restart.
123
+
124
+ Two exceptions:
125
+
126
+ - `bag_output_dir` is set on the robot only, never from Cloud Config. Setting only it keeps Cloud Config in effect: `osiris --ros-args -p bag_output_dir:=/data/bags`.
127
+ - Robot commands always need **Allow robot commands** in Osiris, and Osiris applies its own limits too, whichever mode the bridge runs in. See [Robot commands](#robot-commands).
128
+
129
+ A parameters file sets any of the parameters below under `osiris_node`:
130
+
131
+ ```yaml
132
+ osiris_node:
133
+ ros__parameters:
134
+ tf_tree_enabled: true
135
+ bt_mode: nav2
136
+ battery_topic: /battery_state
137
+ topic_data_rate_hz: 50.0
138
+ ```
139
+
140
+ ### Parameters
141
+
142
+ | Parameter | Default | What it does |
143
+ |---|---|---|
144
+ | `telemetry_enabled` | `true` | CPU, memory, disk, network and battery telemetry. |
145
+ | `goals_enabled` | `true` | Action goal status and feedback. |
146
+ | `params_enabled` | `true` | Node parameters. |
147
+ | `tf_tree_enabled` | `false` | TF tree monitoring, from `/tf` and `/tf_static` (or the ones under the bridge's namespace). |
148
+ | `tf_tree_poll_interval` | `0.2` s | How often the TF tree is checked for changes. |
149
+ | `ros2_control_enabled` | `false` | `ros2_control` controllers and hardware interfaces. |
150
+ | `ros2_control_poll_interval` | `2.0` s | How often they are read. |
151
+ | `bt_mode` | `nav2` | Behavior tree source: `nav2`, `btcpp` or `off`. See [Behavior trees](#behavior-trees). |
152
+ | `bt_host` | `127.0.0.1` | Where the BT.CPP Groot2 publisher runs (`btcpp` only). |
153
+ | `bt_server_port` | `1667` | Groot2 server port (`btcpp` only). |
154
+ | `bt_publisher_port` | `1668` | Groot2 publisher port (`btcpp` only). |
155
+ | `graph_debounce_interval` | `1.0` s | Wait after a graph change before sending it. `0` sends every change at once. |
156
+ | `battery_topic` | `/battery_state` | `sensor_msgs/msg/BatteryState` topic for battery telemetry and the battery check. |
157
+ | `battery_check_enabled` | `false` | Refuse robot commands below `battery_min_percent`. |
158
+ | `battery_min_percent` | `30.0` | Battery threshold for that check. |
159
+ | `dock_check_enabled` | `false` | Refuse robot commands while docked. |
160
+ | `dock_status_topic` | `/dock_status` | `opennav_docking_msgs/msg/DockStatus` topic for that check. |
161
+ | `commands_enabled` | `false` | Accept drive and spin commands. See [Robot commands](#robot-commands). |
162
+ | `command_max_speed_mps` | `0.5` m/s | Fastest drive. |
163
+ | `command_max_distance_m` | `5.0` m | Longest drive, either direction. |
164
+ | `command_max_angle_deg` | `360.0`° | Largest spin, either direction. |
165
+ | `command_max_time_allowance_s` | `120.0` s | Longest time allowance for a drive or spin. |
166
+ | `bag_output_dir` | `~/ros2_bags` | Where bags recorded from Osiris are saved. Robot only. |
167
+ | `topic_data_rate_hz` | `50.0` Hz | Most messages per second sent for each subscribed topic. `0` is no limit. |
168
+ | `topic_data_max_bytes_per_sec` | `0.0` | Most bytes per second for each subscribed topic. `0` is no limit. |
169
+ | `global_topic_data_max_bytes_per_sec` | `0.0` | Most bytes per second for all subscribed topics together. `0` is no limit. |
170
+ | `global_topic_data_max_msgs_per_sec` | `0.0` | Most messages per second for all subscribed topics together. `0` is no limit. |
171
+ | `image_jpeg_quality` | `70` | JPEG quality (1 to 95) for raw `sensor_msgs/Image` frames. Compressed images are sent as they are. |
172
+ | `image_max_dimension` | `640` px | Longest edge of a raw image after resizing. `0` never resizes. |
173
+ | `pointcloud_max_points` | `10000` | Most points per `PointCloud2` frame; larger frames are subsampled. `0` never subsamples. Never more than 300000. |
174
+ | `pointcloud_keep_intensity` | `false` | Keep each point's intensity. |
175
+ | `pointcloud_keep_rgb` | `false` | Keep each point's color. |
176
+ | `pointcloud_default_rate_hz` | `1.0` Hz | Rate for point cloud topics without their own. `0` is no limit. |
177
+
178
+ In Cloud Config, a topic can also get its own rate, size, image and point cloud limits, from its row in the Graph pane. A parameters file sets only the defaults above.
179
+
180
+ ### Environment variables
181
+
182
+ | Variable | Required | What it does |
183
+ |---|---|---|
184
+ | `OSIRIS_AUTH_TOKEN` | Yes | The robot's token. The bridge won't start without it. |
185
+ | `OSIRIS_WS_URL` | On a self-hosted install | The gateway to connect to, for example `wss://osiris.example.com/gateway`. Defaults to the hosted Osiris. |
186
+ | `OSIRIS_ROBOT_MODEL` or `ROBOT_MODEL` | No | The robot model shown in Osiris. Read from `/proc/device-tree/model` when unset. |
187
+
188
+ ## Behavior trees
189
+
190
+ - **Nav2** (`bt_mode: nav2`, the default) follows Nav2's own `/behavior_tree_log`, with nothing to set up. A Nav2 under a namespace publishes `<namespace>/behavior_tree_log`; the bridge follows the one in its own namespace, else the only one there is.
191
+ - **A custom BT.CPP tree** (`bt_mode: btcpp`) needs Groot2 monitoring turned on in your tree's code (`BT::Groot2Publisher`). Set `bt_host`, `bt_server_port` and `bt_publisher_port` if the publisher isn't on this machine's default ports 1667 and 1668. This mode also sends the tree's blackboard.
192
+
193
+ Only one mode runs at a time.
194
+
195
+ ## Robot commands
196
+
197
+ The bridge can run Nav2's `drive_on_heading` and `spin` actions when asked from Osiris. This is **off by default**: while it's off, every motion command is refused. Stopping a running command always works.
198
+
199
+ An owner of the robot's workspace turns commands on with **Allow robot commands** in **Configure bridge**, where the limits are set too. Osiris sends a motion command only when both Osiris and the bridge allow it, and the stricter limits apply. A parameters file can turn commands off or set stricter limits on this robot, but it can't turn them on while they're off in Osiris:
200
+
201
+ ```yaml
202
+ osiris_node:
203
+ ros__parameters:
204
+ commands_enabled: true # still needs Allow robot commands in Osiris
205
+ command_max_speed_mps: 0.3
206
+ ```
207
+
208
+ A command is refused before it reaches Nav2 when:
209
+
210
+ - a value is over a limit, or missing or not a number,
211
+ - another goal is already moving the robot, such as a Nav2 navigation,
212
+ - `battery_check_enabled` is on and the battery is below `battery_min_percent`, or has no reading from the last 10 seconds,
213
+ - `dock_check_enabled` is on and the robot is docked, or has no reading from the last 10 seconds.
214
+
215
+ The refusal says which.
216
+
217
+ ## Bags
218
+
219
+ Bags recorded from Osiris are saved on the robot, one folder per recording, in `bag_output_dir` (default `~/ros2_bags`). Set it on the robot:
220
+
221
+ ```bash
222
+ osiris --ros-args -p bag_output_dir:=/data/bags
223
+ ```
224
+
225
+ Osiris lists and downloads only finished recordings directly in that folder (folders with a `metadata.yaml`). A download skips anything a symlink points to. The user running the bridge needs write access to the folder.
226
+
227
+ ## Several robots on one ROS network
228
+
229
+ Run each robot's bridge in that robot's namespace, so it follows that robot's Nav2, TF and behavior tree and sends commands to the right one:
230
+
231
+ ```bash
232
+ osiris --ros-args -r __ns:=/robot1
233
+ ```
234
+
235
+ ## Troubleshooting
236
+
237
+ - **`OSIRIS_AUTH_TOKEN environment variable must be set`**: export the token in the shell or service that runs `osiris`.
238
+ - **The robot never connects, on a self-hosted install**: `OSIRIS_WS_URL` isn't set where `osiris` runs, so the bridge went to the hosted Osiris. Copy both lines from **Configure bridge**.
239
+ - **`Authentication failed: Invalid token`**: `OSIRIS_WS_URL` points at another install than the one that issued the token, or the token was copied wrong. Otherwise rotate the token.
240
+ - **`Authentication failed: This token was replaced by a newer one`**: someone rotated the token. Use the newest one.
241
+ - **`Authentication failed: This token's robot or its workspace no longer exists`**: the robot was deleted. Add it again and use its new token.
242
+ - **`Authentication failed: Server error`**: the gateway couldn't check the token. Don't rotate it: the bridge keeps retrying and connects once the server is back.
243
+ - **`certificate verify failed`, on a self-hosted install**: the robot doesn't trust the install's certificate. Copy the install's root certificate to the robot (on Ubuntu, into `/usr/local/share/ca-certificates/`, then `sudo update-ca-certificates`).
244
+ - **`osiris: command not found` after switching from osiris-agent**: `osiris-agent` was removed after `osiris-bridge` was installed, which deletes the bridge's files. Run `pip3 install --force-reinstall osiris-bridge`.
245
+ - **`externally-managed-environment` when installing**: use `pip3 install --break-system-packages osiris-bridge`.
246
+ - **Connected, but no nodes or topics**: ROS 2 isn't sourced in the shell that runs the bridge, or `ROS_DOMAIN_ID` differs from the robot's.
247
+ - **Empty TF tree**: turn on `tf_tree_enabled`. With several robots, run the bridge in its robot's namespace.
248
+ - **Empty behavior tree**: see [Behavior trees](#behavior-trees).
249
+ - **No battery data**: `battery_topic` doesn't match the robot's topic (under a namespace it's `<namespace>/battery_state`).
250
+ - **History at the wrong times**: the robot's clock is off. Turn on time sync.
251
+
252
+ ## Contributing
253
+
254
+ Bug reports and pull requests are welcome at https://github.com/nicolaselielll/osiris_agent. See [CONTRIBUTING.md](https://github.com/nicolaselielll/osiris_agent/blob/main/CONTRIBUTING.md) to report a bug or send a change, and [SECURITY.md](https://github.com/nicolaselielll/osiris_agent/blob/main/SECURITY.md) to report a security problem privately.
255
+
256
+ ## License
257
+
258
+ Apache-2.0. See [LICENSE](https://github.com/nicolaselielll/osiris_agent/blob/main/LICENSE).
259
+
260
+ ## Changelog
261
+
262
+ See [CHANGELOG.md](https://github.com/nicolaselielll/osiris_agent/blob/main/CHANGELOG.md) for what changed in each version.