Commit Graph

952 Commits (d306eaddda31f86eb4fcc5bfa505cfe5450f49a8)

Author SHA1 Message Date
gaschler d306eaddda Add pbstream_info executable (#1311)
This is useful to debug and inspect serialized files.
2018-07-23 11:34:37 +02:00
Alexander Belyaev 681cff0435
[GenericPoseGraph] Add proto defs for landmark cost functions. (#1312) 2018-07-22 13:36:25 +02:00
Martin Bokeloh 3a9d1bc465
[GenericPoseGraph] Added rotation cost 3d. (#1313) 2018-07-20 17:45:41 +02:00
Martin Bokeloh bb80d78293
[GenericPoseGraph] Add relative pose constraint 3d. (#1309) 2018-07-20 16:34:27 +02:00
Martin Schwörer f1ac896729 Return the proto from Submap::ToProto instead of passing pointer. (#1294)
Submap::ToProto now returns the proto. 

This PR makes the interfaces for serialization more consistent: In `mapping_state_serialization.cc` all `ToProto` methods return the proto except Submap::ToProto.
2018-07-20 15:16:44 +02:00
danielsievers 2de0e5f04b Don't process PoseGraph3D work items in foreground (#1285)
This helps the foreground thread in keeping up real time.
Also see issue #1250.
2018-07-20 14:41:57 +02:00
Wolfgang Hess 5077224f8e Take PoseGraph2D mutex inside instead of outside work item. (#1310)
This is #1264 for 2D.
2018-07-20 13:31:18 +02:00
Alexander Belyaev 665b95d5c6 [GenericPoseGraph] Add a loss function. (#1308) 2018-07-20 12:50:29 +02:00
Alexander Belyaev 1b455e57e5 [GenericPoseGraph] Use GradientChecker to check gradients (Ba-Dum-Tss). (#1306)
Ba-Dum-Tss!
2018-07-20 10:55:05 +02:00
Alexander Belyaev c473a65a5e Move FindOrNull to common/utils.h. (#1305) 2018-07-20 10:07:45 +02:00
Alexander Belyaev 42d7133a2b
[GenericPoseGraph] Move ParseProto and Near to test_helpers.h (#1307) 2018-07-20 09:30:03 +02:00
Christoph Schütte 7fa11dcde6 Implement recovery behavior for LocalTrajectoryUploader (#1287) 2018-07-20 00:09:44 +02:00
Michael Grupp 5911181849 Fix usage message of map_builder_server_main.cc (#1302) 2018-07-19 22:46:44 +02:00
Martin Bokeloh 5fdb705ea5
[GenericPoseGraph] Added relative pose cost 3d. (#1303)
* [GenericPoseGraph] Added relative pose cost 3d.

* Added another case to the test.

* Removed ceres function from cost function.

* Ran clang-format.

* Minor renaming.
2018-07-19 16:35:27 +02:00
Alexander Belyaev a60b3e2d2d
[GenericPoseGraph] Add CeresOptimizer. (#1300) 2018-07-19 12:41:14 +02:00
Alexander Belyaev df337194e2
[GenericPoseGraph] Add RelativePoseConstraint2D. (#1297) 2018-07-19 09:17:22 +02:00
gaschler ce7f33f97a Fix LoadState trajectory options access (#1298)
FIXES=#1296
2018-07-18 17:08:00 +02:00
Alexander Belyaev 0ab591aa01 [GenericPoseGraph] Add RelativePoseCost2D. (#1295)
This is the implementation of the ceres::CostFunction that uses the new proto definition. It is tested using the Autodiff version.
2018-07-18 15:58:33 +02:00
Martin Schwörer ce9c567e3c No re-use of trajectory node proto in SerializeTrajectoryNodes (#1293)
When serializing `TrajectoryNode`, the declared proto is currently re-used. This can lead to unexpected behavior, in particular when the serialization of the proto is performed in an external function.

This PR also relates PR #1277 where exactly that problem occurred in the SerializeSubmaps.
2018-07-18 12:22:00 +02:00
Christoph Schütte 0668411d6f Deflake destruction and test grpc SerializeState (#1291)
This PR also removes various checks in ThreadPool which ensures that the ThreadPool task queue runs to completion before the destructor returns.
2018-07-18 10:18:08 +02:00
Alexander Belyaev 05a8314a23
Fix Clang warnings. (#1292) 2018-07-18 09:17:39 +02:00
Alexander Belyaev 89f0c45de8
[GenericPoseGraph] Add a NodeId struct. (#1290) 2018-07-17 17:40:49 +02:00
Steve Wolter 6c31420b97 Log status of failed RPCs in PoseGraphStub. (#1288)
Log status of failed RPCs in PoseGraphStub.

This improves the usefulness of error messages in the log.
2018-07-17 13:38:37 +02:00
Christoph Schütte 0ee06ba561
Fix writing state of trajectories with unfinished submaps. (#1286) 2018-07-17 08:39:50 +02:00
danielsievers 482f912d95 Introduce separate mutex for PoseGraph3D work queue access (#1284)
Introduce separate mutex for PoseGraph3D work queue access.

This reduces lock contention, see issue #1250.
In particular higher frequency call to AddWorkItem
don't need to take the main mutex from the froground
thread anymore.
2018-07-16 17:15:28 +02:00
Alexander Belyaev 31d0a6acc7 [GenericPoseGraph] Add IMU Calibration and Pose3D node types. (#1278) 2018-07-16 11:07:37 +02:00
Juraj Oršulić ad572336d4 Include <array> in pose_graph/node.h and pose_2d.h (#1280) 2018-07-16 10:03:54 +02:00
Susanne Pielawa 07a9efee6b Add metrics: real time ratio and cpu time ratio. (#1275)
This PR introduces two metrics to measure performance of local slam: real time ratio, and cpu real time ratio. The latter is introduced to measure the headroom. 

Real time ratio tells us how fast local slam processes the incoming sensor data. When SLAM is falling behind, this is below 100%. In the steady state it is 100% (The real time ratio is above 100% only when slam is 'catching up'.). So this does not tell us how much faster than real time slam processes the data. For this purpose the cpu real time ratio is introduced. It measures how much cpu time slam used, compared to the real time passed to collect the sensor data. Thus it can be more than 100% if slam is faster than real time. For example, a cpu real time ratio of 200% means that slam could process the data twice as fast as it comes in. 

Three durations are measured:
- sensor_duration: the physical time it took to collect the sensor data. 
- wall_time_duration: the time it took to process that data
- thread_cpu_duration: CPU time it took to process that data. 

And the metrics then are: 
real time ratio = sensor_duration / wall_time_duration
cpu real time ratio = sensor_duration / thread_cpu_duration
2018-07-14 12:07:14 +02:00
Kevin Daun df12154542 Fix EqualCellProperties matcher. (#1276) 2018-07-14 10:34:46 +02:00
danielsievers 7b48b66a65 Fined-grained locking for PoseGraph3D constraints (#1279)
When preparing constraints make holding of the PoseGraph3D
mutex fine-grained to address lock contention from issue #1250.
That includes not holding the mutex when acquring the constraint
builder mutex.
2018-07-14 09:27:07 +02:00
Alexander Belyaev d4376e765b
[GenericPoseGraph] Move 'EqualsProto' matcher to test_helpers. (#1271) 2018-07-13 15:05:22 +02:00
Kevin Daun a08037dc47 Add TSDF interpolator. (#1274)
Based on [interpolated_grid.h](https://github.com/googlecartographer/cartographer/blob/master/cartographer/mapping/internal/3d/scan_matching/interpolated_grid.h).
2018-07-13 13:47:09 +02:00
danielsievers 8c9104568a Take PoseGraph3D mutex inside instead of outside work item (#1264)
Take PoseGraph3D mutex inside instead of outside work item
    
This refactors the code but does not alter behavior except
that the shared mutex is separately taken for work_queue_ access,
released, and then re-acquired inside each work item.
    
As a consequence AddWorkItem() also needs to EXCLUDE() the lock and
acquire it internally, because for the case where we run the task
in the foreground we cannot hold the lock and recursively acquire it again
inside the task being run.
    
This prepares for making locking more fine-grained, see issue #1250.
2018-07-13 11:53:25 +02:00
Christoph Schütte 61a89d8ab8 Check client_id in sensor data handlers (#1266) 2018-07-13 09:57:35 +02:00
Christoph Schütte 2b80767b57 Upgrade async_grpc (#1272) 2018-07-13 08:48:48 +02:00
Susanne Pielawa dce713b442 Added function GetThreadCpuTimeSeconds in common/time.h (#1267)
This will be needed for measuring SLAM performance.
2018-07-13 00:11:31 +02:00
Kevin Daun 5abd413310 Add value conversion tables (#1255)
Adds value conversion tables to perform lazy computations of lookup tables for mapping from a uint16 value to a float in [`lower_bound`, `upper_bound`].
Owners of the value conversion tables are `SubmapController`, `PoseGraph2D`, `ActiveSubmaps` and `ProbabilityGridPointsProcessor`. For concurrency reasons, having only a single owner is not possible.
Follow up PR in `cartographer_ros`  is prepared.
2018-07-12 22:11:55 +02:00
Michael Grupp 8602bf9430 Nit: no hardcoded version and current year in Sphinx docs. (#1268)
`Cartographer 1.0.0 documentation` -> `Cartographer documentation`
`Copyright 2016 The Cartographer Authors` -> `Copyright <year> The Cartographer Authors`
2018-07-12 20:43:36 +02:00
Alexander Belyaev c4c5fab5b2 [GenericPoseGraph] Add a base class for all nodes and Pose2D node. (#1265) 2018-07-12 15:21:59 +02:00
Susanne Pielawa 151a78d7be Added TODO for multi-trajectory case. (#1269) 2018-07-12 14:25:00 +02:00
Michael Grupp 30bc6bd97a Add equations for landmark cost function. (#1254) 2018-07-12 13:25:57 +02:00
Christoph Schütte 1b88fb8e90 Introduce client_id in SensorMetadata (#1257) 2018-07-12 00:21:31 +02:00
Wolfgang Hess 5ad2088561 Get rid of std::bind. (#1261)
`std::bind` is bug prone and should be avoided.
Lambdas are a more general and safer replacement.
2018-07-11 20:18:09 +02:00
Martin Schwörer a905036a00 Create first submap with first scan (#1253)
The first submap is now created with first call to `ActiveSubmaps:InsertRangeData`.

Originally the first submap was created at the origin. Creating the first submap with the first range data insertion allows to align the first submap with the gravity estimate of the first scan. This change makes the interface of ActiveSubmaps most consistent, as `ActiveSubmaps::submaps()` will return the correct active submaps after insertion.

The change affects the result of cartographer. The results were verified and provide the same quality as current master.
2018-07-11 19:44:37 +02:00
Alexander Belyaev 288328ef14 [GenericPoseGraph] Add protos for nodes/constraints. (#1258)
Does not cover all constraints yet.
2018-07-11 18:06:28 +02:00
danielsievers 9f1039221c Refactor PoseGraph work queue optimization dispatching (#1252)
Unwrap the logic to dispatch optimization and the deferred
logic to create the work queue (when kicked off in foreground)
to happen in AddWorkItem() and HandleWorkQueue().
The work items will instead return whether they need optimization
to be dispatched or not.
2018-07-11 17:33:41 +02:00
Kevin Daun bb380ae947 Make kSqrtTwoPi const. (#1259) 2018-07-11 13:02:11 +02:00
Wolfgang Hess 88850ec2d7 Add .clang-format file. (#1249)
This adds a .clang-format file, so that git clang-format uses
Google style without the need to remember the commandline flag.

Moreover, this ensures correct formatting if the Cartographer
code is in a subtree of a repo.
2018-07-11 12:28:53 +02:00
Christoph Schütte 35abfccc6b Introduce client_id in cartographer grpc (#1241) 2018-07-10 20:41:00 +02:00
Susanne Pielawa 120c216c47 Measure accumulation_duration from last accumulation stop (#1251)
[PR 946](https://github.com/googlecartographer/cartographer/pull/946) introduced metrics in local trajectory builder. The accumulation duration was measured from accumulation_start to accumulation_stop. 

This PR changes this to measure the entire time elapsed between two accumulations (i.e. from accumulation_stop to the next accumulation_stop). 

Mostly the two measurements result in roughly the same, with the new way measuring slightly larger durations, as expected. But occasionally the measurements differ significantly. This is probably due to a lock contention somewhere outside of what was measured previously. Since we are interested in real time metrics, we need to track the entire time passed.
2018-07-10 16:24:57 +02:00