Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Twist interpolator #646

Merged
merged 14 commits into from
Apr 10, 2024
Merged

Enable Twist interpolator #646

merged 14 commits into from
Apr 10, 2024

Conversation

ahcorde
Copy link
Contributor

@ahcorde ahcorde commented Jan 26, 2024

Related with this issue #643

Signed-off-by: Alejandro Hernández Cordero <[email protected]>
@ahcorde ahcorde self-assigned this Jan 26, 2024
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
@ahcorde ahcorde requested a review from tfoote February 9, 2024 13:55
@ahcorde
Copy link
Contributor Author

ahcorde commented Feb 9, 2024

Ey @caguero and @tfoote when you have some time, do you mind to review the PR?

I'm not really sure how to handle the doTransform API in tf2_geometry_msgs

tf2/include/tf2/convert.h Outdated Show resolved Hide resolved
@@ -572,6 +574,123 @@ struct TransformAccum
tf2::Vector3 result_vec;
};

geometry_msgs::msg::VelocityStamped BufferCore::lookupVelocity(
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure that we want to bother with having this API version. The user can construct the last value inline and it will be much clearer to them what's happening.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

uhmm, when you just want the velocity of the object without any reference point it might be usefull, fill the rest of parameters is error prone.

const TimePoint & time, const tf2::Duration & averaging_interval) const
{
tf2::TimePoint latest_time;
// TODO(anyone): This is incorrect, but better than nothing. Really we want the latest time for
Copy link
Contributor

Choose a reason for hiding this comment

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

Note the todo's are not about who will do them, They're for who wrote them in case you want to ask more questions/get more context. And if it goes through a refactor chasing it down is harder.

Suggested change
// TODO(anyone): This is incorrect, but better than nothing. Really we want the latest time for
// TODO(ahcorde): This is incorrect, but better than nothing. Really we want the latest time for

Copy link
Contributor

Choose a reason for hiding this comment

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

Secondly, could you explain what you mean by any of the frames? You mean all 3? If so you could do the minimum of the common time across two pairs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This comment is from the original implementation. Let me dig in to this more

tf2_py/test/test_buffer_core.py Outdated Show resolved Hide resolved
@@ -216,6 +216,21 @@ class BufferInterface
return out;
}

template<class T>
T & transform(
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder for this one if the overload here makes sense. It's slightly more understandable to have transform_averaged() or something like that which explicitly lets you know that it's doing averaging. But maybe that implementation detail is obvious from the extra parameter required. Mostly thinking out loud here. And making sure that we're not boxing ourselves into the API, but I don't think that there's something else on the horizion with which this will collide.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

transform_average sounds good too. Open to change this too

averaging_interval);
}

geometry_msgs::msg::VelocityStamped BufferCore::lookupVelocity(
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that we can simplify this down with our assumptions about points and frames of references being coincident.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the method above is a simplified version with some assumptions, can you clarify more how we can simplify this?

Signed-off-by: Alejandro Hernández Cordero <[email protected]>
@tfoote
Copy link
Contributor

tfoote commented Feb 27, 2024

@ahcorde I took a stab at adding some notation here to get us consistent. https://github.com/ros2/ros2_documentation/tree/tf_velocity

Based on this I think that the header.frame_id should be the observation frame. And the other two datatypes should be capturing the semantic meaning. Where the naive transform method is only doing the reprojection of the observation. And then we can have a separate API for adding/subtracting transforms across moving frames which will be more complicated.

Signed-off-by: Alejandro Hernández Cordero <[email protected]>
Copy link
Contributor

@tfoote tfoote left a comment

Choose a reason for hiding this comment

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

A few comments the tests look to be there, but not asserting. Other than that I think that we're pretty close here.

tf2_ros/include/tf2_ros/buffer_interface.h Outdated Show resolved Hide resolved
tf2_ros/test/test_buffer.cpp Outdated Show resolved Hide resolved
tf2_ros/test/test_buffer.cpp Outdated Show resolved Hide resolved
tf2_ros/test/test_buffer.cpp Show resolved Hide resolved
@ahcorde ahcorde requested a review from tfoote April 9, 2024 12:21
@ahcorde
Copy link
Contributor Author

ahcorde commented Apr 9, 2024

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

@tfoote
Copy link
Contributor

tfoote commented Apr 9, 2024

I rebased common_interfaces with the same branch name https://github.com/ros2/common_interfaces/tree/ahcorde/rolling/lookupvelocity

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

@tfoote tfoote marked this pull request as ready for review April 9, 2024 16:20
@tfoote tfoote requested a review from clalancette as a code owner April 9, 2024 16:20
@tfoote tfoote changed the title [WIP] Enable Twist interpolator Enable Twist interpolator Apr 9, 2024
@tfoote
Copy link
Contributor

tfoote commented Apr 9, 2024

It looks like we have some linter errors and a symbol visibility on Windows issue in the CI

tfoote and others added 3 commits April 9, 2024 13:57
@ahcorde
Copy link
Contributor Author

ahcorde commented Apr 9, 2024

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

Signed-off-by: Alejandro Hernández Cordero <[email protected]>
@ahcorde
Copy link
Contributor Author

ahcorde commented Apr 9, 2024

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

Copy link
Contributor

@tfoote tfoote left a comment

Choose a reason for hiding this comment

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

Thanks for pushing this over the line.

Signed-off-by: Alejandro Hernández Cordero <[email protected]>
@ahcorde
Copy link
Contributor Author

ahcorde commented Apr 10, 2024

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

@nachovizzo
Copy link
Contributor

Are there any plans to backport this to Iron/jazzy?

@ahcorde
Copy link
Contributor Author

ahcorde commented May 20, 2024

Are there any plans to backport this to Iron/jazzy?

It's already on Jazzy, I can backport this to Humble and Iron, because this is not breaking ABI or API

@ahcorde
Copy link
Contributor Author

ahcorde commented May 20, 2024

https://github.com/Mergifyio backport humble iron

Copy link
Contributor

mergify bot commented May 20, 2024

backport humble iron

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request May 20, 2024
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
Co-authored-by: Tully Foote <[email protected]>
(cherry picked from commit 62322b8)

# Conflicts:
#	tf2/include/tf2/buffer_core.h
#	tf2_ros/test/test_buffer.cpp
mergify bot pushed a commit that referenced this pull request May 20, 2024
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
Co-authored-by: Tully Foote <[email protected]>
(cherry picked from commit 62322b8)

# Conflicts:
#	tf2/include/tf2/buffer_core.h
#	tf2_ros/test/test_buffer.cpp
@nachovizzo
Copy link
Contributor

Are there any plans to backport this to Iron/jazzy?

It's already on Jazzy, I can backport this to Humble and Iron, because this is not breaking ABI or API

@ahcorde thanks !

ahcorde added a commit that referenced this pull request Aug 30, 2024
* Enable Twist interpolator (#646)

Signed-off-by: Alejandro Hernández Cordero <[email protected]>
Co-authored-by: Tully Foote <[email protected]>
(cherry picked from commit 62322b8)

# Conflicts:
#	tf2/include/tf2/buffer_core.h
#	tf2_ros/test/test_buffer.cpp

Signed-off-by: Alejandro Hernández Cordero <[email protected]>
Co-authored-by: Alejandro Hernández Cordero <[email protected]>
ahcorde pushed a commit that referenced this pull request Aug 30, 2024
* Enable Twist interpolator (#646)

Signed-off-by: Alejandro Hernández Cordero <[email protected]>
Co-authored-by: Tully Foote <[email protected]>
(cherry picked from commit 62322b8)
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.

3 participants