Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RB-1640] Add config option to invert base_link to map tf #3

Open
wants to merge 82 commits into
base: master
Choose a base branch
from

Conversation

schayapathy
Copy link

2 nodes cannot simultaneously publish map_frame.
If AMCL is running them AMCL provides map->odom frame. In order to run both AMCL and cartographer in the same environment provide a configuration parameter which when set to true will invert map_cartographer->base_link tf.

Testing:
invert_map_frame_to_published_frame_tf = true,
AMCL provides map->odom, cartographer provides base_link->map_cartographer.
frames_with_amcl.pdf
When AMCL is not running, we can set this parameter to false.
invert_map_frame_to_published_frame_tf = false,
cartographer provides map -> base_link.
frames_without_amcl.pdf

MichaelGrupp and others added 30 commits July 15, 2019 17:07
Prevents confusion with TrajectoryState and GetTrajectoryStates()
of the pose graph interface. The affected data is only local.
…apher-project#910)

cartographer-project/rfcs#35

- makes use of the trajectory state in `map_builder` and `node`
- adds a service to query the trajectory states
- follow-up to cartographer-project/cartographer#1214
  that takes the deleted state into account in the `/finish_trajectory` service
  (could crash otherwise)
…project#912)

We don't need it after the occupancy grid is drawn.
Reduces the memory consumption especially for large maps.
- minimal counter, gauge and histogram implementations
- metric family interfaces as defined in libcartographer
- serializable to ROS messages

RFC: cartographer-project/rfcs#26
…er-project#917)

