dimos-cdrgen 0.1.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.
- dimos_cdrgen-0.1.0/LICENSE +202 -0
- dimos_cdrgen-0.1.0/MANIFEST.in +6 -0
- dimos_cdrgen-0.1.0/NOTICE +28 -0
- dimos_cdrgen-0.1.0/PKG-INFO +263 -0
- dimos_cdrgen-0.1.0/README.md +226 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/.upstream/rosidl_adapter/LICENSE +202 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/.upstream/rosidl_adapter/__init__.py +32 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/.upstream/rosidl_adapter/__main__.py +19 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/.upstream/rosidl_adapter/action/__init__.py +40 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/.upstream/rosidl_adapter/cli.py +108 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/.upstream/rosidl_adapter/main.py +64 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/.upstream/rosidl_adapter/msg/__init__.py +115 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/.upstream/rosidl_adapter/package.xml +36 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/.upstream/rosidl_adapter/parser.py +912 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/.upstream/rosidl_adapter/resource/__init__.py +110 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/.upstream/rosidl_adapter/resource/action.idl.em +39 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/.upstream/rosidl_adapter/resource/msg.idl.em +26 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/.upstream/rosidl_adapter/resource/srv.idl.em +32 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/.upstream/rosidl_adapter/resource/struct.idl.em +103 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/.upstream/rosidl_adapter/srv/__init__.py +40 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/__init__.py +1 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/cpp.py +122 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/definitions.py +203 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/generate.py +236 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/include/dimos_cdrgen/cdr.hpp +60 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/native_build.py +512 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/native_sources.json +281 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/ownership.py +91 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/parser-source.json +8 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/prepare_parser.py +106 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/prepare_test_inputs.py +40 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/py.typed +0 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/python.py +151 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/registry.py +173 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/rust.py +58 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/source_inputs.py +79 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/source_package.py +203 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/templates/message_build.rs +57 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/templates/native-support.cmake +63 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/templates/native-toolchain.cmake +15 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/test-sources.json +83 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/test_definitions.py +261 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/test_generation_transaction.py +68 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/test_native_consumer.py +227 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/test_native_libraries.py +226 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/test_native_portability.py +157 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/test_ownership.py +156 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/test_parser_source.py +103 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/test_rust_reexport.py +59 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/test_source_inputs.py +96 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/test_source_package.py +269 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen/test_stubs.py +83 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen.egg-info/PKG-INFO +263 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen.egg-info/SOURCES.txt +63 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen.egg-info/dependency_links.txt +1 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen.egg-info/entry_points.txt +2 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen.egg-info/requires.txt +26 -0
- dimos_cdrgen-0.1.0/dimos_cdrgen.egg-info/top_level.txt +2 -0
- dimos_cdrgen-0.1.0/examples/README.md +19 -0
- dimos_cdrgen-0.1.0/examples/demo_msgs/msg/Reading.msg +4 -0
- dimos_cdrgen-0.1.0/examples/demo_msgs/msg/Telemetry.msg +9 -0
- dimos_cdrgen-0.1.0/examples/demo_ros_reference.py +44 -0
- dimos_cdrgen-0.1.0/pyproject.toml +36 -0
- dimos_cdrgen-0.1.0/setup.cfg +4 -0
- dimos_cdrgen-0.1.0/setup.py +51 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
Copyright 2025 Dimensional Inc.
|
|
6
|
+
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License.
|
|
9
|
+
You may obtain a copy of the License at
|
|
10
|
+
|
|
11
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
See the License for the specific language governing permissions and
|
|
17
|
+
limitations under the License.
|
|
18
|
+
|
|
19
|
+
Source provenance:
|
|
20
|
+
Derived from the public DimensionalOS/dimos CDR proposal at commit
|
|
21
|
+
a40ae998f0bdde565e68b6bc123c7154f891caef:
|
|
22
|
+
https://github.com/dimensionalOS/dimos/tree/a40ae998f0bdde565e68b6bc123c7154f891caef/dimos/message_codegen
|
|
23
|
+
|
|
24
|
+
This distribution reorganizes that code into a standalone package, renames the
|
|
25
|
+
Python distribution/import/CLI, and extracts the existing C++ CDR helper.
|
|
26
|
+
Original first-party copyright headers are retained. The upstream ROSIDL parser
|
|
27
|
+
is prepared unchanged from the revision and hashes in parser-source.json; its
|
|
28
|
+
Apache-2.0 license is included in built Python artifacts under rosidl_adapter.
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dimos-cdrgen
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: ROS-free message generation and CDR codecs for Python, C++ and Rust
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
Project-URL: Repository, https://github.com/TomCC7/dimos-cdrgen
|
|
7
|
+
Project-URL: Issues, https://github.com/TomCC7/dimos-cdrgen/issues
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Typing :: Typed
|
|
11
|
+
Requires-Python: >=3.10
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
License-File: NOTICE
|
|
15
|
+
Requires-Dist: rosbags==0.11.0
|
|
16
|
+
Requires-Dist: empy==4.2
|
|
17
|
+
Requires-Dist: lark==1.2.2
|
|
18
|
+
Requires-Dist: setuptools>=70
|
|
19
|
+
Requires-Dist: wheel
|
|
20
|
+
Requires-Dist: tomli>=2; python_version < "3.11"
|
|
21
|
+
Provides-Extra: prepare
|
|
22
|
+
Requires-Dist: requests>=2.31; extra == "prepare"
|
|
23
|
+
Provides-Extra: native
|
|
24
|
+
Requires-Dist: pip; extra == "native"
|
|
25
|
+
Requires-Dist: catkin-pkg==1.1.0; extra == "native"
|
|
26
|
+
Requires-Dist: PyYAML==6.0.2; extra == "native"
|
|
27
|
+
Provides-Extra: test
|
|
28
|
+
Requires-Dist: pytest>=8; extra == "test"
|
|
29
|
+
Requires-Dist: pytest-mock; extra == "test"
|
|
30
|
+
Requires-Dist: mypy==1.19.0; extra == "test"
|
|
31
|
+
Requires-Dist: types-setuptools; extra == "test"
|
|
32
|
+
Requires-Dist: types-requests; extra == "test"
|
|
33
|
+
Requires-Dist: requests>=2.31; extra == "test"
|
|
34
|
+
Requires-Dist: build; extra == "test"
|
|
35
|
+
Requires-Dist: numpy>=1.26.4; extra == "test"
|
|
36
|
+
Dynamic: license-file
|
|
37
|
+
|
|
38
|
+
# DimOS message generation and CDR
|
|
39
|
+
|
|
40
|
+
A standalone `.msg` generator and CDR toolkit for Python, C++ and Rust. It does
|
|
41
|
+
not depend on the DimOS runtime, a ROS installation, or a running robot.
|
|
42
|
+
The package is named `dimos-cdrgen` (import `dimos_cdrgen`). No registry release
|
|
43
|
+
is assumed by these instructions.
|
|
44
|
+
|
|
45
|
+
## Documentation
|
|
46
|
+
|
|
47
|
+
The [documentation source](docs/index.md) includes installation, Python, C++, and
|
|
48
|
+
Rust quickstarts, dependency reuse, and CLI/API references. To build and preview
|
|
49
|
+
the MkDocs site locally, follow [the docs maintenance guide](docs/contributing-docs.md).
|
|
50
|
+
The site build uses its own locked environment and does not install this package.
|
|
51
|
+
The [publishing guide](docs/publishing.md) covers local distribution validation,
|
|
52
|
+
the default GitHub dry-run, and approval of registry ownership and OIDC setup.
|
|
53
|
+
|
|
54
|
+
## Install the tool
|
|
55
|
+
|
|
56
|
+
From this package directory, prepare the pinned upstream parser and build local
|
|
57
|
+
artifacts. The preparation environment needs `requests`; the build environment
|
|
58
|
+
needs `build`, setuptools 77 or newer, and wheel.
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
python dimos_cdrgen/prepare_parser.py
|
|
62
|
+
python -m build --no-isolation
|
|
63
|
+
python -m pip install dist/dimos_cdrgen-0.1.0-py3-none-any.whl
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The wheel and source archive contain the unchanged, hash-verified ROSIDL parser
|
|
67
|
+
and its license. Installing either artifact does not download upstream source.
|
|
68
|
+
A checkout with no prepared parser fails with an explicit preparation error.
|
|
69
|
+
Use `--offline` with a populated cache, or `--archive /path/to/rosidl.tar.gz`.
|
|
70
|
+
Normal Python dependencies must also be available for an offline installation.
|
|
71
|
+
|
|
72
|
+
## Define and generate a message
|
|
73
|
+
|
|
74
|
+
In a separate directory, create `interfaces/example_msgs/msg/Reading.msg`:
|
|
75
|
+
|
|
76
|
+
```text
|
|
77
|
+
int32 sequence
|
|
78
|
+
float64 value
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Create `pyproject.toml`:
|
|
82
|
+
|
|
83
|
+
```toml
|
|
84
|
+
[project]
|
|
85
|
+
name = "acme"
|
|
86
|
+
version = "0.1.0"
|
|
87
|
+
|
|
88
|
+
[tool.dimos.messages]
|
|
89
|
+
source = "interfaces"
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
```sh
|
|
93
|
+
dimos-cdrgen
|
|
94
|
+
python -m pip install build/message-source/python
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Generation reads the configuration and writes the following artifacts. It does
|
|
98
|
+
not invoke a compiler or install a system toolchain.
|
|
99
|
+
|
|
100
|
+
| Path under `build/message-source` | Artifact |
|
|
101
|
+
| --- | --- |
|
|
102
|
+
| `python/` | Installable Python project, type stubs and schema provider. |
|
|
103
|
+
| `cpp/` | CMake projects and owned `.msg` sources for upstream ROSIDL/FastRTPS. |
|
|
104
|
+
| `rust/` | Cargo crate, `.msg` sources and a ros2msg `build.rs`. |
|
|
105
|
+
| `schemas/`, `schemas.json` | Complete schema closure, including dependency messages. |
|
|
106
|
+
| `message-package.json` | Ownership, exact dependency versions, hashes and ABI. |
|
|
107
|
+
|
|
108
|
+
### Python
|
|
109
|
+
|
|
110
|
+
```python
|
|
111
|
+
from acme.example_msgs.msg import Reading
|
|
112
|
+
from dimos_cdrgen.registry import encode, decode
|
|
113
|
+
|
|
114
|
+
message = Reading(sequence=1, value=21.5)
|
|
115
|
+
assert decode(encode(message), Reading).value == 21.5
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Runtime values and codecs use rosbags. Python wheels need no native compiler;
|
|
119
|
+
there is no pybind extension. Import initializes the type registry without
|
|
120
|
+
writing generated files or compiling code. Numeric arrays use NumPy.
|
|
121
|
+
|
|
122
|
+
### C++
|
|
123
|
+
|
|
124
|
+
Install the tool's `native` extra and supply CMake plus a C/C++ compiler.
|
|
125
|
+
Prepare the generated package explicitly; pinned upstream dependencies are
|
|
126
|
+
fetched and verified here, not during Python import or installation.
|
|
127
|
+
|
|
128
|
+
```python
|
|
129
|
+
from pathlib import Path
|
|
130
|
+
from dimos_cdrgen.native_build import prepare_cpp, write_cmake_toolchain
|
|
131
|
+
|
|
132
|
+
prefix = prepare_cpp(Path("build/message-source"))
|
|
133
|
+
write_cmake_toolchain(prefix, Path("build/acme-toolchain.cmake"))
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
For an application containing `main.cpp`, use:
|
|
137
|
+
|
|
138
|
+
```cmake
|
|
139
|
+
cmake_minimum_required(VERSION 3.20)
|
|
140
|
+
project(reader LANGUAGES CXX)
|
|
141
|
+
find_package(acme CONFIG REQUIRED)
|
|
142
|
+
add_executable(reader main.cpp)
|
|
143
|
+
target_compile_features(reader PRIVATE cxx_std_17)
|
|
144
|
+
target_link_libraries(reader PRIVATE acme::messages)
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
```cpp
|
|
148
|
+
#include <example_msgs/msg/reading.hpp>
|
|
149
|
+
#include <dimos_cdrgen/cdr.hpp>
|
|
150
|
+
int main() {
|
|
151
|
+
example_msgs::msg::Reading message;
|
|
152
|
+
message.sequence = 1;
|
|
153
|
+
message.value = 21.5;
|
|
154
|
+
auto wire = dimos::cdr::cdr_encode(message);
|
|
155
|
+
auto decoded = dimos::cdr::cdr_decode<example_msgs::msg::Reading>(wire);
|
|
156
|
+
return decoded.value == 21.5 ? 0 : 1;
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
```sh
|
|
161
|
+
cmake -S . -B build/app -DCMAKE_TOOLCHAIN_FILE="$PWD/build/acme-toolchain.cmake"
|
|
162
|
+
cmake --build build/app
|
|
163
|
+
./build/app/reader
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
The prefix contains generated headers, shared libraries and CMake exports.
|
|
167
|
+
The CDR helper is supplied by this library, with no DimOS SDK include path.
|
|
168
|
+
For offline preparation, use `prepare_cpp(..., offline=True)` with a populated
|
|
169
|
+
verified source/build cache. macOS also requires Apple's SDK and command-line tools.
|
|
170
|
+
|
|
171
|
+
### Rust
|
|
172
|
+
|
|
173
|
+
In a Cargo application next to `build/`, declare:
|
|
174
|
+
|
|
175
|
+
```toml
|
|
176
|
+
[workspace]
|
|
177
|
+
exclude = ["build/message-source/rust"]
|
|
178
|
+
|
|
179
|
+
[dependencies]
|
|
180
|
+
acme-messages = { path = "build/message-source/rust" }
|
|
181
|
+
re_cdr = "=0.1.0"
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
```rust
|
|
185
|
+
use acme_messages::example_msgs::msg::reading::Reading;
|
|
186
|
+
fn main() {
|
|
187
|
+
let message = Reading { sequence: 1, value: 21.5 };
|
|
188
|
+
let body = re_cdr::to_vec::<_, re_cdr::LittleEndian>(&message).unwrap();
|
|
189
|
+
let mut wire = vec![0, 1, 0, 0]; // plain little-endian CDR encapsulation
|
|
190
|
+
wire.extend(body);
|
|
191
|
+
let (decoded, used) =
|
|
192
|
+
re_cdr::from_bytes::<Reading, re_cdr::LittleEndian>(&wire[4..]).unwrap();
|
|
193
|
+
assert_eq!(decoded.value, 21.5);
|
|
194
|
+
assert_eq!(used, wire.len() - 4);
|
|
195
|
+
}
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
`cargo run` invokes ros2msg through the generated `build.rs`, writes declarations
|
|
199
|
+
into Cargo's `OUT_DIR`, and compiles the crate into the application. Use
|
|
200
|
+
`cargo run --offline` with cached dependencies. This does not create a Python
|
|
201
|
+
extension or publish a crate.
|
|
202
|
+
|
|
203
|
+
## Dependency ownership and DimOS integration
|
|
204
|
+
|
|
205
|
+
Standard ROS message definitions are a separate catalog, not bundled here.
|
|
206
|
+
Declare an installed message package in `tool.dimos.messages.dependencies` with
|
|
207
|
+
its exact module/version. The generator imports its Python types, links its C++
|
|
208
|
+
declarations, and reuses its Rust crate types. It rejects conflicting ownership,
|
|
209
|
+
versions and schema hashes. The full schema closure remains available for MCAP
|
|
210
|
+
schema registration by consumers; this library itself does not record MCAP.
|
|
211
|
+
|
|
212
|
+
The DimOS `dimos-build-config` adapter from PR #4461 calls this library's
|
|
213
|
+
`package_settings()` to support `pip install .` and editable projects alongside
|
|
214
|
+
blueprint declarations. Existing setuptools callers can use `setup_arguments()`.
|
|
215
|
+
Both call the same `prepare()` implementation as `dimos-cdrgen`.
|
|
216
|
+
Neither requires copying the generator into a DimOS application. Reinstall an
|
|
217
|
+
editable message project and restart Python processes after changing `.msg` files.
|
|
218
|
+
|
|
219
|
+
The codec provides schema/CDR interoperability. It does not implement a ROS 2
|
|
220
|
+
node, DDS discovery, topic QoS, or live ROS 2 network interoperability. Unsupported
|
|
221
|
+
bounds and declared-default semantics remain explicit in the generated manifest
|
|
222
|
+
and the [known limitations](https://github.com/dimensionalOS/dimos/blob/cc/feat/remove-lcm-encoding/docs/development/message-limitations.md).
|
|
223
|
+
|
|
224
|
+
## Run tests from this package alone
|
|
225
|
+
|
|
226
|
+
```sh
|
|
227
|
+
python -m pip install '.[test,native]'
|
|
228
|
+
PYTHONPATH=. python -m dimos_cdrgen.prepare_test_inputs
|
|
229
|
+
PYTHONPATH=. python -m pytest dimos_cdrgen
|
|
230
|
+
# Explicit compiled Python/C++/Rust exchange (requires native toolchains):
|
|
231
|
+
PYTHONPATH=. DIMOS_NATIVE_ACCEPTANCE=1 python -m pytest dimos_cdrgen/test_native_consumer.py
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Test preparation downloads only pinned public upstream test schemas. Use
|
|
235
|
+
`--offline --cache /path/to/verified/archives` to reuse archives. Native acceptance
|
|
236
|
+
can use `DIMOS_OFFLINE=1`, `DIMOS_NATIVE_TEST_CACHE`, and `DIMOS_NATIVE_SOURCE_DIRS`
|
|
237
|
+
(a JSON map of upstream project names to prepared source directories). Isolated
|
|
238
|
+
installation tests require `DIMOS_MESSAGE_WHEELHOUSE` containing the Python build
|
|
239
|
+
and runtime dependency wheels. The optional joint DimOS adapter test also needs
|
|
240
|
+
`DIMOS_BUILD_CONFIG_SOURCE`; it is not required to use the standalone library.
|
|
241
|
+
|
|
242
|
+
## Prepare a release; do not publish yet
|
|
243
|
+
|
|
244
|
+
Use the [publishing guide](docs/publishing.md) for the locked build environment,
|
|
245
|
+
standalone consumer checks, and manual `dry-run`, `testpypi`, or `pypi` workflow.
|
|
246
|
+
The default `dry-run` never uploads. A real upload requires an approved registry
|
|
247
|
+
account and project, Trusted Publisher configuration, and a matching version tag.
|
|
248
|
+
|
|
249
|
+
1. Confirm the authorized registry account and publishing destination.
|
|
250
|
+
The current `0.1.0` metadata is a development candidate, not an existing release.
|
|
251
|
+
2. Prepare the pinned parser, then build the wheel and sdist in a clean directory.
|
|
252
|
+
Retain upstream licenses and source hashes. Do not commit prepared upstream code.
|
|
253
|
+
3. Run `python -m twine check dist/*`, install the wheel in a clean environment,
|
|
254
|
+
rebuild from the sdist offline, and run the language/dependency acceptance tests.
|
|
255
|
+
4. Choose the supported Python/platform matrix and verify those targets before
|
|
256
|
+
declaring release support. Linux checks alone do not validate macOS.
|
|
257
|
+
5. Only after approval of the account and destination, use the registry's
|
|
258
|
+
authorized publishing flow. No upload command is part of build or install.
|
|
259
|
+
|
|
260
|
+
C++ prefixes and generated Rust crates are separate native build artifacts.
|
|
261
|
+
Publishing the Python tool does not publish a standard-message catalog or Cargo
|
|
262
|
+
packages. Packaged Rust dependencies use exact versions and need normal Cargo
|
|
263
|
+
resolution (local patches/workspaces or separately published dependency crates).
|