Skip to content

Commit

Permalink
Address the comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
pifon2a committed Feb 21, 2018
1 parent 186e31e commit 40d2a9d
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 25 deletions.
2 changes: 1 addition & 1 deletion cartographer/internal/mapping/global_trajectory_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class GlobalTrajectoryBuilder : public mapping::TrajectoryBuilderInterface {
const std::string& sensor_id,
const sensor::TimedPointCloudData& timed_point_cloud_data) override {
CHECK(local_trajectory_builder_)
<< "Cannot add TimedPointCloudData without a LocalTrajectoryBuilder2D.";
<< "Cannot add TimedPointCloudData without a LocalTrajectoryBuilder.";
std::unique_ptr<typename LocalTrajectoryBuilder::MatchingResult>
matching_result = local_trajectory_builder_->AddRangeData(
timed_point_cloud_data.time,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include "cartographer/mapping/scan_matching/real_time_correlative_scan_matcher.h"

namespace cartographer {
namespace mapping {
namespace scan_matching {

proto::RealTimeCorrelativeScanMatcherOptions
CreateRealTimeCorrelativeScanMatcherOptions(
common::LuaParameterDictionary* const parameter_dictionary) {
proto::RealTimeCorrelativeScanMatcherOptions options;
options.set_linear_search_window(
parameter_dictionary->GetDouble("linear_search_window"));
options.set_angular_search_window(
parameter_dictionary->GetDouble("angular_search_window"));
options.set_translation_delta_cost_weight(
parameter_dictionary->GetDouble("translation_delta_cost_weight"));
options.set_rotation_delta_cost_weight(
parameter_dictionary->GetDouble("rotation_delta_cost_weight"));
CHECK_GE(options.translation_delta_cost_weight(), 0.);
CHECK_GE(options.rotation_delta_cost_weight(), 0.);
return options;
}

} // namespace scan_matching
} // namespace mapping
} // namespace cartographer
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

/*
* Copyright 2018 The Cartographer Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef CARTOGRAPHER_MAPPING_SCAN_MATCHING_REAL_TIME_CORRELATIVE_SCAN_MATCHER_H_
#define CARTOGRAPHER_MAPPING_SCAN_MATCHING_REAL_TIME_CORRELATIVE_SCAN_MATCHER_H_

#include "cartographer/common/lua_parameter_dictionary.h"
#include "cartographer/mapping/scan_matching/proto/real_time_correlative_scan_matcher_options.pb.h"

namespace cartographer {
namespace mapping {
namespace scan_matching {

proto::RealTimeCorrelativeScanMatcherOptions
CreateRealTimeCorrelativeScanMatcherOptions(
common::LuaParameterDictionary* const parameter_dictionary);

} // namespace scan_matching
} // namespace mapping
} // namespace cartographer

#endif // CARTOGRAPHER_MAPPING_SCAN_MATCHING_REAL_TIME_CORRELATIVE_SCAN_MATCHER_H_
2 changes: 1 addition & 1 deletion cartographer/mapping/trajectory_builder_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class TrajectoryBuilderInterface {
const sensor::LandmarkData& landmark_data) = 0;
// Allows to directly add local SLAM results to the 'PoseGraph'. Note that it
// is invalid to add local SLAM results for a trajectory that has a
// 'LocalTrajectoryBuilder2D'.
// 'LocalTrajectoryBuilder2D/3D'.
virtual void AddLocalSlamResultData(
std::unique_ptr<mapping::LocalSlamResultData> local_slam_result_data) = 0;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,6 @@ namespace cartographer {
namespace mapping {
namespace scan_matching {

proto::RealTimeCorrelativeScanMatcherOptions
CreateRealTimeCorrelativeScanMatcherOptions(
common::LuaParameterDictionary* const parameter_dictionary) {
proto::RealTimeCorrelativeScanMatcherOptions options;
options.set_linear_search_window(
parameter_dictionary->GetDouble("linear_search_window"));
options.set_angular_search_window(
parameter_dictionary->GetDouble("angular_search_window"));
options.set_translation_delta_cost_weight(
parameter_dictionary->GetDouble("translation_delta_cost_weight"));
options.set_rotation_delta_cost_weight(
parameter_dictionary->GetDouble("rotation_delta_cost_weight"));
CHECK_GE(options.translation_delta_cost_weight(), 0.);
CHECK_GE(options.rotation_delta_cost_weight(), 0.);
return options;
}

RealTimeCorrelativeScanMatcher2D::RealTimeCorrelativeScanMatcher2D(
const proto::RealTimeCorrelativeScanMatcherOptions& options)
: options_(options) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,14 @@

#include "Eigen/Core"
#include "cartographer/mapping/scan_matching/proto/real_time_correlative_scan_matcher_options.pb.h"
#include "cartographer/mapping/scan_matching/real_time_correlative_scan_matcher.h"
#include "cartographer/mapping_2d/probability_grid.h"
#include "cartographer/mapping_2d/scan_matching/correlative_scan_matcher_2d.h"

namespace cartographer {
namespace mapping {
namespace scan_matching {

proto::RealTimeCorrelativeScanMatcherOptions
CreateRealTimeCorrelativeScanMatcherOptions(
common::LuaParameterDictionary* const parameter_dictionary);

// An implementation of "Real-Time Correlative Scan Matching" by Olson.
class RealTimeCorrelativeScanMatcher2D {
public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class TranslationDeltaCostFunctor2D {
}

private:
// Constructs a new TranslationDeltaCostFunctor from the given
// Constructs a new TranslationDeltaCostFunctor2D from the given
// 'target_translation' (x, y).
explicit TranslationDeltaCostFunctor2D(
const double scaling_factor, const Eigen::Vector2d& target_translation)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "cartographer/mapping_3d/local_trajectory_builder_options_3d.h"

#include "cartographer/internal/mapping/motion_filter.h"
#include "cartographer/mapping_2d/scan_matching/real_time_correlative_scan_matcher_2d.h"
#include "cartographer/mapping/scan_matching/real_time_correlative_scan_matcher.h"
#include "cartographer/mapping_3d/scan_matching/ceres_scan_matcher.h"
#include "cartographer/mapping_3d/submap_3d.h"
#include "cartographer/sensor/voxel_filter.h"
Expand Down

0 comments on commit 40d2a9d

Please sign in to comment.