Commit Graph

522 Commits (363a337e67776d9762f29d762326bd2c53fb41fb)

Author SHA1 Message Date
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
gaschler 4c999037b4 Integration tests for local slam. (#734) 2017-12-06 15:58:16 +01:00
gaschler 49d55d97c1 Test MapBuilder (#731) 2017-12-05 14:04:10 +01:00
gaschler b77a1f2178
Remove implementation from TrajectoryBuilder. (#728)
To simplify the implementation of a gRPC-based trajectory builder,
this moves the existing implementation to CollatedTrajectoryBuilder
and organizes the interface by sensor type.
2017-12-05 11:05:05 +01:00
gaschler ee9c61a736 Move LocalSlamResultCallback to AddTrajectory (#724) 2017-12-04 22:41:38 +01:00
gaschler 1ff8243802
Test RotationDeltaCostFunctor (#721) 2017-12-01 09:25:15 +01:00
gaschler 63e901d276
Create AutoDiffCostFunction in cost functions. (#718)
Creating a ceres::AutoDiffCostFunction requires specifying numbers
of residuals and variables, so it is safer to implement this within
the cost functions, which know best.
2017-11-30 15:41:57 +01:00
gaschler 85bfb888eb
Interface for MapBuilder (#715)
Defines an interface for MapBuilder that can be used to implement a gRPC stub.
[RFC=0002](https://github.com/googlecartographer/rfcs/blob/master/text/0002-cloud-based-mapping-1.md)
2017-11-30 14:41:48 +01:00
gaschler 24f253a2aa Remove GetBlockingTrajectoryId (#714) 2017-11-30 12:04:14 +01:00
Jihoon Lee 88805a301d Trim all submaps when pure localization trajectory is finished. (#563)
Fixes #560 
based on #562
2017-11-28 10:21:55 +01:00
Juraj Oršulić bebe021b04 Serialize fixed frame pose data. (#689)
Similar to #666 and #548.
2017-11-28 09:44:35 +01:00
gaschler 1c7183d5c4 VoxelFilter for TimedPointCloud, Filter method. (#710)
This makes the VoxelFilter ready for TimedPointCloud and
per-point unwarping.
2017-11-27 15:12:07 +01:00
gaschler c292d76f86 Test ImuTracker (#711)
Adds unit tests for ImuTracker to cover filtering of the gravity
vector and tracking angular velocity.
2017-11-27 14:46:32 +01:00
Wolfgang Hess 7e82ac3bbf Make IMU cost functions internal. (#708)
[RFC=0003](https://github.com/googlecartographer/rfcs/blob/master/text/0003-internal-headers.md)
2017-11-24 15:29:48 +01:00
Wolfgang Hess 79b83b92b2 Make the MotionFilter internal. (#707)
Also moves it from mapping_3d to mapping since it is used
in both 2D and 3D SLAM.

[RFC=0003](https://github.com/googlecartographer/rfcs/blob/master/text/0003-internal-headers.md)
2017-11-24 14:01:07 +01:00
gaschler 0084f14c1c CeresScanMatcher target_translation (#702)
For its translation cost function, CeresScanMatcher now takes
a target translation as an argument instead of a pose, which 
was confusing.
2017-11-24 12:26:14 +01:00
Wolfgang Hess 0819e52a9c Make the LocalTrajectoryBuilders internal. (#704)
[RFC=0003](https://github.com/googlecartographer/rfcs/blob/master/text/0003-internal-headers.md)
2017-11-24 10:39:12 +01:00
Wolfgang Hess 8e6101de5c Make the OccupiedSpaceCostFunction internal. (#703)
[RFC=0003](https://github.com/googlecartographer/rfcs/blob/master/text/0003-internal-headers.md)
2017-11-23 18:04:36 +01:00
Wolfgang Hess 70a0f41364 Remove unused code. (#699) 2017-11-23 16:39:55 +01:00
gaschler 9bfc52d878 Rename arguments of CostFunctors to target_ (#700)
Rename constant targets of cost functors to target_*.
Pass only translation to Translation cost functors.
2017-11-23 16:04:49 +01:00
Wolfgang Hess ec034b13bc Do not install global_trajectory_builder.h. (#698)
This moves the global_trajectory_builder.h header under
cartographer/internal and changes the CMakeLists.txt to
not install internal headers.

[RFC=0003](https://github.com/googlecartographer/rfcs/blob/master/text/0003-internal-headers.md)
2017-11-23 14:47:29 +01:00
Juraj Oršulić 8f9f1cf44e Fix debug build (#697)
Similar to #418.
2017-11-23 14:20:01 +01:00
gaschler 147c8166b6 ImuTracker uses conjugate. (#693)
Normalized quaternions can be inverted with conjugate, which is faster.
The motivation for optimizing ImuTracker::Advance is that
per-point unwarping will call this for every point.
2017-11-23 13:50:44 +01:00
gaschler a8bd98680e ExtrapolatePose uses fewer transforms. (#694)
ExtrapolatePose avoids conversion to Rigid3d and computes translation
and rotation directly, which is faster.
Per-point unwarping will call this function for every point, so we
optimize it.
2017-11-23 12:27:26 +01:00
Juraj Oršulić 31f28b5097 Remove PoseEstimate. (#670)
Replaces #620.

Depends on switching `cartographer_ros` to use the new callback API for handling the last scan and pose estimate (googlecartographer/cartographer_ros#594).
2017-11-17 16:47:06 +01:00
Wolfgang Hess aba4575d93 Rename 'submap_transforms' to follow terminology. (#688)
https://google-cartographer.readthedocs.io/en/latest/terminology.html

Related to #602.
2017-11-17 13:13:45 +01:00
Christoph Schütte b91ff8fe44 Extrapolate poses for ground truth relations. (#687) 2017-11-17 12:27:31 +01:00
Wolfgang Hess 055728af93 Rename options for consistency. (#686)
"scan" is better named "node" if it refers to a node in global SLAM.

"penalty factor" is renamed "weight" for consistency with other similar options.

"scans_per_accumulation" is renamed "num_accumulated_range_data" to match the code and since the accumulated data is not called "scan".
2017-11-17 10:52:22 +01:00
Holger Rapp 5ee830e8cc Cleanup and new features in Image code. (#685)
- Removes stride_, since we know for a fact that it is always width * 4.
- Adds a constructor from a cairo surface.
- Adds a function that rotates the image by 90 degrees.

This is in preparation of adding a tool that can generate an image from a .pbstream.
2017-11-16 17:05:18 +01:00
Holger Rapp 0b4e7a9443 Refactor image related code. (#684)
- Take immutable parameter as const ref instead of pointer.
- make kCairoFormat a global constant, since it is defined in many places in cartographer and cartographer_ros, but we rely on it actually always being the same value.
2017-11-16 15:07:05 +01:00
gaschler b9015f33a7 Filter early in AddRangeData. (#681)
Filter earlier in 3D.
Combine two transforms to one in 2D.
2017-11-16 13:35:44 +01:00
Wolfgang Hess 16d62f45f0 Rename sparse_pose_graph options. (#682)
The default pose graph configuration is now included as "pose_graph.lua"
and available as POSE_GRAPH.

[RFC=0001](https://github.com/googlecartographer/rfcs/blob/master/text/0001-renaming-sparse-pose-graph.md)
2017-11-16 11:48:25 +01:00
jie a08a370ef3 Check if filtered point clouds are empty. (#664)
The point cloud will be filtered by MaxRangeFilter before doing scan matching. For some special cases, the filtered point cloud maybe empty, it will cause crash:
real_time_correlative_scan_matcher.cc:159 Check failed: candidate.score > 0.f (nan vs. 0) 
This PR fixed this bug, check the point cloud size before scan matching, return false for empty point cloud.
2017-11-16 09:56:01 +01:00
Wolfgang Hess bdca2095c0 Rename proto::SparsePoseGraph. (#680)
[RFC=0001](https://github.com/googlecartographer/rfcs/blob/master/text/0001-renaming-sparse-pose-graph.md)
2017-11-15 14:58:49 +01:00
Wolfgang Hess c25379cd20 Rename mapping_{2,3}d::SparsePoseGraph. (#678)
[RFC=0001](https://github.com/googlecartographer/rfcs/blob/master/text/0001-renaming-sparse-pose-graph.md)
2017-11-15 13:50:18 +01:00
Wolfgang Hess 8c114d6eaf Rename mapping::SparsePoseGraph. (#677)
[RFC=0001](https://github.com/googlecartographer/rfcs/blob/master/text/0001-renaming-sparse-pose-graph.md)
2017-11-15 12:06:19 +01:00
Wolfgang Hess 36b9cf7f9a Move the mapping_3d/sparse_pose_graph directory. (#676)
[RFC=0001](https://github.com/googlecartographer/rfcs/blob/master/text/0001-renaming-sparse-pose-graph.md)
2017-11-15 11:30:35 +01:00
Wolfgang Hess 26db9d6210 Move the mapping_2d/sparse_pose_graph directory. (#675)
[RFC=0001](https://github.com/googlecartographer/rfcs/blob/master/text/0001-renaming-sparse-pose-graph.md)
2017-11-15 10:52:06 +01:00
catskul f6192e4735 replace implicit use of cartographer::string with explicit use of std::string (#673)
Fixes #622.
2017-11-15 10:17:59 +01:00
Wolfgang Hess 291c0f581b Move the mapping/sparse_pose_graph directory. (#669)
[RFC=0001](https://github.com/googlecartographer/rfcs/blob/master/text/0001-renaming-sparse-pose-graph.md)
2017-11-15 09:39:45 +01:00
gaschler 7904808d40 Reduce transforms in LocalTrajectoryBuilder. (#668)
This speeds up AddRangeData because we avoid one copy and loop over all points.
2017-11-15 09:15:02 +01:00
Juraj Oršulić 818e5e1a44 Add local SLAM result callback. (#574)
Depends on ~~#619~~ (merged) and ~~#617~~ (merged).
Related to #508.

Also, if cartographer_ros is going to use this, and we wish to serialize the saved range data, that will have to be handled in cartographer_ros, right?
2017-11-14 17:19:14 +01:00
Wolfgang Hess a4c0e4754e Rename scan to node. (#667)
Changes the naming from "scan" to "node" in the pose graph.
AddNode() adds a new node to the graph which might contain
data from multiple range sensors and not necessarily one scan.

Configuration and documentation changes might follow in a
separate PR.

Related to #280.
2017-11-14 16:53:31 +01:00
Juraj Oršulić 4b342eddd0 Miscellaneous: rename odometer->odometry (#665)
Since we're adding `sensor::OdometryData`, I think that the function should be called `AddOdometryData`.
2017-11-14 16:18:07 +01:00
Juraj Oršulić 5496cbdc0c Serialize odometry data (#666)
Replaces #550.
2017-11-14 15:18:39 +01:00
Juraj Oršulić 60c72cb445 Deserialize trajectory connectivity (#552) 2017-11-14 13:26:53 +01:00
Wolfgang Hess 3ec583a327 Change fixed_frame_pose_data_ to MapByTime. (#662) 2017-11-13 17:41:04 +01:00
gaschler fd5003b69b Omit odometry penalty within frozen trajectory. (#661)
In the case of pure localization, this reduces the size of the optimization problem by a large factor.
2017-11-13 14:19:15 +01:00
Wolfgang Hess 4a8607810e Change odometry_data_ to MapByTime. (#655) 2017-11-13 13:21:53 +01:00
damienrg d183ab737a Fix mismatched tag warning for MapByIndex (#658)
- [ X] Keep your PR rebased to master.
- [ X] Keep your PR under 200 lines of code and address a single concern.
- [ X] Add unit test(s) and documentation (these do not count toward your 200 lines).
- [ X] Adhere to the [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html).
- [ X] Run `clang-format -style=Google` on your code (this alone is not enough to ensure you've followed the style guide).
- [ X] Run `ninja test` or `catkin_make_isolated --install --use-ninja --pkg cartographer --make-args test` as appropriate.
2017-11-13 10:18:58 +01:00
damienrg a9da74496a Fix unused lambda capture warning (#659)
- [ X] Keep your PR rebased to master.
- [ X] Keep your PR under 200 lines of code and address a single concern.
- [ X] Add unit test(s) and documentation (these do not count toward your 200 lines).
- [ X] Adhere to the [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html).
- [ X] Run `clang-format -style=Google` on your code (this alone is not enough to ensure you've followed the style guide).
- [ X] Run `ninja test` or `catkin_make_isolated --install --use-ninja --pkg cartographer --make-args test` as appropriate.
2017-11-13 09:44:12 +01:00
Christoph Schütte 6e274766f2 Remove unnecessary [packed=true] annotation (#660)
[RFC=0000](https://github.com/googlecartographer/rfcs/blob/master/text/0000-proto3-transition.md)
2017-11-13 09:18:53 +01:00
Christoph Schütte 53471359f8 Convert all .proto files to proto3 syntax. (#653)
[RFC=0000](https://github.com/googlecartographer/rfcs/blob/master/text/0000-proto3-transition.md)
2017-11-13 08:26:35 +01:00
jie ed71914805 Add MutexLocker to ConnectedComponents::GetComponent and SparsePoseGr… (#565)
…aph::TrimmingHandle::MarkSubmapAsTrimmed

To make them compile successfully in google.
2017-11-10 17:21:20 +01:00
Juraj Oršulić eb4415d17d Introduce MatchingResult for LocalTrajectoryBuilder::AddRangeData. (#619)
In preparation for #574. Depends on ~~#618~~ (merged) and ~~#617~~ (merged).
2017-11-10 14:49:41 +01:00
Jihoon Lee 028391357d Add OccupancyGridState and SubmapState in cartographer/io (#638)
replaces #599 
related to googlecartographer/cartographer_ros#510
2017-11-09 17:19:29 +01:00
Wolfgang Hess 418819a9ef Use 'global_pose' terminology for submaps. (#645)
Use 'global_pose' terminology for submaps.

This follows #624.
2017-11-09 16:40:21 +01:00
gaschler 6eaf0f344d FastCorrelativeScanMatcher outputs unique_ptr. (#643) 2017-11-09 16:08:16 +01:00
Juraj Oršulić e21fc9f253 Serialize IMU data. (#548) 2017-11-09 15:32:54 +01:00
Jihoon Lee 3bdee588bd Add FinishTrajectory() in SparsePosegraph. (#562) 2017-11-09 14:29:26 +01:00
Wolfgang Hess 92f81aec8a
Make proto::ProbabilityGrid proto3 compatible. (#641)
Moves the optional 'known_cells_box' into a message field.
This way its existence can still be checked in proto3.
2017-11-09 11:47:33 +01:00
gaschler 386ee328d8
Fix 3D yaw rotation in GenerateDiscreteScans. (#640)
Correctly generates discrete scans rotating around yaw in the gravity-aligned global map frame.
Fixes #639.
PAIR=wohe
2017-11-08 17:37:36 +01:00
Christoph Schütte eb96c91473
Initial pose implementation. (#606) 2017-11-08 14:01:38 +01:00
catskul 55e4338468 Start cleaning up Google specific types by making them cartographer private.
move string and size specific int/uint types into cartographer namespace as minimal change necessary to keep global namespace clean (#637)
2017-11-08 09:07:46 +01:00
Wolfgang Hess 088681f9ec
Add 3D localization support. (#632)
This adds information about which nodes are contained in which
deserialized submaps. This is necessary for the rotational scan
matcher.

Also skips frozen trajectories when tying together nodes of a
trajectory with IMU data which is unavailable in this case.
2017-11-07 11:26:41 +01:00
Juraj Oršulić 8186316d77 Range loop over trajectories for MapByTime (#633) 2017-11-06 17:14:01 +01:00
Alexander Belyaev 0d2bc8b938 Adds a 'LandmarkData' struct and proto. (#628) 2017-11-06 15:35:21 +01:00
Wolfgang Hess 77fb50fd76
Introduce sensor::MapByTime<>. (#631)
This data structure is used for keeping IMU data. This
allows trimming IMU data in the middle which is needed for
life-long mapping.
2017-11-06 13:36:59 +01:00
Wolfgang Hess 049f30d824
Generalize IntegrateImu(). (#627)
This is in preparation of changing the data structure
for IMU data away from a deque. Needed for localization
and life-long mapping.
2017-11-06 11:00:33 +01:00
gaschler 8854aaae9e Extrapolator reuses result using additional IMU trackers. (#623)
This makes the extrapolator stricter that time arguments
must be monotonously increasing when calling the Extrapolate
methods.
2017-11-03 16:19:55 +01:00
Wolfgang Hess 978544eca4
Add submap and gravity-aligned frame terminology. (#624) 2017-11-03 13:44:23 +01:00
gaschler 5a3bb14083 PoseExtrapolator::GetLastExtrapolatedTime (#626)
This prepares the API for #623 and #616.
2017-11-03 11:56:31 +01:00
Juraj Oršulić 7964211fef Deserialize SPG constraints (#544) 2017-11-02 22:01:01 +01:00
Juraj Oršulić 3c5a7aa2d8 Refactoring of LocalTrajectoryBuilder::AddAccumulatedRangeData (#618)
- introduce InsertIntoSubmap for 2D
- clarify some variable names in 3D
- move rotational_scan_matcher_histogram calculation
  to InsertIntoSubmap for 3D
- refactor last version of range data before insertion into
  range_data_in_local (filtered_range_data_in_local for 3D)
2017-11-02 16:01:23 +01:00
Juraj Oršulić c57641f917 Make SPG::AddScan return the inserted node id. (#617) 2017-11-02 10:28:13 +01:00
Christoph Schütte e10650910e
Pull out time-based transformation interpolation. (#615) 2017-10-30 15:41:02 +01:00
Wolfgang Hess c011177bfd
Fix the origin of accumulated range data. (#613)
This changes the origin of accumulated range data from the
zero vector (which could be far off) to the origin of the
first range data in the accumulation.
2017-10-30 11:32:06 +01:00
Wolfgang Hess 82a4b2f171 Follow #591 terminology in 3D optimization. (#612) 2017-10-27 15:48:51 +02:00
Christoph Schütte dacc962399 Adds lower_bound() to MapById. (#610) 2017-10-27 14:50:14 +02:00
gaschler d4db1e79a6 Add TimedPointCloud and TimedRangeData. (#601)
Adds a type TimedPointCloud that holds 4-dimensional vectors where measurement time of individual points are stored in the fourth entry.
Uses TimedRangeData to pass TimedPointCloud of incoming measurements to LocalTrajectoryBuilder.

Fixes #573.
2017-10-24 11:47:35 +02:00
Holger Rapp 638aee7c2a Fix slow point deletion in RemovePoints. (#608)
This speeds up the asset writer significantly:

For the 3D sample bag:

~~~
/usr/bin/time roslaunch cartographer_ros assets_writer_backpack_3d.launch \
   bag_filenames:=${HOME}/Downloads/b3-2016-04-05-14-14-00.bag \
   pose_graph_filename:=${HOME}/Downloads/b3-2016-04-05-14-14-00.bag.pbstream

master:
2100.96user 26.79system 35:43.60elapsed 99%CPU (0avgtext+0avgdata 3657028maxresident)k
17682632inputs+32080outputs (0major+20021051minor)pagefaults 0swaps

this CL:
1937.46user 11.77system 32:22.49elapsed 100%CPU (0avgtext+0avgdata 3659412maxresident)k
1352inputs+32088outputs (0major+7042032minor)pagefaults 0swaps
~~~

So ~10%. For pipelines that do less this can be even 30% or more.
2017-10-23 10:56:55 +02:00
Juraj Oršulić f179bd942c Support multiple trajectories in LoadMap. (#567) 2017-10-20 16:13:18 +02:00
Wolfgang Hess a96511464e Add map trajectory without a trajectory builder. (#605) 2017-10-19 16:59:04 +02:00
Christoph Schütte 7c03467a78 Change GetTrajectoryNodes() to MapById. (#603) 2017-10-19 14:50:58 +02:00
Holger Rapp 49ead6055c Towards a ROS map writing PointsProcessor. (#598)
- Refactor ProbabilityGridPointsProcessor for code reuse.
- Adds Image::width and height.
- Adds GetFilename for FileWriter.

Related to googlecartographer/cartographer_ros#475.
2017-10-19 12:30:19 +02:00
Holger Rapp 0c9f2c4f65 Remove unused concept of CompressedRangeData. (#604) 2017-10-19 11:19:56 +02:00
Wolfgang Hess e479382ecc Change GetAllSubmapData() to MapById. (#597) 2017-10-17 16:03:16 +02:00
Christoph Schütte 3d4650d675 Remove trimmed() from TrajectoryNode (#596) 2017-10-17 15:36:07 +02:00
Wolfgang Hess e5f9815f67 Change submap_data_ in pose graph to MapById. (#593)
* Change submap_data_ in pose graph to MapById.
2017-10-17 13:13:37 +02:00
Christoph Schütte fdda1dd091 Switch trajectory_nodes in SPG2D to MapById. (#592) 2017-10-17 11:48:23 +02:00
Wolfgang Hess bcd1be92b1 Adds a bit of terminology documentation. (#591)
Changes code to match the new documentation.
2017-10-17 10:07:54 +02:00
Wolfgang Hess 76ed37768f Validate odometry and fixed frame poses. (#588) 2017-10-16 15:59:56 +02:00
Christoph Schütte 6b447c4577 Add FindChecked to MapById. (#586)
* Add FindChecked to MapById.
2017-10-16 14:15:53 +02:00
Wolfgang Hess d91afa4496 Introduces mapping::MapById for nodes in 3D. (#587) 2017-10-16 13:37:28 +02:00
Christoph Schütte 5ed19c15ab Introduce proxy object for iteration over trajectory ids. (#585)
* Introduce proxy object for iteration over trajecotry ids.
2017-10-16 12:52:53 +02:00
Wolfgang Hess 7e0cfc3f22 Introduces mapping::MapById for submaps in 3D. (#584) 2017-10-16 10:48:43 +02:00
Christoph Schütte 006db45910 Introduce proxy object for range based loops over nodes of trajectory. (#583) 2017-10-13 16:44:31 +02:00
Wolfgang Hess 464d770d48 Introduces mapping::MapById for nodes in 2D. (#581)
PAIR=cschuet
2017-10-13 14:41:54 +02:00
Wolfgang Hess 4ab4817104 Add MapById<>::ConstIterator::operator->(). (#580) 2017-10-12 16:15:12 +02:00
Wolfgang Hess cb41777b9e Introduces mapping::MapById in the 2D pose graph for submaps. (#578)
PAIR=cschuet
2017-10-12 11:58:59 +02:00
Wolfgang Hess ea55e837d2 Introduces mapping::MapById in the 2D optimization problem. (#577)
PAIR=cschuet
2017-10-09 17:33:12 +02:00
Wolfgang Hess 2434e7e40e Fix crashing bug in localization. (#575)
Now that we deserialize trajectory nodes, we need to make sure
that the global matcher sampler is added for the map trajectory.
2017-10-06 17:01:04 +02:00
Juraj Oršulić 2f332eca28 Deserialize trajectory nodes. (#569) 2017-10-06 16:16:25 +02:00
Holger Rapp 6708930bbf Adds 'offset_seconds' to PointCloudWithIntensities. (#571)
This is preparing using per-point-unwarping in the `assets_writer` in `cartographer_ros`.

Related to googlecartographer/cartographer_ros#521.

PAIR=@wohe
2017-10-06 13:21:02 +02:00
Christoph Schütte 2862e12506 Add FrameIdFilteringPointsProcessor (#566)
* Add FrameIdFilteringPointsProcessor

Implements a PointProcessor that filters PointBatches (either by
whitelisting or blacklisting) the frame_id.
2017-10-05 17:33:51 +02:00
Wolfgang Hess 0053b30cc8 Add support for odometry to the 3D pose graph optimization. (#570)
Not used yet. Intended to experiment with the 3D pose graph optimization
in 2D SLAM.
2017-10-05 16:56:31 +02:00
Juraj Oršulić bd8a2e6a92 Store node initial pose in constant data. (#568) 2017-10-05 16:10:12 +02:00
Wolfgang Hess cae9c02e05 Follow #547 for 3D. (#564)
And changes to 3D following 2D regarding trimmed data.
2017-10-04 16:47:26 +02:00
Wolfgang Hess 51f5a18462 Fix formatting. (#561) 2017-10-04 15:58:48 +02:00
Juraj Oršulić aaaf5ac546 Rename serialization NodeData proto for consistency. (#540)
node_data should be a member of a node, not the other way around.
2017-10-04 14:13:18 +02:00
Juraj Oršulić b1b0750e5b Check ratios in fixed rate sampler. (#502) 2017-10-04 13:15:35 +02:00
Christoph Schütte 9c81a01608 Add trajectory trimming support to 3d (#559)
* Adds DeleteScanMatcher() to 3D constraint builder
* Add possibility to remove submaps and scans from the 3D optimization
  problem.
* Implements TrimmingHandle in SPA.
2017-10-02 17:01:14 +02:00
Jihoon Lee 3c521eb573 Remove hooray. And prints remaining work items in queue (#547) 2017-09-29 01:04:28 -07:00
jie 3744988fd2 Fix trajectory count check bug for asset writer floor separation. (#542) 2017-09-28 10:43:47 +02:00
Wolfgang Hess 7d0e72dac2 Fix some nits. (#536)
Most importantly makes mapping_2d::SparsePoseGraph::GetLatestScanTime()
private.
2017-09-28 09:21:07 +02:00
Wolfgang Hess 0cbc420b02 Fix odometry in the 2D pose graph optimization. (#533)
Before, the relative change in pose due to odometry in the
2D pose graph optimization problem was incorrectly done in
the tracking frame. Instead, the gravity aligned frame in
which the 2D poses are stored must be used.

Fixes #515.

PAIR=cschuet
2017-09-15 14:11:37 +02:00
Jihoon Lee 259e22a5fc Use oldest and newest instead of last two odometry data. (#530) 2017-09-14 16:10:03 +02:00
Christoph Schütte 5896ead32e Introduce timeout for global constraints. (#517)
This PR introduces a new option that specifies the number of seconds
after which global matcher searches are performed if no recent global
constraints have been found between the submap's and the node's
trajectory.
2017-09-14 12:11:54 +02:00
gaschler 31b5a6f1a9 Allow multiple SubmapTextures. (#519)
This changes submap_visualization.proto that multiple textures can be provided.
As of now, the first texture is generated from the high resolution
grid, which is the same as before.
The second texture is generated from the low resolution grid.
2017-09-13 15:47:02 +02:00
Wolfgang Hess 5ade042520 Fix crash in localization. (#526)
Updating the connectivity needs the data of nodes for which
constraints were added, so we postpone trimming to after the
connectivity update.

Also makes sure the mutex is held as necessary.
2017-09-13 14:08:32 +02:00
Wolfgang Hess 57d53b6d53 Remove unused code. (#522)
Removes FindConnectedComponent() from a proto message.
2017-09-12 18:07:18 +02:00
Christoph Schütte b383f18365 Fix crash in localization. (#523)
This PR fixes a crash when cartographer is run in localization mode due
to the map trajectory not having been properly added to the
ConnectedComponents.
2017-09-12 17:04:13 +02:00
Wolfgang Hess 4437d89dd5 Fix crashing bug during pure localization. (#521)
When loading a serialized state, no nodes are added for each
submap. This leads to crashes when loop closures are found.
2017-09-12 15:36:22 +02:00
Juraj Oršulić 23bf0fc0d4 Fix unsigned comparison warning in 2D SPG test. (#518) 2017-09-12 11:25:51 +02:00
Christoph Schütte 24c2b499dd Introduce TrajectoryConnectivityState. (#513)
* Introduce TrajectoryConnectivityState.

This class will be used to track the connectivity state (including the
last connection time) between pairs of trajectories.
2017-09-11 14:43:55 +02:00
Wolfgang Hess 84da6d75bc Also use vector<map<>> for node data in 3D. (#516)
This reduces the difference between 2D and 3D and moves
3D towards localization and trimming.
2017-09-11 13:46:49 +02:00
Wolfgang Hess 35aa38f73f Also use vector<map<>> submaps in 3D. (#512)
This reduces the difference between 2D and 3D and moves
3D towards localization and trimming.
2017-09-08 15:54:28 +02:00
Christoph Schütte 1a367f0549 Rename TrajectoryConnectivity ConnectedComponents. (#510)
* Rename TrajectoryConnectivity ConnectedComponents.
2017-09-07 17:11:06 +02:00
Christoph Schütte c65f7a97b6 Remove connected_components_ from SPG. (#509)
* Remove connected_components_ from SPG.

This PR removes connected_components_ from the SparsePoseGraph. Since
the connectivity structure is no longer updated by the
ConstraintBuilders it is no longer necessary for SPG to keep a copy of
the connected components for data consistency.
2017-09-07 16:35:49 +02:00
Christoph Schütte fa306d03ec Remove reverse_connected_components. (#507)
Remove reverse_connected_components from SparsePoseGraphs and update
TrajectoryConnectivity to return "connected" for the reflexive case even
if trajectories are unknown.
2017-09-07 15:58:30 +02:00
Wolfgang Hess 476d156f66 Serialize trajectory node data. (#504)
Related to #253.
2017-09-07 15:29:12 +02:00
Christoph Schütte a5dafcfde3 Update trajectory connection in WhenDone callback. (#506)
This modifies the ConstraintBuilder interface so that Maybe*Constraint
is not responsible anymore for updating the TrajectoryConnectivity
member of SparsePoseGraph and moves this responsibility into the
WhenDone callback.
2017-09-07 14:51:19 +02:00
Wolfgang Hess 333516d955 Rename the scan queue. (#505)
This queue does not only contain scans, but also other sensor data,
e.g. from an IMU.
2017-09-07 14:04:00 +02:00
Wolfgang Hess 22f41d8e37 Store rotational histogram as part of the node data. (#503)
The compressed point cloud is no longer stored as part of the
node data to reduce memory consumption.
2017-09-07 11:01:03 +02:00
Christoph Schütte c2d9424342 Add Unittest for transform::RigidX. (#497) 2017-09-06 12:06:33 +02:00
Wolfgang Hess 4829ffee46 Allow rotating histograms in the rotational scan matcher. (#501)
This allows reusing histograms to match for different yaws.
Adds a unit test to test that rotated histograms match as expected.
2017-09-06 10:59:16 +02:00
Jihoon Lee 18d8ea75fa Use vector<map<>> for node_data. (#472) 2017-09-04 18:01:44 +02:00
Wolfgang Hess c8de50bd2b Add 'gravity_alignment' rotation to each node. (#500)
In 2D this replaces the 'tracking_to_tracking_2d' transform.
Also changes the 2D SparsePoseGraph to get the full 3D pose.
2017-09-04 16:24:26 +02:00
Wolfgang Hess 3948943b64 Use EstimateGravityOrientation() in 2D SLAM. (#499) 2017-09-04 11:14:51 +02:00
Wolfgang Hess e3b6f0afc5 Expose complete poses in 2D SLAM. (#498)
This changes the trajectory nodes to contain the complete 'pose'
including 'tracking_to_tracking_2d' applied already. Similar for
the 'zbar_ij' as it is returned by 'constraints()'. This allows
2D and 3D to be handled in the same way.
2017-09-01 15:40:21 +02:00
Wolfgang Hess 5673334f0e Tiny improvement of the gravity estimation. (#494) 2017-09-01 10:22:13 +02:00
Wolfgang Hess d3c49c8585 Pass odometry data to the 3D optimization problem. (#495)
Not yet used.
2017-09-01 09:58:24 +02:00
Wolfgang Hess 72bb24e362 Pass initial pose of nodes to the 3D optimization problem. (#496)
Also drops 'point_cloud' from the name since the pose is also
relevant to other sensor data.
2017-09-01 09:34:48 +02:00
Christoph Schütte 982f2bd2e0 Use TrajectoryNode::Data in FastCorrelativeMatcher. (#493)
* Use TrajectoryNode::Data in FastCorrelativeMatcher.
2017-08-31 15:10:48 +02:00
jie e2c67a7bde Fix Lint and ClangTidy warnings. (#485) 2017-08-31 13:39:47 +02:00
Wolfgang Hess 3215035c1c Add thread annotation to LogResidualHistograms(). (#492) 2017-08-31 12:26:31 +02:00
Mac Mason b54ca0cca6 Fix Rigid2 and Rigid3 to default to an identity transform. (#491) 2017-08-31 11:32:04 +02:00
Christoph Schütte 06e9112bc8 Unify GlobalTrajectoryBuilder across 2D and 3D (#489)
This PR unifies GlobalTrajectoryBuilder across 2D and 3D by templating
it with the LocalTrajectoryBuilder and the SparsePoseGraph. It thus
includes small changes to interfaces in LocalTrajectoryBuilder and
SparsePoseGraph.
2017-08-30 16:34:26 +02:00
Wolfgang Hess 3c22c8253a Refactoring: Do not pass 'constant_data' in pieces. (#488)
Also removes the no longer used range data from trajectory nodes
in 2D.
2017-08-30 14:22:12 +02:00
Wolfgang Hess 094b5a4d93 Template dispatching of sensor data. (#484)
This reduces the amount of code that needs to be written when a
new type of sensor data is introduced by a tiny bit.

Rangefinder data is not yet following this pattern.
2017-08-28 15:43:26 +02:00