Skip to content

Refactored Map Server#31

Merged
mkhansenbot merged 36 commits intoros-navigation:masterfrom
bpwilcox:map_server-devel
Sep 21, 2018
Merged

Refactored Map Server#31
mkhansenbot merged 36 commits intoros-navigation:masterfrom
bpwilcox:map_server-devel

Conversation

@bpwilcox
Copy link
Copy Markdown

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.

@bpwilcox bpwilcox requested review from a user, mhpanah, mjeronimo, mkhansenbot and orduno August 24, 2018 23:12
@lucbettaieb
Copy link
Copy Markdown

lucbettaieb commented Aug 28, 2018

Mind if I give this a review, too? @bpwilcox
No worries if you'd rather not have the potential extra noise.

@bpwilcox
Copy link
Copy Markdown
Author

Feel free to offer your comments/review @lucbettaieb

Copy link
Copy Markdown
Collaborator

@mkhansenbot mkhansenbot left a comment

Choose a reason for hiding this comment

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

@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
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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"


Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please remove extra whitespace. See other source files for example source formatting.

Comment thread src/map_server/package.xml Outdated
@@ -0,0 +1,30 @@
<?xml version="1.0"?>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We're using two space indentation on package.xml and CMakeLists.txt files too.

Comment thread src/map_server/CMakeLists.txt Outdated
Comment thread src/map_server/CMakeLists.txt Outdated
${SDL_INCLUDE_DIR}
${SDL_IMAGE_INCLUDE_DIRS}
${YAML_CPP_ROS2_INCLUDE_DIRS}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why is this public?

GridMap gridMap;
grid_map_msgs::GridMap map_msg;

cv::Mat MapImage;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why is MapImage public?

// Add headers for any used map packages

#include "map_server/map_reps/occupancy_grid.h"
//#include "map_server/map_reps/gridmap.h"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should remove commented-out code.

Comment thread 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"?>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please follow the formatting conventions for the CMakeLists.txt files (see other examples in the source tree).

Copy link
Copy Markdown

@mjeronimo mjeronimo left a comment

Choose a reason for hiding this comment

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

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.

@moriarty
Copy link
Copy Markdown

moriarty commented Sep 2, 2018

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 * and & were moved from Type& variable_name --> Type &variable_name.

Comment thread src/mapping/nav2_map_server/src/map_reps/occupancy_grid.cpp Outdated
}
}

void OccGridLoader::loadMapFromFile(std::string mapfname)
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.

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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Yes, we should be on the lookout for utility code to factor it out into a utility library.

@bpwilcox bpwilcox changed the base branch from ros2_devel to master September 5, 2018 16:39
find_package(Bullet REQUIRED)
find_package(SDL REQUIRED)
find_package(SDL_image REQUIRED)
#find_package(yaml-cpp REQUIRED)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remove commented-out lines

