forked from microsoft/AirSim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drone controller implementation for simple_flight part 1
- Loading branch information
Showing
20 changed files
with
684 additions
and
209 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
50 changes: 50 additions & 0 deletions
50
AirLib/include/firmwares/simple_flight/AirSimSimpleFlightCommon.hpp
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,50 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
#ifndef msr_airlib_AirSimSimpleFlightCommon_hpp | ||
#define msr_airlib_AirSimSimpleFlightCommon_hpp | ||
|
||
#include "physics/Kinematics.hpp" | ||
#include "common/Common.hpp" | ||
|
||
namespace msr { namespace airlib { | ||
|
||
|
||
class AirSimSimpleFlightCommon { | ||
public: | ||
static simple_flight::Axis3r vector3rToAxis3r(const Vector3r& vec) | ||
{ | ||
simple_flight::Axis3r conv; | ||
conv.x() = vec.x(); conv.y() = vec.y(); conv.z() = vec.z(); | ||
|
||
return conv; | ||
} | ||
|
||
static Vector3r axis3rToVector3r(const simple_flight::Axis3r& vec) | ||
{ | ||
Vector3r conv; | ||
conv.x() = vec.x(); conv.y() = vec.y(); conv.z() = vec.z(); | ||
return conv; | ||
} | ||
|
||
static simple_flight::Axis4r quaternion3rToAxis4r(const Quaternionr& q) | ||
{ | ||
simple_flight::Axis4r conv; | ||
conv.axis3.x() = q.x(); conv.axis3.y() = q.y(); conv.axis3.z() = q.z(); | ||
conv.val4 = q.w(); | ||
|
||
return conv; | ||
} | ||
|
||
static Quaternionr axis4rToQuaternionr(const simple_flight::Axis4r& q) | ||
{ | ||
Quaternionr conv; | ||
conv.x() = q.axis3.x(); conv.y() = q.axis3.y(); conv.z() = q.axis3.z(); | ||
conv.w() = q.val4; | ||
return conv; | ||
} | ||
}; | ||
|
||
|
||
}} //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
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.