-
Notifications
You must be signed in to change notification settings - Fork 280
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
add getYaw helper function #110
Comments
I can make a PR but where do you see that ? a member function of the tf2::Quaternion object ? A standalone function ? (that could work with tf2::Matrix3x3 and tf2::QUaternion) |
I like the bare function. It would be nice to support extendable datatypes kind of like convert does with the inclusion of the appropriate headers. It doesn't need to be templated as the datatypes can just be overloaded. As a bare function we can also provide it for the message datatypes. It should probably be something like getHeading for a clearer scope of what it's providing. I guess it should get it's own header file for clarity. Are there other similar methods missing? Common, simple, but painful? |
well, there are a few other functions but they are member functions (like setIdentity for a transform). |
convert.h does seem like a reasonable place. And it can be added side by side with the toMsg fromMsg in the other packages too. |
#112 might be a solution |
+1 to having a getYaw -- especially one that accepts the orientation of geometry_msgs/Pose directly |
hmm, with #112, it only gives the yaw of anything that can be converted to a tf2::Quaternion. Hence, not a pose. You can just call getYaw(pose.orientation). We could also specialize it for a Pose. I just feel that we should keep it simple. If you feel it should work for several types, please let me know which. I see Transform and Pose. Anything else ? Just saw that my PR would not work for Stamped messages, will fix that. |
pose.orientation is fine -- I really just want to avoid converting from message to TF to yaw (something I find is an often repeated calculation) |
Fixed in #112 |
It saves several lines of code which could easily be done wrong.
https://github.com/ros-perception/slam_gmapping/pull/31/files#diff-ee79bfdef4f6452c01f74517ee41c050R371
The text was updated successfully, but these errors were encountered: