Skip to content

tf2_geometry_msgs: Fixing covariance transformation in doTransform<PoseWithCovarianceStamped, TransformStamped> - #430

Merged
aprotyas merged 4 commits into
ros2from
aprotyas/transform-covariance
Jun 11, 2021
Merged

aprotyas merged 4 commits into
ros2from
aprotyas/transform-covariance

Conversation

@aprotyas

@aprotyas aprotyas commented Jun 7, 2021

Copy link
Copy Markdown
Member

Previously, the covariance matrix of a PoseWithCovarianceStamped message was incorrectly transformed. This PR:

  • Adds a transformCovariance method to address the covariance transformation.
  • Updates the TfGeometry/FrameWithCovariance unit test to check for the expected transformed covariance.

Fixes #372

Abrar Rahman Protyasha added 2 commits June 7, 2021 19:04
* The transform operation has been performed with the row-major form
of the covariance matrix.

* tf2 matrix types were used for easier matrix multiplication.

Signed-off-by: Abrar Rahman Protyasha <[email protected]>
* The previous test was doing a wrong covariance check,
i.e. out.covariance = in.covariance.

* The updated test checks against the correctly transformed
covariance matrix.

Signed-off-by: Abrar Rahman Protyasha <[email protected]>
@aprotyas
aprotyas requested review from clalancette and sloretz June 7, 2021 23:33
@aprotyas aprotyas self-assigned this Jun 7, 2021

@sloretz sloretz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The math LGTM (I only checked that it matches the ROS 1 code)

Previously, `transformCovariance`'s transform argument was of type
`geometry_msgs::msg::Transform`, which is not a "general" transform
type, but rather a message type. As such, that argument type has been
changed to `tf2::Transform`, so that the user can convert from whatever
transform type they have to a tf Transform.

Also:

* Moved location of a forward declaration to be closer to its use.
* Applied `ament_uncrustify` changes for maximum line length, changing
  the `transformCovariance` signature ine.
* Reflected change in `transformCovariance` function signature in
  doxygen documentation.

Signed-off-by: Abrar Rahman Protyasha <[email protected]>
@aprotyas
aprotyas requested a review from sloretz June 8, 2021 21:38
@aprotyas

Copy link
Copy Markdown
Member Author

CI (build: --packages-up-to tf2_geometry_msgs test: --packages-select tf2_geometry_msgs)

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@clalancette clalancette left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor thing to fix, then this looks good to me.

Leading tabs prevented the function parameters from lining up, both in
the Github UI and in Vim. Converting all tabs to spaces fixes said
issue.

Signed-off-by: Abrar Rahman Protyasha <[email protected]>
@aprotyas
aprotyas requested a review from clalancette June 11, 2021 18:24

@clalancette clalancette left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@aprotyas

Copy link
Copy Markdown
Member Author

@Mergifyio backport galactic foxy

mergify Bot pushed a commit that referenced this pull request Dec 21, 2021
…<PoseWithCovarianceStamped, TransformStamped>` (#430)

Fixes #372.

* Implement covariance transformation (cpp).

* Fixed `TfGeometry/FrameWithCovariance` test. The updated test checks against the correctly transformed
covariance matrix.

Signed-off-by: Abrar Rahman Protyasha <[email protected]>
(cherry picked from commit ae30f0b)

# Conflicts:
#	tf2_geometry_msgs/include/tf2_geometry_msgs/tf2_geometry_msgs.hpp
mergify Bot pushed a commit that referenced this pull request Dec 21, 2021
…<PoseWithCovarianceStamped, TransformStamped>` (#430)

Fixes #372.

* Implement covariance transformation (cpp).

* Fixed `TfGeometry/FrameWithCovariance` test. The updated test checks against the correctly transformed
covariance matrix.

Signed-off-by: Abrar Rahman Protyasha <[email protected]>
(cherry picked from commit ae30f0b)

# Conflicts:
#	tf2_geometry_msgs/include/tf2_geometry_msgs/tf2_geometry_msgs.hpp
@mergify

mergify Bot commented Dec 21, 2021

Copy link
Copy Markdown
Contributor

aprotyas pushed a commit that referenced this pull request Dec 21, 2021
…<PoseWithCovarianceStamped, TransformStamped>` (#430)

Fixes #372.

* Implement covariance transformation (cpp).

* Fixed `TfGeometry/FrameWithCovariance` test. The updated test checks against the correctly transformed
covariance matrix.

Signed-off-by: Abrar Rahman Protyasha <[email protected]>
(cherry picked from commit ae30f0b)
aprotyas pushed a commit that referenced this pull request Dec 21, 2021
…<PoseWithCovarianceStamped, TransformStamped>` (#430)

Fixes #372.

* Implement covariance transformation (cpp).

* Fixed `TfGeometry/FrameWithCovariance` test. The updated test checks against the correctly transformed
covariance matrix.

Signed-off-by: Abrar Rahman Protyasha <[email protected]>
(cherry picked from commit ae30f0b)
aprotyas pushed a commit that referenced this pull request Dec 23, 2021
…<PoseWithCovarianceStamped, TransformStamped>` (#430) (#488)

Fixes #372.

* Implement covariance transformation (cpp).

* Fixed `TfGeometry/FrameWithCovariance` test. The updated test checks against
the correctly transformed covariance matrix.

Signed-off-by: Abrar Rahman Protyasha <[email protected]>
(cherry picked from commit ae30f0b)
aprotyas pushed a commit that referenced this pull request Dec 23, 2021
…<PoseWithCovarianceStamped, TransformStamped>` (#430) (#489)

Fixes #372.

* Implement covariance transformation (cpp).

* Fixed `TfGeometry/FrameWithCovariance` test. The updated test checks against
the correctly transformed covariance matrix.

Signed-off-by: Abrar Rahman Protyasha <[email protected]>
(cherry picked from commit ae30f0b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PoseWithCovarianceStamped transform doesn't transform covariance part

3 participants