parent
5c694adf93
commit
176fc42c3f
|
@ -21,7 +21,6 @@
|
|||
|
||||
#include "cartographer/common/time.h"
|
||||
#include "cartographer/internal/mapping/motion_filter.h"
|
||||
#include "cartographer/mapping/pose_estimate.h"
|
||||
#include "cartographer/mapping/pose_extrapolator.h"
|
||||
#include "cartographer/mapping_2d/proto/local_trajectory_builder_options.pb.h"
|
||||
#include "cartographer/mapping_2d/scan_matching/ceres_scan_matcher.h"
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
|
||||
#include "cartographer/common/time.h"
|
||||
#include "cartographer/internal/mapping/motion_filter.h"
|
||||
#include "cartographer/mapping/pose_estimate.h"
|
||||
#include "cartographer/mapping/pose_extrapolator.h"
|
||||
#include "cartographer/mapping_3d/proto/local_trajectory_builder_options.pb.h"
|
||||
#include "cartographer/mapping_3d/scan_matching/ceres_scan_matcher.h"
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include <vector>
|
||||
|
||||
#include "cartographer/common/time.h"
|
||||
#include "cartographer/mapping/pose_estimate.h"
|
||||
#include "cartographer/mapping/submaps.h"
|
||||
#include "cartographer/sensor/fixed_frame_pose_data.h"
|
||||
#include "cartographer/sensor/imu_data.h"
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "cartographer/common/make_unique.h"
|
||||
#include "cartographer/common/port.h"
|
||||
#include "cartographer/common/time.h"
|
||||
#include "cartographer/mapping/pose_estimate.h"
|
||||
#include "cartographer/mapping/proto/trajectory_builder_options.pb.h"
|
||||
#include "cartographer/mapping/submaps.h"
|
||||
#include "cartographer/sensor/point_cloud.h"
|
||||
|
|
|
@ -51,8 +51,8 @@ class GetSumHandler
|
|||
int sum_ = 0;
|
||||
};
|
||||
|
||||
class GetRunningSumHandler
|
||||
: public RpcHandler<Stream<proto::GetSumRequest>, Stream<proto::GetSumResponse>> {
|
||||
class GetRunningSumHandler : public RpcHandler<Stream<proto::GetSumRequest>,
|
||||
Stream<proto::GetSumResponse>> {
|
||||
public:
|
||||
void OnRequest(const proto::GetSumRequest& request) override {
|
||||
sum_ += request.input();
|
||||
|
@ -66,9 +66,7 @@ class GetRunningSumHandler
|
|||
Send(std::move(response));
|
||||
}
|
||||
|
||||
void OnReadsDone() override {
|
||||
Finish(::grpc::Status::OK);
|
||||
}
|
||||
void OnReadsDone() override { Finish(::grpc::Status::OK); }
|
||||
|
||||
private:
|
||||
int sum_ = 0;
|
||||
|
@ -98,7 +96,8 @@ class ServerTest : public ::testing::Test {
|
|||
server_builder.SetNumberOfThreads(kNumThreads);
|
||||
server_builder.RegisterHandler<GetSumHandler, proto::Math>("GetSum");
|
||||
server_builder.RegisterHandler<GetSquareHandler, proto::Math>("GetSquare");
|
||||
server_builder.RegisterHandler<GetRunningSumHandler, proto::Math>("GetRunningSum");
|
||||
server_builder.RegisterHandler<GetRunningSumHandler, proto::Math>(
|
||||
"GetRunningSum");
|
||||
server_ = server_builder.Build();
|
||||
|
||||
client_channel_ =
|
||||
|
@ -123,7 +122,7 @@ TEST_F(ServerTest, ProcessRpcStreamTest) {
|
|||
server_->Start();
|
||||
|
||||
proto::GetSumResponse result;
|
||||
std::unique_ptr<grpc::ClientWriter<proto::GetSumRequest> > writer(
|
||||
std::unique_ptr<grpc::ClientWriter<proto::GetSumRequest>> writer(
|
||||
stub_->GetSum(&client_context_, &result));
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
proto::GetSumRequest request;
|
||||
|
|
Loading…
Reference in New Issue