Commit Graph

571 Commits (e89625d36aebaf427d9d633c117d7a5d20e2ef14)

Author SHA1 Message Date
Juraj Oršulić 32b8bd3581 Enable loading unfrozen state (#891)
Enable loading unfrozen state
2018-02-27 20:38:57 +01:00
Alexander Belyaev 29875117b3
Move internal/mapping to mapping/internal. (#941) 2018-02-27 16:25:53 +01:00
gaschler 63fd497e0f Document HybridGrid limits. (#939)
Adds documentation to avoid issue #937.
2018-02-27 15:28:35 +01:00
gaschler f606d4b91c Gracefully handle time-overlapping point clouds. (#936)
Per-point relative times are usually computed by multiplying
a per-point time increment by the number of points.
So it is not uncommon for consecutive point clouds of a single
sensor to overlap in time.
When this happens, we act as if no backward jump in time happened
and warn once per input point cloud.

FIXES=#912
2018-02-26 18:38:00 +01:00
Alexander Belyaev 3ebfa757ef
Move mapping_*d to mapping/*d. (#935)
[Code structure RFC](https://github.com/googlecartographer/rfcs/blob/master/text/0016-code-structure.md)
2018-02-26 17:40:29 +01:00
Alexander Belyaev e75e023ce2
Purge 'mapping_3d::'. (#927) (#928)
[Code structure RFC](https://github.com/googlecartographer/rfcs/blob/master/text/0016-code-structure.md)
2018-02-26 14:26:41 +01:00
danielsievers 258aa715ba Move GetTrajectoryData() down to PoseGraphInterface (#932) 2018-02-26 12:45:53 +01:00
Michael Grupp 90994464a5 Check ifstream::good() in proto_stream.cc (#929)
Check for basic stream errors before doing more involved read actions.
The log message in this case is also more descriptive than
`Check failed: reader->ReadProto(&pose_graph)`.
2018-02-22 16:21:15 +01:00
Alexander Belyaev 94fce13f62
Purge 'mapping_2d::'. (#927)
[Code structure RFC](e11bca586f/text/0000-code-structure.md)
2018-02-21 19:44:53 +01:00
gaschler 30114e364a Instrument metrics in constraint builders. (#921)
RFC=[0014](https://github.com/googlecartographer/rfcs/blob/master/text/0014-monitoring.md)
2018-02-21 17:31:11 +01:00
gaschler 2711f4492f Test PoseExtrapolator (#926) 2018-02-21 16:43:58 +01:00
Alexander Belyaev 7d13383dec
Remove 'mapping_3d' namespace. (#922) (#925)
Remove 'mapping_3d' namespace. (#922)

It is removed from everywhere but 'scan_matching', 'pose_graph'
subfolders of 'mapping_3d'.

[Code structure RFC](e11bca586f/text/0000-code-structure.md)
2018-02-21 14:24:12 +01:00
Alexander Belyaev f8dc89d8ff
Remove 'mapping_2d' namespace. (#922)
It is removed from everywhere but 'scan_matching', 'pose_graph'
subfolders of 'mapping_2d'.

[Code structure RFC](e11bca586f/text/0000-code-structure.md)
2018-02-21 12:41:14 +01:00
Alexander Belyaev 96d5e2819c
Move implementation of ProbabilityGrid to .cc file. (#924) 2018-02-21 09:55:40 +01:00
gaschler ab05459f1c Move GlobalTrajectoryBuilder to cc file (#923)
* Move GlobalTrajectoryBuilder to cc file.

This allows to instrument file-level static metrics.
Also, it is a cleaner interface.

* two create functions

* drop superfluous typename
2018-02-21 08:53:09 +01:00
Alexander Belyaev a58866cb38
Rename mapping_3d::PoseGraph to mapping::PoseGraph3D. (#918)
[Code structure RFC](e11bca586f/text/0000-code-structure.md)
2018-02-20 15:28:21 +01:00
Alexander Belyaev 43544f0fbc
Rename mapping_2d::PoseGraph to mapping::PoseGraph2D. (#917)
[rCode structure RFC](e11bca586f/text/0000-code-structure.md)
2018-02-19 20:01:29 +01:00
danielsievers c38bb60407 (De)serialize trajectory data from the optimization problem (#915)
* Write/Read the trajectory data (gravity, imu calibration, and fixed frame origin) into the serialized state proto
2018-02-19 16:30:32 +01:00
gaschler 64bc194609 Introduce interfaces for metrics (#907)
Adds interfaces for metrics and metrics families.
Adds creation of null (noop) metrics.
Declares global register function.

RFC=[0014](https://github.com/googlecartographer/rfcs/blob/master/text/0014-monitoring.md)
2018-02-19 14:02:54 +01:00
Juraj Oršulić fb631ac9e6 Landmark improvements (#901) 2018-02-14 15:39:43 +01:00
gaschler cf01184114 Fix leak in LandmarkCostFunctionTest. (#902) 2018-02-14 12:38:01 +01:00
gaschler 9793542957 Add 3D global SLAM grpc test. (#904) 2018-02-14 12:04:52 +01:00
gaschler 244cf615f5 Make clang compile without warnings. (#903)
Rule out accidental usage of integer-only ::abs.
Correct static, override and protected annotations.
2018-02-14 11:06:46 +01:00
gaschler b2581b0d58 Make comparison operator const. (#898) 2018-02-13 13:03:26 +01:00
gaschler 7448f93b50 Avoid auto for Eigen expressions. (#899)
While harmless in most cases, auto can delay evaluation
of expressions in unexpected ways.
So it is better to avoid auto for Eigen expressions.
https://eigen.tuxfamily.org/dox/TopicPitfalls.html
2018-02-13 12:34:43 +01:00
Alexander Belyaev ac79f0c034
Save landmark poses after optimization run. (#896)
[RFC=0011](https://github.com/googlecartographer/rfcs/blob/master/text/0011-landmarks.md)
2018-02-12 13:15:16 +01:00
Alexander Belyaev b72bbb20c3
Fix the size of residuals, add test for jacobians. (#895)
[RFC=0011](https://github.com/googlecartographer/rfcs/blob/master/text/0011-landmarks.md)
2018-02-09 13:13:17 +01:00
Alexander Belyaev 95dbcfdf9e Serialize landmarks. (#889)
[RFC=0011](https://github.com/googlecartographer/rfcs/blob/master/text/0011-landmarks.md)
2018-02-07 10:47:39 +01:00
Alexander Belyaev 58bc1ced68
Implement GetLandmarkPoses method. (#888)
[RFC=0011](https://github.com/googlecartographer/rfcs/blob/master/text/0011-landmarks.md)
2018-02-06 18:13:31 +01:00
Alexander Belyaev 28993a8963
Use landmarks in optimization (both 2D & 3D). (#884)
[RFC=0011](https://github.com/googlecartographer/rfcs/blob/master/text/0011-landmarks.md)
2018-02-05 13:23:00 +01:00
Juraj Oršulić 9bebeea742 Serialize and deserialize trajectory builder options (#859) 2018-02-05 09:45:43 +01:00
Holger Rapp c212bbb698 Hand through intensities into the generated PLY - if they exist. (#885) 2018-02-02 18:29:18 +01:00
gaschler 9eaf960936 Configure remaining tests in bazel (#879) 2018-02-01 21:58:59 +01:00
Alexander Belyaev eed51b8bb6 Cleaning up dependencies for constraint builder & optimization problem. (#877) 2018-02-01 20:59:22 +01:00
Alexander Belyaev 8ea46857ac
Move cerec_pose.* to mapping/pose_graph. (#874) 2018-02-01 15:16:50 +01:00
Alexander Belyaev d195c77ebc
Add a 2D landmark cost function. (#868)
[RFC=0011](https://github.com/googlecartographer/rfcs/blob/master/text/0011-landmarks.md)
2018-02-01 13:39:24 +01:00
Christoph Schütte 60e9fa59fe
Implement AddImuDataHandlerTest (#872)
This PR introduces first gRPC handler test that takes advantage of new RpcHandlerTestServer.
2018-02-01 13:05:08 +01:00
Alexander Belyaev e735203a05
Extend MapById::lower_bound() to support structs with 'time' field. (#871)
[RFC=0011](https://github.com/googlecartographer/rfcs/blob/master/text/0011-landmarks.md)
2018-02-01 11:58:13 +01:00
Alexander Belyaev ab890a8e15
Move 3D landmark cost function to mapping_3d/. (#870)
[RFC=0011](https://github.com/googlecartographer/rfcs/blob/master/text/0011-landmarks.md)
2018-01-31 18:40:10 +01:00
Alexander Belyaev 0440761474
Move slerp and scaling of error to 'cost_helpers'. (#864)
[RFC=0011](https://github.com/googlecartographer/rfcs/blob/master/text/0011-landmarks.md)
2018-01-31 17:06:49 +01:00
Rodrigo Queiro ad4dc3c4d3 Bazel: build with -Wno-sign-compare (#863)
This avoids warnings for code like:

```
  CHECK_EQ(local_to_cloud_trajectory_id_map_.count(local_trajectory_id), 0);
```
2018-01-31 15:19:36 +01:00
Alexander Belyaev 708e7fc57d
Add a 'cost_helpers' library. (#862)
* Add a 'cost_helpers' library.

* Change naming and add comments.
2018-01-30 22:12:25 +01:00
Alexander Belyaev 93568641f9
Implement LandmarkCostFunction 3D. (#860) 2018-01-30 15:18:13 +01:00
Alexander Belyaev 8316444319
Store landmark observations as LandmarkNodes in PoseGraph. (#850) 2018-01-29 10:17:05 +01:00
gaschler dab69e0ca0 Struct SensorId (#839)
* WIP, started unordered_set<SensorId>

* struct SensorId. Works for cartographer without grpc.

* correct test

* SensorId in cartographer_grpc/

* clean up

* try to fix for trusty

* SensorId::operator==

* Ran clang-format.
2018-01-26 15:07:49 +01:00
Christoph Schütte edb18231b6 Add ProtoStreamWriterInterface and implement forwarding writer. (#849) 2018-01-25 15:27:50 +01:00
Alexander Belyaev 894bad397d
Rename Landmark->LandmarkObservation. (#847) 2018-01-25 12:10:30 +01:00
Alexander Belyaev aee1bc46dc
Introduce InMemoryProtoStreamReader. (#844)
* Introduce InMemoryProtoStreamReader.

* Move inmemory*.* to in_memory*.*.
2018-01-24 13:58:15 +01:00
Alexander Belyaev 43008d391d
Introduce a ProtoStreamReaderInterface. (#837)
* Introduce a ProtoStreamReaderInterface.

* Remove the comments from interface def.
2018-01-23 09:09:37 +01:00
Alexander Belyaev 986ac28ff8
Rename 'tranform' to 'landmark_to_tracking_transform'. (#836) 2018-01-22 18:30:14 +01:00
Alexander Belyaev 6d4649857a
Move implementation of ReadProto/WriteProto to .cc (#835) 2018-01-22 17:53:31 +01:00
Rodrigo Queiro 0c227097e7 Add a Bazel build for cartographer (#834)
This does not include cartographer_grpc, nor any of the binaries
(*_main.cc). It has been tested with Bazel 0.9.0 on Ubuntu 14.04 with
the latest (at time of writing) dazel/dazel container, by running:

```
bazel build //...
bazel test //...
```

While this is a large CL, the files under third_party are not new - they have been through internal review, and this is their open-source release. The other files come to 212 lines of code.
2018-01-22 16:47:07 +01:00
Alexander Belyaev 67850d25a0 Replace templates in io/proto_stream.h with upcasting. (#833) 2018-01-22 14:12:14 +01:00
Alexander Belyaev 746c9c83c8
Propagate LandmarksData to the PoseGraph. (#830)
Propagate LandmarkData to the PoseGraph.
2018-01-19 09:41:24 +01:00
gaschler de5937856d Collate_by_trajectory option (#828)
Adds an option to create a MapBuilder using TrajectoryCollator
(instead of Collator).

[RFC=0008](https://github.com/googlecartographer/rfcs/blob/master/text/0008-collator-interface.md)
2018-01-17 21:15:15 +01:00
gaschler d92040d0e6 Test Collator for multiple trajectories (#829) 2018-01-17 20:43:20 +01:00
gaschler 70e378b7c5 TrajectoryCollator (#827)
Introduces TrajectorCollator, which collates sensor data ignoring
other trajectories.
Tests the same.

[RFC=0008](https://github.com/googlecartographer/rfcs/blob/master/text/0008-collator-interface.md)
2018-01-17 17:48:20 +01:00
Wolfgang Hess ffdbf1c161 Fix debug output for 3D loop closure error. (#826)
PAIR=spielawa
2018-01-17 13:09:48 +01:00
gaschler f64eef876a Optional GetBlockingTrajectoryId (#820)
[RFC=0008](https://github.com/googlecartographer/rfcs/blob/master/text/0008-collator-interface.md)
2018-01-16 16:21:22 +01:00
Alexander Belyaev 53c2a6b58f
Move 'finished' getter to the base class. (#803)
* Move 'finished' getter to the base class.

* Ran clang-format.

* Ran clang-format.
2018-01-16 14:20:33 +01:00
Christoph Schütte 31ec89614c Add parameter to Submap::ToProto() to determine whether to include loop (#821) 2018-01-16 11:23:29 +01:00
Christoph Schütte 3660408ae6 Forward declare unique_ptr<LocalSlamResultData> (#824) 2018-01-16 10:20:51 +01:00
gaschler 057bd8ce6a Public SpaCostFunction::Compute* (#814) 2018-01-12 21:46:47 +01:00
Wolfgang Hess 19ff047a79 Allow FixedRatioSampler to drop all data. (#817)
This is useful to disable loop closure by setting
constraint_builder.sampling_ratio = 0.
2018-01-12 18:54:41 +01:00
Christoph Schütte 1de696d45f Introduce PoseGraphInterface::ToProto() (#813) 2018-01-12 13:55:14 +01:00
Christoph Schütte fee77c8a99 Add LocalSlamResultData retrieval and submap management (#810)
[RFC=0002](https://github.com/googlecartographer/rfcs/blob/master/text/0002-cloud-based-mapping-1.md)
2018-01-12 13:00:25 +01:00
gaschler 51ccee3e74 CollatorInterface (#808)
[RFC=0008](https://github.com/googlecartographer/rfcs/blob/master/text/0008-collator-interface.md)
2018-01-11 16:02:03 +01:00
Christoph Schütte 8fc64fdbb5 Wrap HybridGrid in unique_ptr to make Submap updatable (#809) 2018-01-11 14:34:56 +01:00
Christoph Schütte e1a182d1fa Implement LocalSlamResult data adding to PoseGraph. (#804) 2018-01-11 10:19:37 +01:00
Christoph Schütte d313af8674
Add InsertionResult to LocalSlamResult. (#801) 2018-01-10 17:26:04 +01:00
Susanne Pielawa c7a8c5fda9 Keep fixed frame across optimizations. (#807)
PAIR=wohe
2018-01-10 16:01:27 +01:00
Susanne Pielawa 286d16238e In optimization_problem, use a map instead of vector for trajectory data. (#805)
PAIR=wohe
2018-01-10 14:30:51 +01:00
Susanne Pielawa 67d26747cc Implement assignment operator for common::optional. (#800)
Implement assignment operator for common::optional.
2018-01-09 17:54:53 +01:00
Christoph Schütte 8c7c4e3d2a Make LocalTrajectoryBuilder optional. (#799)
This is to prepare for the cloud-based mapping case where the robot is running cartographer in pure-localization mode and the cloud instance only solves the global problem. In that case a `LocalTrajectoryBuilder` need to be instantiated in for the cloud instance.
2018-01-09 16:54:30 +01:00
Christoph Schütte 8165da873f Add GetConstraints() to gRPC service. (#798) 2018-01-09 14:25:28 +01:00
Christoph Schütte 78d05bf745 Add GetTrajectoryNodePoses() to gRPC service (#796) 2018-01-08 14:19:39 +01:00
Christoph Schütte d57c2441b8 Implement gRPC submap query. (#794) 2018-01-08 13:52:14 +01:00
Susanne Pielawa 91034eaf58 Making pose in FixedFramePoseData optional. (#792)
This is for the case that the GPS signal is not available.
2018-01-08 11:37:07 +01:00
Christoph Schütte 196b4b891c Add PoseGraphInterface::GetTrajectoryNodePoses() (#795) 2018-01-08 09:13:51 +01:00
Christoph Schütte 1a837ef3ab Introduce PoseGraphInterface::GetAllSubmapPoses() (#790) 2018-01-05 14:19:08 +01:00
Susanne Pielawa 63a80c9340 Adding a minimal implementation of std::optional. (#783)
We're using C++11, which doesn't have std::optional. We need a few
features of std::optional for improved GPS support. These are
implemented here.
2018-01-05 11:27:21 +01:00
Juraj Oršulić 58d94aaa68 Refactor calling optimization into DispatchOptimization. (#729)
I noticed that @jihoonl opened the PR #726 which performs a similar thing. As discussed in googlecartographer/cartographer_ros#613 (@cschuet  has already taken a look), I pulled this out of #481 (a really old PR whose merging has been postponed), which is an example where re-running optimization is triggered from elsewhere as well (besides from `ComputeConstraintsForNode`). This refactoring makes libcartographer friendlier for use cases such as that one.

An important detail is that I have changed the condition in `WaitForAllComputations` to also check if the work queue is empty. If there are other things on the worker queue besides `ComputeConstraintsForNode`, currently we will wrongfully conclude that all computations are done. (This detail was merged in #754, so it's no longer in the diff of this PR).

Also missing is the same thing for 3D. I can add that when we settle on this.

Also, I suggest that `run_loop_closure` gets renamed to `run_optimization`.
2018-01-05 10:43:56 +01:00
Jihoon Lee 2ad83662f2 Migrate SubmapTexture and SubmapSlice logics from cartographer_ros (#782)
Towards [RFC06](https://github.com/googlecartographer/rfcs/blob/master/text/0006-serve-ros-map-from-pbstream.md).

Migrates
* `FillSubmapSlice` from `pbstream_to_rosmap_main.cc` 
* `SubmapTexture` logics from cartographer_ros
2018-01-04 10:52:05 +01:00
Juraj Oršulić 9ee65293d2 Pose graph: do not mark all submaps finished when finalizing a trajectory. (#784)
I think this was a mistake in #563 (@jihoonl). Not all submaps should be marked as finished, only those pertaining to the trajectory being finalized.
2018-01-04 10:11:28 +01:00
gaschler dbb3f7cde4 Test TrajectoryBuilderStub (#780) 2018-01-03 14:56:56 +01:00
Christoph Schütte 5b5b290e9f Implement BlockingQueue::WaitUntilEmpty(). (#775)
PAIR=gaschler
2017-12-20 10:22:53 +01:00
Christoph Schütte 02734c296d Implement ReceiveLocalSlamResultsHandler. (#772) 2017-12-19 15:11:29 +01:00
Christoph Schütte 03751b3c9f Implement local SLAM subscriptions in MapBuilderServer (#766) 2017-12-18 16:32:34 +01:00
gaschler c6decd5b7b Test MapBuilderServer (#762)
Test to start and stop the MapBuilderServer.
Moves test helper functions in common with MapBuilderTest
to internal/mapping.
2017-12-18 11:52:17 +01:00
gaschler d49706944f FixedFramePoseData in gRPC server (#761)
Defines the FixedFramePoseData RPC and implements
the handler for the gRPC server.
2017-12-15 15:26:58 +01:00
gaschler 6817d22788 Test global 2D SLAM. (#751) 2017-12-15 14:45:56 +01:00
Juraj Oršulić 29e4395a5a Make WaitForAllComputation wait for work queue in 3D as well (#758)
Repeat the change in #754 by @gaschler for 3D as well.
2017-12-14 10:02:54 +01:00
gaschler f8452821d7 WaitForAllComputation waits for work queue (#754) 2017-12-13 18:49:22 +01:00
gaschler 59d1b968bc Unwarp by point in LocalTrajectoryBuilder. (#636) 2017-12-13 18:29:42 +01:00
Christoph Schütte c5ec086968 Introduce TimedPointCloudData. (#748)
This data structure is needed to forward RangeFinderData over gRPC.

[RFC=0002](https://github.com/googlecartographer/rfcs/blob/master/text/0002-cloud-based-mapping-1.md)
2017-12-08 19:28:47 +01:00
Christoph Schütte 3ae78563c6 Introduce TrajectoryBuilderInterface. (#736)
[RFC=0004](https://github.com/googlecartographer/rfcs/blob/master/text/0004-trajectory-builder-interface.md)
2017-12-08 11:52:29 +01:00
Christoph Schütte 96cdbde5bf Introduce PoseGraphInterface. (#744)
[RFC=0005](https://github.com/googlecartographer/rfcs/blob/master/text/0005-pose-graph-interface.md)
2017-12-08 11:13:48 +01:00
gaschler 549eef0000 Correct namespace (#742) 2017-12-07 21:17:30 +01:00
Michael Grupp 176fc42c3f Remove empty leftover of pose_estimate.h (#740)
Follow-up of #670.
2017-12-07 08:53:04 +01:00
Christoph Schütte 2a7a6ef934
Make sensor::Data dispatchable to TrajectoryBuilder. (#738)
This change allows to dispatch sensor::Data to implementations of mapping::TrajectoryBuilder, i.e. CollatedTrajectoryBuilder. We need this for cartographer_grpc as the incoming sensor data is inserted into a queue by the gRPC threads and dequeued by a SLAM threads that inserts them into a CollatedTrajectoryBuilder.
2017-12-06 16:36:36 +01:00