Commit Graph

48 Commits (8d5bf2a5dd823624c574359ba20558c9f0ab0323)

Author SHA1 Message Date
Alexander Belyaev 8d5bf2a5dd
[ABSL] Purge common/mutex.h. (#1369) 2018-08-07 10:43:38 +02:00
gaschler 54f7f4f969 Skip constraint search against unfinished submaps. (#1362)
The uplink server only receives the grid content of a submap after
that submap is finished for efficiency. Therefore, constraint
searches against that submap need to be skipped.
Also add checks to avoid this in the future.

FIXES=#1360
2018-08-06 17:34:40 +02:00
Alexander Belyaev 5b44305ea3
[ABSL] Purge common::make_unique. (#1340) 2018-07-27 19:43:35 +02:00
Alexander Belyaev 4990d4d5e9
[ABSL] Purge common::optional. (#1339) 2018-07-27 19:05:45 +02:00
Christoph Schütte dafb4149ed Revert: Fix writing state of trajectories with unfinished submaps. #1286 (#1346)
Reason: Break rviz visualization for submaps loaded from pbstreams.
2018-07-27 17:20:42 +02:00
Arno Fleck 52804df988 Remove warning at the beginning of localization. (#1329)
* Remove warning.

* Remove warning from 2D as well.
2018-07-25 11:02:52 +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
Alexander Belyaev 05a8314a23
Fix Clang warnings. (#1292) 2018-07-18 09:17:39 +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
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
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
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
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
Arno Fleck 9e54a981c6 Introduce common::ToSeconds for std::chrono::steady_clock::duration. (#1244)
Introduce a new overload of ToSeconds for std::chrono::steady_clock and use it for the work queue delay metric.
2018-07-09 20:13:17 +02:00
Martin Schwörer 044f53735c removed unused member matching_submap_index (ActiveSubmaps3D,ActiveSubmaps2D) (#1238)
Removed the unused member matching_submap_index of ActiveSubmaps3D and ActiveSubmaps2D.
Adjusted the test accordingly.
2018-07-06 11:48:25 +02:00
Arno Fleck 627ebb39b9 Add function to get the work queue delay from PoseGraph. (#1218) 2018-07-06 09:40:44 +02:00
gaschler 7839f3f216 Avoid uninitialized NodeId, SubmapId (#1223)
Previously, NodeId and SubmapId could be (partially) uninitialized,
for instance like this:

```
NodeId node_id;
SubmapId submap{0}; // uninitialized submap_index
```

This introduces constructors to prevent this.
2018-07-02 14:51:48 +02:00
gaschler 22ea782fad
Handle invalid requests. (#1222)
FIXES=#1221
2018-07-02 13:05:28 +02:00
Sebastian Klose 2bd987ffb4 Fix serialization for deleted trajectories. (#1214)
* update TrajectoryState of trajectories that got 'trimmed' away to be
 deleted in the PureLocalizationTrimmer
 * update serialization to only serialize 'undeleted' trajectories and
 corresponding options.

#1111
2018-06-26 13:36:42 +02:00
gaschler 54041d76eb DeleteTrajectory (#1205)
[RFC=0023](https://github.com/googlecartographer/rfcs/blob/master/text/0023-delete-load.md)
2018-06-19 13:41:55 +02:00
gaschler a9045fa375
Introduce TrajectoryState (#1201)
[RFC=0023](https://github.com/googlecartographer/rfcs/blob/master/text/0023-delete-load.md)
2018-06-19 11:48:09 +02:00
gaschler de22b9c311 Rename to TrimSubmap (#1192)
Trimmable::MarkSubmapAsTrimmed was incorrectly named and commented.
It really trims the submap.
2018-06-12 16:01:14 +02:00
Alexander Belyaev 5055703490
Use PoseGraphData in PoseGraph3d. (#1188)
[RFC](https://github.com/googlecartographer/rfcs/blob/master/text/0022-pose-graph-data.md)
2018-06-08 14:40:24 +02:00
sotnik-github 3f0bb0eec5 Fixing 846 without tests. (#1183)
Fixing "Optimizing: -nan%... #846" https://github.com/googlecartographer/cartographer/issues/846.
The issue was triggered in a multithreaded execution, when all nodes were processed, but the working queue was still non empty (having other kind of jobs).
Unfortunately I failed to reproduce the bug in tests, so no new tests were added.
2018-06-06 15:38:10 +02:00
Christoph Schütte 876a41f06f
Provide local poses via GetTrajectoryNodePoses() (#1172) 2018-05-30 07:34:49 +02:00
Christoph Schütte ce18ec7295 Add SetGlobalSlamOptimizationCallback() (#1164)
to allow setting the GlobalSlamOptimizationCallback after MapBuilder and PoseGraph
creation. Also removes the GlobalSlamOptimizationCallback from the Constructor
since it is not used.

Prerequisite for implementing ReceiveGlobalSlamOptimizations() in gRPC MapBuilderInterface.
2018-05-25 12:29:52 +02:00
Sebastian Klose d419fe8fd7
More const PoseGraph interface (#1156)
Making getters and non-modifying methods  in PoseGraph* const.

Before most getters where marked non-const because of the need to acquire the mutex for thread safety. This forces all code using the PoseGraph to pass it around as a non-const object even if the consumer is not altering the object.
By making the mutexes mutable we can make getters and methods that do not change the PoseGraph const and thus enable consumer APIs to express how they are going to use the PoseGraph as well.

fixes #1021
2018-05-17 09:30:40 +02:00
Christoph Schütte ce67d684ba
Introduce a GlobalSlamResultCallback (#1143) 2018-05-10 11:25:00 +02:00
Sebastian Klose c2f54b8df2
Organize all protos in mapping in a single folder. (#1147) 2018-05-09 11:22:07 +02:00
Alexander Belyaev 3dd37da51b
Move constraint_builders together. (#1103) 2018-04-23 13:49:25 +02:00
Alexander Belyaev e2623991da Return only optimized & finished submaps for trimmer. (#1104) 2018-04-20 22:19:16 +02:00
Alexander Belyaev 4aa2af23de Move files related to optimization to optimization/. (#1102) 2018-04-20 20:52:17 +02:00
Alexander Belyaev eebced5e16
Clean-up colliding 'SubmapData' names. (#1096) 2018-04-20 18:15:37 +02:00
Alexander Belyaev ab7402ffbb Use references for constraints & nodes in TrimmingHandle. (#1091) 2018-04-19 17:09:16 +02:00
Alexander Belyaev 74f74c4b61 Deserialize landmark poses. (#1064) 2018-04-13 16:38:45 +02:00
jie 74b35caf6e Internal clean up. (#1042)
Add necessary headers to convenient the import to google.
Require holding mutex for some function that access the variables that guard by mutex.
2018-04-09 19:18:58 +02:00
Alexander Belyaev abb2661b76
Allow trimmer to get nodes/constraints. (#1034)
* Allow trimmer to get nodes/constraints.

* Mark the methods const.
2018-04-04 12:50:12 +02:00
Alexander Belyaev 8c6c584524
Allow trimmers fetch submap data. (#1024) 2018-03-28 12:07:28 +02:00
Alexander Belyaev e48e21849a
Acquire mutex before copying landmark poses. (#1007) 2018-03-19 16:16:46 +01:00
Alexander Belyaev 4cc758e830
Serialize landmark observations. (#1006) 2018-03-19 15:12:47 +01:00
gaschler b23ec8ce4e
Fix PureLocalizationTrimmer (#1002)
Remove the wrong assumption that submap index is sequential from 0.
2018-03-19 10:35:35 +01:00
gaschler 55065a2108 Mockable optimization (#994) 2018-03-15 14:13:59 +01:00
gaschler ed47f9d8f8 OptimizationProblemInterface (#991)
Derive optimization problems from a new OptimizationProblemInterface.
Move fix_z into OptimizationProblemOptions.
Move trivial getters to header files.
This will allow mocking the optimization problems.
2018-03-15 11:12:26 +01:00
Alexander Belyaev 1e4d558ac4
Add landmarks to the state and deserialize them. (#988) 2018-03-14 21:36:15 +01:00
Wolfgang Hess c09b643d8d Synchronize correctly in FinishTrajectory(). (#980)
PoseGraph{2D,3D}::FinishTrajectory() calls AddWorkItem() which
requires the mutex to be held. This adds code to do this.
2018-03-13 14:10:51 +01:00
Alexander Belyaev 525f7afe7e
Move sensor-related stuff to internal/. (#985)
[Internal headers RFC](https://github.com/googlecartographer/rfcs/blob/master/text/0003-internal-headers.md)
2018-03-13 13:36:45 +01:00
Alexander Belyaev 418e0964bf
Move pose_graph_*d related files to internal/. (#976)
[Internal headers RFC](https://github.com/googlecartographer/rfcs/blob/master/text/0003-internal-headers.md)
2018-03-12 12:42:52 +01:00