Refactored Map Server#31
Conversation
|
Mind if I give this a review, too? @bpwilcox |
|
Feel free to offer your comments/review @lucbettaieb |
mkhansenbot
left a comment
There was a problem hiding this comment.
@bpwilcox - a few comments. I haven't done a full review yet though. First, unless this has a dependency on the code in the ros2_devel branch, it should be a PR to the master branch. I don't think this has such a dependency.
Second, for code we have ported, if we started with the ROS file, we need to keep the copyright and license in the header. For the others we need to add our copyright and Apache 2.0 license info. Let me know if you want help with that. Otherwise please make those changes and submit the PR to the master branch.
Thanks, Matt
| @@ -0,0 +1,37 @@ | |||
| #ifndef MAP_SERVER_BASE_MAP_LOADER_H | |||
There was a problem hiding this comment.
Please run cpplint and uncrustify on all of the source files (a requirement for integration of a PR).
| @@ -0,0 +1,37 @@ | |||
| #ifndef MAP_SERVER_BASE_MAP_LOADER_H | |||
There was a problem hiding this comment.
You'll have to make some changes to accomodate the new directory structure. For example, map_server becomes nav2_map_server, affecting include directories, header macro guards, etc.
| #include <fstream> | ||
| #include "rclcpp/rclcpp.hpp" | ||
|
|
||
|
|
There was a problem hiding this comment.
Please remove extra whitespace. See other source files for example source formatting.
src/map_server/package.xml
Outdated
| @@ -0,0 +1,30 @@ | |||
| <?xml version="1.0"?> | |||
There was a problem hiding this comment.
We're using two space indentation on package.xml and CMakeLists.txt files too.
src/map_server/CMakeLists.txt
Outdated
| ${SDL_INCLUDE_DIR} | ||
| ${SDL_IMAGE_INCLUDE_DIRS} | ||
| ${YAML_CPP_ROS2_INCLUDE_DIRS} | ||
|
|
There was a problem hiding this comment.
Remove extra lines in this file (and similar files).
| #include <grid_map_msgs/GridMap.h> | ||
| #include <grid_map_ros/grid_map_ros.hpp> | ||
| #include <grid_map_cv/grid_map_cv.hpp> | ||
| #include <cv_bridge/cv_bridge.h> |
There was a problem hiding this comment.
There seem to be several headers included that aren't required by the definition of this interface. Only include header files required by the interface. The implementation file can include additional headers, if required by the implementation.
| { | ||
| public: | ||
| GridMap gridMap; | ||
| grid_map_msgs::GridMap map_msg; |
| GridMap gridMap; | ||
| grid_map_msgs::GridMap map_msg; | ||
|
|
||
| cv::Mat MapImage; |
| // Add headers for any used map packages | ||
|
|
||
| #include "map_server/map_reps/occupancy_grid.h" | ||
| //#include "map_server/map_reps/gridmap.h" |
src/map_server/package.xml
Outdated
| @@ -0,0 +1,30 @@ | |||
| <?xml version="1.0"?> | |||
| <?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | |||
There was a problem hiding this comment.
Please follow the formatting conventions for the CMakeLists.txt files (see other examples in the source tree).
mjeronimo
left a comment
There was a problem hiding this comment.
Please address all cpplint, uncrustify, and other formatting issues. Also, accomodate the new directory organization and related naming conventions. Remove dead code and extra lines/whitespace.
|
Not to bring up an age old debate, but it looks like when you addressed the whitespace and formatting in 1f16881 maybe you ran an auto-format tool and there are some oddities... Unless ROS2 is using a different style guide than ROS1, you've gone from spaces to tabs, and all/most of the |
| } | ||
| } | ||
|
|
||
| void OccGridLoader::loadMapFromFile(std::string mapfname) |
There was a problem hiding this comment.
Should this function be instead on the utils folder?
On the planner_tester, I also have code for reading an image file and generating an occupancy grid msg.
nav_msgs::msg::OccupancyGrid loadMapFromFile(
const std::string image_file_name, const double resolution, const bool negate,
const double occupancy_threshold, const double free_threshold, const geometry_msgs::msg::Twist origin,
const MapMode mode)There was a problem hiding this comment.
Yes, we should be on the lookout for utility code to factor it out into a utility library.
| find_package(Bullet REQUIRED) | ||
| find_package(SDL REQUIRED) | ||
| find_package(SDL_image REQUIRED) | ||
| #find_package(yaml-cpp REQUIRED) |
| add_library(map_reps | ||
| src/map_reps/occupancy_grid.cpp | ||
| src/map_reps/map_loader.cpp | ||
| #src/map_reps/gridmap.cpp |
| class BaseMapLoader | ||
| { | ||
| public: | ||
| std::string fname; |
There was a problem hiding this comment.
Do these need to be public? Also, do they need to be in the abstract base class. I'd rather see a set of virtual methods and a virtual destructor (only).
|
|
||
| // Occupancy Grid Specific // | ||
|
|
||
| OccGridLoader() {} |
There was a problem hiding this comment.
By convention, I'd put constructors and destructors first in the class definition. The logical flow is that someone needs to first know how to create one of the objects, and then would be interested in the methods it provides.
|
|
||
| ~OccGridLoader() {} | ||
|
|
||
| void OccMapCallback( |
There was a problem hiding this comment.
Does the callback work when it is private?
This file is unused / hasn't been ported to ROS2 yet
* adding map_server tests & starting port of costmap_2d package * adding integration test node * + integration tests * ++ integration test * create branch for tests
…nd server class, fixed yaml-cpp path, throwing exceptions up from yaml parser, cleaned cmakelist, added gtest assert throws, fixes naming conventions, added namespace
…Map, adhered to project cmakelist style and build_test, deleted unused packages
…int tests, uncrustify, etc.
afd2def to
2ade04e
Compare
|
I approve 👍 @mjeronimo - were their any further changes you were requesting or can you change your status to approved also? |
|
Squashing and merging map_server |
…t_configurable_timeout Backport configurable service BT wait timeout
* Adding disengagement threshold to rotation shim controller (backport ros-navigation#4699) (ros-navigation#4702) * Adding disengagement threshold to rotation shim controller (ros-navigation#4699) * adding disengagement threshold to rotation shim controller Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> * change default to 22.5 deg Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> --------- Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> (cherry picked from commit fc7e086) * Update nav2_rotation_shim_controller/src/nav2_rotation_shim_controller.cpp Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> --------- Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> Co-authored-by: Steve Macenski <stevenmacenski@gmail.com> * fix(nav2_theta_star_planner) Fix crash on Humble when goal is outside map bounds (ros-navigation#4706) * Humble sync 13: Nov 8, 2024 (ros-navigation#4748) * [DWB] Option to limit velocity commands in trajectory generator (ros-navigation#4663) * Option to limit vel cmd through traj generator Signed-off-by: huiyulhy <lhyleonghuiyu@gmail.com> * Cleanup Signed-off-by: huiyulhy <lhyleonghuiyu@gmail.com> * fix linting Signed-off-by: huiyulhy <lhyleonghuiyu@gmail.com> * Update linting Signed-off-by: huiyulhy <lhyleonghuiyu@gmail.com> * uncrustify Signed-off-by: huiyulhy <lhyleonghuiyu@gmail.com> * uncrustify Signed-off-by: huiyulhy <lhyleonghuiyu@gmail.com> --------- Signed-off-by: huiyulhy <lhyleonghuiyu@gmail.com> * fix to bt action server logging before bt execution result being ready (ros-navigation#4677) Signed-off-by: DreamWest <sirjamestsao@gmail.com> * fix(simple-action-server): info log instead of warn on cancel (ros-navigation#4684) Cancelling a goal is nominal behavior and therefore it should not log warning. Signed-off-by: Rein Appeldoorn <rein.appeldoorn@nobleo.nl> * [RotationShimController] fix: rotate to goal heading (ros-navigation#4724) Add frame_id to goal when rotating towards goal heading, otherwise the transform would fail. This bug was introduced in 30e2cde by not setting the frame_id. Signed-off-by: agennart <antoine.gennart@quimesis.be> Co-authored-by: agennart <antoine.gennart@quimesis.be> * Fix incorrect doxygen comment (ros-navigation#4741) Signed-off-by: Ryan Friedman <25047695+Ryanf55@users.noreply.github.com> * [map_io] Replace std logs by rclcpp logs (ros-navigation#4720) * replace std logs by rclcpp logs Signed-off-by: Guillaume Doisy <guillaume@dexory.com> * RCLCPP_DEBUG to RCLCPP_INFO for visibility Signed-off-by: Guillaume Doisy <guillaume@dexory.com> --------- Signed-off-by: Guillaume Doisy <guillaume@dexory.com> Co-authored-by: Guillaume Doisy <guillaume@dexory.com> * bump to 1.1.17 for humble sync Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> --------- Signed-off-by: huiyulhy <lhyleonghuiyu@gmail.com> Signed-off-by: DreamWest <sirjamestsao@gmail.com> Signed-off-by: Rein Appeldoorn <rein.appeldoorn@nobleo.nl> Signed-off-by: agennart <antoine.gennart@quimesis.be> Signed-off-by: Ryan Friedman <25047695+Ryanf55@users.noreply.github.com> Signed-off-by: Guillaume Doisy <guillaume@dexory.com> Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> Co-authored-by: Huiyu Leong <26198479+huiyulhy@users.noreply.github.com> Co-authored-by: DreamWest <sirjamestsao@gmail.com> Co-authored-by: Rein Appeldoorn <rein.appeldoorn@nobleo.nl> Co-authored-by: Saitama <gennartan@users.noreply.github.com> Co-authored-by: agennart <antoine.gennart@quimesis.be> Co-authored-by: Ryan <25047695+Ryanf55@users.noreply.github.com> Co-authored-by: Guillaume Doisy <doisyg@users.noreply.github.com> Co-authored-by: Guillaume Doisy <guillaume@dexory.com> --------- Signed-off-by: Steve Macenski <stevenmacenski@gmail.com> Signed-off-by: huiyulhy <lhyleonghuiyu@gmail.com> Signed-off-by: DreamWest <sirjamestsao@gmail.com> Signed-off-by: Rein Appeldoorn <rein.appeldoorn@nobleo.nl> Signed-off-by: agennart <antoine.gennart@quimesis.be> Signed-off-by: Ryan Friedman <25047695+Ryanf55@users.noreply.github.com> Signed-off-by: Guillaume Doisy <guillaume@dexory.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Steve Macenski <stevenmacenski@gmail.com> Co-authored-by: brayanpa <brayanspallares@gmail.com> Co-authored-by: Huiyu Leong <26198479+huiyulhy@users.noreply.github.com> Co-authored-by: DreamWest <sirjamestsao@gmail.com> Co-authored-by: Rein Appeldoorn <rein.appeldoorn@nobleo.nl> Co-authored-by: Saitama <gennartan@users.noreply.github.com> Co-authored-by: agennart <antoine.gennart@quimesis.be> Co-authored-by: Ryan <25047695+Ryanf55@users.noreply.github.com> Co-authored-by: Guillaume Doisy <doisyg@users.noreply.github.com> Co-authored-by: Guillaume Doisy <guillaume@dexory.com>
* added parameters and initial layout * update page name Co-authored-by: Steve Macenski <stevenmacenski@gmail.com> * split parameters into multiple files * some formatting fixes * more formatting fixes * added some descriptions * fixed RotateToGoalCritic params namespaces * Update configuration/packages/dwb-params/controller.rst Co-authored-by: Steve Macenski <stevenmacenski@gmail.com> * Fixed namings * removed tunable parameters table * fixed formatting error Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>
This is a refactored map server from ROS Navigation. It provides machinery for an extensible framework for loading map files into available map representations (currently just nav_msgs/msg/OccupancyGrid) and provide as services/topics.