forked from microsoft/AirSim
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
API refactor, simSetPose, simGetPose, reset for drones
- Loading branch information
Showing
35 changed files
with
577 additions
and
465 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
#ifndef air_RpcLibServerBase_hpp | ||
#define air_RpcLibServerBase_hpp | ||
|
||
#include "common/Common.hpp" | ||
#include "api/ControlServerBase.hpp" | ||
#include "api/VehicleApiBase.hpp" | ||
|
||
|
||
namespace msr { namespace airlib { | ||
|
||
|
||
class RpcLibServerBase : public ControlServerBase { | ||
public: | ||
RpcLibServerBase(VehicleApiBase* vehicle, string server_address, uint16_t port); | ||
virtual void start(bool block = false) override; | ||
virtual void stop() override; | ||
virtual ~RpcLibServerBase() override; | ||
|
||
protected: | ||
void* getServer(); | ||
VehicleApiBase* getVehicleApi(); | ||
|
||
private: | ||
VehicleApiBase* vehicle_; | ||
struct impl; | ||
std::unique_ptr<impl> pimpl_; | ||
}; | ||
|
||
|
||
}} //namespace | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
#ifndef air_VehicleApiBase_hpp | ||
#define air_VehicleApiBase_hpp | ||
|
||
#include "common/CommonStructs.hpp" | ||
#include "controllers/VehicleCameraBase.hpp" | ||
|
||
namespace msr { namespace airlib { | ||
|
||
|
||
class VehicleApiBase { | ||
public: | ||
virtual GeoPoint getHomeGeoPoint() = 0; | ||
virtual void enableApiControl(bool is_enabled) = 0; | ||
virtual bool isApiControlEnabled() = 0; | ||
virtual void reset() = 0; | ||
|
||
virtual vector<VehicleCameraBase::ImageResponse> simGetImages(const vector<VehicleCameraBase::ImageRequest>& request) = 0; | ||
virtual vector<uint8_t> simGetImage(uint8_t camera_id, VehicleCameraBase::ImageType image_type) = 0; | ||
|
||
virtual void simSetPose(const Pose& pose, bool ignore_collison) = 0; | ||
virtual Pose simGetPose() = 0; | ||
|
||
virtual ~VehicleApiBase() = default; | ||
}; | ||
|
||
|
||
}} //namespace | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
#ifndef air_VehicleConnectorBase_hpp | ||
#define air_VehicleConnectorBase_hpp | ||
|
||
#include "VehicleControllerBase.hpp" | ||
#include "VehicleCameraBase.hpp" | ||
#include "common/UpdatableObject.hpp" | ||
|
||
namespace msr { namespace airlib { | ||
|
||
class VehicleConnectorBase : public UpdatableObject | ||
{ | ||
public: | ||
//pure abstract methods in addition to UpdatableObject | ||
|
||
//called when physics gets updated (must be fast, avoid rendering) | ||
virtual void updateRenderedState() = 0; | ||
//called when render changes are required | ||
virtual void updateRendering(float dt) = 0; | ||
|
||
//opens up channel to talk to vehicle via APIs | ||
virtual void startApiServer() = 0; | ||
virtual void stopApiServer() = 0; | ||
virtual bool isApiServerStarted() = 0; | ||
virtual VehicleControllerBase* getController() = 0; | ||
virtual VehicleCameraBase* getCamera(unsigned int index) = 0; | ||
virtual void setPose(const Pose& pose, bool ignore_collison) = 0; | ||
virtual Pose getPose() = 0; | ||
}; | ||
|
||
|
||
}} //namespace | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.