Skip to content

Commit

Permalink
Fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
douglaswsilva authored and JonasVautherin committed Mar 5, 2019
1 parent 2a62cf3 commit 26e1992
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion backend/src/grpc_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void GRPCServer::run()

builder.RegisterService(&_core);
builder.RegisterService(&_action_service);
builder.RegisterService(&_calibration_service);
builder.RegisterService(&_calibration_service);
builder.RegisterService(&_gimbal_service);
builder.RegisterService(&_camera_service);
builder.RegisterService(&_mission_service);
Expand Down
21 changes: 11 additions & 10 deletions backend/src/plugins/gimbal/gimbal_service_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,24 @@ namespace backend {

template<typename Gimbal = Gimbal>
class GimbalServiceImpl final : public rpc::gimbal::GimbalService::Service {
public:
public:
GimbalServiceImpl(Gimbal &gimbal) : _gimbal(gimbal) {}

grpc::Status
SetPitchAndYaw(grpc::ServerContext * /* context */,
const rpc::gimbal::SetPitchAndYawRequest *request,
rpc::gimbal::SetPitchAndYawResponse *response) override
grpc::Status SetPitchAndYaw(grpc::ServerContext * /* context */,
const rpc::gimbal::SetPitchAndYawRequest *request,
rpc::gimbal::SetPitchAndYawResponse *response) override
{
if (request != nullptr) {
const auto requested_gimbal_pitch = request->pitch_deg();
const auto requested_gimbal_yaw = request->yaw_deg();

const auto gimbal_result = _gimbal.set_pitch_and_yaw(requested_gimbal_pitch, requested_gimbal_yaw);
const auto gimbal_result =
_gimbal.set_pitch_and_yaw(requested_gimbal_pitch, requested_gimbal_yaw);

if (response != nullptr) {
auto *rpc_gimbal_result = new rpc::gimbal::GimbalResult();
rpc_gimbal_result->set_result(static_cast<rpc::gimbal::GimbalResult::Result>(gimbal_result));
rpc_gimbal_result->set_result(
static_cast<rpc::gimbal::GimbalResult::Result>(gimbal_result));
rpc_gimbal_result->set_result_str(dronecode_sdk::Gimbal::result_str(gimbal_result));

response->set_allocated_gimbal_result(rpc_gimbal_result);
Expand All @@ -33,8 +34,8 @@ class GimbalServiceImpl final : public rpc::gimbal::GimbalService::Service {
}

private:
Gimbal &_gimbal;
Gimbal &_gimbal;
};

} // namespace backend
} // namespace dronecode_sdk
} // namespace backend
} // namespace dronecode_sdk

0 comments on commit 26e1992

Please sign in to comment.