rst-tu-dortmund / teb_local_planner

An optimal trajectory planner considering distinctive topologies for mobile robots based on Timed-Elastic-Bands (ROS Package)
http://wiki.ros.org/teb_local_planner
BSD 3-Clause "New" or "Revised" License
1.03k stars 546 forks source link

[ros2] General ros2 maintenance and Humble support #373

Open doisyg opened 2 years ago

doisyg commented 2 years ago

Hello TEB users, I did not come here for a long time, but it seems that the noetic branch have seen lots of activity (@corot , @kenomo , @siferati ). I believe there is a sync that needs to be done with the ros2-master branch, and also the ros2-master branch needs changes to work with humble (@chenjunn) , @tonynajjar). I have already a humble version that works with the last nav2 (https://github.com/rst-tu-dortmund/teb_local_planner/pull/371) plus some changes that I never pushed for dynamic footprint support (@guilyx). I am willing to contribute an push these changes in the following days. I propose that all parties interested discuss here how to get organized. Who has the maintenance rights nowadays ? I believe a first step should be to create a galactic branch from a copy of the current ros2-master. Then maybe a humble and rolling branch , or we continue to use ros2-master ?

doisyg commented 2 years ago

First PR for both humble support and sharing changes form our fork: https://github.com/rst-tu-dortmund/teb_local_planner/pull/374 Once merged (maybe in a humble branch ?), the next step is probably to review and decide to sync if needed the different noetic commits

doisyg commented 2 years ago

Updated PR (never merged) for costmap_converter: https://github.com/rst-tu-dortmund/costmap_converter/pull/27 Compiler warnings, spin_some memory leak workaround and tf2_geometry header.

davidteixeira commented 2 years ago

Hi @doisyg . I checked out your branch (great work btw, thanks) and tested it on a ROS2 docker container -- everything seems to be working as expected.

How can we move forward to make this "official"? Considering TEB is mentioned as one of the controller plugins for Nav2, I think having an up to date release would be important.

doisyg commented 2 years ago

Hi @davidteixeira, I don't really know, we need somebody with admin rights. Last time (galactic) @SteveMacenski gave us a hand for merging but we did not make an official release.

SteveMacenski commented 2 years ago

Who has the maintenance rights nowadays ? I believe a first step should be to create a galactic branch from a copy of the current ros2-master. Then maybe a humble and rolling branch , or we continue to use ros2-master ?

I was given permissions for merging PRs and making new branches, etc but I don't have the time to take on maintaining this codebase. TEB is very complex and I don't have the cycles to add something of this size to my queue. Really, at most I can be a rubber stamp if there's a trusted agent with a well tested PR, but if major changes are made and stuff breaks, I'm not going to really be able to do anything about it.

I have made a galactic branch and the new ros2-master is targeting the API breaking changes for Humble++.

I don't have rights over costmap converter though :frowning:

corot commented 2 years ago

Hello, has there been any progress regarding this? I would like to use TEB with humble on Ubuntu 22.04, currently I'm having errors when building from source in galactic branch.

I recently run TEB with Humble w/o problems. Please ensure that you are using latest ros2-master branch, as we have recently merged PR #371 that fixes compilation issues

doisyg commented 2 years ago

Additional, this more complete PR is ready and is going to be merged soon: https://github.com/rst-tu-dortmund/teb_local_planner/pull/374

doisyg commented 2 years ago

TEB and nav2 are working well together under ros2 Humble (ros2-master branch that you have to compile from source). That was the point of this recent PR: https://github.com/rst-tu-dortmund/teb_local_planner/pull/374

There is not provided launch files for the ROS2 Humble versions and the readme is outdated.

tonynajjar commented 1 year ago

I'm trying to build teb_local_planner from source on Nvidia Xavier Humble (it's Ubuntu 18 but that should not be causing my problem). I cannot install libg2o (ros-humble-libg2o) from apt so I need to build it from source, which I do successfully:

root@ebdb5db27d4e:/code/ros2_ws# colcon build --packages-select libg2o
Starting >>> libg2o  
Finished <<< libg2o [1.11s]  

it's this tag (release/humble/libg2o/2020.5.29-4), which I believe is the right one as it is the one installed via apt on Ubuntu 20.

My problem is that when building teb_local_planner, I get:

