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

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

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
Author

Feel free to offer your comments/review @lucbettaieb

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

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

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"


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.

@@ -0,0 +1,30 @@
<?xml version="1.0"?>

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.

${SDL_INCLUDE_DIR}
${SDL_IMAGE_INCLUDE_DIRS}
${YAML_CPP_ROS2_INCLUDE_DIRS}

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>

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;

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;

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"

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.

@@ -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"?>

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

@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

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.

}
}

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

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)

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

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;

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

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(

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
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?

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
Collaborator

I approve 👍

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

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