@foxglove/schemas 0.1.2 → 0.4.0
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.
- package/.github/workflows/ci.yml +7 -1
- package/README.md +45 -4
- package/dist/cjs/schemas/typescript/CameraCalibration.js +1 -1
- package/dist/cjs/schemas/typescript/CameraCalibration.js.map +1 -1
- package/dist/cjs/schemas/typescript/CircleAnnotation.js +1 -1
- package/dist/cjs/schemas/typescript/CircleAnnotation.js.map +1 -1
- package/dist/cjs/schemas/typescript/Color.js +1 -1
- package/dist/cjs/schemas/typescript/Color.js.map +1 -1
- package/dist/cjs/schemas/typescript/CompressedImage.js +1 -1
- package/dist/cjs/schemas/typescript/CompressedImage.js.map +1 -1
- package/dist/cjs/schemas/typescript/FrameTransform.d.ts +6 -3
- package/dist/cjs/schemas/typescript/FrameTransform.d.ts.map +1 -1
- package/dist/cjs/schemas/typescript/FrameTransform.js +1 -1
- package/dist/cjs/schemas/typescript/FrameTransform.js.map +1 -1
- package/dist/cjs/schemas/typescript/GeoJSON.js +1 -1
- package/dist/cjs/schemas/typescript/GeoJSON.js.map +1 -1
- package/dist/cjs/schemas/typescript/Grid.js +1 -1
- package/dist/cjs/schemas/typescript/Grid.js.map +1 -1
- package/dist/cjs/schemas/typescript/ImageAnnotations.js +1 -1
- package/dist/cjs/schemas/typescript/ImageAnnotations.js.map +1 -1
- package/dist/cjs/schemas/typescript/LaserScan.js +1 -1
- package/dist/cjs/schemas/typescript/LaserScan.js.map +1 -1
- package/dist/cjs/schemas/typescript/LocationFix.js +1 -1
- package/dist/cjs/schemas/typescript/LocationFix.js.map +1 -1
- package/dist/cjs/schemas/typescript/Log.js +1 -1
- package/dist/cjs/schemas/typescript/Log.js.map +1 -1
- package/dist/cjs/schemas/typescript/LogLevel.js +1 -1
- package/dist/cjs/schemas/typescript/LogLevel.js.map +1 -1
- package/dist/cjs/schemas/typescript/NumericType.js +1 -1
- package/dist/cjs/schemas/typescript/NumericType.js.map +1 -1
- package/dist/cjs/schemas/typescript/PackedElementField.d.ts +1 -1
- package/dist/cjs/schemas/typescript/PackedElementField.d.ts.map +1 -1
- package/dist/cjs/schemas/typescript/PackedElementField.js +1 -1
- package/dist/cjs/schemas/typescript/PackedElementField.js.map +1 -1
- package/dist/cjs/schemas/typescript/Point2.js +1 -1
- package/dist/cjs/schemas/typescript/Point2.js.map +1 -1
- package/dist/cjs/schemas/typescript/Point3.js +1 -1
- package/dist/cjs/schemas/typescript/Point3.js.map +1 -1
- package/dist/cjs/schemas/typescript/PointCloud.js +1 -1
- package/dist/cjs/schemas/typescript/PointCloud.js.map +1 -1
- package/dist/cjs/schemas/typescript/PointsAnnotation.d.ts +5 -1
- package/dist/cjs/schemas/typescript/PointsAnnotation.d.ts.map +1 -1
- package/dist/cjs/schemas/typescript/PointsAnnotation.js +1 -1
- package/dist/cjs/schemas/typescript/PointsAnnotation.js.map +1 -1
- package/dist/cjs/schemas/typescript/PointsAnnotationType.js +1 -1
- package/dist/cjs/schemas/typescript/PointsAnnotationType.js.map +1 -1
- package/dist/cjs/schemas/typescript/Pose.js +1 -1
- package/dist/cjs/schemas/typescript/Pose.js.map +1 -1
- package/dist/cjs/schemas/typescript/PoseInFrame.js +1 -1
- package/dist/cjs/schemas/typescript/PoseInFrame.js.map +1 -1
- package/dist/cjs/schemas/typescript/PosesInFrame.js +1 -1
- package/dist/cjs/schemas/typescript/PositionCovarianceType.js +1 -1
- package/dist/cjs/schemas/typescript/PositionCovarianceType.js.map +1 -1
- package/dist/cjs/schemas/typescript/Quaternion.js +1 -1
- package/dist/cjs/schemas/typescript/Quaternion.js.map +1 -1
- package/dist/cjs/schemas/typescript/RawImage.js +1 -1
- package/dist/cjs/schemas/typescript/RawImage.js.map +1 -1
- package/dist/cjs/schemas/typescript/Vector2.js +1 -1
- package/dist/cjs/schemas/typescript/Vector2.js.map +1 -1
- package/dist/cjs/schemas/typescript/Vector3.js +1 -1
- package/dist/cjs/schemas/typescript/Vector3.js.map +1 -1
- package/dist/cjs/schemas/typescript/index.d.ts +0 -1
- package/dist/cjs/schemas/typescript/index.d.ts.map +1 -1
- package/dist/cjs/schemas/typescript/index.js +0 -1
- package/dist/cjs/schemas/typescript/index.js.map +1 -1
- package/dist/cjs/scripts/updateGeneratedFiles.js +17 -4
- package/dist/cjs/scripts/updateGeneratedFiles.js.map +1 -1
- package/dist/cjs/src/generateJsonSchema.d.ts.map +1 -1
- package/dist/cjs/src/generateJsonSchema.js +4 -3
- package/dist/cjs/src/generateJsonSchema.js.map +1 -1
- package/dist/cjs/src/generateJsonSchema.test.js +6 -8
- package/dist/cjs/src/generateJsonSchema.test.js.map +1 -1
- package/dist/cjs/src/generateMarkdown.d.ts +3 -0
- package/dist/cjs/src/generateMarkdown.d.ts.map +1 -0
- package/dist/cjs/src/generateMarkdown.js +80 -0
- package/dist/cjs/src/generateMarkdown.js.map +1 -0
- package/dist/cjs/src/generateProto.js +1 -1
- package/dist/cjs/src/generateProto.js.map +1 -1
- package/dist/cjs/src/generateProto.test.js +1 -1
- package/dist/cjs/src/generateRos.d.ts +4 -1
- package/dist/cjs/src/generateRos.d.ts.map +1 -1
- package/dist/cjs/src/generateRos.js +8 -4
- package/dist/cjs/src/generateRos.js.map +1 -1
- package/dist/cjs/src/generateRos.test.js +463 -7
- package/dist/cjs/src/generateRos.test.js.map +1 -1
- package/dist/cjs/src/generateTypeScript.js +1 -1
- package/dist/cjs/src/generateTypeScript.js.map +1 -1
- package/dist/cjs/src/generateTypeScript.test.js +2 -2
- package/dist/cjs/src/schemas.d.ts +0 -2
- package/dist/cjs/src/schemas.d.ts.map +1 -1
- package/dist/cjs/src/schemas.js +23 -31
- package/dist/cjs/src/schemas.js.map +1 -1
- package/dist/esm/schemas/typescript/CameraCalibration.js +1 -1
- package/dist/esm/schemas/typescript/CameraCalibration.js.map +1 -1
- package/dist/esm/schemas/typescript/CircleAnnotation.js +1 -1
- package/dist/esm/schemas/typescript/CircleAnnotation.js.map +1 -1
- package/dist/esm/schemas/typescript/Color.js +1 -1
- package/dist/esm/schemas/typescript/Color.js.map +1 -1
- package/dist/esm/schemas/typescript/CompressedImage.js +1 -1
- package/dist/esm/schemas/typescript/CompressedImage.js.map +1 -1
- package/dist/esm/schemas/typescript/FrameTransform.d.ts +6 -3
- package/dist/esm/schemas/typescript/FrameTransform.d.ts.map +1 -1
- package/dist/esm/schemas/typescript/FrameTransform.js +1 -1
- package/dist/esm/schemas/typescript/FrameTransform.js.map +1 -1
- package/dist/esm/schemas/typescript/GeoJSON.js +1 -1
- package/dist/esm/schemas/typescript/GeoJSON.js.map +1 -1
- package/dist/esm/schemas/typescript/Grid.js +1 -1
- package/dist/esm/schemas/typescript/Grid.js.map +1 -1
- package/dist/esm/schemas/typescript/ImageAnnotations.js +1 -1
- package/dist/esm/schemas/typescript/ImageAnnotations.js.map +1 -1
- package/dist/esm/schemas/typescript/LaserScan.js +1 -1
- package/dist/esm/schemas/typescript/LaserScan.js.map +1 -1
- package/dist/esm/schemas/typescript/LocationFix.js +1 -1
- package/dist/esm/schemas/typescript/LocationFix.js.map +1 -1
- package/dist/esm/schemas/typescript/Log.js +1 -1
- package/dist/esm/schemas/typescript/Log.js.map +1 -1
- package/dist/esm/schemas/typescript/LogLevel.js +1 -1
- package/dist/esm/schemas/typescript/LogLevel.js.map +1 -1
- package/dist/esm/schemas/typescript/NumericType.js +1 -1
- package/dist/esm/schemas/typescript/NumericType.js.map +1 -1
- package/dist/esm/schemas/typescript/PackedElementField.d.ts +1 -1
- package/dist/esm/schemas/typescript/PackedElementField.d.ts.map +1 -1
- package/dist/esm/schemas/typescript/PackedElementField.js +1 -1
- package/dist/esm/schemas/typescript/PackedElementField.js.map +1 -1
- package/dist/esm/schemas/typescript/Point2.js +1 -1
- package/dist/esm/schemas/typescript/Point2.js.map +1 -1
- package/dist/esm/schemas/typescript/Point3.js +1 -1
- package/dist/esm/schemas/typescript/Point3.js.map +1 -1
- package/dist/esm/schemas/typescript/PointCloud.js +1 -1
- package/dist/esm/schemas/typescript/PointCloud.js.map +1 -1
- package/dist/esm/schemas/typescript/PointsAnnotation.d.ts +5 -1
- package/dist/esm/schemas/typescript/PointsAnnotation.d.ts.map +1 -1
- package/dist/esm/schemas/typescript/PointsAnnotation.js +1 -1
- package/dist/esm/schemas/typescript/PointsAnnotation.js.map +1 -1
- package/dist/esm/schemas/typescript/PointsAnnotationType.js +1 -1
- package/dist/esm/schemas/typescript/PointsAnnotationType.js.map +1 -1
- package/dist/esm/schemas/typescript/Pose.js +1 -1
- package/dist/esm/schemas/typescript/Pose.js.map +1 -1
- package/dist/esm/schemas/typescript/PoseInFrame.js +1 -1
- package/dist/esm/schemas/typescript/PoseInFrame.js.map +1 -1
- package/dist/esm/schemas/typescript/PosesInFrame.js +1 -1
- package/dist/esm/schemas/typescript/PositionCovarianceType.js +1 -1
- package/dist/esm/schemas/typescript/PositionCovarianceType.js.map +1 -1
- package/dist/esm/schemas/typescript/Quaternion.js +1 -1
- package/dist/esm/schemas/typescript/Quaternion.js.map +1 -1
- package/dist/esm/schemas/typescript/RawImage.js +1 -1
- package/dist/esm/schemas/typescript/RawImage.js.map +1 -1
- package/dist/esm/schemas/typescript/Vector2.js +1 -1
- package/dist/esm/schemas/typescript/Vector2.js.map +1 -1
- package/dist/esm/schemas/typescript/Vector3.js +1 -1
- package/dist/esm/schemas/typescript/Vector3.js.map +1 -1
- package/dist/esm/schemas/typescript/index.d.ts +0 -1
- package/dist/esm/schemas/typescript/index.d.ts.map +1 -1
- package/dist/esm/schemas/typescript/index.js +0 -1
- package/dist/esm/schemas/typescript/index.js.map +1 -1
- package/dist/esm/scripts/updateGeneratedFiles.js +17 -4
- package/dist/esm/scripts/updateGeneratedFiles.js.map +1 -1
- package/dist/esm/src/generateJsonSchema.d.ts.map +1 -1
- package/dist/esm/src/generateJsonSchema.js +4 -3
- package/dist/esm/src/generateJsonSchema.js.map +1 -1
- package/dist/esm/src/generateJsonSchema.test.js +6 -8
- package/dist/esm/src/generateJsonSchema.test.js.map +1 -1
- package/dist/esm/src/generateMarkdown.d.ts +3 -0
- package/dist/esm/src/generateMarkdown.d.ts.map +1 -0
- package/dist/esm/src/generateMarkdown.js +76 -0
- package/dist/esm/src/generateMarkdown.js.map +1 -0
- package/dist/esm/src/generateProto.js +1 -1
- package/dist/esm/src/generateProto.js.map +1 -1
- package/dist/esm/src/generateProto.test.js +1 -1
- package/dist/esm/src/generateRos.d.ts +4 -1
- package/dist/esm/src/generateRos.d.ts.map +1 -1
- package/dist/esm/src/generateRos.js +8 -4
- package/dist/esm/src/generateRos.js.map +1 -1
- package/dist/esm/src/generateRos.test.js +463 -7
- package/dist/esm/src/generateRos.test.js.map +1 -1
- package/dist/esm/src/generateTypeScript.js +1 -1
- package/dist/esm/src/generateTypeScript.js.map +1 -1
- package/dist/esm/src/generateTypeScript.test.js +2 -2
- package/dist/esm/src/schemas.d.ts +0 -2
- package/dist/esm/src/schemas.d.ts.map +1 -1
- package/dist/esm/src/schemas.js +21 -29
- package/dist/esm/src/schemas.js.map +1 -1
- package/package.json +2 -2
- package/schemas/README.md +1711 -0
- package/schemas/jsonschema/CameraCalibration.json +2 -2
- package/schemas/jsonschema/CircleAnnotation.json +5 -8
- package/schemas/jsonschema/Color.json +2 -2
- package/schemas/jsonschema/CompressedImage.json +2 -2
- package/schemas/jsonschema/FrameTransform.json +37 -63
- package/schemas/jsonschema/GeoJSON.json +2 -2
- package/schemas/jsonschema/Grid.json +9 -14
- package/schemas/jsonschema/ImageAnnotations.json +39 -20
- package/schemas/jsonschema/LaserScan.json +5 -8
- package/schemas/jsonschema/LocationFix.json +3 -3
- package/schemas/jsonschema/Log.json +3 -3
- package/schemas/jsonschema/PackedElementField.json +4 -4
- package/schemas/jsonschema/Point2.json +2 -2
- package/schemas/jsonschema/Point3.json +2 -2
- package/schemas/jsonschema/PointCloud.json +8 -12
- package/schemas/jsonschema/PointsAnnotation.json +34 -10
- package/schemas/jsonschema/Pose.json +4 -6
- package/schemas/jsonschema/PoseInFrame.json +5 -8
- package/schemas/jsonschema/PosesInFrame.json +5 -8
- package/schemas/jsonschema/Quaternion.json +2 -2
- package/schemas/jsonschema/RawImage.json +2 -2
- package/schemas/jsonschema/Vector2.json +2 -2
- package/schemas/jsonschema/Vector3.json +2 -2
- package/schemas/proto/foxglove/CameraCalibration.proto +1 -1
- package/schemas/proto/foxglove/CircleAnnotation.proto +1 -1
- package/schemas/proto/foxglove/Color.proto +1 -1
- package/schemas/proto/foxglove/CompressedImage.proto +1 -1
- package/schemas/proto/foxglove/FrameTransform.proto +8 -4
- package/schemas/proto/foxglove/GeoJSON.proto +1 -1
- package/schemas/proto/foxglove/Grid.proto +1 -1
- package/schemas/proto/foxglove/ImageAnnotations.proto +1 -1
- package/schemas/proto/foxglove/LaserScan.proto +1 -1
- package/schemas/proto/foxglove/LocationFix.proto +1 -1
- package/schemas/proto/foxglove/Log.proto +1 -1
- package/schemas/proto/foxglove/PackedElementField.proto +2 -2
- package/schemas/proto/foxglove/Point2.proto +1 -1
- package/schemas/proto/foxglove/Point3.proto +1 -1
- package/schemas/proto/foxglove/PointCloud.proto +1 -1
- package/schemas/proto/foxglove/PointsAnnotation.proto +10 -4
- package/schemas/proto/foxglove/Pose.proto +1 -1
- package/schemas/proto/foxglove/PoseInFrame.proto +1 -1
- package/schemas/proto/foxglove/PosesInFrame.proto +1 -1
- package/schemas/proto/foxglove/Quaternion.proto +1 -1
- package/schemas/proto/foxglove/RawImage.proto +1 -1
- package/schemas/proto/foxglove/Vector2.proto +1 -1
- package/schemas/proto/foxglove/Vector3.proto +1 -1
- package/schemas/ros1/CameraCalibration.msg +4 -1
- package/schemas/ros1/CircleAnnotation.msg +4 -1
- package/schemas/ros1/Color.msg +4 -1
- package/schemas/ros1/CompressedImage.msg +4 -1
- package/schemas/ros1/FrameTransform.msg +9 -3
- package/schemas/ros1/GeoJSON.msg +4 -1
- package/schemas/ros1/Grid.msg +4 -1
- package/schemas/ros1/ImageAnnotations.msg +4 -1
- package/schemas/ros1/LaserScan.msg +4 -1
- package/schemas/ros1/LocationFix.msg +4 -1
- package/schemas/ros1/Log.msg +4 -1
- package/schemas/ros1/PackedElementField.msg +4 -1
- package/schemas/ros1/Point2.msg +4 -1
- package/schemas/ros1/PointCloud.msg +4 -1
- package/schemas/ros1/PointsAnnotation.msg +11 -2
- package/schemas/ros1/PoseInFrame.msg +4 -1
- package/schemas/ros1/PosesInFrame.msg +4 -1
- package/schemas/ros1/RawImage.msg +4 -1
- package/schemas/ros1/Vector2.msg +4 -1
- package/schemas/ros2/CameraCalibration.msg +4 -1
- package/schemas/ros2/CircleAnnotation.msg +4 -1
- package/schemas/ros2/Color.msg +4 -1
- package/schemas/ros2/CompressedImage.msg +4 -1
- package/schemas/ros2/FrameTransform.msg +9 -3
- package/schemas/ros2/GeoJSON.msg +4 -1
- package/schemas/ros2/Grid.msg +4 -1
- package/schemas/ros2/ImageAnnotations.msg +4 -1
- package/schemas/ros2/LaserScan.msg +4 -1
- package/schemas/ros2/LocationFix.msg +4 -1
- package/schemas/ros2/Log.msg +4 -1
- package/schemas/ros2/PackedElementField.msg +4 -1
- package/schemas/ros2/Point2.msg +4 -1
- package/schemas/ros2/PointCloud.msg +4 -1
- package/schemas/ros2/PointsAnnotation.msg +11 -2
- package/schemas/ros2/PoseInFrame.msg +4 -1
- package/schemas/ros2/PosesInFrame.msg +4 -1
- package/schemas/ros2/RawImage.msg +4 -1
- package/schemas/ros2/Vector2.msg +4 -1
- package/schemas/typescript/CameraCalibration.ts +1 -1
- package/schemas/typescript/CircleAnnotation.ts +1 -1
- package/schemas/typescript/Color.ts +1 -1
- package/schemas/typescript/CompressedImage.ts +1 -1
- package/schemas/typescript/FrameTransform.ts +8 -4
- package/schemas/typescript/GeoJSON.ts +1 -1
- package/schemas/typescript/Grid.ts +1 -1
- package/schemas/typescript/ImageAnnotations.ts +1 -1
- package/schemas/typescript/LaserScan.ts +1 -1
- package/schemas/typescript/LocationFix.ts +1 -1
- package/schemas/typescript/Log.ts +1 -1
- package/schemas/typescript/LogLevel.ts +1 -1
- package/schemas/typescript/NumericType.ts +1 -1
- package/schemas/typescript/PackedElementField.ts +2 -2
- package/schemas/typescript/Point2.ts +1 -1
- package/schemas/typescript/Point3.ts +1 -1
- package/schemas/typescript/PointCloud.ts +1 -1
- package/schemas/typescript/PointsAnnotation.ts +8 -2
- package/schemas/typescript/PointsAnnotationType.ts +1 -1
- package/schemas/typescript/Pose.ts +1 -1
- package/schemas/typescript/PoseInFrame.ts +1 -1
- package/schemas/typescript/PosesInFrame.ts +1 -1
- package/schemas/typescript/PositionCovarianceType.ts +1 -1
- package/schemas/typescript/Quaternion.ts +1 -1
- package/schemas/typescript/RawImage.ts +1 -1
- package/schemas/typescript/Vector2.ts +1 -1
- package/schemas/typescript/Vector3.ts +1 -1
- package/schemas/typescript/index.ts +0 -1
- package/scripts/updateGeneratedFiles.ts +21 -10
- package/src/generateJsonSchema.test.ts +6 -8
- package/src/generateJsonSchema.ts +4 -3
- package/src/generateMarkdown.ts +88 -0
- package/src/generateProto.test.ts +1 -1
- package/src/generateProto.ts +1 -1
- package/src/generateRos.test.ts +464 -7
- package/src/generateRos.ts +14 -5
- package/src/generateTypeScript.test.ts +2 -2
- package/src/generateTypeScript.ts +1 -1
- package/src/schemas.ts +22 -30
- package/dist/cjs/schemas/typescript/Transform.d.ts +0 -13
- package/dist/cjs/schemas/typescript/Transform.d.ts.map +0 -1
- package/dist/cjs/schemas/typescript/Transform.js +0 -4
- package/dist/cjs/schemas/typescript/Transform.js.map +0 -1
- package/dist/esm/schemas/typescript/Transform.d.ts +0 -13
- package/dist/esm/schemas/typescript/Transform.d.ts.map +0 -1
- package/dist/esm/schemas/typescript/Transform.js +0 -3
- package/dist/esm/schemas/typescript/Transform.js.map +0 -1
- package/schemas/jsonschema/Transform.json +0 -68
- package/schemas/proto/foxglove/Transform.proto +0 -21
- package/schemas/ros1/Transform.msg +0 -10
- package/schemas/ros2/Transform.msg +0 -10
- package/schemas/typescript/Transform.ts +0 -17
package/src/generateRos.ts
CHANGED
|
@@ -9,7 +9,10 @@ type RosMsgFieldWithDescription = RosMsgField & {
|
|
|
9
9
|
type RosMsgDefinitionWithDescription = {
|
|
10
10
|
originalName: string;
|
|
11
11
|
description?: string;
|
|
12
|
-
|
|
12
|
+
/** The name of this message type as used in .msg files (foo_msgs/Bar) */
|
|
13
|
+
rosMsgInterfaceName: string;
|
|
14
|
+
/** The name used to refer to this message type in ROS (foo_msgs/Bar for ROS 1, foo_msgs/msg/Bar for ROS 2) */
|
|
15
|
+
rosFullInterfaceName: string;
|
|
13
16
|
fields: RosMsgFieldWithDescription[];
|
|
14
17
|
};
|
|
15
18
|
|
|
@@ -33,10 +36,12 @@ function primitiveToRos(
|
|
|
33
36
|
|
|
34
37
|
export function generateRosMsg(def: RosMsgDefinitionWithDescription): string {
|
|
35
38
|
let source = "";
|
|
36
|
-
source += `#
|
|
39
|
+
source += `# ${def.rosFullInterfaceName}\n`;
|
|
37
40
|
if (def.description != undefined) {
|
|
38
41
|
source += `# ${def.description}\n`;
|
|
39
42
|
}
|
|
43
|
+
source += `\n# Generated by https://github.com/foxglove/schemas\n`;
|
|
44
|
+
|
|
40
45
|
let prevFieldHadComment = true; // start true because of top-of-file comment
|
|
41
46
|
for (const field of def.fields) {
|
|
42
47
|
if (prevFieldHadComment || field.description != undefined) {
|
|
@@ -181,7 +186,10 @@ export function generateRosMsgDefinition(
|
|
|
181
186
|
|
|
182
187
|
return {
|
|
183
188
|
originalName: schema.name,
|
|
184
|
-
|
|
189
|
+
rosMsgInterfaceName: `foxglove_msgs/${schema.name}`,
|
|
190
|
+
rosFullInterfaceName:
|
|
191
|
+
rosVersion === 2 ? `foxglove_msgs/msg/${schema.name}` : `foxglove_msgs/${schema.name}`,
|
|
192
|
+
description: schema.description,
|
|
185
193
|
fields,
|
|
186
194
|
};
|
|
187
195
|
}
|
|
@@ -205,12 +213,13 @@ export function generateRosMsgMergedSchema(
|
|
|
205
213
|
name = dep.name;
|
|
206
214
|
source = generateRosMsg({
|
|
207
215
|
originalName: dep.name,
|
|
208
|
-
|
|
216
|
+
rosMsgInterfaceName: dep.name,
|
|
217
|
+
rosFullInterfaceName: dep.name,
|
|
209
218
|
fields: rosCommonDefs[dep.name].definitions,
|
|
210
219
|
});
|
|
211
220
|
} else {
|
|
212
221
|
const definition = generateRosMsgDefinition(dep.schema, { rosVersion });
|
|
213
|
-
name = definition.
|
|
222
|
+
name = definition.rosMsgInterfaceName;
|
|
214
223
|
source = generateRosMsg(definition);
|
|
215
224
|
}
|
|
216
225
|
result += `================================================================================\nMSG: ${name}\n${source}`;
|
|
@@ -4,7 +4,7 @@ import { exampleEnum, exampleMessage } from "./testFixtures";
|
|
|
4
4
|
describe("generateTypeScript", () => {
|
|
5
5
|
it("generates .d.ts files", () => {
|
|
6
6
|
expect(generateTypeScript(exampleEnum)).toMatchInlineSnapshot(`
|
|
7
|
-
"// Generated
|
|
7
|
+
"// Generated by https://github.com/foxglove/schemas
|
|
8
8
|
|
|
9
9
|
/** An example enum */
|
|
10
10
|
export enum ExampleEnum {
|
|
@@ -17,7 +17,7 @@ describe("generateTypeScript", () => {
|
|
|
17
17
|
"
|
|
18
18
|
`);
|
|
19
19
|
expect(generateTypeScript(exampleMessage)).toMatchInlineSnapshot(`
|
|
20
|
-
"// Generated
|
|
20
|
+
"// Generated by https://github.com/foxglove/schemas
|
|
21
21
|
|
|
22
22
|
import { Duration } from \\"./Duration\\";
|
|
23
23
|
import { ExampleEnum } from \\"./ExampleEnum\\";
|
package/src/schemas.ts
CHANGED
|
@@ -160,7 +160,7 @@ const foxglove_Pose: FoxgloveMessageSchema = {
|
|
|
160
160
|
],
|
|
161
161
|
};
|
|
162
162
|
|
|
163
|
-
|
|
163
|
+
const foxglove_CameraCalibration: FoxgloveMessageSchema = {
|
|
164
164
|
type: "message",
|
|
165
165
|
name: "CameraCalibration",
|
|
166
166
|
description: "Camera calibration parameters",
|
|
@@ -311,29 +311,6 @@ const foxglove_RawImage: FoxgloveMessageSchema = {
|
|
|
311
311
|
],
|
|
312
312
|
};
|
|
313
313
|
|
|
314
|
-
const foxglove_Transform: FoxgloveMessageSchema = {
|
|
315
|
-
type: "message",
|
|
316
|
-
name: "Transform",
|
|
317
|
-
description: "A transform in 3D space",
|
|
318
|
-
fields: [
|
|
319
|
-
{
|
|
320
|
-
name: "timestamp",
|
|
321
|
-
type: { type: "primitive", name: "time" },
|
|
322
|
-
description: "Transform time",
|
|
323
|
-
},
|
|
324
|
-
{
|
|
325
|
-
name: "translation",
|
|
326
|
-
type: { type: "nested", schema: foxglove_Vector3 },
|
|
327
|
-
description: "Translation component of the transform",
|
|
328
|
-
},
|
|
329
|
-
{
|
|
330
|
-
name: "rotation",
|
|
331
|
-
type: { type: "nested", schema: foxglove_Quaternion },
|
|
332
|
-
description: "Rotation component of the transform",
|
|
333
|
-
},
|
|
334
|
-
],
|
|
335
|
-
};
|
|
336
|
-
|
|
337
314
|
const foxglove_FrameTransform: FoxgloveMessageSchema = {
|
|
338
315
|
type: "message",
|
|
339
316
|
name: "FrameTransform",
|
|
@@ -355,9 +332,14 @@ const foxglove_FrameTransform: FoxgloveMessageSchema = {
|
|
|
355
332
|
description: "Name of the child frame",
|
|
356
333
|
},
|
|
357
334
|
{
|
|
358
|
-
name: "
|
|
359
|
-
type: { type: "nested", schema:
|
|
360
|
-
description: "
|
|
335
|
+
name: "translation",
|
|
336
|
+
type: { type: "nested", schema: foxglove_Vector3 },
|
|
337
|
+
description: "Translation component of the transform",
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
name: "rotation",
|
|
341
|
+
type: { type: "nested", schema: foxglove_Quaternion },
|
|
342
|
+
description: "Rotation component of the transform",
|
|
361
343
|
},
|
|
362
344
|
],
|
|
363
345
|
};
|
|
@@ -444,7 +426,7 @@ const foxglove_NumericType: FoxgloveEnumSchema = {
|
|
|
444
426
|
const foxglove_PackedElementField: FoxgloveMessageSchema = {
|
|
445
427
|
type: "message",
|
|
446
428
|
name: "PackedElementField",
|
|
447
|
-
description: "
|
|
429
|
+
description: "A field present within each element in a byte array of packed elements.",
|
|
448
430
|
fields: [
|
|
449
431
|
{
|
|
450
432
|
name: "name",
|
|
@@ -593,10 +575,16 @@ const foxglove_PointsAnnotation: FoxgloveMessageSchema = {
|
|
|
593
575
|
description: "Points in 2D image coordinates",
|
|
594
576
|
array: true,
|
|
595
577
|
},
|
|
578
|
+
{
|
|
579
|
+
name: "outline_color",
|
|
580
|
+
type: { type: "nested", schema: foxglove_Color },
|
|
581
|
+
description: "Outline color",
|
|
582
|
+
},
|
|
596
583
|
{
|
|
597
584
|
name: "outline_colors",
|
|
598
585
|
type: { type: "nested", schema: foxglove_Color },
|
|
599
|
-
description:
|
|
586
|
+
description:
|
|
587
|
+
"Per-point colors, if `type` is `POINTS`, or per-segment stroke colors, if `type` is `LINE_LIST`.",
|
|
600
588
|
array: true,
|
|
601
589
|
},
|
|
602
590
|
{
|
|
@@ -604,6 +592,11 @@ const foxglove_PointsAnnotation: FoxgloveMessageSchema = {
|
|
|
604
592
|
type: { type: "nested", schema: foxglove_Color },
|
|
605
593
|
description: "Fill color",
|
|
606
594
|
},
|
|
595
|
+
{
|
|
596
|
+
name: "thickness",
|
|
597
|
+
type: { type: "primitive", name: "float64" },
|
|
598
|
+
description: "Stroke thickness",
|
|
599
|
+
},
|
|
607
600
|
],
|
|
608
601
|
};
|
|
609
602
|
|
|
@@ -840,7 +833,6 @@ export const foxgloveMessageSchemas = {
|
|
|
840
833
|
PosesInFrame: foxglove_PosesInFrame,
|
|
841
834
|
Quaternion: foxglove_Quaternion,
|
|
842
835
|
RawImage: foxglove_RawImage,
|
|
843
|
-
Transform: foxglove_Transform,
|
|
844
836
|
Vector2: foxglove_Vector2,
|
|
845
837
|
Vector3: foxglove_Vector3,
|
|
846
838
|
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Quaternion } from "./Quaternion";
|
|
2
|
-
import { Time } from "./Time";
|
|
3
|
-
import { Vector3 } from "./Vector3";
|
|
4
|
-
/** A transform in 3D space */
|
|
5
|
-
export declare type Transform = {
|
|
6
|
-
/** Transform time */
|
|
7
|
-
timestamp: Time;
|
|
8
|
-
/** Translation component of the transform */
|
|
9
|
-
translation: Vector3;
|
|
10
|
-
/** Rotation component of the transform */
|
|
11
|
-
rotation: Quaternion;
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=Transform.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Transform.d.ts","sourceRoot":"","sources":["../../../../schemas/typescript/Transform.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,8BAA8B;AAC9B,oBAAY,SAAS,GAAG;IACtB,qBAAqB;IACrB,SAAS,EAAE,IAAI,CAAC;IAEhB,6CAA6C;IAC7C,WAAW,EAAE,OAAO,CAAC;IAErB,0CAA0C;IAC1C,QAAQ,EAAE,UAAU,CAAC;CACtB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Transform.js","sourceRoot":"","sources":["../../../../schemas/typescript/Transform.ts"],"names":[],"mappings":";AAAA,gDAAgD"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Quaternion } from "./Quaternion";
|
|
2
|
-
import { Time } from "./Time";
|
|
3
|
-
import { Vector3 } from "./Vector3";
|
|
4
|
-
/** A transform in 3D space */
|
|
5
|
-
export declare type Transform = {
|
|
6
|
-
/** Transform time */
|
|
7
|
-
timestamp: Time;
|
|
8
|
-
/** Translation component of the transform */
|
|
9
|
-
translation: Vector3;
|
|
10
|
-
/** Rotation component of the transform */
|
|
11
|
-
rotation: Quaternion;
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=Transform.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Transform.d.ts","sourceRoot":"","sources":["../../../../schemas/typescript/Transform.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,8BAA8B;AAC9B,oBAAY,SAAS,GAAG;IACtB,qBAAqB;IACrB,SAAS,EAAE,IAAI,CAAC;IAEhB,6CAA6C;IAC7C,WAAW,EAAE,OAAO,CAAC;IAErB,0CAA0C;IAC1C,QAAQ,EAAE,UAAU,CAAC;CACtB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Transform.js","sourceRoot":"","sources":["../../../../schemas/typescript/Transform.ts"],"names":[],"mappings":"AAAA,gDAAgD"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$comment": "Generated from Transform by @foxglove/schemas",
|
|
3
|
-
"title": "Transform",
|
|
4
|
-
"description": "A transform in 3D space",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"properties": {
|
|
7
|
-
"timestamp": {
|
|
8
|
-
"type": "object",
|
|
9
|
-
"title": "time",
|
|
10
|
-
"properties": {
|
|
11
|
-
"sec": {
|
|
12
|
-
"type": "integer",
|
|
13
|
-
"minimum": 0
|
|
14
|
-
},
|
|
15
|
-
"nsec": {
|
|
16
|
-
"type": "integer",
|
|
17
|
-
"minimum": 0,
|
|
18
|
-
"maximum": 999999999
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"description": "Transform time"
|
|
22
|
-
},
|
|
23
|
-
"translation": {
|
|
24
|
-
"$comment": "Generated from Vector3 by @foxglove/schemas",
|
|
25
|
-
"title": "Vector3",
|
|
26
|
-
"description": "Translation component of the transform",
|
|
27
|
-
"type": "object",
|
|
28
|
-
"properties": {
|
|
29
|
-
"x": {
|
|
30
|
-
"type": "number",
|
|
31
|
-
"description": "x coordinate length"
|
|
32
|
-
},
|
|
33
|
-
"y": {
|
|
34
|
-
"type": "number",
|
|
35
|
-
"description": "y coordinate length"
|
|
36
|
-
},
|
|
37
|
-
"z": {
|
|
38
|
-
"type": "number",
|
|
39
|
-
"description": "z coordinate length"
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
"rotation": {
|
|
44
|
-
"$comment": "Generated from Quaternion by @foxglove/schemas",
|
|
45
|
-
"title": "Quaternion",
|
|
46
|
-
"description": "Rotation component of the transform",
|
|
47
|
-
"type": "object",
|
|
48
|
-
"properties": {
|
|
49
|
-
"x": {
|
|
50
|
-
"type": "number",
|
|
51
|
-
"description": "x value"
|
|
52
|
-
},
|
|
53
|
-
"y": {
|
|
54
|
-
"type": "number",
|
|
55
|
-
"description": "y value"
|
|
56
|
-
},
|
|
57
|
-
"z": {
|
|
58
|
-
"type": "number",
|
|
59
|
-
"description": "z value"
|
|
60
|
-
},
|
|
61
|
-
"w": {
|
|
62
|
-
"type": "number",
|
|
63
|
-
"description": "w value"
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// Generated from Transform by @foxglove/schemas
|
|
2
|
-
|
|
3
|
-
syntax = "proto3";
|
|
4
|
-
|
|
5
|
-
import "foxglove/Quaternion.proto";
|
|
6
|
-
import "foxglove/Vector3.proto";
|
|
7
|
-
import "google/protobuf/timestamp.proto";
|
|
8
|
-
|
|
9
|
-
package foxglove;
|
|
10
|
-
|
|
11
|
-
// A transform in 3D space
|
|
12
|
-
message Transform {
|
|
13
|
-
// Transform time
|
|
14
|
-
google.protobuf.Timestamp timestamp = 1;
|
|
15
|
-
|
|
16
|
-
// Translation component of the transform
|
|
17
|
-
foxglove.Vector3 translation = 2;
|
|
18
|
-
|
|
19
|
-
// Rotation component of the transform
|
|
20
|
-
foxglove.Quaternion rotation = 3;
|
|
21
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# Generated from Transform by @foxglove/schemas
|
|
2
|
-
|
|
3
|
-
# Transform time
|
|
4
|
-
builtin_interfaces/Time timestamp
|
|
5
|
-
|
|
6
|
-
# Translation component of the transform
|
|
7
|
-
geometry_msgs/Vector3 translation
|
|
8
|
-
|
|
9
|
-
# Rotation component of the transform
|
|
10
|
-
geometry_msgs/Quaternion rotation
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// Generated from Transform by @foxglove/schemas
|
|
2
|
-
|
|
3
|
-
import { Quaternion } from "./Quaternion";
|
|
4
|
-
import { Time } from "./Time";
|
|
5
|
-
import { Vector3 } from "./Vector3";
|
|
6
|
-
|
|
7
|
-
/** A transform in 3D space */
|
|
8
|
-
export type Transform = {
|
|
9
|
-
/** Transform time */
|
|
10
|
-
timestamp: Time;
|
|
11
|
-
|
|
12
|
-
/** Translation component of the transform */
|
|
13
|
-
translation: Vector3;
|
|
14
|
-
|
|
15
|
-
/** Rotation component of the transform */
|
|
16
|
-
rotation: Quaternion;
|
|
17
|
-
};
|