ROS2 port #48
Conversation
rhaschke
left a comment
There was a problem hiding this comment.
I cannot judge this PR. I'm not an expert for ROS 2.
I suggest to split reformatting from actual changes. Right now, it's hard to review this PR at all.
Travis is not yet succeeding.
| self.assertTrue( xml_matches(robot.to_xml_string(False),expected)) | ||
|
|
||
|
|
||
| # def test_simple_srdf(self): |
There was a problem hiding this comment.
Thanks for catching this. I restored it
| self.assertTrue(len(robot.end_effectors)==0) | ||
|
|
||
| def test_complex_srdf(self): | ||
| datadir=rospkg.RosPack().get_path('srdfdom')+"/test/resources/" |
There was a problem hiding this comment.
This file contains a lot of unnecessary reformatting.
There was a problem hiding this comment.
I believe the reformatting is necessary as it is bad style to change indentation mid file. I have refactored my changes so that the whitespace changes are in a separate commit
|
@henningkayser Please review |
I have split up the PR into separate commits for formatting and porting
This is because moveit_ci is still broken: Porting srdfdom is one step in getting moveit_ci ported to ROS2. |
I think, the only thing you need is to provide the corresponding docker container. Didn't you work on that already?
srdfdom is completely unrelated to moveit_ci. |
It is a WIP. We realized that quite a few of the dependencies (eg srdfdom) weren't building correctly so we are porting them now.
Not exactly. The travis.yml for srdfdom clones moveit_ci and runs travis.sh from that repo. Porting everything is going to be kind of a chicken and the egg problem so we choose to start with the dependencies |
|
@vmayoral Can you give this a quick review? |
There is a clear dependency chain, isn't it?
|
|
moveit_ci pulls in https://raw.githubusercontent.com/ros-planning/moveit/$ROS_DISTRO-devel/moveit.rosinstall It also tries do download the docker image for MoveIt which isn't for crystal yet. If we get the base moveit docker image building and update the rosinstall (without CI passing) then the chain will be broken and we'll be all clear to port moveit_ci |
|
What is pulled in by |
henningkayser
left a comment
There was a problem hiding this comment.
Please fix clang. Also rosdep still fails because of urdfdom_py, but I guess this will only be fixed by ros/urdf_parser_py#41
| srdf::Model s; | ||
| urdf::ModelInterfaceSharedPtr u = loadURDF(std::string(TEST_RESOURCE_LOCATION) + "/pr2_desc.urdf"); | ||
|
|
||
| std::string package_name = "srdfdom"; |
There was a problem hiding this comment.
const or constexpr char[] ?
There was a problem hiding this comment.
seems like over-optimization ;-)
There was a problem hiding this comment.
I'm with Henning. Adding a const doesn't harm and clearly states that this variable will not be modified.
| @@ -1,3 +0,0 @@ | |||
| <launch> | |||
There was a problem hiding this comment.
I understand that ros2 uses a different test approach, but is the replacement in this PR? I don't see it. If not, I think we should keep this with an in-line TODO (and maybe matching Issue).
There was a problem hiding this comment.
ros2 tests the .cpp without needing .test files
| self.assertTrue(len(robot.end_effectors)==0) | ||
|
|
||
| def test_complex_srdf(self): | ||
| datadir=rospkg.RosPack().get_path('srdfdom')+"/test/resources/" |
|
|
||
| TEST(TestCpp, testSimpleUTF) | ||
| { | ||
| testSimple("nl_NL.UTF-8"); |
| srdf::Model s; | ||
| urdf::ModelInterfaceSharedPtr u = loadURDF(std::string(TEST_RESOURCE_LOCATION) + "/pr2_desc.urdf"); | ||
|
|
||
| std::string package_name = "srdfdom"; |
There was a problem hiding this comment.
seems like over-optimization ;-)
rhaschke
left a comment
There was a problem hiding this comment.
I'm curious, how the new ROS2 approach to integration tests looks like.
The approach you took here, explicitly coding the two environment options in the cpp files, works here, but for more complex scenarios that's not a feasible approach anymore. Sometimes, we need to launch several nodes to perform an integration test...
| endif() | ||
|
|
||
| if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
| add_compile_options(-Wall -Wextra -Wpedantic) |
There was a problem hiding this comment.
These shouldn't be part of a CMakeLists file, but rather defined by the user.
| find_package(console_bridge REQUIRED) | ||
| find_package(urdfdom_headers REQUIRED) | ||
| find_package(urdf REQUIRED) | ||
| find_package(tinyxml_vendor REQUIRED) |
There was a problem hiding this comment.
What are these *_vendor packages?
You add many new find_packages, but don't use them in include_directories or target_link_libraries.
I don't think they are really needed. Please clean up if possible or better explain.
|
|
||
| before_script: | ||
| - git clone -q --depth=1 https://github.com/ros-planning/moveit_ci.git .moveit_ci | ||
| - git clone -q -b ros2 --depth=1 -b ros2 https://github.com/ros-planning/moveit_ci.git .moveit_ci |
There was a problem hiding this comment.
One --branch ros2 is sufficient 😉
|
|
||
| <build_depend>boost</build_depend> | ||
| <build_depend>cmake_modules</build_depend> | ||
| <build_depend>python_cmake_module</build_depend> |
There was a problem hiding this comment.
cmake_modules wasn't related to python in ROS1. Do you really need this package? What does it do?
| srdf::Model s; | ||
| urdf::ModelInterfaceSharedPtr u = loadURDF(std::string(TEST_RESOURCE_LOCATION) + "/pr2_desc.urdf"); | ||
|
|
||
| std::string package_name = "srdfdom"; |
There was a problem hiding this comment.
I'm with Henning. Adding a const doesn't harm and clearly states that this variable will not be modified.
This ports srdfdom to ROS2. Both python and C++ tests pass