root@ebdb5db27d4e:~# colcon build --packages-select teb_local_planner --cmake-force-configure --event-handlers console_direct+
Starting >>> teb_local_planner
-- Found ament_cmake: 1.3.2 (/opt/ros/humble/install/share/ament_cmake/cmake)
-- Override CMake install command with custom implementation using symlinks instead of copying resources
-- Found costmap_converter: 0.1.2 (/code/ros2_ws/install/costmap_converter/share/costmap_converter/cmake)
-- Found rosidl_generator_c: 3.1.3 (/opt/ros/humble/install/share/rosidl_generator_c/cmake)
-- Found rosidl_adapter: 3.1.3 (/opt/ros/humble/install/share/rosidl_adapter/cmake)
-- Found rosidl_generator_cpp: 3.1.3 (/opt/ros/humble/install/share/rosidl_generator_cpp/cmake)
-- Using all available rosidl_typesupport_c: rosidl_typesupport_fastrtps_c;rosidl_typesupport_introspection_c
-- Using all available rosidl_typesupport_cpp: rosidl_typesupport_fastrtps_cpp;rosidl_typesupport_introspection_cpp
-- Found rmw_implementation_cmake: 6.1.0 (/opt/ros/humble/install/share/rmw_implementation_cmake/cmake)
-- Found rmw_cyclonedds_cpp: 1.3.3 (/opt/ros/humble/install/share/rmw_cyclonedds_cpp/cmake)
-- Using RMW implementation 'rmw_cyclonedds_cpp' as default
-- Ensuring Eigen3 include directory is part of orocos-kdl CMake target
-- Found dwb_critics: 1.1.2 (/code/ros2_ws/install/dwb_critics/share/dwb_critics/cmake)
-- Found teb_msgs: 0.0.1 (/code/ros2_ws/install/teb_msgs/share/teb_msgs/cmake)
-- Found tf2_eigen: 0.25.1 (/opt/ros/humble/install/share/tf2_eigen/cmake)
-- System: Linux-5.15.0-1022-aws
-- /opt/ros/humble/install/share/tinyxml2_vendor/cmake/Modules;/opt/ros/humble/install/share/eigen3_cmake_module/cmake/Modules;/opt/ros/humble/install/share/fastrtps_cmake_module/cmake/Modules;/code/ros2_ws/src/teb_local_planner/teb_local_planner/cmake_modules
-- Found SuiteSparse
-- Searching for g2o ...
-- Found g2o headers in: /code/ros2_ws/install/libg2o/include/g2o
-- Found libg2o: /code/ros2_ws/install/libg2o/lib/libg2o_csparse_extension.so;/code/ros2_ws/install/libg2o/lib/libg2o_core.so;/code/ros2_ws/install/libg2o/lib/libg2o_stuff.so;/code/ros2_ws/install/libg2o/lib/libg2o_types_slam2d.so;/code/ros2_ws/install/libg2o/lib/libg2o_types_slam3d.so;/code/ros2_ws/install/libg2o/lib/libg2o_solver_cholmod.so;/code/ros2_ws/install/libg2o/lib/libg2o_solver_pcg.so;/code/ros2_ws/install/libg2o/lib/libg2o_solver_csparse.so;/code/ros2_ws/install/libg2o/lib/libg2o_incremental.so
[Processing: teb_local_planner]                         
-- Found ament_cmake_gtest: 1.3.2 (/opt/ros/humble/install/share/ament_cmake_gtest/cmake)
-- Configuring done                                     
-- Generating done                                      
-- Build files have been written to: /code/ros2_ws/build/teb_local_planner
Consolidate compiler generated dependencies of target teb_local_planner
[ 20%] Building CXX object CMakeFiles/teb_local_planner.dir/src/optimal_planner.cpp.o
[ 20%] Building CXX object CMakeFiles/teb_local_planner.dir/src/timed_elastic_band.cpp.o
[ 50%] Building CXX object CMakeFiles/teb_local_planner.dir/src/visualization.cpp.o
[ 50%] Building CXX object CMakeFiles/teb_local_planner.dir/src/recovery_behaviors.cpp.o
[ 60%] Building CXX object CMakeFiles/teb_local_planner.dir/src/teb_config.cpp.o
[ 60%] Building CXX object CMakeFiles/teb_local_planner.dir/src/homotopy_class_planner.cpp.o
[ 70%] Building CXX object CMakeFiles/teb_local_planner.dir/src/teb_local_planner_ros.cpp.o
[ 80%] Building CXX object CMakeFiles/teb_local_planner.dir/src/graph_search.cpp.o
In file included from /code/ros2_ws/src/teb_local_planner/teb_local_planner/include/teb_local_planner/robot_footprint_model.h:43,
                 from /code/ros2_ws/src/teb_local_planner/teb_local_planner/include/teb_local_planner/teb_config.h:48,
                 from /code/ros2_ws/src/teb_local_planner/teb_local_planner/src/teb_config.cpp:39:
