From a07acd0958f7ca19f6af7e06356953940490082f Mon Sep 17 00:00:00 2001 From: Benjamin Perseghetti Date: Mon, 6 May 2024 22:04:44 -0400 Subject: [PATCH 1/5] Add Camera Track message. Signed-off-by: Benjamin Perseghetti --- proto/gz/msgs/cameratrack.proto | 49 +++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 proto/gz/msgs/cameratrack.proto diff --git a/proto/gz/msgs/cameratrack.proto b/proto/gz/msgs/cameratrack.proto new file mode 100644 index 00000000..6c93a2ee --- /dev/null +++ b/proto/gz/msgs/cameratrack.proto @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2024 Rudis Laboratories + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ + +syntax = "proto3"; +package gz.msgs; +option java_package = "com.gz.msgs"; +option java_outer_classname = "CameraTrackProtos"; + +/// \ingroup gz.msgs +/// \interface CameraTrack +/// \brief Message for camera tracking + +import "gz/msgs/header.proto"; +import "gz/msgs/vector3d.proto"; + +message CameraTrack +{ + enum TrackMode + { + /// \brief TRACK observes a target from fixed x,y,z world camera point with pgain allowing only for orientation change. + TRACK = 0; + /// \brief FOLLOW moves with a target with an offset x,y,z camera and following pgain. + FOLLOW = 1; + /// \brief FOLLOW_FREE_LOOK moves with a target with an offset x,y,z camera and following pgain but allows for changing orientation for free looking around. + FOLLOW_FREE_LOOK = 2; + } + + /// \brief Optional header data + Header header = 1; + TrackMode track_mode = 2; + string target = 3; + Vector3d offset = 4; + Vector3d track_pose = 5; + double pgain = 6; +} From c927f6f53e21e5d67748532b0f0895cda24720d2 Mon Sep 17 00:00:00 2001 From: Benjamin Perseghetti Date: Thu, 9 May 2024 02:54:03 -0400 Subject: [PATCH 2/5] Update camera track for unique targets and pgains. Signed-off-by: Benjamin Perseghetti --- proto/gz/msgs/cameratrack.proto | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/proto/gz/msgs/cameratrack.proto b/proto/gz/msgs/cameratrack.proto index 6c93a2ee..2114be57 100644 --- a/proto/gz/msgs/cameratrack.proto +++ b/proto/gz/msgs/cameratrack.proto @@ -31,19 +31,27 @@ message CameraTrack { enum TrackMode { + /// \brief Defaults to no tracking mode. + NONE = 0; /// \brief TRACK observes a target from fixed x,y,z world camera point with pgain allowing only for orientation change. - TRACK = 0; + TRACK = 1; /// \brief FOLLOW moves with a target with an offset x,y,z camera and following pgain. - FOLLOW = 1; + FOLLOW = 2; /// \brief FOLLOW_FREE_LOOK moves with a target with an offset x,y,z camera and following pgain but allows for changing orientation for free looking around. - FOLLOW_FREE_LOOK = 2; + FOLLOW_FREE_LOOK = 3; + /// \brief FOLLOW_LOOK_AT moves with a target with an offset x,y,z camera and following pgain while looking at a specified target. + FOLLOW_LOOK_AT = 4; + /// \brief USE_LAST updates offsets and pgains without changing the fundamental track mode or target(s) + USE_LAST = 5; } /// \brief Optional header data - Header header = 1; - TrackMode track_mode = 2; - string target = 3; - Vector3d offset = 4; - Vector3d track_pose = 5; - double pgain = 6; + Header header = 1; + TrackMode track_mode = 2; + string follow_target = 3; + string track_target = 4; + Vector3d follow_offset = 5; + Vector3d track_offset = 6; + double follow_pgain = 7; + double track_pgain = 8; } From 7c607268bb920cf5b529669ecc6e9728567a041f Mon Sep 17 00:00:00 2001 From: Benjamin Perseghetti Date: Fri, 10 May 2024 13:05:04 -0400 Subject: [PATCH 3/5] Linting. Signed-off-by: Benjamin Perseghetti --- proto/gz/msgs/cameratrack.proto | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/proto/gz/msgs/cameratrack.proto b/proto/gz/msgs/cameratrack.proto index 2114be57..0dcf3a75 100644 --- a/proto/gz/msgs/cameratrack.proto +++ b/proto/gz/msgs/cameratrack.proto @@ -33,15 +33,19 @@ message CameraTrack { /// \brief Defaults to no tracking mode. NONE = 0; - /// \brief TRACK observes a target from fixed x,y,z world camera point with pgain allowing only for orientation change. + /// \brief TRACK observes a target from fixed x,y,z world + /// camera point with pgain allowing only for orientation change. TRACK = 1; - /// \brief FOLLOW moves with a target with an offset x,y,z camera and following pgain. + /// \brief FOLLOW moves with a target with an offset x,y,z camera and pgain. FOLLOW = 2; - /// \brief FOLLOW_FREE_LOOK moves with a target with an offset x,y,z camera and following pgain but allows for changing orientation for free looking around. + /// \brief FOLLOW_FREE_LOOK moves with a target with an offset x,y,z camera + /// and pgain but allows for changing orientation for free looking around. FOLLOW_FREE_LOOK = 3; - /// \brief FOLLOW_LOOK_AT moves with a target with an offset x,y,z camera and following pgain while looking at a specified target. + /// \brief FOLLOW_LOOK_AT moves with a target with an offset x,y,z camera + /// and pgain while looking at a specified target. FOLLOW_LOOK_AT = 4; - /// \brief USE_LAST updates offsets and pgains without changing the fundamental track mode or target(s) + /// \brief USE_LAST updates offsets and pgains without changing the + /// fundamental track_mode or target(s) USE_LAST = 5; } From 1704c0f79817f962a41ca5fd125c6ca811e0fd14 Mon Sep 17 00:00:00 2001 From: Benjamin Perseghetti Date: Fri, 10 May 2024 20:44:08 -0400 Subject: [PATCH 4/5] Favor use of Entity over string. Signed-off-by: Benjamin Perseghetti --- proto/gz/msgs/cameratrack.proto | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/proto/gz/msgs/cameratrack.proto b/proto/gz/msgs/cameratrack.proto index 0dcf3a75..22cc2a55 100644 --- a/proto/gz/msgs/cameratrack.proto +++ b/proto/gz/msgs/cameratrack.proto @@ -24,6 +24,7 @@ option java_outer_classname = "CameraTrackProtos"; /// \interface CameraTrack /// \brief Message for camera tracking +import "gz/msgs/entity.proto"; import "gz/msgs/header.proto"; import "gz/msgs/vector3d.proto"; @@ -52,8 +53,8 @@ message CameraTrack /// \brief Optional header data Header header = 1; TrackMode track_mode = 2; - string follow_target = 3; - string track_target = 4; + Entity follow_target = 3; + Entity track_target = 4; Vector3d follow_offset = 5; Vector3d track_offset = 6; double follow_pgain = 7; From 459478a6f805bc8e6b9dd5f8cad2ccc83aa6d261 Mon Sep 17 00:00:00 2001 From: Benjamin Perseghetti Date: Mon, 13 May 2024 14:20:06 -0400 Subject: [PATCH 5/5] Add more information for doxygen. Signed-off-by: Benjamin Perseghetti --- proto/gz/msgs/cameratrack.proto | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/proto/gz/msgs/cameratrack.proto b/proto/gz/msgs/cameratrack.proto index 22cc2a55..566c091b 100644 --- a/proto/gz/msgs/cameratrack.proto +++ b/proto/gz/msgs/cameratrack.proto @@ -52,11 +52,18 @@ message CameraTrack /// \brief Optional header data Header header = 1; + /// \brief Tracking mode. TrackMode track_mode = 2; + /// \brief Target entity to follow. Entity follow_target = 3; + /// \brief Target entity to track. Entity track_target = 4; + /// \brief Follow offset in local target frame. Vector3d follow_offset = 5; + /// \brief Track offset in local target frame. Vector3d track_offset = 6; + /// \brief Follow pgain for following a target. double follow_pgain = 7; + /// \brief Track pgain for following a target. double track_pgain = 8; }