Skip to content

Commit

Permalink
Merge pull request #1590 from mavlink/pr-missing-plugins
Browse files Browse the repository at this point in the history
mavsdk_server: add missing plugins
  • Loading branch information
julianoes authored Oct 31, 2021
2 parents 55d94ec + 23ed4fa commit acdc3b8
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 28 deletions.
2 changes: 1 addition & 1 deletion proto
32 changes: 31 additions & 1 deletion src/mavsdk_server/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
cmake_minimum_required(VERSION 3.10.2)

set(COMPONENTS_LIST action calibration camera core failure follow_me ftp geofence gimbal info log_files manual_control mission mission_raw mocap offboard param server_utility shell telemetry tracking_server tune transponder)
set(COMPONENTS_LIST
action
action_server
calibration
camera
core
failure
follow_me
ftp
geofence
gimbal
info log_files
manual_control
mission
mission_raw
mission_raw_server
mocap offboard
param
param_server
server_utility
shell
telemetry
telemetry_server
tracking_server
tune
transponder
)

foreach(COMPONENT_NAME ${COMPONENTS_LIST})
add_library(${COMPONENT_NAME}_proto_gens STATIC
Expand Down Expand Up @@ -45,6 +71,7 @@ endif()
target_link_libraries(mavsdk_server
PRIVATE
mavsdk_action
mavsdk_action_server
mavsdk_calibration
mavsdk_camera
mavsdk_failure
Expand All @@ -57,12 +84,15 @@ target_link_libraries(mavsdk_server
mavsdk_manual_control
mavsdk_mission
mavsdk_mission_raw
mavsdk_mission_raw_server
mavsdk_mocap
mavsdk_offboard
mavsdk_param
mavsdk_param_server
mavsdk_server_utility
mavsdk_shell
mavsdk_telemetry
mavsdk_telemetry_server
mavsdk_tracking_server
mavsdk_tune
mavsdk_transponder
Expand Down
51 changes: 27 additions & 24 deletions src/mavsdk_server/src/generated/param_server/param_server.pb.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion src/mavsdk_server/src/grpc_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ int GrpcServer::run()

builder.RegisterService(&_core);
builder.RegisterService(&_action_service);
builder.RegisterService(&_action_server_service);
builder.RegisterService(&_calibration_service);
builder.RegisterService(&_camera_service);
builder.RegisterService(&_failure_service);
Expand All @@ -32,15 +33,18 @@ int GrpcServer::run()
builder.RegisterService(&_manual_control_service);
builder.RegisterService(&_mission_service);
builder.RegisterService(&_mission_raw_service);
builder.RegisterService(&_mission_raw_server_service);
builder.RegisterService(&_mocap_service);
builder.RegisterService(&_offboard_service);
builder.RegisterService(&_param_service);
builder.RegisterService(&_param_server_service);
builder.RegisterService(&_server_utility_service);
builder.RegisterService(&_shell_service);
builder.RegisterService(&_telemetry_service);
builder.RegisterService(&_telemetry_server_service);
builder.RegisterService(&_tracking_server_service);
builder.RegisterService(&_tune_service);
builder.RegisterService(&_transponder_service);
builder.RegisterService(&_tune_service);

_server = builder.BuildAndStart();

Expand Down Expand Up @@ -68,6 +72,7 @@ void GrpcServer::stop()
if (_server != nullptr) {
_core.stop();
_action_service.stop();
_action_server_service.stop();
_calibration_service.stop();
_camera_service.stop();
_failure_service.stop();
Expand All @@ -80,12 +85,15 @@ void GrpcServer::stop()
_manual_control_service.stop();
_mission_service.stop();
_mission_raw_service.stop();
_mission_raw_server_service.stop();
_mocap_service.stop();
_offboard_service.stop();
_param_service.stop();
_param_server_service.stop();
_server_utility_service.stop();
_shell_service.stop();
_telemetry_service.stop();
_telemetry_server_service.stop();
_tracking_server_service.stop();
_tune_service.stop();
_transponder_service.stop();
Expand Down
24 changes: 24 additions & 0 deletions src/mavsdk_server/src/grpc_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include "core/core_service_impl.h"
#include "plugins/action/action.h"
#include "action/action_service_impl.h"
#include "plugins/action_server/action_server.h"
#include "action_server/action_server_service_impl.h"
#include "plugins/calibration/calibration.h"
#include "calibration/calibration_service_impl.h"
#include "plugins/camera/camera.h"
Expand All @@ -32,18 +34,24 @@
#include "mission/mission_service_impl.h"
#include "plugins/mission_raw/mission_raw.h"
#include "mission_raw/mission_raw_service_impl.h"
#include "plugins/mission_raw_server/mission_raw_server.h"
#include "mission_raw_server/mission_raw_server_service_impl.h"
#include "plugins/mocap/mocap.h"
#include "mocap/mocap_service_impl.h"
#include "plugins/offboard/offboard.h"
#include "offboard/offboard_service_impl.h"
#include "plugins/param/param.h"
#include "param/param_service_impl.h"
#include "plugins/param_server/param_server.h"
#include "param_server/param_server_service_impl.h"
#include "plugins/server_utility/server_utility.h"
#include "server_utility/server_utility_service_impl.h"
#include "plugins/shell/shell.h"
#include "shell/shell_service_impl.h"
#include "plugins/telemetry/telemetry.h"
#include "telemetry/telemetry_service_impl.h"
#include "plugins/telemetry_server/telemetry_server.h"
#include "telemetry_server/telemetry_server_service_impl.h"
#include "plugins/tracking_server/tracking_server.h"
#include "tracking_server/tracking_server_service_impl.h"
#include "plugins/tune/tune.h"
Expand All @@ -60,6 +68,8 @@ class GrpcServer {
_core(mavsdk),
_action_lazy_plugin(mavsdk),
_action_service(_action_lazy_plugin),
_action_server_lazy_plugin(mavsdk),
_action_server_service(_action_server_lazy_plugin),
_calibration_lazy_plugin(mavsdk),
_calibration_service(_calibration_lazy_plugin),
_camera_lazy_plugin(mavsdk),
Expand All @@ -84,18 +94,24 @@ class GrpcServer {
_mission_service(_mission_lazy_plugin),
_mission_raw_lazy_plugin(mavsdk),
_mission_raw_service(_mission_raw_lazy_plugin),
_mission_raw_server_lazy_plugin(mavsdk),
_mission_raw_server_service(_mission_raw_server_lazy_plugin),
_mocap_lazy_plugin(mavsdk),
_mocap_service(_mocap_lazy_plugin),
_offboard_lazy_plugin(mavsdk),
_offboard_service(_offboard_lazy_plugin),
_param_lazy_plugin(mavsdk),
_param_service(_param_lazy_plugin),
_param_server_lazy_plugin(mavsdk),
_param_server_service(_param_server_lazy_plugin),
_server_utility_lazy_plugin(mavsdk),
_server_utility_service(_server_utility_lazy_plugin),
_shell_lazy_plugin(mavsdk),
_shell_service(_shell_lazy_plugin),
_telemetry_lazy_plugin(mavsdk),
_telemetry_service(_telemetry_lazy_plugin),
_telemetry_server_lazy_plugin(mavsdk),
_telemetry_server_service(_telemetry_server_lazy_plugin),
_tracking_server_lazy_plugin(mavsdk),
_tracking_server_service(_tracking_server_lazy_plugin),
_tune_lazy_plugin(mavsdk),
Expand All @@ -115,6 +131,8 @@ class GrpcServer {
CoreServiceImpl<> _core;
LazyPlugin<Action> _action_lazy_plugin;
ActionServiceImpl<> _action_service;
LazyPlugin<ActionServer> _action_server_lazy_plugin;
ActionServerServiceImpl<> _action_server_service;
LazyPlugin<Calibration> _calibration_lazy_plugin;
CalibrationServiceImpl<> _calibration_service;
LazyPlugin<Camera> _camera_lazy_plugin;
Expand All @@ -139,18 +157,24 @@ class GrpcServer {
MissionServiceImpl<> _mission_service;
LazyPlugin<MissionRaw> _mission_raw_lazy_plugin;
MissionRawServiceImpl<> _mission_raw_service;
LazyPlugin<MissionRawServer> _mission_raw_server_lazy_plugin;
MissionRawServerServiceImpl<> _mission_raw_server_service;
LazyPlugin<Mocap> _mocap_lazy_plugin;
MocapServiceImpl<> _mocap_service;
LazyPlugin<Offboard> _offboard_lazy_plugin;
OffboardServiceImpl<> _offboard_service;
LazyPlugin<Param> _param_lazy_plugin;
ParamServiceImpl<> _param_service;
LazyPlugin<ParamServer> _param_server_lazy_plugin;
ParamServerServiceImpl<> _param_server_service;
LazyPlugin<ServerUtility> _server_utility_lazy_plugin;
ServerUtilityServiceImpl<> _server_utility_service;
LazyPlugin<Shell> _shell_lazy_plugin;
ShellServiceImpl<> _shell_service;
LazyPlugin<Telemetry> _telemetry_lazy_plugin;
TelemetryServiceImpl<> _telemetry_service;
LazyPlugin<TelemetryServer> _telemetry_server_lazy_plugin;
TelemetryServerServiceImpl<> _telemetry_server_service;
LazyPlugin<TrackingServer> _tracking_server_lazy_plugin;
TrackingServerServiceImpl<> _tracking_server_service;
LazyPlugin<Tune> _tune_lazy_plugin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ class ParamServerServiceImpl final : public rpc::param_server::ParamServerServic
return rpc::param_server::ParamServerResult_Result_RESULT_WRONG_TYPE;
case mavsdk::ParamServer::Result::ParamNameTooLong:
return rpc::param_server::ParamServerResult_Result_RESULT_PARAM_NAME_TOO_LONG;
case mavsdk::ParamServer::Result::NoSystem:
return rpc::param_server::ParamServerResult_Result_RESULT_NO_SYSTEM;
}
}

Expand All @@ -159,6 +161,8 @@ class ParamServerServiceImpl final : public rpc::param_server::ParamServerServic
return mavsdk::ParamServer::Result::WrongType;
case rpc::param_server::ParamServerResult_Result_RESULT_PARAM_NAME_TOO_LONG:
return mavsdk::ParamServer::Result::ParamNameTooLong;
case rpc::param_server::ParamServerResult_Result_RESULT_NO_SYSTEM:
return mavsdk::ParamServer::Result::NoSystem;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ class ParamServer : public PluginBase {
NotFound, /**< @brief Not Found. */
WrongType, /**< @brief Wrong type. */
ParamNameTooLong, /**< @brief Parameter name too long (> 16). */
NoSystem, /**< @brief No system available. */
};

/**
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/param_server/param_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ std::ostream& operator<<(std::ostream& str, ParamServer::Result const& result)
return str << "Wrong Type";
case ParamServer::Result::ParamNameTooLong:
return str << "Param Name Too Long";
case ParamServer::Result::NoSystem:
return str << "No System";
default:
return str << "Unknown";
}
Expand Down

0 comments on commit acdc3b8

Please sign in to comment.