Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

[tf2] cherry pick: Move some packages to tf2 - #752

Merged
mikeferguson merged 1 commit into
ros-planning:melodic-develfrom
moriarty:vrabaud-kinetic-tf2-math-on-melodic
Jul 14, 2018
Merged

mikeferguson merged 1 commit into
ros-planning:melodic-develfrom
moriarty:vrabaud-kinetic-tf2-math-on-melodic

Conversation

@moriarty

Copy link
Copy Markdown
Contributor

This cherry-picks commit 144cae29
#531 from @vrabaud which targeted Kinetic.

I fixed the conflicts.

Conflicts:
base_local_planner/package.xml
base_local_planner/src/trajectory_planner_ros.cpp
carrot_planner/package.xml
global_planner/src/orientation_filter.cpp

Author: Vincent Rabaud
Date: Mon Oct 24 22:08:55 2016 +0200

This cherry-picks commit 144cae29

Conflicts:
	base_local_planner/package.xml
	base_local_planner/src/trajectory_planner_ros.cpp
	carrot_planner/package.xml
	global_planner/src/orientation_filter.cpp

 Author:    Vincent Rabaud <[email protected]>
 Date:      Mon Oct 24 22:08:55 2016 +0200
@moriarty

Copy link
Copy Markdown
Contributor Author

@moriarty

Copy link
Copy Markdown
Contributor Author

It looks like #458 could similarly be cherry-picked or rebased into melodic. It was just a bigger conflict list so I didn't do it last night.

#561 (comment)

@mikeferguson

Copy link
Copy Markdown
Contributor

How have you tested this? I have yet to have a TF2 PR for the costmaps/planners that actually worked on a robot (or in sim).

@moriarty

Copy link
Copy Markdown
Contributor Author

@mikeferguson I did some basic system level testing of this indirectly by launching: https://github.com/fetchrobotics/fetch_ros/blob/melodic-devel/fetch_navigation/launch/fetch_nav.launch and giving it some nav goals... It seemed okay.

I didn't test the carrot_planner ;)

But I didn't do any side by side testing to compare the differences with and without this PR.

I'm currently cherry-picking the #458 changes and can do some more testing when done that.

@moriarty

Copy link
Copy Markdown
Contributor Author

FYI: @jcmayoral, @oscar-lima, if you have time to give this some more testing on other hardware.

@mikeferguson mikeferguson 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.

Ok -- so this just does the planners -- I can confirm that this is working for me (on simulated robot).

If I recall correctly, costmap2d is where things got wonky -- but somehow I missed that we can do these planners separately from costmap2d.

I'm gonna give this some additional comment time (til monday) before I merge.

@@ -18,6 +18,7 @@ find_package(catkin REQUIRED
rospy
std_msgs
tf

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.

shouldn't we be getting rid of this if we are moving to tf2?

@mikeferguson

Copy link
Copy Markdown
Contributor

@moriarty do you plan on having time to work on the costmap2d -> tf2 part? If not, perhaps we'll move forward with a Melodic release without that conversion having been done, and push that to N-turtle.

@mikeferguson mikeferguson added this to the Melodic Release (1.16) milestone Jul 14, 2018
@moriarty

Copy link
Copy Markdown
Contributor Author

@mikeferguson yes I have been testing this and also was trying to get @vrabaud's other branch from #458 which does the rest of the tf2 changes... I was busy on something else during the week and that's why I tagged two other ppl who I thought might be able to try it out in their labs.

I was hoping to finish this weekend, sorry for the delay, I got side tracked with two other issues... occasionally https://github.com/ros-perception/slam_karto crashes on loop closure, and the PS3 Joy isn't great at the moment.

Here is the line you mentioned above:
https://github.com/ros-planning/navigation/pull/458/files#diff-ed5ea4540bc099d8f4287c266e2ffafcL20

@mikeferguson

Copy link
Copy Markdown
Contributor

Just a note -- the crash on loop closure may not be all that new if it is intermittent...

@oscar-lima

Copy link
Copy Markdown

I confirm it works for us in real robot and simulation, but under kinetic (we do not have melodic) #531

@jcmayoral

Copy link
Copy Markdown

Sorry for the delay. I tested on simulation and works well (under kinetic).

@moriarty

Copy link
Copy Markdown
Contributor Author

screenshot from 2018-07-14 15-40-30
screenshot from 2018-07-14 15-42-59
screenshot from 2018-07-14 15-43-31
screenshot from 2018-07-14 15-43-59
screenshot from 2018-07-14 15-44-41

@moriarty

Copy link
Copy Markdown
Contributor Author

I checked this branch out and gave it some more testing on the hardware in a clean ros workspace.
Everything seemed ok- the costmap visualization depends on zooming around and pan/tilting in RViz. See screenshots

@moriarty

Copy link
Copy Markdown
Contributor Author

Ignore my above weird rviz visualization comment
screenshot from 2018-07-14 15-50-34
screenshot from 2018-07-14 15-52-09

Setting the Alpha on all maps to 0.7 and the global map "draw behind" fixed any weird visualization errors so I don't thing that is the "wonky" costmap thing you were referring to.

@mikeferguson

Copy link
Copy Markdown
Contributor

My comment about cost maps was that the costmap2d package is still using TF, having not yet been ported to TF2. I've previously worked on this a bit, but had issues trying to port it to TF2.

Thank you to all for the feedback -- I'd say this is probably the most tested PR we've had recently.

@mikeferguson
mikeferguson merged commit 96c5f9f into ros-planning:melodic-devel Jul 14, 2018
@moriarty

Copy link
Copy Markdown
Contributor Author

@mikeferguson, 👍 yes cherry-picking the other change with all the changes for melodic at the same time in my workspace led to some pain... I'll give it another shot now that this one is merged.

@moriarty

Copy link
Copy Markdown
Contributor Author

thanks @jcmayoral && @oscar-lima for testing ;) but you should upgrade to 18.04 & Melodic 😆

