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

Migrate to tf2 #93

Merged
merged 4 commits into from
Mar 24, 2021
Merged

Migrate to tf2 #93

merged 4 commits into from
Mar 24, 2021

Conversation

f-fl0
Copy link
Contributor

@f-fl0 f-fl0 commented Mar 20, 2021

This PR replaces calls to tf functions with their tf2 equivalent.

- Add tf2 dependencies instead of tf.
- Update yp-spur requirements (same as in package.xml).
- Set compiler to cpp14.
- Replace calls to tf functions with their tf2 equivalent.
@at-wat
Copy link
Member

at-wat commented Mar 20, 2021

[45] FAILED on noetic

catkin_make failed


[45] FAILED on melodic

catkin_make failed

@at-wat
Copy link
Member

at-wat commented Mar 20, 2021

[45] FAILED on kinetic

catkin_make failed

@at-wat
Copy link
Member

at-wat commented Mar 20, 2021

[46] PASSED on melodic

All tests passed
build/test_results/ypspur_ros/roslint-ypspur_ros.xml: 1 tests
build/test_results/ypspur_ros/rostest-test_test_joint_trajectory.xml: 1 tests
build/test_results/ypspur_ros/rosunit-test_joint_trajectory.xml: 2 tests
Summary: 4 tests, 0 errors, 0 failures, 0 skipped

[46] PASSED on noetic

All tests passed
build/test_results/ypspur_ros/roslint-ypspur_ros.xml: 1 tests
build/test_results/ypspur_ros/rostest-test_test_joint_trajectory.xml: 1 tests
build/test_results/ypspur_ros/rosunit-test_joint_trajectory.xml: 2 tests
Summary: 4 tests, 0 errors, 0 failures, 0 skipped

[46] PASSED on kinetic

All tests passed
build/test_results/ypspur_ros/roslint-ypspur_ros.xml: 1 tests
build/test_results/ypspur_ros/rostest-test_test_joint_trajectory.xml: 1 tests
build/test_results/ypspur_ros/rosunit-test_joint_trajectory.xml: 2 tests
Summary: 4 tests, 0 errors, 0 failures, 0 skipped

for (unsigned int i = 0; i < joints_.size(); i++)
{
joint_trans[i].transform.rotation =
tf::createQuaternionMsgFromYaw(joint.position[i]);
quat_tf.setRPY(0, 0, joint.position[i]);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
quat_tf.setRPY(0, 0, joint.position[i]);
const tf2::Quaternion quat_tf(0, 0, joint.position[i]);

api ref: http://docs.ros.org/en/jade/api/tf2/html/classtf2_1_1Quaternion.html#a29cf4deb42a3a1867a066b9f74578bf6

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

trans.transform.rotation = tf2::toMsg(tf2::Quaternion(tf2::Vector3(0, 0, 1), msg->position[i]));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in f8fbe7e

joint_trans[i].transform.rotation =
tf::createQuaternionMsgFromYaw(joint.position[i]);
quat_tf.setRPY(0, 0, joint.position[i]);
joint_trans[i].transform.rotation = tf2::toMsg(quat_tf);
Copy link
Member

Choose a reason for hiding this comment

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

or

Suggested change
joint_trans[i].transform.rotation = tf2::toMsg(quat_tf);
joint_trans[i].transform.rotation = tf2::toMsg(tf2::Quaternion(0, 0, joint.position[i]));

would be more simple.

@at-wat
Copy link
Member

at-wat commented Mar 23, 2021

[47] PASSED on noetic

All tests passed
build/test_results/ypspur_ros/roslint-ypspur_ros.xml: 1 tests
build/test_results/ypspur_ros/rostest-test_test_joint_trajectory.xml: 1 tests
build/test_results/ypspur_ros/rosunit-test_joint_trajectory.xml: 2 tests
Summary: 4 tests, 0 errors, 0 failures, 0 skipped

@at-wat
Copy link
Member

at-wat commented Mar 23, 2021

[47] PASSED on kinetic

All tests passed
build/test_results/ypspur_ros/roslint-ypspur_ros.xml: 1 tests
build/test_results/ypspur_ros/rostest-test_test_joint_trajectory.xml: 1 tests
build/test_results/ypspur_ros/rosunit-test_joint_trajectory.xml: 2 tests
Summary: 4 tests, 0 errors, 0 failures, 0 skipped

@at-wat
Copy link
Member

at-wat commented Mar 23, 2021

[47] PASSED on melodic

All tests passed
build/test_results/ypspur_ros/roslint-ypspur_ros.xml: 1 tests
build/test_results/ypspur_ros/rostest-test_test_joint_trajectory.xml: 1 tests
build/test_results/ypspur_ros/rosunit-test_joint_trajectory.xml: 2 tests
Summary: 4 tests, 0 errors, 0 failures, 0 skipped

@@ -88,6 +88,7 @@ class YpspurRosNode
tf2_ros::Buffer tf_buffer_;
tf2_ros::TransformListener tf_listener_;
tf2_ros::TransformBroadcaster tf_broadcaster_;
tf2::Vector3 z_axis_;
Copy link
Member

Choose a reason for hiding this comment

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

Could it be const?

- Use const.
@at-wat
Copy link
Member

at-wat commented Mar 24, 2021

[48] PASSED on melodic

All tests passed
build/test_results/ypspur_ros/roslint-ypspur_ros.xml: 1 tests
build/test_results/ypspur_ros/rostest-test_test_joint_trajectory.xml: 1 tests
build/test_results/ypspur_ros/rosunit-test_joint_trajectory.xml: 2 tests
Summary: 4 tests, 0 errors, 0 failures, 0 skipped

[48] PASSED on noetic

All tests passed
build/test_results/ypspur_ros/roslint-ypspur_ros.xml: 1 tests
build/test_results/ypspur_ros/rostest-test_test_joint_trajectory.xml: 1 tests
build/test_results/ypspur_ros/rosunit-test_joint_trajectory.xml: 2 tests
Summary: 4 tests, 0 errors, 0 failures, 0 skipped

@at-wat
Copy link
Member

at-wat commented Mar 24, 2021

[48] PASSED on kinetic

All tests passed
build/test_results/ypspur_ros/roslint-ypspur_ros.xml: 1 tests
build/test_results/ypspur_ros/rostest-test_test_joint_trajectory.xml: 1 tests
build/test_results/ypspur_ros/rosunit-test_joint_trajectory.xml: 2 tests
Summary: 4 tests, 0 errors, 0 failures, 0 skipped

Copy link
Member

@at-wat at-wat left a comment

Choose a reason for hiding this comment

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

LGTM

@at-wat at-wat merged commit e3ad235 into openspur:master Mar 24, 2021
@f-fl0 f-fl0 deleted the use-tf2 branch March 24, 2021 02:02
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.

2 participants