[RFC 24](https://github.com/googlecartographer/rfcs/blob/master/text/0024-monitoring-ros.md)

Public API:
  - adds `cartographer_ros::metrics::FamilyFactory`
  - compatible with `::cartographer::metrics::RegisterAllMetrics`

Public RPC interface:
  - adds the ROS service `/read_metrics`
  - response contains the latest values of all available metric families
This PR adds additional bookkeeping for trajectories that we scheduled for
finishing.

In Node::RunFinalOptimization(...), we were calling FinishTrajectory for
every active trajectory (state == ACTIVE). Since the state only gets updated
once the corresponding worker for the FinishTrajectory task is
scheduled, we were potentially calling FinishTrajectory twice for a
single trajectory id.

Reproducible on master e.g. with 
```
roslaunch cartographer_ros offline_backpack_2d.launch bag_filenames:=b2-2016-02-02-14-01-56.bag no_rviz:=true
```
To compare different SLAM software online, it is necessary to
disable tf broadcast.
Because we already have a parameter "pose_publish_period_sec",
we use a zero value here to turn off tf broadcast.
Use mutex locker instead of atomic operations in Gauge.
Remove unnecessary constructor overload from Histogram.
This adds a .clang-format file, so that git clang-format uses
Google style without the need to remember the commandline flag.
Similar to cartographer-project/cartographer#1249.
`std::bind` is bug prone and should be avoided.
Lambdas are a more general and safer replacement.
Similar to cartographer-project/cartographer#1261.
This is useful for tuning/debugging to rule out (simulated) time issues
(because published pose will then only depend on header times).
Another use case is when Cartographer runs on a separate machine
that has a different system clock than the sensors.
cartographer-project/cartographer#1286 modified Submap::ToProto such that grids for unfinished submaps are no longer serialized. This commit fixes the breakage this introduced in the pbstream exporting binaries.
- add new ROS services
- remove outdated text about command line flags, refer users to `--help`
- bonus: fix a few typos, a Sphinx build warning and follow cartographer-project/cartographer#1268
…apher-project#966)

- default to false in gRPC node (unsupported in `MapBuilderStub`)
- default to true in classic ROS nodes (as it was before)
- add as parameter to `write_state`
MichaelGrupp and others added 25 commits July 15, 2019 17:07
…#1087)

* Update /write_state call in assets writer docs.

Follow-up to cartographer-project#966
Closes cartographer-project#1086

* typo

* bump googlebot
This fixes cartographer-project#1050. Tested standalone compilation and with the debian fakeroot tool. I had to build with a custom Protobuf3 instance though, so another build-check on a regular setup would be appreciated.

Before this change all *.cc files would be included. If subprojects
were run individually with the Debian package generator. This resulted in an
inclusion of temporarily checked out *.cc from the abseil include. This
change fixes the import behaviour and enables the creation of a valid
package.
…rapher-project#1089)

* Consider waiting trajectories with a sensor bridge as active.

Fixes a corner case where trajectories that didn't start SLAMing yet
couldn't be finished, e.g. due to waiting for sensor data. They don't
appear in the trajectory states list of the pose graph yet but already
have a trajectory builder.

cartographer-project/cartographer#1367
Surprising that this has not lead to any issues yet. 
This just works by chance on other systems if QT has been find_packaged before.
…er-project#1157)

* Don't run final optimization in visualize_pbstream.launch

Replaces the offline node with the normal node.

The problem is that the offline node immediately runs a final
optimization with `visualize_pbstream.lua`, which is most likely not the
configuration that was used to generate the pbstream. This can lead to
effects like distortions in the map e.g. due to different weights, even
though the actual saved state is fine.

* Drop all /echoes or /imu messages.

* Use -start_trajectory_with_default_topics=false
…pher-project#1166)

For every trajectory, writes tf
        FLAGS_parent_frame --> trajectory_`trajectory_id`
The expected topic name for the cartographer seems to be landmark not landmarks even tough a list of landmarks is expected.
…#1235)

The metrics registry is used as a raw pointer reference in map builder
and must outlive it.

Since C++ destroys in reverse declaration order, we have to put the
registry declaration before the map builder bridge.

Fixes cartographer-project#1234.
Added a note to point out that even if all the SLAM options are set for a 2D SLAM the landmarks will remain 3D objects.
Expanded landmarks to included more information and make it more clear and first-time user friendly. Used knowledge from the issues, especially issue cartographer-project#909 and cartographer-project#1067
Apparently the format bot uses a bleeding edge clang-format that uses
the new Google style and reformats a bunch of files in every PR. This is
an empty commit to trigger this in a separate commit.

See llvm-mirror/clang@62e3198
…ject#1262)

Some service handlers need to check if a trajectory is in a valid
state for the requested operation. If it's not, they return an error
response.

`Node::CheckTrajectoryState` allows to avoid code duplication in such
situations.
I have added a few lines to the doc to alert users to remove ros abseil-cpp and also to change the rosinstall file if they wish to checkout a different version of cartographer. As discussed in cartographer-project#1208
…pher-project#1204)

This allows to serialize the state also when no bagfile is given, e.g.
when the offline node is used to run an optimization and/or trimming
configuration on a pbstream. Or simply when one wants to use a custom
name directly. This doesn't break compatibility with the previous CLI.
…er-project#1222)

This `/trajectory_query` service allows to look up trajectory segments
from the pose graph.

This can be useful if one wants to get optimized trajectory data from
the current SLAM run and listening to live TF data would be too noisy.
For example, to stitch buffered point cloud data from a depth sensor
based on a recent localization trajectory segment of a robot.

Before, the pose graph trajectory nodes were not available except for
the trajectory marker topic (only positions, no orientation; inefficient)
or after serialization (which is not practical in live operation).
* Simplify start_trajectory.

* Ran clang-format.

* Make corrections based on the review

* Make corrections based on review BossaNova#2, remove obsolete functions

* Remove unnecessary local variables
@akshay-prsd
Copy link

Have we tried catkin_make run_tests_cartographer_ros?

@schayapathy
Copy link
Author

Yes
ninja test -j4 -l4 in '/home/sindhura/catkin_ws/build_isolated/cartographer_ros'
ninja: warning: multiple rules generate abseil/src/abseil-build/absl/synchronization/libabsl_synchronization.a. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
[0/1] Running tests...
Test project /home/sindhura/catkin_ws/build_isolated/cartographer_ros
Start 1: _ctest_cartographer_ros_gtest_time_conversion_test
1/4 Test #1: _ctest_cartographer_ros_gtest_time_conversion_test ....... Passed 0.03 sec
Start 2: _ctest_cartographer_ros_gtest_configuration_files_test
2/4 Test #2: _ctest_cartographer_ros_gtest_configuration_files_test ... Passed 0.06 sec
Start 3: _ctest_cartographer_ros_gtest_msg_conversion_test
3/4 Test #3: _ctest_cartographer_ros_gtest_msg_conversion_test ........ Passed 0.03 sec
Start 4: _ctest_cartographer_ros_gtest_metrics_test
4/4 Test #4: _ctest_cartographer_ros_gtest_metrics_test ............... Passed 0.03 sec

100% tests passed, 0 tests failed out of 4

Total Test time (real) = 0.15 sec

@akshay-prsd
Copy link

Looks good. Will approve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.