@mikeferguson

Copy link
Copy Markdown
Contributor

Not sure why -- but CI timed out after merging this. http://build.ros.org/job/Mdev__navigation__ubuntu_bionic_amd64/14/

I've retriggered to see if is a Jenkins thing...

@moriarty moriarty mentioned this pull request Jul 15, 2018
@moriarty

Copy link
Copy Markdown
Contributor Author

@mikeferguson I will look into it

@moriarty

moriarty commented Jul 15, 2018 •

Copy link
Copy Markdown
Contributor Author

My fault... sorry I've gotten use to tests being run on the branches of pull requests...

gtest-all.cc:(.text._ZNK7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE16GetOrCreateValueEv[_ZNK7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE16GetOrCreateValueEv]+0x88): undefined reference to `pthread_setspecific'

[build] Summary: 9 of 15 packages succeeded.                                                                                                                                                               
[build]   Ignored:   1 packages were skipped or are blacklisted.                                                                                                                                           
[build]   Warnings:  1 packages succeeded with warnings.                                                                                                                                                   
[build]   Abandoned: 5 packages were abandoned.                                                                                                                                                            
[build]   Failed:    1 packages failed.                                                                                                                                                                    
[build] Runtime: 4 minutes and 25.7 seconds total. 

With this change, 14/15 tests have passed and AMCL is still running

diff --git a/base_local_planner/CMakeLists.txt b/base_local_planner/CMakeLists.txt
index abad7e34..0b1b02fa 100644
--- a/base_local_planner/CMakeLists.txt
+++ b/base_local_planner/CMakeLists.txt
@@ -141,6 +141,8 @@ install(DIRECTORY include/${PROJECT_NAME}/
 
 if(CATKIN_ENABLE_TESTING)
   find_package(rostest)
+  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
+
   catkin_add_gtest(base_local_planner_utest
     test/gtest_main.cpp
     test/utest.cpp

moriarty added a commit to moriarty/navigation that referenced this pull request Jul 15, 2018
adds -lpthread in front of all calls to catkin_add_gtest

With this the tests all pass locally, without they can't find symbols.
Should fix why the CI timed out after merging ros-planning#752.
moriarty added a commit to moriarty/navigation that referenced this pull request Jul 15, 2018
adds -lpthread in front of all calls to catkin_add_gtest

With this the tests all pass locally, without they can't find symbols.
Should fix why the CI timed out after merging ros-planning#752.
geometry_msgs::PoseStamped new_goal = goal;
tf::Quaternion goal_quat = tf::createQuaternionFromYaw(target_yaw);
tf2::Quaternion goal_quat;
goal_quat.setEuler(target_yaw, 0, 0);

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.

This is one potential issue -- it looks like internally createQuaternionFromYaw() called setRPY(). In TF2 -- setEuler() is different from SetRPY() or SetEulerZYX() which internally calls SetRPY()

{
return tf::getYaw(pose.pose.orientation);
tf2::Quaternion q;
q.setEuler( angle, 0, 0 );

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.

again, I think this should be SetRPY possibly?

@reinzor reinzor Jul 17, 2018 •

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.

I can verify that changing q.setEuler( angle, 0, 0 ); to q.setRPY(0, 0, angle); works. This fixes #760

pose.pose.position.y = p_y;
pose.pose.position.z = 0.0;
tf2::Quaternion q;
q.setEuler(p_th, 0, 0);

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.

same note -- setRPY might be the correct thing here?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants