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 <ahcorde@gmail.com>
@ahcorde ahcorde self-assigned this Jan 26, 2024
Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
@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 <ahcorde@gmail.com>
@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 <ahcorde@gmail.com>
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
Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
@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
Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
@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 <ahcorde@gmail.com>
@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 <ahcorde@gmail.com>
@ahcorde
Copy link
Contributor Author

ahcorde commented Apr 10, 2024

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

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.

None yet

2 participants