Skip to content

Commit

Permalink
Improve portability (#1452)
Browse files Browse the repository at this point in the history
This change improves the portability of Cartographer.
  • Loading branch information
gaschler authored and wally-the-cartographer committed Oct 24, 2018
1 parent 1905b6b commit ceddabb
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,11 @@ ProbabilityGridRangeDataInserter2D::ProbabilityGridRangeDataInserter2D(
void ProbabilityGridRangeDataInserter2D::Insert(
const sensor::RangeData& range_data, GridInterface* const grid) const {
ProbabilityGrid* const probability_grid = static_cast<ProbabilityGrid*>(grid);
CHECK(probability_grid != nullptr);
// By not finishing the update after hits are inserted, we give hits priority
// (i.e. no hits will be ignored because of a miss in the same cell).
CastRays(range_data, hit_table_, miss_table_, options_.insert_free_space(),
CHECK_NOTNULL(probability_grid));
probability_grid);
probability_grid->FinishUpdate();
}

Expand Down
2 changes: 1 addition & 1 deletion cartographer/mapping/3d/range_data_inserter_3d.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ RangeDataInserter3D::RangeDataInserter3D(

void RangeDataInserter3D::Insert(const sensor::RangeData& range_data,
HybridGrid* hybrid_grid) const {
CHECK_NOTNULL(hybrid_grid);
CHECK(hybrid_grid != nullptr);

for (const sensor::RangefinderPoint& hit : range_data.returns) {
const Eigen::Array3i hit_cell = hybrid_grid->GetCellIndex(hit.position);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ bool FastCorrelativeScanMatcher2D::MatchWithSearchParameters(
const transform::Rigid2d& initial_pose_estimate,
const sensor::PointCloud& point_cloud, float min_score, float* score,
transform::Rigid2d* pose_estimate) const {
CHECK_NOTNULL(score);
CHECK_NOTNULL(pose_estimate);
CHECK(score != nullptr);
CHECK(pose_estimate != nullptr);

const Eigen::Rotation2Dd initial_rotation = initial_pose_estimate.rotation();
const sensor::PointCloud rotated_point_cloud = sensor::TransformPointCloud(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ double RealTimeCorrelativeScanMatcher2D::Match(
const transform::Rigid2d& initial_pose_estimate,
const sensor::PointCloud& point_cloud, const Grid2D& grid,
transform::Rigid2d* pose_estimate) const {
CHECK_NOTNULL(pose_estimate);
CHECK(pose_estimate != nullptr);

const Eigen::Rotation2Dd initial_rotation = initial_pose_estimate.rotation();
const sensor::PointCloud rotated_point_cloud = sensor::TransformPointCloud(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ float RealTimeCorrelativeScanMatcher3D::Match(
const transform::Rigid3d& initial_pose_estimate,
const sensor::PointCloud& point_cloud, const HybridGrid& hybrid_grid,
transform::Rigid3d* pose_estimate) const {
CHECK_NOTNULL(pose_estimate);
CHECK(pose_estimate != nullptr);
float best_score = -1.f;
for (const transform::Rigid3f& transform : GenerateExhaustiveSearchTransforms(
hybrid_grid.resolution(), point_cloud)) {
Expand Down
2 changes: 1 addition & 1 deletion cartographer/mapping/pose_extrapolator_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

#include "Eigen/Geometry"
#include "absl/memory/memory.h"
#include "cartographer/transform/rigid_transform_test_helpers.h"
#include "gtest/gtest.h"
#include "transform/rigid_transform_test_helpers.h"

namespace cartographer {
namespace mapping {
Expand Down

0 comments on commit ceddabb

Please sign in to comment.