diff --git a/examples/gimbal_full_control/CMakeLists.txt b/examples/gimbal_full_control/CMakeLists.txt new file mode 100644 index 0000000000..045a407a7c --- /dev/null +++ b/examples/gimbal_full_control/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.10.2) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +project(gimbal_full_control) + +add_executable(gimbal_full_control + gimbal_full_control.cpp +) + +find_package(MAVSDK REQUIRED) + +target_link_libraries(gimbal_full_control + MAVSDK::mavsdk +) + +if(NOT MSVC) + add_compile_options(gimbal PRIVATE -Wall -Wextra) +else() + add_compile_options(gimbal PRIVATE -WX -W2) +endif() diff --git a/examples/gimbal_full_control/gimbal_full_control.cpp b/examples/gimbal_full_control/gimbal_full_control.cpp new file mode 100644 index 0000000000..e16dec8435 --- /dev/null +++ b/examples/gimbal_full_control/gimbal_full_control.cpp @@ -0,0 +1,118 @@ +// +// Example to demonstrate how to control a gimbal including roll. +// +// Can be tested against PX4 SITL with Typhoon H480: +// make px4_sitl gazebo_typhoon_h480 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace mavsdk; +using std::chrono::seconds; +using std::this_thread::sleep_for; + +void usage(const std::string& bin_name) +{ + std::cerr << "Usage : " << bin_name << " \n" + << "Connection URL format should be :\n" + << " For TCP : tcp://[server_host][:server_port]\n" + << " For UDP : udp://[bind_host][:bind_port]\n" + << " For Serial : serial:///path/to/serial/dev[:baudrate]\n" + << "For example, to connect to the simulator use URL: udp://:14540\n"; +} + +int main(int argc, char** argv) +{ + if (argc != 2) { + usage(argv[0]); + return 1; + } + + Mavsdk mavsdk{Mavsdk::Configuration{Mavsdk::ComponentType::GroundStation}}; + ConnectionResult connection_result = mavsdk.add_any_connection(argv[1]); + + if (connection_result != ConnectionResult::Success) { + std::cerr << "Connection failed: " << connection_result << '\n'; + return 1; + } + + auto system = mavsdk.first_autopilot(3.0); + if (!system) { + std::cerr << "Timed out waiting for system\n"; + return 1; + } + + // Instantiate plugins. + auto telemetry = Telemetry{system.value()}; + auto gimbal = Gimbal{system.value()}; + + // We want to listen to the camera/gimbal angle of the drone at 5 Hz. + const Telemetry::Result set_rate_result = telemetry.set_rate_camera_attitude(5.0); + if (set_rate_result != Telemetry::Result::Success) { + std::cerr << "Setting rate failed:" << set_rate_result << '\n'; + return 1; + } + + // Set up callback to monitor camera/gimbal angle + telemetry.subscribe_camera_attitude_euler([](Telemetry::EulerAngle angle) { + std::cout << "Gimbal angle pitch: " << angle.pitch_deg << " deg, yaw: " << angle.yaw_deg + << " deg, roll: " << angle.roll_deg << " deg\n"; + }); + + std::cout << "Start controlling gimbal...\n"; + Gimbal::Result gimbal_result = gimbal.take_control(Gimbal::ControlMode::Primary); + if (gimbal_result != Gimbal::Result::Success) { + std::cerr << "Could not take gimbal control: " << gimbal_result << '\n'; + return 1; + } + + std::cout << "Set yaw mode to lock to a specific direction...\n"; + gimbal_result = gimbal.set_mode(Gimbal::GimbalMode::YawLock); + if (gimbal_result != Gimbal::Result::Success) { + std::cerr << "Could not set to lock mode: " << gimbal_result << '\n'; + return 1; + } + + std::cout << "Test SetAngles...\n"; + std::cout << "Roll=0 Pitch=0 Yaw=0\n"; + gimbal.set_angles(0.0f, 0.0f, 0.0f); + sleep_for(seconds(5)); + std::cout << "Roll=-30 Pitch=0 Yaw=0\n"; + gimbal.set_angles(-30.0f, 0.0f, 0.0f); + sleep_for(seconds(5)); + std::cout << "Roll=30 Pitch=0 Yaw=0\n"; + gimbal.set_angles(30.0f, 0.0f, 0.0f); + sleep_for(seconds(5)); + std::cout << "Roll=0 Pitch=-30 Yaw=0\n"; + gimbal.set_angles(0.0f, -30.0f, 0.0f); + sleep_for(seconds(5)); + std::cout << "Roll=0 Pitch=30 Yaw=0\n"; + gimbal.set_angles(0.0f, 30.0f, 0.0f); + sleep_for(seconds(5)); + std::cout << "Roll=0 Pitch=0 Yaw=-30\n"; + gimbal.set_angles(0.0f, 0.0f, -30.0f); + sleep_for(seconds(5)); + std::cout << "Roll=0 Pitch=0 Yaw=30\n"; + gimbal.set_angles(0.0f, 0.0f, 30.0f); + sleep_for(seconds(5)); + std::cout << "Roll=0 Pitch=0 Yaw=0\n"; + gimbal.set_angles(0.0f, 0.0f, 0.0f); + sleep_for(seconds(2)); + + std::cout << "Stop controlling gimbal...\n"; + gimbal_result = gimbal.release_control(); + if (gimbal_result != Gimbal::Result::Success) { + std::cerr << "Could not take gimbal control: " << gimbal_result << '\n'; + return 1; + } + + std::cout << "Finished.\n"; + return 0; +} diff --git a/proto b/proto index a10b832c7a..736bc2af1b 160000 --- a/proto +++ b/proto @@ -1 +1 @@ -Subproject commit a10b832c7a342cf6a85ce771ea6671eef01ab892 +Subproject commit 736bc2af1b6eae5c255b5b68014597527bd78c8c diff --git a/src/mavsdk/core/CMakeLists.txt b/src/mavsdk/core/CMakeLists.txt index 07485c3756..c8b1b1e3ef 100644 --- a/src/mavsdk/core/CMakeLists.txt +++ b/src/mavsdk/core/CMakeLists.txt @@ -121,7 +121,7 @@ if(ANDROID) endif() if((BUILD_STATIC_MAVSDK_SERVER AND ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")) OR - (${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "(armv6|armv7)")) + (${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "(armv6|armv7|aarch64)")) target_link_libraries(mavsdk PRIVATE atomic) endif() diff --git a/src/mavsdk/plugins/gimbal/gimbal.cpp b/src/mavsdk/plugins/gimbal/gimbal.cpp index 220b75933b..849f34f037 100644 --- a/src/mavsdk/plugins/gimbal/gimbal.cpp +++ b/src/mavsdk/plugins/gimbal/gimbal.cpp @@ -20,6 +20,17 @@ Gimbal::Gimbal(std::shared_ptr system) : Gimbal::~Gimbal() {} +void Gimbal::set_angles_async( + float roll_deg, float pitch_deg, float yaw_deg, const ResultCallback callback) +{ + _impl->set_angles_async(roll_deg, pitch_deg, yaw_deg, callback); +} + +Gimbal::Result Gimbal::set_angles(float roll_deg, float pitch_deg, float yaw_deg) const +{ + return _impl->set_angles(roll_deg, pitch_deg, yaw_deg); +} + void Gimbal::set_pitch_and_yaw_async(float pitch_deg, float yaw_deg, const ResultCallback callback) { _impl->set_pitch_and_yaw_async(pitch_deg, yaw_deg, callback); diff --git a/src/mavsdk/plugins/gimbal/gimbal_impl.cpp b/src/mavsdk/plugins/gimbal/gimbal_impl.cpp index ee0e3d2264..ee206822e6 100644 --- a/src/mavsdk/plugins/gimbal/gimbal_impl.cpp +++ b/src/mavsdk/plugins/gimbal/gimbal_impl.cpp @@ -79,6 +79,20 @@ void GimbalImpl::process_gimbal_manager_information(const mavlink_message_t& mes } } +Gimbal::Result GimbalImpl::set_angles(float roll_deg, float pitch_deg, float yaw_deg) +{ + wait_for_protocol(); + + return _gimbal_protocol->set_angles(roll_deg, pitch_deg, yaw_deg); +} + +void GimbalImpl::set_angles_async( + float roll_deg, float pitch_deg, float yaw_deg, Gimbal::ResultCallback callback) +{ + wait_for_protocol_async( + [=]() { _gimbal_protocol->set_angles_async(roll_deg, pitch_deg, yaw_deg, callback); }); +} + Gimbal::Result GimbalImpl::set_pitch_and_yaw(float pitch_deg, float yaw_deg) { wait_for_protocol(); diff --git a/src/mavsdk/plugins/gimbal/gimbal_impl.h b/src/mavsdk/plugins/gimbal/gimbal_impl.h index 7a7ab1f8f4..7396dc8eca 100644 --- a/src/mavsdk/plugins/gimbal/gimbal_impl.h +++ b/src/mavsdk/plugins/gimbal/gimbal_impl.h @@ -20,6 +20,10 @@ class GimbalImpl : public PluginImplBase { void enable() override; void disable() override; + Gimbal::Result set_angles(float roll_deg, float pitch_deg, float yaw_deg); + void set_angles_async( + float roll_deg, float pitch_deg, float yaw_deg, Gimbal::ResultCallback callback); + Gimbal::Result set_pitch_and_yaw(float pitch_deg, float yaw_deg); void set_pitch_and_yaw_async(float pitch_deg, float yaw_deg, Gimbal::ResultCallback callback); diff --git a/src/mavsdk/plugins/gimbal/gimbal_protocol_base.h b/src/mavsdk/plugins/gimbal/gimbal_protocol_base.h index 5bb5a4d522..09488f24a9 100644 --- a/src/mavsdk/plugins/gimbal/gimbal_protocol_base.h +++ b/src/mavsdk/plugins/gimbal/gimbal_protocol_base.h @@ -11,6 +11,10 @@ class GimbalProtocolBase { GimbalProtocolBase(SystemImpl& system_impl) : _system_impl(system_impl) {} virtual ~GimbalProtocolBase() = default; + virtual Gimbal::Result set_angles(float roll_deg, float pitch_deg, float yaw_deg) = 0; + virtual void set_angles_async( + float roll_deg, float pitch_deg, float yaw_deg, Gimbal::ResultCallback callback) = 0; + virtual Gimbal::Result set_pitch_and_yaw(float pitch_deg, float yaw_deg) = 0; virtual void set_pitch_and_yaw_async(float pitch_deg, float yaw_deg, Gimbal::ResultCallback callback) = 0; diff --git a/src/mavsdk/plugins/gimbal/gimbal_protocol_v1.cpp b/src/mavsdk/plugins/gimbal/gimbal_protocol_v1.cpp index 434c090729..b6ae78db93 100644 --- a/src/mavsdk/plugins/gimbal/gimbal_protocol_v1.cpp +++ b/src/mavsdk/plugins/gimbal/gimbal_protocol_v1.cpp @@ -13,9 +13,8 @@ GimbalProtocolV1::~GimbalProtocolV1() _system_impl.remove_call_every(_control_cookie); } -Gimbal::Result GimbalProtocolV1::set_pitch_and_yaw(float pitch_deg, float yaw_deg) +Gimbal::Result GimbalProtocolV1::set_angles(float roll_deg, float pitch_deg, float yaw_deg) { - const float roll_deg = 0.0f; MavlinkCommandSender::CommandLong command{}; command.command = MAV_CMD_DO_MOUNT_CONTROL; @@ -28,10 +27,9 @@ Gimbal::Result GimbalProtocolV1::set_pitch_and_yaw(float pitch_deg, float yaw_de return GimbalImpl::gimbal_result_from_command_result(_system_impl.send_command(command)); } -void GimbalProtocolV1::set_pitch_and_yaw_async( - float pitch_deg, float yaw_deg, Gimbal::ResultCallback callback) +void GimbalProtocolV1::set_angles_async( + float roll_deg, float pitch_deg, float yaw_deg, Gimbal::ResultCallback callback) { - const float roll_deg = 0.0f; MavlinkCommandSender::CommandLong command{}; command.command = MAV_CMD_DO_MOUNT_CONTROL; @@ -48,6 +46,17 @@ void GimbalProtocolV1::set_pitch_and_yaw_async( }); } +Gimbal::Result GimbalProtocolV1::set_pitch_and_yaw(float pitch_deg, float yaw_deg) +{ + return set_angles(0.0f, pitch_deg, yaw_deg); +} + +void GimbalProtocolV1::set_pitch_and_yaw_async( + float pitch_deg, float yaw_deg, Gimbal::ResultCallback callback) +{ + set_angles_async(0.0f, pitch_deg, yaw_deg, callback); +} + Gimbal::Result GimbalProtocolV1::set_pitch_rate_and_yaw_rate(float pitch_rate_deg_s, float yaw_rate_deg_s) { diff --git a/src/mavsdk/plugins/gimbal/gimbal_protocol_v1.h b/src/mavsdk/plugins/gimbal/gimbal_protocol_v1.h index 25595facc3..1e286120f0 100644 --- a/src/mavsdk/plugins/gimbal/gimbal_protocol_v1.h +++ b/src/mavsdk/plugins/gimbal/gimbal_protocol_v1.h @@ -13,6 +13,10 @@ class GimbalProtocolV1 : public GimbalProtocolBase { GimbalProtocolV1(SystemImpl& system_impl); ~GimbalProtocolV1() override; + Gimbal::Result set_angles(float roll_deg, float pitch_deg, float yaw_deg) override; + void set_angles_async( + float roll_deg, float pitch_deg, float yaw_deg, Gimbal::ResultCallback callback) override; + Gimbal::Result set_pitch_and_yaw(float pitch_deg, float yaw_deg) override; void set_pitch_and_yaw_async( float pitch_deg, float yaw_deg, Gimbal::ResultCallback callback) override; diff --git a/src/mavsdk/plugins/gimbal/gimbal_protocol_v2.cpp b/src/mavsdk/plugins/gimbal/gimbal_protocol_v2.cpp index d8a123cd28..6276735187 100644 --- a/src/mavsdk/plugins/gimbal/gimbal_protocol_v2.cpp +++ b/src/mavsdk/plugins/gimbal/gimbal_protocol_v2.cpp @@ -61,9 +61,9 @@ void GimbalProtocolV2::process_gimbal_manager_status(const mavlink_message_t& me } } -Gimbal::Result GimbalProtocolV2::set_pitch_and_yaw(float pitch_deg, float yaw_deg) +Gimbal::Result GimbalProtocolV2::set_angles(float roll_deg, float pitch_deg, float yaw_deg) { - const float roll_rad = 0.0f; + const float roll_rad = to_rad_from_deg(roll_deg); const float pitch_rad = to_rad_from_deg(pitch_deg); const float yaw_rad = to_rad_from_deg(yaw_deg); @@ -95,11 +95,27 @@ Gimbal::Result GimbalProtocolV2::set_pitch_and_yaw(float pitch_deg, float yaw_de Gimbal::Result::Error; } +void GimbalProtocolV2::set_angles_async( + float roll_deg, float pitch_deg, float yaw_deg, Gimbal::ResultCallback callback) +{ + // Sending the message should be quick and we can just do that straighaway. + Gimbal::Result result = set_angles(roll_deg, pitch_deg, yaw_deg); + + if (callback) { + _system_impl.call_user_callback([callback, result]() { callback(result); }); + } +} + +Gimbal::Result GimbalProtocolV2::set_pitch_and_yaw(float pitch_deg, float yaw_deg) +{ + return set_angles(0.0f, pitch_deg, yaw_deg); +} + void GimbalProtocolV2::set_pitch_and_yaw_async( float pitch_deg, float yaw_deg, Gimbal::ResultCallback callback) { // Sending the message should be quick and we can just do that straighaway. - Gimbal::Result result = set_pitch_and_yaw(pitch_deg, yaw_deg); + Gimbal::Result result = set_angles(0.0f, pitch_deg, yaw_deg); if (callback) { _system_impl.call_user_callback([callback, result]() { callback(result); }); diff --git a/src/mavsdk/plugins/gimbal/gimbal_protocol_v2.h b/src/mavsdk/plugins/gimbal/gimbal_protocol_v2.h index e7f60a3104..b625858318 100644 --- a/src/mavsdk/plugins/gimbal/gimbal_protocol_v2.h +++ b/src/mavsdk/plugins/gimbal/gimbal_protocol_v2.h @@ -14,6 +14,10 @@ class GimbalProtocolV2 : public GimbalProtocolBase { uint8_t gimbal_manager_compid); ~GimbalProtocolV2() override; + Gimbal::Result set_angles(float roll_deg, float pitch_deg, float yaw_deg) override; + void set_angles_async( + float roll_deg, float pitch_deg, float yaw_deg, Gimbal::ResultCallback callback) override; + Gimbal::Result set_pitch_and_yaw(float pitch_deg, float yaw_deg) override; void set_pitch_and_yaw_async( float pitch_deg, float yaw_deg, Gimbal::ResultCallback callback) override; diff --git a/src/mavsdk/plugins/gimbal/include/plugins/gimbal/gimbal.h b/src/mavsdk/plugins/gimbal/include/plugins/gimbal/gimbal.h index d9188909df..b8751da9ec 100644 --- a/src/mavsdk/plugins/gimbal/include/plugins/gimbal/gimbal.h +++ b/src/mavsdk/plugins/gimbal/include/plugins/gimbal/gimbal.h @@ -143,6 +143,31 @@ class Gimbal : public PluginBase { */ using ResultCallback = std::function; + /** + * @brief Set gimbal roll, pitch and yaw angles. + * + * This sets the desired roll, pitch and yaw angles of a gimbal. + * Will return when the command is accepted, however, it might + * take the gimbal longer to actually be set to the new angles. + * + * This function is non-blocking. See 'set_angles' for the blocking counterpart. + */ + void + set_angles_async(float roll_deg, float pitch_deg, float yaw_deg, const ResultCallback callback); + + /** + * @brief Set gimbal roll, pitch and yaw angles. + * + * This sets the desired roll, pitch and yaw angles of a gimbal. + * Will return when the command is accepted, however, it might + * take the gimbal longer to actually be set to the new angles. + * + * This function is blocking. See 'set_angles_async' for the non-blocking counterpart. + * + * @return Result of request. + */ + Result set_angles(float roll_deg, float pitch_deg, float yaw_deg) const; + /** * @brief Set gimbal pitch and yaw angles. * diff --git a/src/mavsdk_server/src/generated/gimbal/gimbal.grpc.pb.cc b/src/mavsdk_server/src/generated/gimbal/gimbal.grpc.pb.cc index dcf204499e..5d61079fd4 100644 --- a/src/mavsdk_server/src/generated/gimbal/gimbal.grpc.pb.cc +++ b/src/mavsdk_server/src/generated/gimbal/gimbal.grpc.pb.cc @@ -24,6 +24,7 @@ namespace rpc { namespace gimbal { static const char* GimbalService_method_names[] = { + "/mavsdk.rpc.gimbal.GimbalService/SetAngles", "/mavsdk.rpc.gimbal.GimbalService/SetPitchAndYaw", "/mavsdk.rpc.gimbal.GimbalService/SetPitchRateAndYawRate", "/mavsdk.rpc.gimbal.GimbalService/SetMode", @@ -40,15 +41,39 @@ std::unique_ptr< GimbalService::Stub> GimbalService::NewStub(const std::shared_p } GimbalService::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) - : channel_(channel), rpcmethod_SetPitchAndYaw_(GimbalService_method_names[0], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_SetPitchRateAndYawRate_(GimbalService_method_names[1], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_SetMode_(GimbalService_method_names[2], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_SetRoiLocation_(GimbalService_method_names[3], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_TakeControl_(GimbalService_method_names[4], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_ReleaseControl_(GimbalService_method_names[5], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_SubscribeControl_(GimbalService_method_names[6], options.suffix_for_stats(),::grpc::internal::RpcMethod::SERVER_STREAMING, channel) + : channel_(channel), rpcmethod_SetAngles_(GimbalService_method_names[0], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_SetPitchAndYaw_(GimbalService_method_names[1], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_SetPitchRateAndYawRate_(GimbalService_method_names[2], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_SetMode_(GimbalService_method_names[3], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_SetRoiLocation_(GimbalService_method_names[4], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_TakeControl_(GimbalService_method_names[5], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_ReleaseControl_(GimbalService_method_names[6], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) + , rpcmethod_SubscribeControl_(GimbalService_method_names[7], options.suffix_for_stats(),::grpc::internal::RpcMethod::SERVER_STREAMING, channel) {} +::grpc::Status GimbalService::Stub::SetAngles(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetAnglesRequest& request, ::mavsdk::rpc::gimbal::SetAnglesResponse* response) { + return ::grpc::internal::BlockingUnaryCall< ::mavsdk::rpc::gimbal::SetAnglesRequest, ::mavsdk::rpc::gimbal::SetAnglesResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_SetAngles_, context, request, response); +} + +void GimbalService::Stub::async::SetAngles(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetAnglesRequest* request, ::mavsdk::rpc::gimbal::SetAnglesResponse* response, std::function f) { + ::grpc::internal::CallbackUnaryCall< ::mavsdk::rpc::gimbal::SetAnglesRequest, ::mavsdk::rpc::gimbal::SetAnglesResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_SetAngles_, context, request, response, std::move(f)); +} + +void GimbalService::Stub::async::SetAngles(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetAnglesRequest* request, ::mavsdk::rpc::gimbal::SetAnglesResponse* response, ::grpc::ClientUnaryReactor* reactor) { + ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_SetAngles_, context, request, response, reactor); +} + +::grpc::ClientAsyncResponseReader< ::mavsdk::rpc::gimbal::SetAnglesResponse>* GimbalService::Stub::PrepareAsyncSetAnglesRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetAnglesRequest& request, ::grpc::CompletionQueue* cq) { + return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::mavsdk::rpc::gimbal::SetAnglesResponse, ::mavsdk::rpc::gimbal::SetAnglesRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_SetAngles_, context, request); +} + +::grpc::ClientAsyncResponseReader< ::mavsdk::rpc::gimbal::SetAnglesResponse>* GimbalService::Stub::AsyncSetAnglesRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetAnglesRequest& request, ::grpc::CompletionQueue* cq) { + auto* result = + this->PrepareAsyncSetAnglesRaw(context, request, cq); + result->StartCall(); + return result; +} + ::grpc::Status GimbalService::Stub::SetPitchAndYaw(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetPitchAndYawRequest& request, ::mavsdk::rpc::gimbal::SetPitchAndYawResponse* response) { return ::grpc::internal::BlockingUnaryCall< ::mavsdk::rpc::gimbal::SetPitchAndYawRequest, ::mavsdk::rpc::gimbal::SetPitchAndYawResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_SetPitchAndYaw_, context, request, response); } @@ -207,6 +232,16 @@ GimbalService::Service::Service() { AddMethod(new ::grpc::internal::RpcServiceMethod( GimbalService_method_names[0], ::grpc::internal::RpcMethod::NORMAL_RPC, + new ::grpc::internal::RpcMethodHandler< GimbalService::Service, ::mavsdk::rpc::gimbal::SetAnglesRequest, ::mavsdk::rpc::gimbal::SetAnglesResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( + [](GimbalService::Service* service, + ::grpc::ServerContext* ctx, + const ::mavsdk::rpc::gimbal::SetAnglesRequest* req, + ::mavsdk::rpc::gimbal::SetAnglesResponse* resp) { + return service->SetAngles(ctx, req, resp); + }, this))); + AddMethod(new ::grpc::internal::RpcServiceMethod( + GimbalService_method_names[1], + ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< GimbalService::Service, ::mavsdk::rpc::gimbal::SetPitchAndYawRequest, ::mavsdk::rpc::gimbal::SetPitchAndYawResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](GimbalService::Service* service, ::grpc::ServerContext* ctx, @@ -215,7 +250,7 @@ GimbalService::Service::Service() { return service->SetPitchAndYaw(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - GimbalService_method_names[1], + GimbalService_method_names[2], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< GimbalService::Service, ::mavsdk::rpc::gimbal::SetPitchRateAndYawRateRequest, ::mavsdk::rpc::gimbal::SetPitchRateAndYawRateResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](GimbalService::Service* service, @@ -225,7 +260,7 @@ GimbalService::Service::Service() { return service->SetPitchRateAndYawRate(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - GimbalService_method_names[2], + GimbalService_method_names[3], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< GimbalService::Service, ::mavsdk::rpc::gimbal::SetModeRequest, ::mavsdk::rpc::gimbal::SetModeResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](GimbalService::Service* service, @@ -235,7 +270,7 @@ GimbalService::Service::Service() { return service->SetMode(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - GimbalService_method_names[3], + GimbalService_method_names[4], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< GimbalService::Service, ::mavsdk::rpc::gimbal::SetRoiLocationRequest, ::mavsdk::rpc::gimbal::SetRoiLocationResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](GimbalService::Service* service, @@ -245,7 +280,7 @@ GimbalService::Service::Service() { return service->SetRoiLocation(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - GimbalService_method_names[4], + GimbalService_method_names[5], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< GimbalService::Service, ::mavsdk::rpc::gimbal::TakeControlRequest, ::mavsdk::rpc::gimbal::TakeControlResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](GimbalService::Service* service, @@ -255,7 +290,7 @@ GimbalService::Service::Service() { return service->TakeControl(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - GimbalService_method_names[5], + GimbalService_method_names[6], ::grpc::internal::RpcMethod::NORMAL_RPC, new ::grpc::internal::RpcMethodHandler< GimbalService::Service, ::mavsdk::rpc::gimbal::ReleaseControlRequest, ::mavsdk::rpc::gimbal::ReleaseControlResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( [](GimbalService::Service* service, @@ -265,7 +300,7 @@ GimbalService::Service::Service() { return service->ReleaseControl(ctx, req, resp); }, this))); AddMethod(new ::grpc::internal::RpcServiceMethod( - GimbalService_method_names[6], + GimbalService_method_names[7], ::grpc::internal::RpcMethod::SERVER_STREAMING, new ::grpc::internal::ServerStreamingHandler< GimbalService::Service, ::mavsdk::rpc::gimbal::SubscribeControlRequest, ::mavsdk::rpc::gimbal::ControlResponse>( [](GimbalService::Service* service, @@ -279,6 +314,13 @@ GimbalService::Service::Service() { GimbalService::Service::~Service() { } +::grpc::Status GimbalService::Service::SetAngles(::grpc::ServerContext* context, const ::mavsdk::rpc::gimbal::SetAnglesRequest* request, ::mavsdk::rpc::gimbal::SetAnglesResponse* response) { + (void) context; + (void) request; + (void) response; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + ::grpc::Status GimbalService::Service::SetPitchAndYaw(::grpc::ServerContext* context, const ::mavsdk::rpc::gimbal::SetPitchAndYawRequest* request, ::mavsdk::rpc::gimbal::SetPitchAndYawResponse* response) { (void) context; (void) request; diff --git a/src/mavsdk_server/src/generated/gimbal/gimbal.grpc.pb.h b/src/mavsdk_server/src/generated/gimbal/gimbal.grpc.pb.h index b54700bab5..67263b7690 100644 --- a/src/mavsdk_server/src/generated/gimbal/gimbal.grpc.pb.h +++ b/src/mavsdk_server/src/generated/gimbal/gimbal.grpc.pb.h @@ -40,6 +40,20 @@ class GimbalService final { virtual ~StubInterface() {} // // + // Set gimbal roll, pitch and yaw angles. + // + // This sets the desired roll, pitch and yaw angles of a gimbal. + // Will return when the command is accepted, however, it might + // take the gimbal longer to actually be set to the new angles. + virtual ::grpc::Status SetAngles(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetAnglesRequest& request, ::mavsdk::rpc::gimbal::SetAnglesResponse* response) = 0; + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::mavsdk::rpc::gimbal::SetAnglesResponse>> AsyncSetAngles(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetAnglesRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::mavsdk::rpc::gimbal::SetAnglesResponse>>(AsyncSetAnglesRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::mavsdk::rpc::gimbal::SetAnglesResponse>> PrepareAsyncSetAngles(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetAnglesRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::mavsdk::rpc::gimbal::SetAnglesResponse>>(PrepareAsyncSetAnglesRaw(context, request, cq)); + } + // + // // Set gimbal pitch and yaw angles. // // This sets the desired pitch and yaw angles of a gimbal. @@ -142,6 +156,15 @@ class GimbalService final { virtual ~async_interface() {} // // + // Set gimbal roll, pitch and yaw angles. + // + // This sets the desired roll, pitch and yaw angles of a gimbal. + // Will return when the command is accepted, however, it might + // take the gimbal longer to actually be set to the new angles. + virtual void SetAngles(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetAnglesRequest* request, ::mavsdk::rpc::gimbal::SetAnglesResponse* response, std::function) = 0; + virtual void SetAngles(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetAnglesRequest* request, ::mavsdk::rpc::gimbal::SetAnglesResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; + // + // // Set gimbal pitch and yaw angles. // // This sets the desired pitch and yaw angles of a gimbal. @@ -206,6 +229,8 @@ class GimbalService final { virtual class async_interface* async() { return nullptr; } class async_interface* experimental_async() { return async(); } private: + virtual ::grpc::ClientAsyncResponseReaderInterface< ::mavsdk::rpc::gimbal::SetAnglesResponse>* AsyncSetAnglesRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetAnglesRequest& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface< ::mavsdk::rpc::gimbal::SetAnglesResponse>* PrepareAsyncSetAnglesRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetAnglesRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::mavsdk::rpc::gimbal::SetPitchAndYawResponse>* AsyncSetPitchAndYawRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetPitchAndYawRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::mavsdk::rpc::gimbal::SetPitchAndYawResponse>* PrepareAsyncSetPitchAndYawRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetPitchAndYawRequest& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface< ::mavsdk::rpc::gimbal::SetPitchRateAndYawRateResponse>* AsyncSetPitchRateAndYawRateRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetPitchRateAndYawRateRequest& request, ::grpc::CompletionQueue* cq) = 0; @@ -225,6 +250,13 @@ class GimbalService final { class Stub final : public StubInterface { public: Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); + ::grpc::Status SetAngles(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetAnglesRequest& request, ::mavsdk::rpc::gimbal::SetAnglesResponse* response) override; + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::mavsdk::rpc::gimbal::SetAnglesResponse>> AsyncSetAngles(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetAnglesRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::mavsdk::rpc::gimbal::SetAnglesResponse>>(AsyncSetAnglesRaw(context, request, cq)); + } + std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::mavsdk::rpc::gimbal::SetAnglesResponse>> PrepareAsyncSetAngles(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetAnglesRequest& request, ::grpc::CompletionQueue* cq) { + return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::mavsdk::rpc::gimbal::SetAnglesResponse>>(PrepareAsyncSetAnglesRaw(context, request, cq)); + } ::grpc::Status SetPitchAndYaw(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetPitchAndYawRequest& request, ::mavsdk::rpc::gimbal::SetPitchAndYawResponse* response) override; std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::mavsdk::rpc::gimbal::SetPitchAndYawResponse>> AsyncSetPitchAndYaw(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetPitchAndYawRequest& request, ::grpc::CompletionQueue* cq) { return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::mavsdk::rpc::gimbal::SetPitchAndYawResponse>>(AsyncSetPitchAndYawRaw(context, request, cq)); @@ -279,6 +311,8 @@ class GimbalService final { class async final : public StubInterface::async_interface { public: + void SetAngles(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetAnglesRequest* request, ::mavsdk::rpc::gimbal::SetAnglesResponse* response, std::function) override; + void SetAngles(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetAnglesRequest* request, ::mavsdk::rpc::gimbal::SetAnglesResponse* response, ::grpc::ClientUnaryReactor* reactor) override; void SetPitchAndYaw(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetPitchAndYawRequest* request, ::mavsdk::rpc::gimbal::SetPitchAndYawResponse* response, std::function) override; void SetPitchAndYaw(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetPitchAndYawRequest* request, ::mavsdk::rpc::gimbal::SetPitchAndYawResponse* response, ::grpc::ClientUnaryReactor* reactor) override; void SetPitchRateAndYawRate(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetPitchRateAndYawRateRequest* request, ::mavsdk::rpc::gimbal::SetPitchRateAndYawRateResponse* response, std::function) override; @@ -303,6 +337,8 @@ class GimbalService final { private: std::shared_ptr< ::grpc::ChannelInterface> channel_; class async async_stub_{this}; + ::grpc::ClientAsyncResponseReader< ::mavsdk::rpc::gimbal::SetAnglesResponse>* AsyncSetAnglesRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetAnglesRequest& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader< ::mavsdk::rpc::gimbal::SetAnglesResponse>* PrepareAsyncSetAnglesRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetAnglesRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::mavsdk::rpc::gimbal::SetPitchAndYawResponse>* AsyncSetPitchAndYawRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetPitchAndYawRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::mavsdk::rpc::gimbal::SetPitchAndYawResponse>* PrepareAsyncSetPitchAndYawRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetPitchAndYawRequest& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader< ::mavsdk::rpc::gimbal::SetPitchRateAndYawRateResponse>* AsyncSetPitchRateAndYawRateRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SetPitchRateAndYawRateRequest& request, ::grpc::CompletionQueue* cq) override; @@ -318,6 +354,7 @@ class GimbalService final { ::grpc::ClientReader< ::mavsdk::rpc::gimbal::ControlResponse>* SubscribeControlRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SubscribeControlRequest& request) override; ::grpc::ClientAsyncReader< ::mavsdk::rpc::gimbal::ControlResponse>* AsyncSubscribeControlRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SubscribeControlRequest& request, ::grpc::CompletionQueue* cq, void* tag) override; ::grpc::ClientAsyncReader< ::mavsdk::rpc::gimbal::ControlResponse>* PrepareAsyncSubscribeControlRaw(::grpc::ClientContext* context, const ::mavsdk::rpc::gimbal::SubscribeControlRequest& request, ::grpc::CompletionQueue* cq) override; + const ::grpc::internal::RpcMethod rpcmethod_SetAngles_; const ::grpc::internal::RpcMethod rpcmethod_SetPitchAndYaw_; const ::grpc::internal::RpcMethod rpcmethod_SetPitchRateAndYawRate_; const ::grpc::internal::RpcMethod rpcmethod_SetMode_; @@ -334,6 +371,14 @@ class GimbalService final { virtual ~Service(); // // + // Set gimbal roll, pitch and yaw angles. + // + // This sets the desired roll, pitch and yaw angles of a gimbal. + // Will return when the command is accepted, however, it might + // take the gimbal longer to actually be set to the new angles. + virtual ::grpc::Status SetAngles(::grpc::ServerContext* context, const ::mavsdk::rpc::gimbal::SetAnglesRequest* request, ::mavsdk::rpc::gimbal::SetAnglesResponse* response); + // + // // Set gimbal pitch and yaw angles. // // This sets the desired pitch and yaw angles of a gimbal. @@ -389,12 +434,32 @@ class GimbalService final { virtual ::grpc::Status SubscribeControl(::grpc::ServerContext* context, const ::mavsdk::rpc::gimbal::SubscribeControlRequest* request, ::grpc::ServerWriter< ::mavsdk::rpc::gimbal::ControlResponse>* writer); }; template + class WithAsyncMethod_SetAngles : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithAsyncMethod_SetAngles() { + ::grpc::Service::MarkMethodAsync(0); + } + ~WithAsyncMethod_SetAngles() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status SetAngles(::grpc::ServerContext* /*context*/, const ::mavsdk::rpc::gimbal::SetAnglesRequest* /*request*/, ::mavsdk::rpc::gimbal::SetAnglesResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestSetAngles(::grpc::ServerContext* context, ::mavsdk::rpc::gimbal::SetAnglesRequest* request, ::grpc::ServerAsyncResponseWriter< ::mavsdk::rpc::gimbal::SetAnglesResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template class WithAsyncMethod_SetPitchAndYaw : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_SetPitchAndYaw() { - ::grpc::Service::MarkMethodAsync(0); + ::grpc::Service::MarkMethodAsync(1); } ~WithAsyncMethod_SetPitchAndYaw() override { BaseClassMustBeDerivedFromService(this); @@ -405,7 +470,7 @@ class GimbalService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSetPitchAndYaw(::grpc::ServerContext* context, ::mavsdk::rpc::gimbal::SetPitchAndYawRequest* request, ::grpc::ServerAsyncResponseWriter< ::mavsdk::rpc::gimbal::SetPitchAndYawResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -414,7 +479,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_SetPitchRateAndYawRate() { - ::grpc::Service::MarkMethodAsync(1); + ::grpc::Service::MarkMethodAsync(2); } ~WithAsyncMethod_SetPitchRateAndYawRate() override { BaseClassMustBeDerivedFromService(this); @@ -425,7 +490,7 @@ class GimbalService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSetPitchRateAndYawRate(::grpc::ServerContext* context, ::mavsdk::rpc::gimbal::SetPitchRateAndYawRateRequest* request, ::grpc::ServerAsyncResponseWriter< ::mavsdk::rpc::gimbal::SetPitchRateAndYawRateResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -434,7 +499,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_SetMode() { - ::grpc::Service::MarkMethodAsync(2); + ::grpc::Service::MarkMethodAsync(3); } ~WithAsyncMethod_SetMode() override { BaseClassMustBeDerivedFromService(this); @@ -445,7 +510,7 @@ class GimbalService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSetMode(::grpc::ServerContext* context, ::mavsdk::rpc::gimbal::SetModeRequest* request, ::grpc::ServerAsyncResponseWriter< ::mavsdk::rpc::gimbal::SetModeResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(3, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -454,7 +519,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_SetRoiLocation() { - ::grpc::Service::MarkMethodAsync(3); + ::grpc::Service::MarkMethodAsync(4); } ~WithAsyncMethod_SetRoiLocation() override { BaseClassMustBeDerivedFromService(this); @@ -465,7 +530,7 @@ class GimbalService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSetRoiLocation(::grpc::ServerContext* context, ::mavsdk::rpc::gimbal::SetRoiLocationRequest* request, ::grpc::ServerAsyncResponseWriter< ::mavsdk::rpc::gimbal::SetRoiLocationResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(3, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(4, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -474,7 +539,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_TakeControl() { - ::grpc::Service::MarkMethodAsync(4); + ::grpc::Service::MarkMethodAsync(5); } ~WithAsyncMethod_TakeControl() override { BaseClassMustBeDerivedFromService(this); @@ -485,7 +550,7 @@ class GimbalService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestTakeControl(::grpc::ServerContext* context, ::mavsdk::rpc::gimbal::TakeControlRequest* request, ::grpc::ServerAsyncResponseWriter< ::mavsdk::rpc::gimbal::TakeControlResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(4, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(5, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -494,7 +559,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_ReleaseControl() { - ::grpc::Service::MarkMethodAsync(5); + ::grpc::Service::MarkMethodAsync(6); } ~WithAsyncMethod_ReleaseControl() override { BaseClassMustBeDerivedFromService(this); @@ -505,7 +570,7 @@ class GimbalService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestReleaseControl(::grpc::ServerContext* context, ::mavsdk::rpc::gimbal::ReleaseControlRequest* request, ::grpc::ServerAsyncResponseWriter< ::mavsdk::rpc::gimbal::ReleaseControlResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(5, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(6, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -514,7 +579,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithAsyncMethod_SubscribeControl() { - ::grpc::Service::MarkMethodAsync(6); + ::grpc::Service::MarkMethodAsync(7); } ~WithAsyncMethod_SubscribeControl() override { BaseClassMustBeDerivedFromService(this); @@ -525,23 +590,50 @@ class GimbalService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSubscribeControl(::grpc::ServerContext* context, ::mavsdk::rpc::gimbal::SubscribeControlRequest* request, ::grpc::ServerAsyncWriter< ::mavsdk::rpc::gimbal::ControlResponse>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncServerStreaming(6, context, request, writer, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncServerStreaming(7, context, request, writer, new_call_cq, notification_cq, tag); + } + }; + typedef WithAsyncMethod_SetAngles > > > > > > > AsyncService; + template + class WithCallbackMethod_SetAngles : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithCallbackMethod_SetAngles() { + ::grpc::Service::MarkMethodCallback(0, + new ::grpc::internal::CallbackUnaryHandler< ::mavsdk::rpc::gimbal::SetAnglesRequest, ::mavsdk::rpc::gimbal::SetAnglesResponse>( + [this]( + ::grpc::CallbackServerContext* context, const ::mavsdk::rpc::gimbal::SetAnglesRequest* request, ::mavsdk::rpc::gimbal::SetAnglesResponse* response) { return this->SetAngles(context, request, response); }));} + void SetMessageAllocatorFor_SetAngles( + ::grpc::MessageAllocator< ::mavsdk::rpc::gimbal::SetAnglesRequest, ::mavsdk::rpc::gimbal::SetAnglesResponse>* allocator) { + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(0); + static_cast<::grpc::internal::CallbackUnaryHandler< ::mavsdk::rpc::gimbal::SetAnglesRequest, ::mavsdk::rpc::gimbal::SetAnglesResponse>*>(handler) + ->SetMessageAllocator(allocator); + } + ~WithCallbackMethod_SetAngles() override { + BaseClassMustBeDerivedFromService(this); } + // disable synchronous version of this method + ::grpc::Status SetAngles(::grpc::ServerContext* /*context*/, const ::mavsdk::rpc::gimbal::SetAnglesRequest* /*request*/, ::mavsdk::rpc::gimbal::SetAnglesResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + virtual ::grpc::ServerUnaryReactor* SetAngles( + ::grpc::CallbackServerContext* /*context*/, const ::mavsdk::rpc::gimbal::SetAnglesRequest* /*request*/, ::mavsdk::rpc::gimbal::SetAnglesResponse* /*response*/) { return nullptr; } }; - typedef WithAsyncMethod_SetPitchAndYaw > > > > > > AsyncService; template class WithCallbackMethod_SetPitchAndYaw : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithCallbackMethod_SetPitchAndYaw() { - ::grpc::Service::MarkMethodCallback(0, + ::grpc::Service::MarkMethodCallback(1, new ::grpc::internal::CallbackUnaryHandler< ::mavsdk::rpc::gimbal::SetPitchAndYawRequest, ::mavsdk::rpc::gimbal::SetPitchAndYawResponse>( [this]( ::grpc::CallbackServerContext* context, const ::mavsdk::rpc::gimbal::SetPitchAndYawRequest* request, ::mavsdk::rpc::gimbal::SetPitchAndYawResponse* response) { return this->SetPitchAndYaw(context, request, response); }));} void SetMessageAllocatorFor_SetPitchAndYaw( ::grpc::MessageAllocator< ::mavsdk::rpc::gimbal::SetPitchAndYawRequest, ::mavsdk::rpc::gimbal::SetPitchAndYawResponse>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(0); + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(1); static_cast<::grpc::internal::CallbackUnaryHandler< ::mavsdk::rpc::gimbal::SetPitchAndYawRequest, ::mavsdk::rpc::gimbal::SetPitchAndYawResponse>*>(handler) ->SetMessageAllocator(allocator); } @@ -562,13 +654,13 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithCallbackMethod_SetPitchRateAndYawRate() { - ::grpc::Service::MarkMethodCallback(1, + ::grpc::Service::MarkMethodCallback(2, new ::grpc::internal::CallbackUnaryHandler< ::mavsdk::rpc::gimbal::SetPitchRateAndYawRateRequest, ::mavsdk::rpc::gimbal::SetPitchRateAndYawRateResponse>( [this]( ::grpc::CallbackServerContext* context, const ::mavsdk::rpc::gimbal::SetPitchRateAndYawRateRequest* request, ::mavsdk::rpc::gimbal::SetPitchRateAndYawRateResponse* response) { return this->SetPitchRateAndYawRate(context, request, response); }));} void SetMessageAllocatorFor_SetPitchRateAndYawRate( ::grpc::MessageAllocator< ::mavsdk::rpc::gimbal::SetPitchRateAndYawRateRequest, ::mavsdk::rpc::gimbal::SetPitchRateAndYawRateResponse>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(1); + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(2); static_cast<::grpc::internal::CallbackUnaryHandler< ::mavsdk::rpc::gimbal::SetPitchRateAndYawRateRequest, ::mavsdk::rpc::gimbal::SetPitchRateAndYawRateResponse>*>(handler) ->SetMessageAllocator(allocator); } @@ -589,13 +681,13 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithCallbackMethod_SetMode() { - ::grpc::Service::MarkMethodCallback(2, + ::grpc::Service::MarkMethodCallback(3, new ::grpc::internal::CallbackUnaryHandler< ::mavsdk::rpc::gimbal::SetModeRequest, ::mavsdk::rpc::gimbal::SetModeResponse>( [this]( ::grpc::CallbackServerContext* context, const ::mavsdk::rpc::gimbal::SetModeRequest* request, ::mavsdk::rpc::gimbal::SetModeResponse* response) { return this->SetMode(context, request, response); }));} void SetMessageAllocatorFor_SetMode( ::grpc::MessageAllocator< ::mavsdk::rpc::gimbal::SetModeRequest, ::mavsdk::rpc::gimbal::SetModeResponse>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(2); + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(3); static_cast<::grpc::internal::CallbackUnaryHandler< ::mavsdk::rpc::gimbal::SetModeRequest, ::mavsdk::rpc::gimbal::SetModeResponse>*>(handler) ->SetMessageAllocator(allocator); } @@ -616,13 +708,13 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithCallbackMethod_SetRoiLocation() { - ::grpc::Service::MarkMethodCallback(3, + ::grpc::Service::MarkMethodCallback(4, new ::grpc::internal::CallbackUnaryHandler< ::mavsdk::rpc::gimbal::SetRoiLocationRequest, ::mavsdk::rpc::gimbal::SetRoiLocationResponse>( [this]( ::grpc::CallbackServerContext* context, const ::mavsdk::rpc::gimbal::SetRoiLocationRequest* request, ::mavsdk::rpc::gimbal::SetRoiLocationResponse* response) { return this->SetRoiLocation(context, request, response); }));} void SetMessageAllocatorFor_SetRoiLocation( ::grpc::MessageAllocator< ::mavsdk::rpc::gimbal::SetRoiLocationRequest, ::mavsdk::rpc::gimbal::SetRoiLocationResponse>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(3); + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(4); static_cast<::grpc::internal::CallbackUnaryHandler< ::mavsdk::rpc::gimbal::SetRoiLocationRequest, ::mavsdk::rpc::gimbal::SetRoiLocationResponse>*>(handler) ->SetMessageAllocator(allocator); } @@ -643,13 +735,13 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithCallbackMethod_TakeControl() { - ::grpc::Service::MarkMethodCallback(4, + ::grpc::Service::MarkMethodCallback(5, new ::grpc::internal::CallbackUnaryHandler< ::mavsdk::rpc::gimbal::TakeControlRequest, ::mavsdk::rpc::gimbal::TakeControlResponse>( [this]( ::grpc::CallbackServerContext* context, const ::mavsdk::rpc::gimbal::TakeControlRequest* request, ::mavsdk::rpc::gimbal::TakeControlResponse* response) { return this->TakeControl(context, request, response); }));} void SetMessageAllocatorFor_TakeControl( ::grpc::MessageAllocator< ::mavsdk::rpc::gimbal::TakeControlRequest, ::mavsdk::rpc::gimbal::TakeControlResponse>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(4); + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(5); static_cast<::grpc::internal::CallbackUnaryHandler< ::mavsdk::rpc::gimbal::TakeControlRequest, ::mavsdk::rpc::gimbal::TakeControlResponse>*>(handler) ->SetMessageAllocator(allocator); } @@ -670,13 +762,13 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithCallbackMethod_ReleaseControl() { - ::grpc::Service::MarkMethodCallback(5, + ::grpc::Service::MarkMethodCallback(6, new ::grpc::internal::CallbackUnaryHandler< ::mavsdk::rpc::gimbal::ReleaseControlRequest, ::mavsdk::rpc::gimbal::ReleaseControlResponse>( [this]( ::grpc::CallbackServerContext* context, const ::mavsdk::rpc::gimbal::ReleaseControlRequest* request, ::mavsdk::rpc::gimbal::ReleaseControlResponse* response) { return this->ReleaseControl(context, request, response); }));} void SetMessageAllocatorFor_ReleaseControl( ::grpc::MessageAllocator< ::mavsdk::rpc::gimbal::ReleaseControlRequest, ::mavsdk::rpc::gimbal::ReleaseControlResponse>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(5); + ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(6); static_cast<::grpc::internal::CallbackUnaryHandler< ::mavsdk::rpc::gimbal::ReleaseControlRequest, ::mavsdk::rpc::gimbal::ReleaseControlResponse>*>(handler) ->SetMessageAllocator(allocator); } @@ -697,7 +789,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithCallbackMethod_SubscribeControl() { - ::grpc::Service::MarkMethodCallback(6, + ::grpc::Service::MarkMethodCallback(7, new ::grpc::internal::CallbackServerStreamingHandler< ::mavsdk::rpc::gimbal::SubscribeControlRequest, ::mavsdk::rpc::gimbal::ControlResponse>( [this]( ::grpc::CallbackServerContext* context, const ::mavsdk::rpc::gimbal::SubscribeControlRequest* request) { return this->SubscribeControl(context, request); })); @@ -713,15 +805,32 @@ class GimbalService final { virtual ::grpc::ServerWriteReactor< ::mavsdk::rpc::gimbal::ControlResponse>* SubscribeControl( ::grpc::CallbackServerContext* /*context*/, const ::mavsdk::rpc::gimbal::SubscribeControlRequest* /*request*/) { return nullptr; } }; - typedef WithCallbackMethod_SetPitchAndYaw > > > > > > CallbackService; + typedef WithCallbackMethod_SetAngles > > > > > > > CallbackService; typedef CallbackService ExperimentalCallbackService; template + class WithGenericMethod_SetAngles : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithGenericMethod_SetAngles() { + ::grpc::Service::MarkMethodGeneric(0); + } + ~WithGenericMethod_SetAngles() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status SetAngles(::grpc::ServerContext* /*context*/, const ::mavsdk::rpc::gimbal::SetAnglesRequest* /*request*/, ::mavsdk::rpc::gimbal::SetAnglesResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; + template class WithGenericMethod_SetPitchAndYaw : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_SetPitchAndYaw() { - ::grpc::Service::MarkMethodGeneric(0); + ::grpc::Service::MarkMethodGeneric(1); } ~WithGenericMethod_SetPitchAndYaw() override { BaseClassMustBeDerivedFromService(this); @@ -738,7 +847,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_SetPitchRateAndYawRate() { - ::grpc::Service::MarkMethodGeneric(1); + ::grpc::Service::MarkMethodGeneric(2); } ~WithGenericMethod_SetPitchRateAndYawRate() override { BaseClassMustBeDerivedFromService(this); @@ -755,7 +864,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_SetMode() { - ::grpc::Service::MarkMethodGeneric(2); + ::grpc::Service::MarkMethodGeneric(3); } ~WithGenericMethod_SetMode() override { BaseClassMustBeDerivedFromService(this); @@ -772,7 +881,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_SetRoiLocation() { - ::grpc::Service::MarkMethodGeneric(3); + ::grpc::Service::MarkMethodGeneric(4); } ~WithGenericMethod_SetRoiLocation() override { BaseClassMustBeDerivedFromService(this); @@ -789,7 +898,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_TakeControl() { - ::grpc::Service::MarkMethodGeneric(4); + ::grpc::Service::MarkMethodGeneric(5); } ~WithGenericMethod_TakeControl() override { BaseClassMustBeDerivedFromService(this); @@ -806,7 +915,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_ReleaseControl() { - ::grpc::Service::MarkMethodGeneric(5); + ::grpc::Service::MarkMethodGeneric(6); } ~WithGenericMethod_ReleaseControl() override { BaseClassMustBeDerivedFromService(this); @@ -823,7 +932,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithGenericMethod_SubscribeControl() { - ::grpc::Service::MarkMethodGeneric(6); + ::grpc::Service::MarkMethodGeneric(7); } ~WithGenericMethod_SubscribeControl() override { BaseClassMustBeDerivedFromService(this); @@ -835,12 +944,32 @@ class GimbalService final { } }; template + class WithRawMethod_SetAngles : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawMethod_SetAngles() { + ::grpc::Service::MarkMethodRaw(0); + } + ~WithRawMethod_SetAngles() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status SetAngles(::grpc::ServerContext* /*context*/, const ::mavsdk::rpc::gimbal::SetAnglesRequest* /*request*/, ::mavsdk::rpc::gimbal::SetAnglesResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestSetAngles(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); + } + }; + template class WithRawMethod_SetPitchAndYaw : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_SetPitchAndYaw() { - ::grpc::Service::MarkMethodRaw(0); + ::grpc::Service::MarkMethodRaw(1); } ~WithRawMethod_SetPitchAndYaw() override { BaseClassMustBeDerivedFromService(this); @@ -851,7 +980,7 @@ class GimbalService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSetPitchAndYaw(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -860,7 +989,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_SetPitchRateAndYawRate() { - ::grpc::Service::MarkMethodRaw(1); + ::grpc::Service::MarkMethodRaw(2); } ~WithRawMethod_SetPitchRateAndYawRate() override { BaseClassMustBeDerivedFromService(this); @@ -871,7 +1000,7 @@ class GimbalService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSetPitchRateAndYawRate(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -880,7 +1009,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_SetMode() { - ::grpc::Service::MarkMethodRaw(2); + ::grpc::Service::MarkMethodRaw(3); } ~WithRawMethod_SetMode() override { BaseClassMustBeDerivedFromService(this); @@ -891,7 +1020,7 @@ class GimbalService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSetMode(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(3, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -900,7 +1029,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_SetRoiLocation() { - ::grpc::Service::MarkMethodRaw(3); + ::grpc::Service::MarkMethodRaw(4); } ~WithRawMethod_SetRoiLocation() override { BaseClassMustBeDerivedFromService(this); @@ -911,7 +1040,7 @@ class GimbalService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSetRoiLocation(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(3, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(4, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -920,7 +1049,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_TakeControl() { - ::grpc::Service::MarkMethodRaw(4); + ::grpc::Service::MarkMethodRaw(5); } ~WithRawMethod_TakeControl() override { BaseClassMustBeDerivedFromService(this); @@ -931,7 +1060,7 @@ class GimbalService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestTakeControl(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(4, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(5, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -940,7 +1069,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_ReleaseControl() { - ::grpc::Service::MarkMethodRaw(5); + ::grpc::Service::MarkMethodRaw(6); } ~WithRawMethod_ReleaseControl() override { BaseClassMustBeDerivedFromService(this); @@ -951,7 +1080,7 @@ class GimbalService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestReleaseControl(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(5, context, request, response, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncUnary(6, context, request, response, new_call_cq, notification_cq, tag); } }; template @@ -960,7 +1089,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawMethod_SubscribeControl() { - ::grpc::Service::MarkMethodRaw(6); + ::grpc::Service::MarkMethodRaw(7); } ~WithRawMethod_SubscribeControl() override { BaseClassMustBeDerivedFromService(this); @@ -971,8 +1100,30 @@ class GimbalService final { return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } void RequestSubscribeControl(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncWriter< ::grpc::ByteBuffer>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncServerStreaming(6, context, request, writer, new_call_cq, notification_cq, tag); + ::grpc::Service::RequestAsyncServerStreaming(7, context, request, writer, new_call_cq, notification_cq, tag); + } + }; + template + class WithRawCallbackMethod_SetAngles : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithRawCallbackMethod_SetAngles() { + ::grpc::Service::MarkMethodRawCallback(0, + new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( + [this]( + ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->SetAngles(context, request, response); })); + } + ~WithRawCallbackMethod_SetAngles() override { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status SetAngles(::grpc::ServerContext* /*context*/, const ::mavsdk::rpc::gimbal::SetAnglesRequest* /*request*/, ::mavsdk::rpc::gimbal::SetAnglesResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } + virtual ::grpc::ServerUnaryReactor* SetAngles( + ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } }; template class WithRawCallbackMethod_SetPitchAndYaw : public BaseClass { @@ -980,7 +1131,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawCallbackMethod_SetPitchAndYaw() { - ::grpc::Service::MarkMethodRawCallback(0, + ::grpc::Service::MarkMethodRawCallback(1, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->SetPitchAndYaw(context, request, response); })); @@ -1002,7 +1153,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawCallbackMethod_SetPitchRateAndYawRate() { - ::grpc::Service::MarkMethodRawCallback(1, + ::grpc::Service::MarkMethodRawCallback(2, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->SetPitchRateAndYawRate(context, request, response); })); @@ -1024,7 +1175,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawCallbackMethod_SetMode() { - ::grpc::Service::MarkMethodRawCallback(2, + ::grpc::Service::MarkMethodRawCallback(3, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->SetMode(context, request, response); })); @@ -1046,7 +1197,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawCallbackMethod_SetRoiLocation() { - ::grpc::Service::MarkMethodRawCallback(3, + ::grpc::Service::MarkMethodRawCallback(4, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->SetRoiLocation(context, request, response); })); @@ -1068,7 +1219,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawCallbackMethod_TakeControl() { - ::grpc::Service::MarkMethodRawCallback(4, + ::grpc::Service::MarkMethodRawCallback(5, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->TakeControl(context, request, response); })); @@ -1090,7 +1241,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawCallbackMethod_ReleaseControl() { - ::grpc::Service::MarkMethodRawCallback(5, + ::grpc::Service::MarkMethodRawCallback(6, new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->ReleaseControl(context, request, response); })); @@ -1112,7 +1263,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithRawCallbackMethod_SubscribeControl() { - ::grpc::Service::MarkMethodRawCallback(6, + ::grpc::Service::MarkMethodRawCallback(7, new ::grpc::internal::CallbackServerStreamingHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( [this]( ::grpc::CallbackServerContext* context, const::grpc::ByteBuffer* request) { return this->SubscribeControl(context, request); })); @@ -1129,12 +1280,39 @@ class GimbalService final { ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/) { return nullptr; } }; template + class WithStreamedUnaryMethod_SetAngles : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} + public: + WithStreamedUnaryMethod_SetAngles() { + ::grpc::Service::MarkMethodStreamed(0, + new ::grpc::internal::StreamedUnaryHandler< + ::mavsdk::rpc::gimbal::SetAnglesRequest, ::mavsdk::rpc::gimbal::SetAnglesResponse>( + [this](::grpc::ServerContext* context, + ::grpc::ServerUnaryStreamer< + ::mavsdk::rpc::gimbal::SetAnglesRequest, ::mavsdk::rpc::gimbal::SetAnglesResponse>* streamer) { + return this->StreamedSetAngles(context, + streamer); + })); + } + ~WithStreamedUnaryMethod_SetAngles() override { + BaseClassMustBeDerivedFromService(this); + } + // disable regular version of this method + ::grpc::Status SetAngles(::grpc::ServerContext* /*context*/, const ::mavsdk::rpc::gimbal::SetAnglesRequest* /*request*/, ::mavsdk::rpc::gimbal::SetAnglesResponse* /*response*/) override { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + // replace default version of method with streamed unary + virtual ::grpc::Status StreamedSetAngles(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::mavsdk::rpc::gimbal::SetAnglesRequest,::mavsdk::rpc::gimbal::SetAnglesResponse>* server_unary_streamer) = 0; + }; + template class WithStreamedUnaryMethod_SetPitchAndYaw : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_SetPitchAndYaw() { - ::grpc::Service::MarkMethodStreamed(0, + ::grpc::Service::MarkMethodStreamed(1, new ::grpc::internal::StreamedUnaryHandler< ::mavsdk::rpc::gimbal::SetPitchAndYawRequest, ::mavsdk::rpc::gimbal::SetPitchAndYawResponse>( [this](::grpc::ServerContext* context, @@ -1161,7 +1339,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_SetPitchRateAndYawRate() { - ::grpc::Service::MarkMethodStreamed(1, + ::grpc::Service::MarkMethodStreamed(2, new ::grpc::internal::StreamedUnaryHandler< ::mavsdk::rpc::gimbal::SetPitchRateAndYawRateRequest, ::mavsdk::rpc::gimbal::SetPitchRateAndYawRateResponse>( [this](::grpc::ServerContext* context, @@ -1188,7 +1366,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_SetMode() { - ::grpc::Service::MarkMethodStreamed(2, + ::grpc::Service::MarkMethodStreamed(3, new ::grpc::internal::StreamedUnaryHandler< ::mavsdk::rpc::gimbal::SetModeRequest, ::mavsdk::rpc::gimbal::SetModeResponse>( [this](::grpc::ServerContext* context, @@ -1215,7 +1393,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_SetRoiLocation() { - ::grpc::Service::MarkMethodStreamed(3, + ::grpc::Service::MarkMethodStreamed(4, new ::grpc::internal::StreamedUnaryHandler< ::mavsdk::rpc::gimbal::SetRoiLocationRequest, ::mavsdk::rpc::gimbal::SetRoiLocationResponse>( [this](::grpc::ServerContext* context, @@ -1242,7 +1420,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_TakeControl() { - ::grpc::Service::MarkMethodStreamed(4, + ::grpc::Service::MarkMethodStreamed(5, new ::grpc::internal::StreamedUnaryHandler< ::mavsdk::rpc::gimbal::TakeControlRequest, ::mavsdk::rpc::gimbal::TakeControlResponse>( [this](::grpc::ServerContext* context, @@ -1269,7 +1447,7 @@ class GimbalService final { void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithStreamedUnaryMethod_ReleaseControl() { - ::grpc::Service::MarkMethodStreamed(5, + ::grpc::Service::MarkMethodStreamed(6, new ::grpc::internal::StreamedUnaryHandler< ::mavsdk::rpc::gimbal::ReleaseControlRequest, ::mavsdk::rpc::gimbal::ReleaseControlResponse>( [this](::grpc::ServerContext* context, @@ -1290,14 +1468,14 @@ class GimbalService final { // replace default version of method with streamed unary virtual ::grpc::Status StreamedReleaseControl(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::mavsdk::rpc::gimbal::ReleaseControlRequest,::mavsdk::rpc::gimbal::ReleaseControlResponse>* server_unary_streamer) = 0; }; - typedef WithStreamedUnaryMethod_SetPitchAndYaw > > > > > StreamedUnaryService; + typedef WithStreamedUnaryMethod_SetAngles > > > > > > StreamedUnaryService; template class WithSplitStreamingMethod_SubscribeControl : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} public: WithSplitStreamingMethod_SubscribeControl() { - ::grpc::Service::MarkMethodStreamed(6, + ::grpc::Service::MarkMethodStreamed(7, new ::grpc::internal::SplitServerStreamingHandler< ::mavsdk::rpc::gimbal::SubscribeControlRequest, ::mavsdk::rpc::gimbal::ControlResponse>( [this](::grpc::ServerContext* context, @@ -1319,7 +1497,7 @@ class GimbalService final { virtual ::grpc::Status StreamedSubscribeControl(::grpc::ServerContext* context, ::grpc::ServerSplitStreamer< ::mavsdk::rpc::gimbal::SubscribeControlRequest,::mavsdk::rpc::gimbal::ControlResponse>* server_split_streamer) = 0; }; typedef WithSplitStreamingMethod_SubscribeControl SplitStreamedService; - typedef WithStreamedUnaryMethod_SetPitchAndYaw > > > > > > StreamedService; + typedef WithStreamedUnaryMethod_SetAngles > > > > > > > StreamedService; }; } // namespace gimbal diff --git a/src/mavsdk_server/src/generated/gimbal/gimbal.pb.cc b/src/mavsdk_server/src/generated/gimbal/gimbal.pb.cc index 000e5e1933..fc5cfaa923 100644 --- a/src/mavsdk_server/src/generated/gimbal/gimbal.pb.cc +++ b/src/mavsdk_server/src/generated/gimbal/gimbal.pb.cc @@ -134,6 +134,27 @@ struct SetModeRequestDefaultTypeInternal { PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SetModeRequestDefaultTypeInternal _SetModeRequest_default_instance_; + +inline constexpr SetAnglesRequest::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : roll_deg_{0}, + pitch_deg_{0}, + yaw_deg_{0}, + _cached_size_{0} {} + +template +PROTOBUF_CONSTEXPR SetAnglesRequest::SetAnglesRequest(::_pbi::ConstantInitialized) + : _impl_(::_pbi::ConstantInitialized()) {} +struct SetAnglesRequestDefaultTypeInternal { + PROTOBUF_CONSTEXPR SetAnglesRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~SetAnglesRequestDefaultTypeInternal() {} + union { + SetAnglesRequest _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SetAnglesRequestDefaultTypeInternal _SetAnglesRequest_default_instance_; template PROTOBUF_CONSTEXPR ReleaseControlRequest::ReleaseControlRequest(::_pbi::ConstantInitialized) {} struct ReleaseControlRequestDefaultTypeInternal { @@ -287,6 +308,25 @@ struct SetModeResponseDefaultTypeInternal { PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SetModeResponseDefaultTypeInternal _SetModeResponse_default_instance_; +inline constexpr SetAnglesResponse::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + gimbal_result_{nullptr} {} + +template +PROTOBUF_CONSTEXPR SetAnglesResponse::SetAnglesResponse(::_pbi::ConstantInitialized) + : _impl_(::_pbi::ConstantInitialized()) {} +struct SetAnglesResponseDefaultTypeInternal { + PROTOBUF_CONSTEXPR SetAnglesResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~SetAnglesResponseDefaultTypeInternal() {} + union { + SetAnglesResponse _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SetAnglesResponseDefaultTypeInternal _SetAnglesResponse_default_instance_; + inline constexpr ReleaseControlResponse::Impl_::Impl_( ::_pbi::ConstantInitialized) noexcept : _cached_size_{0}, @@ -327,13 +367,34 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT } // namespace gimbal } // namespace rpc } // namespace mavsdk -static ::_pb::Metadata file_level_metadata_gimbal_2fgimbal_2eproto[16]; +static ::_pb::Metadata file_level_metadata_gimbal_2fgimbal_2eproto[18]; static const ::_pb::EnumDescriptor* file_level_enum_descriptors_gimbal_2fgimbal_2eproto[3]; static constexpr const ::_pb::ServiceDescriptor** file_level_service_descriptors_gimbal_2fgimbal_2eproto = nullptr; const ::uint32_t TableStruct_gimbal_2fgimbal_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE( protodesc_cold) = { ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::mavsdk::rpc::gimbal::SetAnglesRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ~0u, // no _split_ + ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::mavsdk::rpc::gimbal::SetAnglesRequest, _impl_.roll_deg_), + PROTOBUF_FIELD_OFFSET(::mavsdk::rpc::gimbal::SetAnglesRequest, _impl_.pitch_deg_), + PROTOBUF_FIELD_OFFSET(::mavsdk::rpc::gimbal::SetAnglesRequest, _impl_.yaw_deg_), + PROTOBUF_FIELD_OFFSET(::mavsdk::rpc::gimbal::SetAnglesResponse, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::mavsdk::rpc::gimbal::SetAnglesResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ~0u, // no _split_ + ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::mavsdk::rpc::gimbal::SetAnglesResponse, _impl_.gimbal_result_), + 0, + ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::mavsdk::rpc::gimbal::SetPitchAndYawRequest, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ @@ -495,25 +556,29 @@ const ::uint32_t TableStruct_gimbal_2fgimbal_2eproto::offsets[] PROTOBUF_SECTION static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - {0, -1, -1, sizeof(::mavsdk::rpc::gimbal::SetPitchAndYawRequest)}, - {10, 19, -1, sizeof(::mavsdk::rpc::gimbal::SetPitchAndYawResponse)}, - {20, -1, -1, sizeof(::mavsdk::rpc::gimbal::SetPitchRateAndYawRateRequest)}, - {30, 39, -1, sizeof(::mavsdk::rpc::gimbal::SetPitchRateAndYawRateResponse)}, - {40, -1, -1, sizeof(::mavsdk::rpc::gimbal::SetModeRequest)}, - {49, 58, -1, sizeof(::mavsdk::rpc::gimbal::SetModeResponse)}, - {59, -1, -1, sizeof(::mavsdk::rpc::gimbal::SetRoiLocationRequest)}, - {70, 79, -1, sizeof(::mavsdk::rpc::gimbal::SetRoiLocationResponse)}, - {80, -1, -1, sizeof(::mavsdk::rpc::gimbal::TakeControlRequest)}, - {89, 98, -1, sizeof(::mavsdk::rpc::gimbal::TakeControlResponse)}, - {99, -1, -1, sizeof(::mavsdk::rpc::gimbal::ReleaseControlRequest)}, - {107, 116, -1, sizeof(::mavsdk::rpc::gimbal::ReleaseControlResponse)}, - {117, -1, -1, sizeof(::mavsdk::rpc::gimbal::SubscribeControlRequest)}, - {125, 134, -1, sizeof(::mavsdk::rpc::gimbal::ControlResponse)}, - {135, -1, -1, sizeof(::mavsdk::rpc::gimbal::ControlStatus)}, - {148, -1, -1, sizeof(::mavsdk::rpc::gimbal::GimbalResult)}, + {0, -1, -1, sizeof(::mavsdk::rpc::gimbal::SetAnglesRequest)}, + {11, 20, -1, sizeof(::mavsdk::rpc::gimbal::SetAnglesResponse)}, + {21, -1, -1, sizeof(::mavsdk::rpc::gimbal::SetPitchAndYawRequest)}, + {31, 40, -1, sizeof(::mavsdk::rpc::gimbal::SetPitchAndYawResponse)}, + {41, -1, -1, sizeof(::mavsdk::rpc::gimbal::SetPitchRateAndYawRateRequest)}, + {51, 60, -1, sizeof(::mavsdk::rpc::gimbal::SetPitchRateAndYawRateResponse)}, + {61, -1, -1, sizeof(::mavsdk::rpc::gimbal::SetModeRequest)}, + {70, 79, -1, sizeof(::mavsdk::rpc::gimbal::SetModeResponse)}, + {80, -1, -1, sizeof(::mavsdk::rpc::gimbal::SetRoiLocationRequest)}, + {91, 100, -1, sizeof(::mavsdk::rpc::gimbal::SetRoiLocationResponse)}, + {101, -1, -1, sizeof(::mavsdk::rpc::gimbal::TakeControlRequest)}, + {110, 119, -1, sizeof(::mavsdk::rpc::gimbal::TakeControlResponse)}, + {120, -1, -1, sizeof(::mavsdk::rpc::gimbal::ReleaseControlRequest)}, + {128, 137, -1, sizeof(::mavsdk::rpc::gimbal::ReleaseControlResponse)}, + {138, -1, -1, sizeof(::mavsdk::rpc::gimbal::SubscribeControlRequest)}, + {146, 155, -1, sizeof(::mavsdk::rpc::gimbal::ControlResponse)}, + {156, -1, -1, sizeof(::mavsdk::rpc::gimbal::ControlStatus)}, + {169, -1, -1, sizeof(::mavsdk::rpc::gimbal::GimbalResult)}, }; static const ::_pb::Message* const file_default_instances[] = { + &::mavsdk::rpc::gimbal::_SetAnglesRequest_default_instance_._instance, + &::mavsdk::rpc::gimbal::_SetAnglesResponse_default_instance_._instance, &::mavsdk::rpc::gimbal::_SetPitchAndYawRequest_default_instance_._instance, &::mavsdk::rpc::gimbal::_SetPitchAndYawResponse_default_instance_._instance, &::mavsdk::rpc::gimbal::_SetPitchRateAndYawRateRequest_default_instance_._instance, @@ -533,78 +598,84 @@ static const ::_pb::Message* const file_default_instances[] = { }; const char descriptor_table_protodef_gimbal_2fgimbal_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { "\n\023gimbal/gimbal.proto\022\021mavsdk.rpc.gimbal" - "\";\n\025SetPitchAndYawRequest\022\021\n\tpitch_deg\030\001" - " \001(\002\022\017\n\007yaw_deg\030\002 \001(\002\"P\n\026SetPitchAndYawR" - "esponse\0226\n\rgimbal_result\030\001 \001(\0132\037.mavsdk." - "rpc.gimbal.GimbalResult\"Q\n\035SetPitchRateA" - "ndYawRateRequest\022\030\n\020pitch_rate_deg_s\030\001 \001" - "(\002\022\026\n\016yaw_rate_deg_s\030\002 \001(\002\"X\n\036SetPitchRa" - "teAndYawRateResponse\0226\n\rgimbal_result\030\001 " - "\001(\0132\037.mavsdk.rpc.gimbal.GimbalResult\"D\n\016" - "SetModeRequest\0222\n\013gimbal_mode\030\001 \001(\0162\035.ma" - "vsdk.rpc.gimbal.GimbalMode\"I\n\017SetModeRes" - "ponse\0226\n\rgimbal_result\030\001 \001(\0132\037.mavsdk.rp" - "c.gimbal.GimbalResult\"X\n\025SetRoiLocationR" - "equest\022\024\n\014latitude_deg\030\001 \001(\001\022\025\n\rlongitud" - "e_deg\030\002 \001(\001\022\022\n\naltitude_m\030\003 \001(\002\"P\n\026SetRo" - "iLocationResponse\0226\n\rgimbal_result\030\001 \001(\013" - "2\037.mavsdk.rpc.gimbal.GimbalResult\"J\n\022Tak" - "eControlRequest\0224\n\014control_mode\030\001 \001(\0162\036." - "mavsdk.rpc.gimbal.ControlMode\"M\n\023TakeCon" - "trolResponse\0226\n\rgimbal_result\030\001 \001(\0132\037.ma" - "vsdk.rpc.gimbal.GimbalResult\"\027\n\025ReleaseC" - "ontrolRequest\"P\n\026ReleaseControlResponse\022" - "6\n\rgimbal_result\030\001 \001(\0132\037.mavsdk.rpc.gimb" - "al.GimbalResult\"\031\n\027SubscribeControlReque" - "st\"K\n\017ControlResponse\0228\n\016control_status\030" - "\001 \001(\0132 .mavsdk.rpc.gimbal.ControlStatus\"" - "\307\001\n\rControlStatus\0224\n\014control_mode\030\001 \001(\0162" - "\036.mavsdk.rpc.gimbal.ControlMode\022\035\n\025sysid" - "_primary_control\030\002 \001(\005\022\036\n\026compid_primary" - "_control\030\003 \001(\005\022\037\n\027sysid_secondary_contro" - "l\030\004 \001(\005\022 \n\030compid_secondary_control\030\005 \001(" - "\005\"\341\001\n\014GimbalResult\0226\n\006result\030\001 \001(\0162&.mav" - "sdk.rpc.gimbal.GimbalResult.Result\022\022\n\nre" - "sult_str\030\002 \001(\t\"\204\001\n\006Result\022\022\n\016RESULT_UNKN" - "OWN\020\000\022\022\n\016RESULT_SUCCESS\020\001\022\020\n\014RESULT_ERRO" - "R\020\002\022\022\n\016RESULT_TIMEOUT\020\003\022\026\n\022RESULT_UNSUPP" - "ORTED\020\004\022\024\n\020RESULT_NO_SYSTEM\020\005*B\n\nGimbalM" - "ode\022\032\n\026GIMBAL_MODE_YAW_FOLLOW\020\000\022\030\n\024GIMBA" - "L_MODE_YAW_LOCK\020\001*Z\n\013ControlMode\022\025\n\021CONT" - "ROL_MODE_NONE\020\000\022\030\n\024CONTROL_MODE_PRIMARY\020" - "\001\022\032\n\026CONTROL_MODE_SECONDARY\020\0022\347\005\n\rGimbal" - "Service\022g\n\016SetPitchAndYaw\022(.mavsdk.rpc.g" - "imbal.SetPitchAndYawRequest\032).mavsdk.rpc" - ".gimbal.SetPitchAndYawResponse\"\000\022\177\n\026SetP" - "itchRateAndYawRate\0220.mavsdk.rpc.gimbal.S" - "etPitchRateAndYawRateRequest\0321.mavsdk.rp" - "c.gimbal.SetPitchRateAndYawRateResponse\"" - "\000\022R\n\007SetMode\022!.mavsdk.rpc.gimbal.SetMode" - "Request\032\".mavsdk.rpc.gimbal.SetModeRespo" - "nse\"\000\022g\n\016SetRoiLocation\022(.mavsdk.rpc.gim" - "bal.SetRoiLocationRequest\032).mavsdk.rpc.g" - "imbal.SetRoiLocationResponse\"\000\022^\n\013TakeCo" - "ntrol\022%.mavsdk.rpc.gimbal.TakeControlReq" - "uest\032&.mavsdk.rpc.gimbal.TakeControlResp" - "onse\"\000\022g\n\016ReleaseControl\022(.mavsdk.rpc.gi" - "mbal.ReleaseControlRequest\032).mavsdk.rpc." - "gimbal.ReleaseControlResponse\"\000\022f\n\020Subsc" - "ribeControl\022*.mavsdk.rpc.gimbal.Subscrib" - "eControlRequest\032\".mavsdk.rpc.gimbal.Cont" - "rolResponse\"\0000\001B\037\n\020io.mavsdk.gimbalB\013Gim" - "balProtob\006proto3" + "\"H\n\020SetAnglesRequest\022\020\n\010roll_deg\030\001 \001(\002\022\021" + "\n\tpitch_deg\030\002 \001(\002\022\017\n\007yaw_deg\030\003 \001(\002\"K\n\021Se" + "tAnglesResponse\0226\n\rgimbal_result\030\001 \001(\0132\037" + ".mavsdk.rpc.gimbal.GimbalResult\";\n\025SetPi" + "tchAndYawRequest\022\021\n\tpitch_deg\030\001 \001(\002\022\017\n\007y" + "aw_deg\030\002 \001(\002\"P\n\026SetPitchAndYawResponse\0226" + "\n\rgimbal_result\030\001 \001(\0132\037.mavsdk.rpc.gimba" + "l.GimbalResult\"Q\n\035SetPitchRateAndYawRate" + "Request\022\030\n\020pitch_rate_deg_s\030\001 \001(\002\022\026\n\016yaw" + "_rate_deg_s\030\002 \001(\002\"X\n\036SetPitchRateAndYawR" + "ateResponse\0226\n\rgimbal_result\030\001 \001(\0132\037.mav" + "sdk.rpc.gimbal.GimbalResult\"D\n\016SetModeRe" + "quest\0222\n\013gimbal_mode\030\001 \001(\0162\035.mavsdk.rpc." + "gimbal.GimbalMode\"I\n\017SetModeResponse\0226\n\r" + "gimbal_result\030\001 \001(\0132\037.mavsdk.rpc.gimbal." + "GimbalResult\"X\n\025SetRoiLocationRequest\022\024\n" + "\014latitude_deg\030\001 \001(\001\022\025\n\rlongitude_deg\030\002 \001" + "(\001\022\022\n\naltitude_m\030\003 \001(\002\"P\n\026SetRoiLocation" + "Response\0226\n\rgimbal_result\030\001 \001(\0132\037.mavsdk" + ".rpc.gimbal.GimbalResult\"J\n\022TakeControlR" + "equest\0224\n\014control_mode\030\001 \001(\0162\036.mavsdk.rp" + "c.gimbal.ControlMode\"M\n\023TakeControlRespo" + "nse\0226\n\rgimbal_result\030\001 \001(\0132\037.mavsdk.rpc." + "gimbal.GimbalResult\"\027\n\025ReleaseControlReq" + "uest\"P\n\026ReleaseControlResponse\0226\n\rgimbal" + "_result\030\001 \001(\0132\037.mavsdk.rpc.gimbal.Gimbal" + "Result\"\031\n\027SubscribeControlRequest\"K\n\017Con" + "trolResponse\0228\n\016control_status\030\001 \001(\0132 .m" + "avsdk.rpc.gimbal.ControlStatus\"\307\001\n\rContr" + "olStatus\0224\n\014control_mode\030\001 \001(\0162\036.mavsdk." + "rpc.gimbal.ControlMode\022\035\n\025sysid_primary_" + "control\030\002 \001(\005\022\036\n\026compid_primary_control\030" + "\003 \001(\005\022\037\n\027sysid_secondary_control\030\004 \001(\005\022 " + "\n\030compid_secondary_control\030\005 \001(\005\"\341\001\n\014Gim" + "balResult\0226\n\006result\030\001 \001(\0162&.mavsdk.rpc.g" + "imbal.GimbalResult.Result\022\022\n\nresult_str\030" + "\002 \001(\t\"\204\001\n\006Result\022\022\n\016RESULT_UNKNOWN\020\000\022\022\n\016" + "RESULT_SUCCESS\020\001\022\020\n\014RESULT_ERROR\020\002\022\022\n\016RE" + "SULT_TIMEOUT\020\003\022\026\n\022RESULT_UNSUPPORTED\020\004\022\024" + "\n\020RESULT_NO_SYSTEM\020\005*B\n\nGimbalMode\022\032\n\026GI" + "MBAL_MODE_YAW_FOLLOW\020\000\022\030\n\024GIMBAL_MODE_YA" + "W_LOCK\020\001*Z\n\013ControlMode\022\025\n\021CONTROL_MODE_" + "NONE\020\000\022\030\n\024CONTROL_MODE_PRIMARY\020\001\022\032\n\026CONT" + "ROL_MODE_SECONDARY\020\0022\301\006\n\rGimbalService\022X" + "\n\tSetAngles\022#.mavsdk.rpc.gimbal.SetAngle" + "sRequest\032$.mavsdk.rpc.gimbal.SetAnglesRe" + "sponse\"\000\022g\n\016SetPitchAndYaw\022(.mavsdk.rpc." + "gimbal.SetPitchAndYawRequest\032).mavsdk.rp" + "c.gimbal.SetPitchAndYawResponse\"\000\022\177\n\026Set" + "PitchRateAndYawRate\0220.mavsdk.rpc.gimbal." + "SetPitchRateAndYawRateRequest\0321.mavsdk.r" + "pc.gimbal.SetPitchRateAndYawRateResponse" + "\"\000\022R\n\007SetMode\022!.mavsdk.rpc.gimbal.SetMod" + "eRequest\032\".mavsdk.rpc.gimbal.SetModeResp" + "onse\"\000\022g\n\016SetRoiLocation\022(.mavsdk.rpc.gi" + "mbal.SetRoiLocationRequest\032).mavsdk.rpc." + "gimbal.SetRoiLocationResponse\"\000\022^\n\013TakeC" + "ontrol\022%.mavsdk.rpc.gimbal.TakeControlRe" + "quest\032&.mavsdk.rpc.gimbal.TakeControlRes" + "ponse\"\000\022g\n\016ReleaseControl\022(.mavsdk.rpc.g" + "imbal.ReleaseControlRequest\032).mavsdk.rpc" + ".gimbal.ReleaseControlResponse\"\000\022f\n\020Subs" + "cribeControl\022*.mavsdk.rpc.gimbal.Subscri" + "beControlRequest\032\".mavsdk.rpc.gimbal.Con" + "trolResponse\"\0000\001B\037\n\020io.mavsdk.gimbalB\013Gi" + "mbalProtob\006proto3" }; static ::absl::once_flag descriptor_table_gimbal_2fgimbal_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_gimbal_2fgimbal_2eproto = { false, false, - 2416, + 2657, descriptor_table_protodef_gimbal_2fgimbal_2eproto, "gimbal/gimbal.proto", &descriptor_table_gimbal_2fgimbal_2eproto_once, nullptr, 0, - 16, + 18, schemas, file_default_instances, TableStruct_gimbal_2fgimbal_2eproto::offsets, @@ -677,6 +748,482 @@ bool ControlMode_IsValid(int value) { } // =================================================================== +class SetAnglesRequest::_Internal { + public: +}; + +SetAnglesRequest::SetAnglesRequest(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:mavsdk.rpc.gimbal.SetAnglesRequest) +} +SetAnglesRequest::SetAnglesRequest( + ::google::protobuf::Arena* arena, const SetAnglesRequest& from) + : SetAnglesRequest(arena) { + MergeFrom(from); +} +inline PROTOBUF_NDEBUG_INLINE SetAnglesRequest::Impl_::Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* arena) + : _cached_size_{0} {} + +inline void SetAnglesRequest::SharedCtor(::_pb::Arena* arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + ::memset(reinterpret_cast(&_impl_) + + offsetof(Impl_, roll_deg_), + 0, + offsetof(Impl_, yaw_deg_) - + offsetof(Impl_, roll_deg_) + + sizeof(Impl_::yaw_deg_)); +} +SetAnglesRequest::~SetAnglesRequest() { + // @@protoc_insertion_point(destructor:mavsdk.rpc.gimbal.SetAnglesRequest) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void SetAnglesRequest::SharedDtor() { + ABSL_DCHECK(GetArena() == nullptr); + _impl_.~Impl_(); +} + +PROTOBUF_NOINLINE void SetAnglesRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:mavsdk.rpc.gimbal.SetAnglesRequest) + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&_impl_.roll_deg_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.yaw_deg_) - + reinterpret_cast(&_impl_.roll_deg_)) + sizeof(_impl_.yaw_deg_)); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +const char* SetAnglesRequest::_InternalParse( + const char* ptr, ::_pbi::ParseContext* ctx) { + ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); + return ptr; +} + + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<2, 3, 0, 0, 2> SetAnglesRequest::_table_ = { + { + 0, // no _has_bits_ + 0, // no _extensions_ + 3, 24, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967288, // skipmap + offsetof(decltype(_table_), field_entries), + 3, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + &_SetAnglesRequest_default_instance_._instance, + ::_pbi::TcParser::GenericFallback, // fallback + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + // float roll_deg = 1; + {::_pbi::TcParser::FastF32S1, + {13, 63, 0, PROTOBUF_FIELD_OFFSET(SetAnglesRequest, _impl_.roll_deg_)}}, + // float pitch_deg = 2; + {::_pbi::TcParser::FastF32S1, + {21, 63, 0, PROTOBUF_FIELD_OFFSET(SetAnglesRequest, _impl_.pitch_deg_)}}, + // float yaw_deg = 3; + {::_pbi::TcParser::FastF32S1, + {29, 63, 0, PROTOBUF_FIELD_OFFSET(SetAnglesRequest, _impl_.yaw_deg_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // float roll_deg = 1; + {PROTOBUF_FIELD_OFFSET(SetAnglesRequest, _impl_.roll_deg_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kFloat)}, + // float pitch_deg = 2; + {PROTOBUF_FIELD_OFFSET(SetAnglesRequest, _impl_.pitch_deg_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kFloat)}, + // float yaw_deg = 3; + {PROTOBUF_FIELD_OFFSET(SetAnglesRequest, _impl_.yaw_deg_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kFloat)}, + }}, + // no aux_entries + {{ + }}, +}; + +::uint8_t* SetAnglesRequest::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:mavsdk.rpc.gimbal.SetAnglesRequest) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + // float roll_deg = 1; + static_assert(sizeof(::uint32_t) == sizeof(float), + "Code assumes ::uint32_t and float are the same size."); + float tmp_roll_deg = this->_internal_roll_deg(); + ::uint32_t raw_roll_deg; + memcpy(&raw_roll_deg, &tmp_roll_deg, sizeof(tmp_roll_deg)); + if (raw_roll_deg != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteFloatToArray( + 1, this->_internal_roll_deg(), target); + } + + // float pitch_deg = 2; + static_assert(sizeof(::uint32_t) == sizeof(float), + "Code assumes ::uint32_t and float are the same size."); + float tmp_pitch_deg = this->_internal_pitch_deg(); + ::uint32_t raw_pitch_deg; + memcpy(&raw_pitch_deg, &tmp_pitch_deg, sizeof(tmp_pitch_deg)); + if (raw_pitch_deg != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteFloatToArray( + 2, this->_internal_pitch_deg(), target); + } + + // float yaw_deg = 3; + static_assert(sizeof(::uint32_t) == sizeof(float), + "Code assumes ::uint32_t and float are the same size."); + float tmp_yaw_deg = this->_internal_yaw_deg(); + ::uint32_t raw_yaw_deg; + memcpy(&raw_yaw_deg, &tmp_yaw_deg, sizeof(tmp_yaw_deg)); + if (raw_yaw_deg != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteFloatToArray( + 3, this->_internal_yaw_deg(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:mavsdk.rpc.gimbal.SetAnglesRequest) + return target; +} + +::size_t SetAnglesRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:mavsdk.rpc.gimbal.SetAnglesRequest) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // float roll_deg = 1; + static_assert(sizeof(::uint32_t) == sizeof(float), + "Code assumes ::uint32_t and float are the same size."); + float tmp_roll_deg = this->_internal_roll_deg(); + ::uint32_t raw_roll_deg; + memcpy(&raw_roll_deg, &tmp_roll_deg, sizeof(tmp_roll_deg)); + if (raw_roll_deg != 0) { + total_size += 5; + } + + // float pitch_deg = 2; + static_assert(sizeof(::uint32_t) == sizeof(float), + "Code assumes ::uint32_t and float are the same size."); + float tmp_pitch_deg = this->_internal_pitch_deg(); + ::uint32_t raw_pitch_deg; + memcpy(&raw_pitch_deg, &tmp_pitch_deg, sizeof(tmp_pitch_deg)); + if (raw_pitch_deg != 0) { + total_size += 5; + } + + // float yaw_deg = 3; + static_assert(sizeof(::uint32_t) == sizeof(float), + "Code assumes ::uint32_t and float are the same size."); + float tmp_yaw_deg = this->_internal_yaw_deg(); + ::uint32_t raw_yaw_deg; + memcpy(&raw_yaw_deg, &tmp_yaw_deg, sizeof(tmp_yaw_deg)); + if (raw_yaw_deg != 0) { + total_size += 5; + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::google::protobuf::Message::ClassData SetAnglesRequest::_class_data_ = { + SetAnglesRequest::MergeImpl, + nullptr, // OnDemandRegisterArenaDtor +}; +const ::google::protobuf::Message::ClassData* SetAnglesRequest::GetClassData() const { + return &_class_data_; +} + +void SetAnglesRequest::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:mavsdk.rpc.gimbal.SetAnglesRequest) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + static_assert(sizeof(::uint32_t) == sizeof(float), + "Code assumes ::uint32_t and float are the same size."); + float tmp_roll_deg = from._internal_roll_deg(); + ::uint32_t raw_roll_deg; + memcpy(&raw_roll_deg, &tmp_roll_deg, sizeof(tmp_roll_deg)); + if (raw_roll_deg != 0) { + _this->_internal_set_roll_deg(from._internal_roll_deg()); + } + static_assert(sizeof(::uint32_t) == sizeof(float), + "Code assumes ::uint32_t and float are the same size."); + float tmp_pitch_deg = from._internal_pitch_deg(); + ::uint32_t raw_pitch_deg; + memcpy(&raw_pitch_deg, &tmp_pitch_deg, sizeof(tmp_pitch_deg)); + if (raw_pitch_deg != 0) { + _this->_internal_set_pitch_deg(from._internal_pitch_deg()); + } + static_assert(sizeof(::uint32_t) == sizeof(float), + "Code assumes ::uint32_t and float are the same size."); + float tmp_yaw_deg = from._internal_yaw_deg(); + ::uint32_t raw_yaw_deg; + memcpy(&raw_yaw_deg, &tmp_yaw_deg, sizeof(tmp_yaw_deg)); + if (raw_yaw_deg != 0) { + _this->_internal_set_yaw_deg(from._internal_yaw_deg()); + } + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void SetAnglesRequest::CopyFrom(const SetAnglesRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:mavsdk.rpc.gimbal.SetAnglesRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +PROTOBUF_NOINLINE bool SetAnglesRequest::IsInitialized() const { + return true; +} + +::_pbi::CachedSize* SetAnglesRequest::AccessCachedSize() const { + return &_impl_._cached_size_; +} +void SetAnglesRequest::InternalSwap(SetAnglesRequest* PROTOBUF_RESTRICT other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(SetAnglesRequest, _impl_.yaw_deg_) + + sizeof(SetAnglesRequest::_impl_.yaw_deg_) + - PROTOBUF_FIELD_OFFSET(SetAnglesRequest, _impl_.roll_deg_)>( + reinterpret_cast(&_impl_.roll_deg_), + reinterpret_cast(&other->_impl_.roll_deg_)); +} + +::google::protobuf::Metadata SetAnglesRequest::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_gimbal_2fgimbal_2eproto_getter, &descriptor_table_gimbal_2fgimbal_2eproto_once, + file_level_metadata_gimbal_2fgimbal_2eproto[0]); +} +// =================================================================== + +class SetAnglesResponse::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(SetAnglesResponse, _impl_._has_bits_); + static const ::mavsdk::rpc::gimbal::GimbalResult& gimbal_result(const SetAnglesResponse* msg); + static void set_has_gimbal_result(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } +}; + +const ::mavsdk::rpc::gimbal::GimbalResult& SetAnglesResponse::_Internal::gimbal_result(const SetAnglesResponse* msg) { + return *msg->_impl_.gimbal_result_; +} +SetAnglesResponse::SetAnglesResponse(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:mavsdk.rpc.gimbal.SetAnglesResponse) +} +inline PROTOBUF_NDEBUG_INLINE SetAnglesResponse::Impl_::Impl_( + ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, + const Impl_& from) + : _has_bits_{from._has_bits_}, + _cached_size_{0} {} + +SetAnglesResponse::SetAnglesResponse( + ::google::protobuf::Arena* arena, + const SetAnglesResponse& from) + : ::google::protobuf::Message(arena) { + SetAnglesResponse* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); + ::uint32_t cached_has_bits = _impl_._has_bits_[0]; + _impl_.gimbal_result_ = (cached_has_bits & 0x00000001u) + ? CreateMaybeMessage<::mavsdk::rpc::gimbal::GimbalResult>(arena, *from._impl_.gimbal_result_) + : nullptr; + + // @@protoc_insertion_point(copy_constructor:mavsdk.rpc.gimbal.SetAnglesResponse) +} +inline PROTOBUF_NDEBUG_INLINE SetAnglesResponse::Impl_::Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* arena) + : _cached_size_{0} {} + +inline void SetAnglesResponse::SharedCtor(::_pb::Arena* arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + _impl_.gimbal_result_ = {}; +} +SetAnglesResponse::~SetAnglesResponse() { + // @@protoc_insertion_point(destructor:mavsdk.rpc.gimbal.SetAnglesResponse) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void SetAnglesResponse::SharedDtor() { + ABSL_DCHECK(GetArena() == nullptr); + delete _impl_.gimbal_result_; + _impl_.~Impl_(); +} + +PROTOBUF_NOINLINE void SetAnglesResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:mavsdk.rpc.gimbal.SetAnglesResponse) + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + ABSL_DCHECK(_impl_.gimbal_result_ != nullptr); + _impl_.gimbal_result_->Clear(); + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +const char* SetAnglesResponse::_InternalParse( + const char* ptr, ::_pbi::ParseContext* ctx) { + ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); + return ptr; +} + + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<0, 1, 1, 0, 2> SetAnglesResponse::_table_ = { + { + PROTOBUF_FIELD_OFFSET(SetAnglesResponse, _impl_._has_bits_), + 0, // no _extensions_ + 1, 0, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967294, // skipmap + offsetof(decltype(_table_), field_entries), + 1, // num_field_entries + 1, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + &_SetAnglesResponse_default_instance_._instance, + ::_pbi::TcParser::GenericFallback, // fallback + }, {{ + // .mavsdk.rpc.gimbal.GimbalResult gimbal_result = 1; + {::_pbi::TcParser::FastMtS1, + {10, 0, 0, PROTOBUF_FIELD_OFFSET(SetAnglesResponse, _impl_.gimbal_result_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // .mavsdk.rpc.gimbal.GimbalResult gimbal_result = 1; + {PROTOBUF_FIELD_OFFSET(SetAnglesResponse, _impl_.gimbal_result_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + }}, {{ + {::_pbi::TcParser::GetTable<::mavsdk::rpc::gimbal::GimbalResult>()}, + }}, {{ + }}, +}; + +::uint8_t* SetAnglesResponse::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:mavsdk.rpc.gimbal.SetAnglesResponse) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + // .mavsdk.rpc.gimbal.GimbalResult gimbal_result = 1; + if (cached_has_bits & 0x00000001u) { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 1, _Internal::gimbal_result(this), + _Internal::gimbal_result(this).GetCachedSize(), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:mavsdk.rpc.gimbal.SetAnglesResponse) + return target; +} + +::size_t SetAnglesResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:mavsdk.rpc.gimbal.SetAnglesResponse) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // .mavsdk.rpc.gimbal.GimbalResult gimbal_result = 1; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + total_size += + 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.gimbal_result_); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::google::protobuf::Message::ClassData SetAnglesResponse::_class_data_ = { + SetAnglesResponse::MergeImpl, + nullptr, // OnDemandRegisterArenaDtor +}; +const ::google::protobuf::Message::ClassData* SetAnglesResponse::GetClassData() const { + return &_class_data_; +} + +void SetAnglesResponse::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:mavsdk.rpc.gimbal.SetAnglesResponse) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { + _this->_internal_mutable_gimbal_result()->::mavsdk::rpc::gimbal::GimbalResult::MergeFrom( + from._internal_gimbal_result()); + } + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void SetAnglesResponse::CopyFrom(const SetAnglesResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:mavsdk.rpc.gimbal.SetAnglesResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +PROTOBUF_NOINLINE bool SetAnglesResponse::IsInitialized() const { + return true; +} + +::_pbi::CachedSize* SetAnglesResponse::AccessCachedSize() const { + return &_impl_._cached_size_; +} +void SetAnglesResponse::InternalSwap(SetAnglesResponse* PROTOBUF_RESTRICT other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + swap(_impl_.gimbal_result_, other->_impl_.gimbal_result_); +} + +::google::protobuf::Metadata SetAnglesResponse::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_gimbal_2fgimbal_2eproto_getter, &descriptor_table_gimbal_2fgimbal_2eproto_once, + file_level_metadata_gimbal_2fgimbal_2eproto[1]); +} +// =================================================================== + class SetPitchAndYawRequest::_Internal { public: }; @@ -905,7 +1452,7 @@ void SetPitchAndYawRequest::InternalSwap(SetPitchAndYawRequest* PROTOBUF_RESTRIC ::google::protobuf::Metadata SetPitchAndYawRequest::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_gimbal_2fgimbal_2eproto_getter, &descriptor_table_gimbal_2fgimbal_2eproto_once, - file_level_metadata_gimbal_2fgimbal_2eproto[0]); + file_level_metadata_gimbal_2fgimbal_2eproto[2]); } // =================================================================== @@ -1112,7 +1659,7 @@ void SetPitchAndYawResponse::InternalSwap(SetPitchAndYawResponse* PROTOBUF_RESTR ::google::protobuf::Metadata SetPitchAndYawResponse::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_gimbal_2fgimbal_2eproto_getter, &descriptor_table_gimbal_2fgimbal_2eproto_once, - file_level_metadata_gimbal_2fgimbal_2eproto[1]); + file_level_metadata_gimbal_2fgimbal_2eproto[3]); } // =================================================================== @@ -1344,7 +1891,7 @@ void SetPitchRateAndYawRateRequest::InternalSwap(SetPitchRateAndYawRateRequest* ::google::protobuf::Metadata SetPitchRateAndYawRateRequest::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_gimbal_2fgimbal_2eproto_getter, &descriptor_table_gimbal_2fgimbal_2eproto_once, - file_level_metadata_gimbal_2fgimbal_2eproto[2]); + file_level_metadata_gimbal_2fgimbal_2eproto[4]); } // =================================================================== @@ -1551,7 +2098,7 @@ void SetPitchRateAndYawRateResponse::InternalSwap(SetPitchRateAndYawRateResponse ::google::protobuf::Metadata SetPitchRateAndYawRateResponse::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_gimbal_2fgimbal_2eproto_getter, &descriptor_table_gimbal_2fgimbal_2eproto_once, - file_level_metadata_gimbal_2fgimbal_2eproto[3]); + file_level_metadata_gimbal_2fgimbal_2eproto[5]); } // =================================================================== @@ -1721,7 +2268,7 @@ void SetModeRequest::InternalSwap(SetModeRequest* PROTOBUF_RESTRICT other) { ::google::protobuf::Metadata SetModeRequest::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_gimbal_2fgimbal_2eproto_getter, &descriptor_table_gimbal_2fgimbal_2eproto_once, - file_level_metadata_gimbal_2fgimbal_2eproto[4]); + file_level_metadata_gimbal_2fgimbal_2eproto[6]); } // =================================================================== @@ -1928,7 +2475,7 @@ void SetModeResponse::InternalSwap(SetModeResponse* PROTOBUF_RESTRICT other) { ::google::protobuf::Metadata SetModeResponse::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_gimbal_2fgimbal_2eproto_getter, &descriptor_table_gimbal_2fgimbal_2eproto_once, - file_level_metadata_gimbal_2fgimbal_2eproto[5]); + file_level_metadata_gimbal_2fgimbal_2eproto[7]); } // =================================================================== @@ -2197,7 +2744,7 @@ void SetRoiLocationRequest::InternalSwap(SetRoiLocationRequest* PROTOBUF_RESTRIC ::google::protobuf::Metadata SetRoiLocationRequest::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_gimbal_2fgimbal_2eproto_getter, &descriptor_table_gimbal_2fgimbal_2eproto_once, - file_level_metadata_gimbal_2fgimbal_2eproto[6]); + file_level_metadata_gimbal_2fgimbal_2eproto[8]); } // =================================================================== @@ -2404,7 +2951,7 @@ void SetRoiLocationResponse::InternalSwap(SetRoiLocationResponse* PROTOBUF_RESTR ::google::protobuf::Metadata SetRoiLocationResponse::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_gimbal_2fgimbal_2eproto_getter, &descriptor_table_gimbal_2fgimbal_2eproto_once, - file_level_metadata_gimbal_2fgimbal_2eproto[7]); + file_level_metadata_gimbal_2fgimbal_2eproto[9]); } // =================================================================== @@ -2574,7 +3121,7 @@ void TakeControlRequest::InternalSwap(TakeControlRequest* PROTOBUF_RESTRICT othe ::google::protobuf::Metadata TakeControlRequest::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_gimbal_2fgimbal_2eproto_getter, &descriptor_table_gimbal_2fgimbal_2eproto_once, - file_level_metadata_gimbal_2fgimbal_2eproto[8]); + file_level_metadata_gimbal_2fgimbal_2eproto[10]); } // =================================================================== @@ -2781,7 +3328,7 @@ void TakeControlResponse::InternalSwap(TakeControlResponse* PROTOBUF_RESTRICT ot ::google::protobuf::Metadata TakeControlResponse::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_gimbal_2fgimbal_2eproto_getter, &descriptor_table_gimbal_2fgimbal_2eproto_once, - file_level_metadata_gimbal_2fgimbal_2eproto[9]); + file_level_metadata_gimbal_2fgimbal_2eproto[11]); } // =================================================================== @@ -2816,7 +3363,7 @@ ReleaseControlRequest::ReleaseControlRequest( ::google::protobuf::Metadata ReleaseControlRequest::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_gimbal_2fgimbal_2eproto_getter, &descriptor_table_gimbal_2fgimbal_2eproto_once, - file_level_metadata_gimbal_2fgimbal_2eproto[10]); + file_level_metadata_gimbal_2fgimbal_2eproto[12]); } // =================================================================== @@ -3023,7 +3570,7 @@ void ReleaseControlResponse::InternalSwap(ReleaseControlResponse* PROTOBUF_RESTR ::google::protobuf::Metadata ReleaseControlResponse::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_gimbal_2fgimbal_2eproto_getter, &descriptor_table_gimbal_2fgimbal_2eproto_once, - file_level_metadata_gimbal_2fgimbal_2eproto[11]); + file_level_metadata_gimbal_2fgimbal_2eproto[13]); } // =================================================================== @@ -3058,7 +3605,7 @@ SubscribeControlRequest::SubscribeControlRequest( ::google::protobuf::Metadata SubscribeControlRequest::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_gimbal_2fgimbal_2eproto_getter, &descriptor_table_gimbal_2fgimbal_2eproto_once, - file_level_metadata_gimbal_2fgimbal_2eproto[12]); + file_level_metadata_gimbal_2fgimbal_2eproto[14]); } // =================================================================== @@ -3265,7 +3812,7 @@ void ControlResponse::InternalSwap(ControlResponse* PROTOBUF_RESTRICT other) { ::google::protobuf::Metadata ControlResponse::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_gimbal_2fgimbal_2eproto_getter, &descriptor_table_gimbal_2fgimbal_2eproto_once, - file_level_metadata_gimbal_2fgimbal_2eproto[13]); + file_level_metadata_gimbal_2fgimbal_2eproto[15]); } // =================================================================== @@ -3538,7 +4085,7 @@ void ControlStatus::InternalSwap(ControlStatus* PROTOBUF_RESTRICT other) { ::google::protobuf::Metadata ControlStatus::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_gimbal_2fgimbal_2eproto_getter, &descriptor_table_gimbal_2fgimbal_2eproto_once, - file_level_metadata_gimbal_2fgimbal_2eproto[14]); + file_level_metadata_gimbal_2fgimbal_2eproto[16]); } // =================================================================== @@ -3754,7 +4301,7 @@ void GimbalResult::InternalSwap(GimbalResult* PROTOBUF_RESTRICT other) { ::google::protobuf::Metadata GimbalResult::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_gimbal_2fgimbal_2eproto_getter, &descriptor_table_gimbal_2fgimbal_2eproto_once, - file_level_metadata_gimbal_2fgimbal_2eproto[15]); + file_level_metadata_gimbal_2fgimbal_2eproto[17]); } // @@protoc_insertion_point(namespace_scope) } // namespace gimbal diff --git a/src/mavsdk_server/src/generated/gimbal/gimbal.pb.h b/src/mavsdk_server/src/generated/gimbal/gimbal.pb.h index e1e21a53a7..cdcfe4bc3e 100644 --- a/src/mavsdk_server/src/generated/gimbal/gimbal.pb.h +++ b/src/mavsdk_server/src/generated/gimbal/gimbal.pb.h @@ -75,6 +75,12 @@ extern ReleaseControlRequestDefaultTypeInternal _ReleaseControlRequest_default_i class ReleaseControlResponse; struct ReleaseControlResponseDefaultTypeInternal; extern ReleaseControlResponseDefaultTypeInternal _ReleaseControlResponse_default_instance_; +class SetAnglesRequest; +struct SetAnglesRequestDefaultTypeInternal; +extern SetAnglesRequestDefaultTypeInternal _SetAnglesRequest_default_instance_; +class SetAnglesResponse; +struct SetAnglesResponseDefaultTypeInternal; +extern SetAnglesResponseDefaultTypeInternal _SetAnglesResponse_default_instance_; class SetModeRequest; struct SetModeRequestDefaultTypeInternal; extern SetModeRequestDefaultTypeInternal _SetModeRequest_default_instance_; @@ -288,7 +294,7 @@ class TakeControlRequest final : &_TakeControlRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 8; + 10; friend void swap(TakeControlRequest& a, TakeControlRequest& b) { a.Swap(&b); @@ -462,7 +468,7 @@ class SubscribeControlRequest final : &_SubscribeControlRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 12; + 14; friend void swap(SubscribeControlRequest& a, SubscribeControlRequest& b) { a.Swap(&b); @@ -599,7 +605,7 @@ class SetRoiLocationRequest final : &_SetRoiLocationRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 6; + 8; friend void swap(SetRoiLocationRequest& a, SetRoiLocationRequest& b) { a.Swap(&b); @@ -798,7 +804,7 @@ class SetPitchRateAndYawRateRequest final : &_SetPitchRateAndYawRateRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 2; + 4; friend void swap(SetPitchRateAndYawRateRequest& a, SetPitchRateAndYawRateRequest& b) { a.Swap(&b); @@ -985,7 +991,7 @@ class SetPitchAndYawRequest final : &_SetPitchAndYawRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 0; + 2; friend void swap(SetPitchAndYawRequest& a, SetPitchAndYawRequest& b) { a.Swap(&b); @@ -1172,7 +1178,7 @@ class SetModeRequest final : &_SetModeRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 4; + 6; friend void swap(SetModeRequest& a, SetModeRequest& b) { a.Swap(&b); @@ -1288,6 +1294,205 @@ class SetModeRequest final : friend struct ::TableStruct_gimbal_2fgimbal_2eproto; };// ------------------------------------------------------------------- +class SetAnglesRequest final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:mavsdk.rpc.gimbal.SetAnglesRequest) */ { + public: + inline SetAnglesRequest() : SetAnglesRequest(nullptr) {} + ~SetAnglesRequest() override; + template + explicit PROTOBUF_CONSTEXPR SetAnglesRequest(::google::protobuf::internal::ConstantInitialized); + + inline SetAnglesRequest(const SetAnglesRequest& from) + : SetAnglesRequest(nullptr, from) {} + SetAnglesRequest(SetAnglesRequest&& from) noexcept + : SetAnglesRequest() { + *this = ::std::move(from); + } + + inline SetAnglesRequest& operator=(const SetAnglesRequest& from) { + CopyFrom(from); + return *this; + } + inline SetAnglesRequest& operator=(SetAnglesRequest&& from) noexcept { + if (this == &from) return *this; + if (GetArena() == from.GetArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const SetAnglesRequest& default_instance() { + return *internal_default_instance(); + } + static inline const SetAnglesRequest* internal_default_instance() { + return reinterpret_cast( + &_SetAnglesRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(SetAnglesRequest& a, SetAnglesRequest& b) { + a.Swap(&b); + } + inline void Swap(SetAnglesRequest* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(SetAnglesRequest* other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + SetAnglesRequest* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const SetAnglesRequest& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom( const SetAnglesRequest& from) { + SetAnglesRequest::MergeImpl(*this, from); + } + private: + static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + ::size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; + ::uint8_t* _InternalSerialize( + ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const { return _impl_._cached_size_.Get(); } + + private: + ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; + void SharedCtor(::google::protobuf::Arena* arena); + void SharedDtor(); + void InternalSwap(SetAnglesRequest* other); + + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { + return "mavsdk.rpc.gimbal.SetAnglesRequest"; + } + protected: + explicit SetAnglesRequest(::google::protobuf::Arena* arena); + SetAnglesRequest(::google::protobuf::Arena* arena, const SetAnglesRequest& from); + public: + + static const ClassData _class_data_; + const ::google::protobuf::Message::ClassData*GetClassData() const final; + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kRollDegFieldNumber = 1, + kPitchDegFieldNumber = 2, + kYawDegFieldNumber = 3, + }; + // float roll_deg = 1; + void clear_roll_deg() ; + float roll_deg() const; + void set_roll_deg(float value); + + private: + float _internal_roll_deg() const; + void _internal_set_roll_deg(float value); + + public: + // float pitch_deg = 2; + void clear_pitch_deg() ; + float pitch_deg() const; + void set_pitch_deg(float value); + + private: + float _internal_pitch_deg() const; + void _internal_set_pitch_deg(float value); + + public: + // float yaw_deg = 3; + void clear_yaw_deg() ; + float yaw_deg() const; + void set_yaw_deg(float value); + + private: + float _internal_yaw_deg() const; + void _internal_set_yaw_deg(float value); + + public: + // @@protoc_insertion_point(class_scope:mavsdk.rpc.gimbal.SetAnglesRequest) + private: + class _Internal; + + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable< + 2, 3, 0, + 0, 2> + _table_; + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + + inline explicit constexpr Impl_( + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* arena); + inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* arena, const Impl_& from); + float roll_deg_; + float pitch_deg_; + float yaw_deg_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_gimbal_2fgimbal_2eproto; +};// ------------------------------------------------------------------- + class ReleaseControlRequest final : public ::google::protobuf::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:mavsdk.rpc.gimbal.ReleaseControlRequest) */ { public: @@ -1346,7 +1551,7 @@ class ReleaseControlRequest final : &_ReleaseControlRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 10; + 12; friend void swap(ReleaseControlRequest& a, ReleaseControlRequest& b) { a.Swap(&b); @@ -1483,7 +1688,7 @@ class GimbalResult final : &_GimbalResult_default_instance_); } static constexpr int kIndexInFileMessages = - 15; + 17; friend void swap(GimbalResult& a, GimbalResult& b) { a.Swap(&b); @@ -1700,7 +1905,7 @@ class ControlStatus final : &_ControlStatus_default_instance_); } static constexpr int kIndexInFileMessages = - 14; + 16; friend void swap(ControlStatus& a, ControlStatus& b) { a.Swap(&b); @@ -1923,7 +2128,7 @@ class TakeControlResponse final : &_TakeControlResponse_default_instance_); } static constexpr int kIndexInFileMessages = - 9; + 11; friend void swap(TakeControlResponse& a, TakeControlResponse& b) { a.Swap(&b); @@ -2104,7 +2309,7 @@ class SetRoiLocationResponse final : &_SetRoiLocationResponse_default_instance_); } static constexpr int kIndexInFileMessages = - 7; + 9; friend void swap(SetRoiLocationResponse& a, SetRoiLocationResponse& b) { a.Swap(&b); @@ -2285,7 +2490,7 @@ class SetPitchRateAndYawRateResponse final : &_SetPitchRateAndYawRateResponse_default_instance_); } static constexpr int kIndexInFileMessages = - 3; + 5; friend void swap(SetPitchRateAndYawRateResponse& a, SetPitchRateAndYawRateResponse& b) { a.Swap(&b); @@ -2466,7 +2671,7 @@ class SetPitchAndYawResponse final : &_SetPitchAndYawResponse_default_instance_); } static constexpr int kIndexInFileMessages = - 1; + 3; friend void swap(SetPitchAndYawResponse& a, SetPitchAndYawResponse& b) { a.Swap(&b); @@ -2647,7 +2852,7 @@ class SetModeResponse final : &_SetModeResponse_default_instance_); } static constexpr int kIndexInFileMessages = - 5; + 7; friend void swap(SetModeResponse& a, SetModeResponse& b) { a.Swap(&b); @@ -2769,6 +2974,187 @@ class SetModeResponse final : friend struct ::TableStruct_gimbal_2fgimbal_2eproto; };// ------------------------------------------------------------------- +class SetAnglesResponse final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:mavsdk.rpc.gimbal.SetAnglesResponse) */ { + public: + inline SetAnglesResponse() : SetAnglesResponse(nullptr) {} + ~SetAnglesResponse() override; + template + explicit PROTOBUF_CONSTEXPR SetAnglesResponse(::google::protobuf::internal::ConstantInitialized); + + inline SetAnglesResponse(const SetAnglesResponse& from) + : SetAnglesResponse(nullptr, from) {} + SetAnglesResponse(SetAnglesResponse&& from) noexcept + : SetAnglesResponse() { + *this = ::std::move(from); + } + + inline SetAnglesResponse& operator=(const SetAnglesResponse& from) { + CopyFrom(from); + return *this; + } + inline SetAnglesResponse& operator=(SetAnglesResponse&& from) noexcept { + if (this == &from) return *this; + if (GetArena() == from.GetArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const SetAnglesResponse& default_instance() { + return *internal_default_instance(); + } + static inline const SetAnglesResponse* internal_default_instance() { + return reinterpret_cast( + &_SetAnglesResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + friend void swap(SetAnglesResponse& a, SetAnglesResponse& b) { + a.Swap(&b); + } + inline void Swap(SetAnglesResponse* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() != nullptr && + GetArena() == other->GetArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(SetAnglesResponse* other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + SetAnglesResponse* New(::google::protobuf::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const SetAnglesResponse& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom( const SetAnglesResponse& from) { + SetAnglesResponse::MergeImpl(*this, from); + } + private: + static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + ::size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; + ::uint8_t* _InternalSerialize( + ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const { return _impl_._cached_size_.Get(); } + + private: + ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; + void SharedCtor(::google::protobuf::Arena* arena); + void SharedDtor(); + void InternalSwap(SetAnglesResponse* other); + + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { + return "mavsdk.rpc.gimbal.SetAnglesResponse"; + } + protected: + explicit SetAnglesResponse(::google::protobuf::Arena* arena); + SetAnglesResponse(::google::protobuf::Arena* arena, const SetAnglesResponse& from); + public: + + static const ClassData _class_data_; + const ::google::protobuf::Message::ClassData*GetClassData() const final; + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kGimbalResultFieldNumber = 1, + }; + // .mavsdk.rpc.gimbal.GimbalResult gimbal_result = 1; + bool has_gimbal_result() const; + void clear_gimbal_result() ; + const ::mavsdk::rpc::gimbal::GimbalResult& gimbal_result() const; + PROTOBUF_NODISCARD ::mavsdk::rpc::gimbal::GimbalResult* release_gimbal_result(); + ::mavsdk::rpc::gimbal::GimbalResult* mutable_gimbal_result(); + void set_allocated_gimbal_result(::mavsdk::rpc::gimbal::GimbalResult* value); + void unsafe_arena_set_allocated_gimbal_result(::mavsdk::rpc::gimbal::GimbalResult* value); + ::mavsdk::rpc::gimbal::GimbalResult* unsafe_arena_release_gimbal_result(); + + private: + const ::mavsdk::rpc::gimbal::GimbalResult& _internal_gimbal_result() const; + ::mavsdk::rpc::gimbal::GimbalResult* _internal_mutable_gimbal_result(); + + public: + // @@protoc_insertion_point(class_scope:mavsdk.rpc.gimbal.SetAnglesResponse) + private: + class _Internal; + + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable< + 0, 1, 1, + 0, 2> + _table_; + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + + inline explicit constexpr Impl_( + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* arena); + inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* arena, const Impl_& from); + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::mavsdk::rpc::gimbal::GimbalResult* gimbal_result_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_gimbal_2fgimbal_2eproto; +};// ------------------------------------------------------------------- + class ReleaseControlResponse final : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:mavsdk.rpc.gimbal.ReleaseControlResponse) */ { public: @@ -2828,7 +3214,7 @@ class ReleaseControlResponse final : &_ReleaseControlResponse_default_instance_); } static constexpr int kIndexInFileMessages = - 11; + 13; friend void swap(ReleaseControlResponse& a, ReleaseControlResponse& b) { a.Swap(&b); @@ -3009,7 +3395,7 @@ class ControlResponse final : &_ControlResponse_default_instance_); } static constexpr int kIndexInFileMessages = - 13; + 15; friend void swap(ControlResponse& a, ControlResponse& b) { a.Swap(&b); @@ -3145,6 +3531,179 @@ class ControlResponse final : #endif // __GNUC__ // ------------------------------------------------------------------- +// SetAnglesRequest + +// float roll_deg = 1; +inline void SetAnglesRequest::clear_roll_deg() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_.roll_deg_ = 0; +} +inline float SetAnglesRequest::roll_deg() const { + // @@protoc_insertion_point(field_get:mavsdk.rpc.gimbal.SetAnglesRequest.roll_deg) + return _internal_roll_deg(); +} +inline void SetAnglesRequest::set_roll_deg(float value) { + _internal_set_roll_deg(value); + // @@protoc_insertion_point(field_set:mavsdk.rpc.gimbal.SetAnglesRequest.roll_deg) +} +inline float SetAnglesRequest::_internal_roll_deg() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.roll_deg_; +} +inline void SetAnglesRequest::_internal_set_roll_deg(float value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.roll_deg_ = value; +} + +// float pitch_deg = 2; +inline void SetAnglesRequest::clear_pitch_deg() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_.pitch_deg_ = 0; +} +inline float SetAnglesRequest::pitch_deg() const { + // @@protoc_insertion_point(field_get:mavsdk.rpc.gimbal.SetAnglesRequest.pitch_deg) + return _internal_pitch_deg(); +} +inline void SetAnglesRequest::set_pitch_deg(float value) { + _internal_set_pitch_deg(value); + // @@protoc_insertion_point(field_set:mavsdk.rpc.gimbal.SetAnglesRequest.pitch_deg) +} +inline float SetAnglesRequest::_internal_pitch_deg() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.pitch_deg_; +} +inline void SetAnglesRequest::_internal_set_pitch_deg(float value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.pitch_deg_ = value; +} + +// float yaw_deg = 3; +inline void SetAnglesRequest::clear_yaw_deg() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_.yaw_deg_ = 0; +} +inline float SetAnglesRequest::yaw_deg() const { + // @@protoc_insertion_point(field_get:mavsdk.rpc.gimbal.SetAnglesRequest.yaw_deg) + return _internal_yaw_deg(); +} +inline void SetAnglesRequest::set_yaw_deg(float value) { + _internal_set_yaw_deg(value); + // @@protoc_insertion_point(field_set:mavsdk.rpc.gimbal.SetAnglesRequest.yaw_deg) +} +inline float SetAnglesRequest::_internal_yaw_deg() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + return _impl_.yaw_deg_; +} +inline void SetAnglesRequest::_internal_set_yaw_deg(float value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + ; + _impl_.yaw_deg_ = value; +} + +// ------------------------------------------------------------------- + +// SetAnglesResponse + +// .mavsdk.rpc.gimbal.GimbalResult gimbal_result = 1; +inline bool SetAnglesResponse::has_gimbal_result() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + PROTOBUF_ASSUME(!value || _impl_.gimbal_result_ != nullptr); + return value; +} +inline void SetAnglesResponse::clear_gimbal_result() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + if (_impl_.gimbal_result_ != nullptr) _impl_.gimbal_result_->Clear(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline const ::mavsdk::rpc::gimbal::GimbalResult& SetAnglesResponse::_internal_gimbal_result() const { + PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); + const ::mavsdk::rpc::gimbal::GimbalResult* p = _impl_.gimbal_result_; + return p != nullptr ? *p : reinterpret_cast(::mavsdk::rpc::gimbal::_GimbalResult_default_instance_); +} +inline const ::mavsdk::rpc::gimbal::GimbalResult& SetAnglesResponse::gimbal_result() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:mavsdk.rpc.gimbal.SetAnglesResponse.gimbal_result) + return _internal_gimbal_result(); +} +inline void SetAnglesResponse::unsafe_arena_set_allocated_gimbal_result(::mavsdk::rpc::gimbal::GimbalResult* value) { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + if (GetArena() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.gimbal_result_); + } + _impl_.gimbal_result_ = reinterpret_cast<::mavsdk::rpc::gimbal::GimbalResult*>(value); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:mavsdk.rpc.gimbal.SetAnglesResponse.gimbal_result) +} +inline ::mavsdk::rpc::gimbal::GimbalResult* SetAnglesResponse::release_gimbal_result() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + + _impl_._has_bits_[0] &= ~0x00000001u; + ::mavsdk::rpc::gimbal::GimbalResult* released = _impl_.gimbal_result_; + _impl_.gimbal_result_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArena() == nullptr) { + delete old; + } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArena() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return released; +} +inline ::mavsdk::rpc::gimbal::GimbalResult* SetAnglesResponse::unsafe_arena_release_gimbal_result() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + // @@protoc_insertion_point(field_release:mavsdk.rpc.gimbal.SetAnglesResponse.gimbal_result) + + _impl_._has_bits_[0] &= ~0x00000001u; + ::mavsdk::rpc::gimbal::GimbalResult* temp = _impl_.gimbal_result_; + _impl_.gimbal_result_ = nullptr; + return temp; +} +inline ::mavsdk::rpc::gimbal::GimbalResult* SetAnglesResponse::_internal_mutable_gimbal_result() { + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + _impl_._has_bits_[0] |= 0x00000001u; + if (_impl_.gimbal_result_ == nullptr) { + auto* p = CreateMaybeMessage<::mavsdk::rpc::gimbal::GimbalResult>(GetArena()); + _impl_.gimbal_result_ = reinterpret_cast<::mavsdk::rpc::gimbal::GimbalResult*>(p); + } + return _impl_.gimbal_result_; +} +inline ::mavsdk::rpc::gimbal::GimbalResult* SetAnglesResponse::mutable_gimbal_result() ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::mavsdk::rpc::gimbal::GimbalResult* _msg = _internal_mutable_gimbal_result(); + // @@protoc_insertion_point(field_mutable:mavsdk.rpc.gimbal.SetAnglesResponse.gimbal_result) + return _msg; +} +inline void SetAnglesResponse::set_allocated_gimbal_result(::mavsdk::rpc::gimbal::GimbalResult* value) { + ::google::protobuf::Arena* message_arena = GetArena(); + PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); + if (message_arena == nullptr) { + delete reinterpret_cast<::mavsdk::rpc::gimbal::GimbalResult*>(_impl_.gimbal_result_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::mavsdk::rpc::gimbal::GimbalResult*>(value)->GetArena(); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + + _impl_.gimbal_result_ = reinterpret_cast<::mavsdk::rpc::gimbal::GimbalResult*>(value); + // @@protoc_insertion_point(field_set_allocated:mavsdk.rpc.gimbal.SetAnglesResponse.gimbal_result) +} + +// ------------------------------------------------------------------- + // SetPitchAndYawRequest // float pitch_deg = 1; diff --git a/src/mavsdk_server/src/plugins/gimbal/gimbal_service_impl.h b/src/mavsdk_server/src/plugins/gimbal/gimbal_service_impl.h index 5c5bf88f99..62d06f3ca8 100644 --- a/src/mavsdk_server/src/plugins/gimbal/gimbal_service_impl.h +++ b/src/mavsdk_server/src/plugins/gimbal/gimbal_service_impl.h @@ -181,6 +181,35 @@ class GimbalServiceImpl final : public rpc::gimbal::GimbalService::Service { } } + grpc::Status SetAngles( + grpc::ServerContext* /* context */, + const rpc::gimbal::SetAnglesRequest* request, + rpc::gimbal::SetAnglesResponse* response) override + { + if (_lazy_plugin.maybe_plugin() == nullptr) { + if (response != nullptr) { + auto result = mavsdk::Gimbal::Result::NoSystem; + fillResponseWithResult(response, result); + } + + return grpc::Status::OK; + } + + if (request == nullptr) { + LogWarn() << "SetAngles sent with a null request! Ignoring..."; + return grpc::Status::OK; + } + + auto result = _lazy_plugin.maybe_plugin()->set_angles( + request->roll_deg(), request->pitch_deg(), request->yaw_deg()); + + if (response != nullptr) { + fillResponseWithResult(response, result); + } + + return grpc::Status::OK; + } + grpc::Status SetPitchAndYaw( grpc::ServerContext* /* context */, const rpc::gimbal::SetPitchAndYawRequest* request,