From fc952f912d59c365f92c187263425849ce0446a5 Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Wed, 5 Jun 2024 23:51:39 +0800 Subject: [PATCH 1/2] update camera based sensors to use //sensor/camera/pose Signed-off-by: Ian Chen --- Migration.md | 3 +++ src/rendering/RenderUtil.cc | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/Migration.md b/Migration.md index 2e55298ea9..2d5c015c2a 100644 --- a/Migration.md +++ b/Migration.md @@ -12,6 +12,9 @@ release will remove the deprecated code. each time step, whereas previously the component values were set to `0` after each time step. Persistent velocity commands should be reapplied at each time step. + + For camera baesd sensors, their pose now takes into account the + `//sensor/camera/pose` sdf element. Previously only the `//sensor/pose` + sdf element was used and `//sensor/camera/pose` was ignored. ## Gazebo Sim 7.x to 8.0 * **Deprecated** diff --git a/src/rendering/RenderUtil.cc b/src/rendering/RenderUtil.cc index 9b2cbf8acd..73bec2c531 100644 --- a/src/rendering/RenderUtil.cc +++ b/src/rendering/RenderUtil.cc @@ -1334,6 +1334,10 @@ void RenderUtil::Update() { sensorPose = dataSdf.RawPose(); } + if (dataSdf.CameraSensor()) + { + sensorPose = sensorPose * dataSdf.CameraSensor()->RawPose(); + } sensorNode->SetLocalPose(sensorPose); } } From 051190ee6d75c0078433d1150994983af7bc03fd Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Wed, 5 Jun 2024 23:56:13 +0800 Subject: [PATCH 2/2] typo Signed-off-by: Ian Chen --- Migration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Migration.md b/Migration.md index 2d5c015c2a..6fe6160bf3 100644 --- a/Migration.md +++ b/Migration.md @@ -12,7 +12,7 @@ release will remove the deprecated code. each time step, whereas previously the component values were set to `0` after each time step. Persistent velocity commands should be reapplied at each time step. - + For camera baesd sensors, their pose now takes into account the + + For camera based sensors, their pose now takes into account the `//sensor/camera/pose` sdf element. Previously only the `//sensor/pose` sdf element was used and `//sensor/camera/pose` was ignored.