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
parent
7dfe404278
commit
eff103f663
|
@ -55,6 +55,9 @@ void AddTrajectoryHandler::OnRequest(
|
||||||
// freeze the trajectory on the server.
|
// freeze the trajectory on the server.
|
||||||
trajectory_builder_options.clear_pure_localization_trimmer();
|
trajectory_builder_options.clear_pure_localization_trimmer();
|
||||||
|
|
||||||
|
// Ignore initial poses in trajectory_builder_options.
|
||||||
|
trajectory_builder_options.clear_initial_trajectory_pose();
|
||||||
|
|
||||||
GetContext<MapBuilderContextInterface>()
|
GetContext<MapBuilderContextInterface>()
|
||||||
->local_trajectory_uploader()
|
->local_trajectory_uploader()
|
||||||
->AddTrajectory(trajectory_id, expected_sensor_ids,
|
->AddTrajectory(trajectory_id, expected_sensor_ids,
|
||||||
|
|
|
@ -122,9 +122,11 @@ TEST_F(AddTrajectoryHandlerTest, WithLocalSlamUploader) {
|
||||||
.WillOnce(Return(13));
|
.WillOnce(Return(13));
|
||||||
auto upstream_trajectory_builder_options =
|
auto upstream_trajectory_builder_options =
|
||||||
request.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_2d_options();
|
||||||
upstream_trajectory_builder_options.clear_trajectory_builder_3d_options();
|
upstream_trajectory_builder_options.clear_trajectory_builder_3d_options();
|
||||||
upstream_trajectory_builder_options.clear_pure_localization_trimmer();
|
upstream_trajectory_builder_options.clear_pure_localization_trimmer();
|
||||||
|
upstream_trajectory_builder_options.clear_initial_trajectory_pose();
|
||||||
EXPECT_CALL(*mock_local_trajectory_uploader_,
|
EXPECT_CALL(*mock_local_trajectory_uploader_,
|
||||||
AddTrajectory(Eq(13), ParseSensorIds(request),
|
AddTrajectory(Eq(13), ParseSensorIds(request),
|
||||||
Truly(testing::BuildProtoPredicateEquals(
|
Truly(testing::BuildProtoPredicateEquals(
|
||||||
|
|
Loading…
Reference in New Issue