/code/ros2_ws/src/teb_local_planner/teb_local_planner/include/teb_local_planner/pose_se2.h:42:10: fatal error: g2o/stuff/misc.h: No such file or directory
   42 | #include <g2o/stuff/misc.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from /code/ros2_ws/src/teb_local_planner/teb_local_planner/include/teb_local_planner/robot_footprint_model.h:43,
                 from /code/ros2_ws/src/teb_local_planner/teb_local_planner/include/teb_local_planner/teb_config.h:48,
                 from /code/ros2_ws/src/teb_local_planner/teb_local_planner/include/teb_local_planner/visualization.h:45,
                 from /code/ros2_ws/src/teb_local_planner/teb_local_planner/src/visualization.cpp:40:
/code/ros2_ws/src/teb_local_planner/teb_local_planner/include/teb_local_planner/pose_se2.h:42:10: fatal error: g2o/stuff/misc.h: No such file or directory
   42 | #include <g2o/stuff/misc.h>
      |          ^~~~~~~~~~~~~~~~~~

Any help would be appreciated.

SteveMacenski commented 1 year ago

https://github.com/ros/rosdistro/blob/master/humble/distribution.yaml#L2097 this is the version in rosdep, you might want to see if those are the same.

tonynajjar commented 1 year ago

it is indeed:

root@ebdb5db27d4e:/opt/ros/humble/src/libg2o# git status
HEAD detached at release/humble/libg2o/2020.5.29-4

I also edited the building logs in my first post (added some debug) to show that libg2o was in fact found:

-- Found g2o headers in: /code/ros2_ws/install/libg2o/include/g2o
-- Found libg2o: /code/ros2_ws/install/libg2o/lib/libg2o_csparse_extension.so;/code/ros2_ws/install/libg2o/lib/libg2o_core.so;/code/ros2_ws/install/libg2o/lib/libg2o_stuff.so;/code/ros2_ws/install/libg2o/lib/libg2o_types_slam2d.so;/code/ros2_ws/install/libg2o/lib/libg2o_types_slam3d.so;/code/ros2_ws/install/libg2o/lib/libg2o_solver_cholmod.so;/code/ros2_ws/install/libg2o/lib/libg2o_solver_pcg.so;/code/ros2_ws/install/libg2o/lib/libg2o_solver_csparse.so;/code/ros2_ws/install/libg2o/lib/libg2o_incremental.so

This question might be related but I'm really a noob when it comes to cmake

SteveMacenski commented 1 year ago

If you look at your install, can you find that header?

tonynajjar commented 1 year ago
root@ebdb5db27d4e:/code/ros2_ws# ls install/libg2o/include/g2o/stuff/
color_macros.h  filesys_tools.h  macros.h  opengl_primitives.h  os_specific.h  sampler.h        string_tools.h  timeutil.h     unscented.h
command_args.h  g2o_stuff_api.h  misc.h    opengl_wrapper.h     property.h     sparse_helper.h  tictoc.h        tuple_tools.h

you're referring to the header from the error right? -> misc.h. If so then yes it's there

SteveMacenski commented 1 year ago

Is that simply the first header in the files that its complaining about from g2o? Maybe it has nothing to do with that file, but just finding any file in g2o.

(This is me just going through what I would do if I ran into this issue, this isn't any specific insight about g2o, don't mean to state the obvious)

tonynajjar commented 1 year ago

Maybe it has nothing to do with that file, but just finding any file in g2o.

Yes I think this was the problem. I built and installed g2o with make install instead of colcon and now it works. I still don't know what's the difference though, I didn't pass any extra arguments to the make workflow.