add_library(map_reps
src/map_reps/occupancy_grid.cpp
src/map_reps/map_loader.cpp
#src/map_reps/gridmap.cpp
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remove commented-out lines

class BaseMapLoader
{
public:
std::string fname;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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() {}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should be private (or protected).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does the callback work when it is private?

Comment thread src/mapping/nav2_map_server/package.xml Outdated
Brian added 17 commits September 20, 2018 11:14
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
@mkhansenbot
Copy link
Copy Markdown
Collaborator

I approve 👍

@mjeronimo - were their any further changes you were requesting or can you change your status to approved also?

@mkhansenbot
Copy link
Copy Markdown
Collaborator

Squashing and merging map_server

@mkhansenbot mkhansenbot merged commit e57809b into ros-navigation:master Sep 21, 2018
ghost referenced this pull request in logivations/navigation2 Mar 7, 2022
doisyg pushed a commit to doisyg/navigation2 that referenced this pull request Apr 30, 2024
…t_configurable_timeout

Backport configurable service BT wait timeout
turtlewizard73 pushed a commit to turtlewizard73/navigation2 that referenced this pull request Dec 14, 2024
* 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 <[email protected]>

* change default to 22.5 deg

Signed-off-by: Steve Macenski <[email protected]>

---------

Signed-off-by: Steve Macenski <[email protected]>
(cherry picked from commit fc7e086)

* Update nav2_rotation_shim_controller/src/nav2_rotation_shim_controller.cpp

Signed-off-by: Steve Macenski <[email protected]>

---------

Signed-off-by: Steve Macenski <[email protected]>
Co-authored-by: Steve Macenski <[email protected]>

* 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 <[email protected]>

* Cleanup

Signed-off-by: huiyulhy <[email protected]>

* fix linting

Signed-off-by: huiyulhy <[email protected]>

* Update linting

Signed-off-by: huiyulhy <[email protected]>

* uncrustify

Signed-off-by: huiyulhy <[email protected]>

* uncrustify

Signed-off-by: huiyulhy <[email protected]>

---------

Signed-off-by: huiyulhy <[email protected]>

* fix to bt action server logging before bt execution result being ready (ros-navigation#4677)

Signed-off-by: DreamWest <[email protected]>

* 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 <[email protected]>

* [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 <[email protected]>
Co-authored-by: agennart <[email protected]>

* Fix incorrect doxygen comment (ros-navigation#4741)

Signed-off-by: Ryan Friedman <[email protected]>

* [map_io] Replace std logs by rclcpp logs (ros-navigation#4720)

* replace std logs by rclcpp logs

Signed-off-by: Guillaume Doisy <[email protected]>

* RCLCPP_DEBUG to RCLCPP_INFO for visibility

Signed-off-by: Guillaume Doisy <[email protected]>

---------

Signed-off-by: Guillaume Doisy <[email protected]>
Co-authored-by: Guillaume Doisy <[email protected]>

* bump to 1.1.17 for humble sync

Signed-off-by: Steve Macenski <[email protected]>

---------

Signed-off-by: huiyulhy <[email protected]>
Signed-off-by: DreamWest <[email protected]>
Signed-off-by: Rein Appeldoorn <[email protected]>
Signed-off-by: agennart <[email protected]>
Signed-off-by: Ryan Friedman <[email protected]>
Signed-off-by: Guillaume Doisy <[email protected]>
Signed-off-by: Steve Macenski <[email protected]>
Co-authored-by: Huiyu Leong <[email protected]>
Co-authored-by: DreamWest <[email protected]>
Co-authored-by: Rein Appeldoorn <[email protected]>
Co-authored-by: Saitama <[email protected]>
Co-authored-by: agennart <[email protected]>
Co-authored-by: Ryan <[email protected]>
Co-authored-by: Guillaume Doisy <[email protected]>
Co-authored-by: Guillaume Doisy <[email protected]>

---------

Signed-off-by: Steve Macenski <[email protected]>
Signed-off-by: huiyulhy <[email protected]>
Signed-off-by: DreamWest <[email protected]>
Signed-off-by: Rein Appeldoorn <[email protected]>
Signed-off-by: agennart <[email protected]>
Signed-off-by: Ryan Friedman <[email protected]>
Signed-off-by: Guillaume Doisy <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Steve Macenski <[email protected]>
Co-authored-by: brayanpa <[email protected]>
Co-authored-by: Huiyu Leong <[email protected]>
Co-authored-by: DreamWest <[email protected]>
Co-authored-by: Rein Appeldoorn <[email protected]>
Co-authored-by: Saitama <[email protected]>
Co-authored-by: agennart <[email protected]>
Co-authored-by: Ryan <[email protected]>
Co-authored-by: Guillaume Doisy <[email protected]>
Co-authored-by: Guillaume Doisy <[email protected]>
mini-1235 pushed a commit to mini-1235/navigation2 that referenced this pull request Feb 5, 2025
* added parameters and initial layout

* update page name

Co-authored-by: Steve Macenski <[email protected]>

* 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 <[email protected]>

* Fixed namings

* removed tunable parameters table

* fixed formatting error

Co-authored-by: Steve Macenski <[email protected]>
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.

6 participants