Follow googlecartographer/cartographer#326. (#370)
parent
6658cffa20
commit
8d8cc09f80
|
@ -16,6 +16,8 @@
|
|||
|
||||
#include "cartographer_ros/occupancy_grid.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "cartographer/common/time.h"
|
||||
#include "cartographer/sensor/range_data.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
@ -25,18 +27,19 @@ namespace cartographer_ros {
|
|||
namespace {
|
||||
|
||||
TEST(OccupancyGridTest, ComputeMapLimits) {
|
||||
using ::cartographer::mapping::TrajectoryNode;
|
||||
constexpr int kTrajectoryId = 0;
|
||||
const ::cartographer::mapping::TrajectoryNode::ConstantData constant_data{
|
||||
::cartographer::common::FromUniversal(52),
|
||||
::cartographer::sensor::RangeData{
|
||||
Eigen::Vector3f::Zero(),
|
||||
{Eigen::Vector3f(-30.f, 1.f, 0.f), Eigen::Vector3f(50.f, -10.f, 0.f)},
|
||||
{}},
|
||||
::cartographer::sensor::Compress(
|
||||
::cartographer::sensor::RangeData{Eigen::Vector3f::Zero(), {}, {}}),
|
||||
kTrajectoryId, ::cartographer::transform::Rigid3d::Identity()};
|
||||
const ::cartographer::mapping::TrajectoryNode trajectory_node{
|
||||
&constant_data, ::cartographer::transform::Rigid3d::Identity()};
|
||||
const TrajectoryNode trajectory_node{
|
||||
std::make_shared<TrajectoryNode::Data>(TrajectoryNode::Data{
|
||||
::cartographer::common::FromUniversal(52),
|
||||
::cartographer::sensor::RangeData{Eigen::Vector3f::Zero(),
|
||||
{Eigen::Vector3f(-30.f, 1.f, 0.f),
|
||||
Eigen::Vector3f(50.f, -10.f, 0.f)},
|
||||
{}},
|
||||
::cartographer::sensor::Compress(::cartographer::sensor::RangeData{
|
||||
Eigen::Vector3f::Zero(), {}, {}}),
|
||||
kTrajectoryId, ::cartographer::transform::Rigid3d::Identity()}),
|
||||
::cartographer::transform::Rigid3d::Identity()};
|
||||
constexpr double kResolution = 0.05;
|
||||
const ::cartographer::mapping_2d::MapLimits limits =
|
||||
ComputeMapLimits(kResolution, {trajectory_node});
|
||||
|
|
Loading…
Reference in New Issue