From f8d19d032541f8241b5e1576dd833fa09545bf40 Mon Sep 17 00:00:00 2001 From: Roman Shtylman Date: Thu, 11 May 2023 11:33:54 -0700 Subject: [PATCH] Add a frame_id field to LocationFix (#108) The frame_id field for the LocationFix message specifies the frame for the origin of the sensor so the lat/lon values can be tied to a location on the robot. Fixes: #100 --- internal/schemas.ts | 18 ++++++++++++++++ ros_foxglove_msgs/ros1/LocationFix.msg | 6 ++++++ ros_foxglove_msgs/ros2/LocationFix.msg | 6 ++++++ schemas/README.md | 26 ++++++++++++++++++++++++ schemas/flatbuffer/LocationFix.fbs | 8 ++++++++ schemas/jsonschema/LocationFix.json | 20 ++++++++++++++++++ schemas/jsonschema/index.ts | 20 ++++++++++++++++++ schemas/proto/foxglove/LocationFix.proto | 8 ++++++++ schemas/ros1/LocationFix.msg | 6 ++++++ schemas/ros2/LocationFix.msg | 6 ++++++ schemas/typescript/LocationFix.ts | 7 +++++++ 11 files changed, 131 insertions(+) diff --git a/internal/schemas.ts b/internal/schemas.ts index 6f0aaffa..05ca4963 100644 --- a/internal/schemas.ts +++ b/internal/schemas.ts @@ -1228,20 +1228,36 @@ const LocationFix: FoxgloveMessageSchema = { name: "LocationFix", description: "A navigation satellite fix for any Global Navigation Satellite System", fields: [ + { + name: "timestamp", + type: { type: "primitive", name: "time" }, + description: "Timestamp of the message", + protobufFieldNumber: 6, + }, + { + name: "frame_id", + type: { type: "primitive", name: "string" }, + description: + "Frame for the sensor. Latitude and longitude readings are at the origin of the frame.", + protobufFieldNumber: 7, + }, { name: "latitude", type: { type: "primitive", name: "float64" }, description: "Latitude in degrees", + protobufFieldNumber: 1, }, { name: "longitude", type: { type: "primitive", name: "float64" }, description: "Longitude in degrees", + protobufFieldNumber: 2, }, { name: "altitude", type: { type: "primitive", name: "float64" }, description: "Altitude in meters", + protobufFieldNumber: 3, }, { name: "position_covariance", @@ -1249,12 +1265,14 @@ const LocationFix: FoxgloveMessageSchema = { description: "Position covariance (m^2) defined relative to a tangential plane through the reported position. The components are East, North, and Up (ENU), in row-major order.", array: 9, + protobufFieldNumber: 4, }, { name: "position_covariance_type", type: { type: "enum", enum: PositionCovarianceType }, description: "If `position_covariance` is available, `position_covariance_type` must be set to indicate the type of covariance.", + protobufFieldNumber: 5, }, ], }; diff --git a/ros_foxglove_msgs/ros1/LocationFix.msg b/ros_foxglove_msgs/ros1/LocationFix.msg index 37600251..8593faaa 100644 --- a/ros_foxglove_msgs/ros1/LocationFix.msg +++ b/ros_foxglove_msgs/ros1/LocationFix.msg @@ -3,6 +3,12 @@ # Generated by https://github.com/foxglove/schemas +# Timestamp of the message +time timestamp + +# Frame for the sensor. Latitude and longitude readings are at the origin of the frame. +string frame_id + # Latitude in degrees float64 latitude diff --git a/ros_foxglove_msgs/ros2/LocationFix.msg b/ros_foxglove_msgs/ros2/LocationFix.msg index abb105f6..33cf956d 100644 --- a/ros_foxglove_msgs/ros2/LocationFix.msg +++ b/ros_foxglove_msgs/ros2/LocationFix.msg @@ -3,6 +3,12 @@ # Generated by https://github.com/foxglove/schemas +# Timestamp of the message +builtin_interfaces/Time timestamp + +# Frame for the sensor. Latitude and longitude readings are at the origin of the frame. +string frame_id + # Latitude in degrees float64 latitude diff --git a/schemas/README.md b/schemas/README.md index d2c71288..8e04ab65 100644 --- a/schemas/README.md +++ b/schemas/README.md @@ -1319,6 +1319,32 @@ A navigation satellite fix for any Global Navigation Satellite System description +timestamp + + +time + + + + +Timestamp of the message + + + + +frame_id + + +string + + + + +Frame for the sensor. Latitude and longitude readings are at the origin of the frame. + + + + latitude diff --git a/schemas/flatbuffer/LocationFix.fbs b/schemas/flatbuffer/LocationFix.fbs index 68a6011a..9db5a592 100644 --- a/schemas/flatbuffer/LocationFix.fbs +++ b/schemas/flatbuffer/LocationFix.fbs @@ -1,5 +1,7 @@ // Generated by https://github.com/foxglove/schemas +include "Time.fbs"; + namespace foxglove; /// Type of position covariance @@ -14,6 +16,12 @@ enum PositionCovarianceType : ubyte { } /// A navigation satellite fix for any Global Navigation Satellite System table LocationFix { + /// Timestamp of the message + timestamp:Time; + + /// Frame for the sensor. Latitude and longitude readings are at the origin of the frame. + frame_id:string; + /// Latitude in degrees latitude:double; diff --git a/schemas/jsonschema/LocationFix.json b/schemas/jsonschema/LocationFix.json index 8305c3db..375f5672 100644 --- a/schemas/jsonschema/LocationFix.json +++ b/schemas/jsonschema/LocationFix.json @@ -4,6 +4,26 @@ "$comment": "Generated by https://github.com/foxglove/schemas", "type": "object", "properties": { + "timestamp": { + "type": "object", + "title": "time", + "properties": { + "sec": { + "type": "integer", + "minimum": 0 + }, + "nsec": { + "type": "integer", + "minimum": 0, + "maximum": 999999999 + } + }, + "description": "Timestamp of the message" + }, + "frame_id": { + "type": "string", + "description": "Frame for the sensor. Latitude and longitude readings are at the origin of the frame." + }, "latitude": { "type": "number", "description": "Latitude in degrees" diff --git a/schemas/jsonschema/index.ts b/schemas/jsonschema/index.ts index a9093bcb..c7197d81 100644 --- a/schemas/jsonschema/index.ts +++ b/schemas/jsonschema/index.ts @@ -1533,6 +1533,26 @@ export const LocationFix = { "$comment": "Generated by https://github.com/foxglove/schemas", "type": "object", "properties": { + "timestamp": { + "type": "object", + "title": "time", + "properties": { + "sec": { + "type": "integer", + "minimum": 0 + }, + "nsec": { + "type": "integer", + "minimum": 0, + "maximum": 999999999 + } + }, + "description": "Timestamp of the message" + }, + "frame_id": { + "type": "string", + "description": "Frame for the sensor. Latitude and longitude readings are at the origin of the frame." + }, "latitude": { "type": "number", "description": "Latitude in degrees" diff --git a/schemas/proto/foxglove/LocationFix.proto b/schemas/proto/foxglove/LocationFix.proto index c7f7fe50..6ddbc59a 100644 --- a/schemas/proto/foxglove/LocationFix.proto +++ b/schemas/proto/foxglove/LocationFix.proto @@ -2,6 +2,8 @@ syntax = "proto3"; +import "google/protobuf/timestamp.proto"; + package foxglove; // A navigation satellite fix for any Global Navigation Satellite System @@ -16,6 +18,12 @@ message LocationFix { KNOWN = 3; } + // Timestamp of the message + google.protobuf.Timestamp timestamp = 6; + + // Frame for the sensor. Latitude and longitude readings are at the origin of the frame. + string frame_id = 7; + // Latitude in degrees double latitude = 1; diff --git a/schemas/ros1/LocationFix.msg b/schemas/ros1/LocationFix.msg index 37600251..8593faaa 100644 --- a/schemas/ros1/LocationFix.msg +++ b/schemas/ros1/LocationFix.msg @@ -3,6 +3,12 @@ # Generated by https://github.com/foxglove/schemas +# Timestamp of the message +time timestamp + +# Frame for the sensor. Latitude and longitude readings are at the origin of the frame. +string frame_id + # Latitude in degrees float64 latitude diff --git a/schemas/ros2/LocationFix.msg b/schemas/ros2/LocationFix.msg index abb105f6..33cf956d 100644 --- a/schemas/ros2/LocationFix.msg +++ b/schemas/ros2/LocationFix.msg @@ -3,6 +3,12 @@ # Generated by https://github.com/foxglove/schemas +# Timestamp of the message +builtin_interfaces/Time timestamp + +# Frame for the sensor. Latitude and longitude readings are at the origin of the frame. +string frame_id + # Latitude in degrees float64 latitude diff --git a/schemas/typescript/LocationFix.ts b/schemas/typescript/LocationFix.ts index 677f2941..27d2c97a 100644 --- a/schemas/typescript/LocationFix.ts +++ b/schemas/typescript/LocationFix.ts @@ -1,9 +1,16 @@ // Generated by https://github.com/foxglove/schemas import { PositionCovarianceType } from "./PositionCovarianceType"; +import { Time } from "./Time"; /** A navigation satellite fix for any Global Navigation Satellite System */ export type LocationFix = { + /** Timestamp of the message */ + timestamp: Time; + + /** Frame for the sensor. Latitude and longitude readings are at the origin of the frame. */ + frame_id: string; + /** Latitude in degrees */ latitude: number;