Ignore initial poses on gRPC server side. (#1234)

Fixes a crash if a client initializes with an initial pose inside a frozen map
that isn't known to the server.
master
Michael Grupp 2018-07-09 15:03:40 +02:00 committed by Wally B. Feed
parent 7dfe404278
commit eff103f663
2 changed files with 5 additions and 0 deletions

View File

@ -55,6 +55,9 @@ void AddTrajectoryHandler::OnRequest(
// freeze the trajectory on the server.
trajectory_builder_options.clear_pure_localization_trimmer();
// Ignore initial poses in trajectory_builder_options.
trajectory_builder_options.clear_initial_trajectory_pose();
GetContext<MapBuilderContextInterface>()
->local_trajectory_uploader()
->AddTrajectory(trajectory_id, expected_sensor_ids,

View File

@ -122,9 +122,11 @@ TEST_F(AddTrajectoryHandlerTest, WithLocalSlamUploader) {
.WillOnce(Return(13));
auto upstream_trajectory_builder_options =
request.trajectory_builder_options();
// Reproduce the changes to the request as done by the handler.
upstream_trajectory_builder_options.clear_trajectory_builder_2d_options();
upstream_trajectory_builder_options.clear_trajectory_builder_3d_options();
upstream_trajectory_builder_options.clear_pure_localization_trimmer();
upstream_trajectory_builder_options.clear_initial_trajectory_pose();
EXPECT_CALL(*mock_local_trajectory_uploader_,
AddTrajectory(Eq(13), ParseSensorIds(request),
Truly(testing::BuildProtoPredicateEquals(