Skip to content

Commit 2623a0e

Browse files
Merge pull request #6109 from cyberbotics/sync-master-eb8acdf9e
Merge master into develop
2 parents 702c69d + 6a405e0 commit 2623a0e

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

docs/reference/changelog-r2023.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ Released on ??
7979
- Fixed generation of moment of inertia matrix based on bounding box ([#6048](https://github.com/cyberbotics/webots/pull/6048)).
8080
- Fixed the loading of remote mesh bounding objects ([#6047](https://github.com/cyberbotics/webots/pull/6047)).
8181
- Fixed crash during conversion of PROTO to base nodes in case of Mesh nodes with invalid scale values ([#6088](https://github.com/cyberbotics/webots/pull/6088)).
82+
- Fixed object's relative orientation returned by the [Recognition](recognition.md) functionality ([#6100](https://github.com/cyberbotics/webots/pull/6100)).
8283

8384
## Webots R2023a
8485
Released on November 29th, 2022.

src/webots/nodes/WbCamera.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -804,8 +804,8 @@ bool WbCamera::setRecognizedObjectProperties(WbRecognizedObject *recognizedObjec
804804

805805
// compute object relative orientation
806806
WbRotation relativeRotation;
807-
relativeRotation.fromMatrix3(recognizedObject->object()->rotationMatrix() *
808-
recognizedObject->device()->rotationMatrix().transposed());
807+
relativeRotation.fromMatrix3(recognizedObject->device()->rotationMatrix().transposed() *
808+
recognizedObject->object()->rotationMatrix());
809809
relativeRotation.normalize();
810810
recognizedObject->setRelativeOrientation(relativeRotation);
811811

tests/api/controllers/camera_recognition/camera_recognition.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ int main(int argc, char **argv) {
217217

218218
// test spherical camera
219219
const double invisible_capsule_position[3] = {0.369, 1.650, 0.899};
220-
const double invisible_capsule_orientation[4] = {-0.014153, 0.447164, -0.894340, 2.094391};
220+
const double invisible_capsule_orientation[4] = {0.577350, -0.577350, -0.577350, 2.094390};
221221
const double invisible_capsule_size[2] = {0.1, 0.1};
222222
object_number = wb_camera_recognition_get_number_of_objects(camera_spherical);
223223
ts_assert_int_equal(object_number, 4,
@@ -235,7 +235,7 @@ int main(int argc, char **argv) {
235235
objects[i].position[0], objects[i].position[1], objects[i].position[2], expected_position[0], expected_position[1],
236236
expected_position[2]);
237237
// orientation
238-
double expected_orientation[4] = {-0.014153, 0.447166, -0.894339, 2.094390};
238+
double expected_orientation[4] = {0.577350, -0.577350, -0.577350, 2.094390};
239239
ts_assert_doubles_in_delta(
240240
4, objects[i].orientation, expected_orientation, 0.001,
241241
"Orientation of 'occluded box' is not correct for spherical camera: found=(%f, %f, %f, %f), expected=(%f, %f, %f, %f).",

0 commit comments

Comments
 (0)