验证和修复机动组件StrightLineCmd
This commit is contained in:
parent
304292d7f2
commit
86cbc5a9d6
|
@ -39,7 +39,8 @@ void SurfaceMotionControlPlugin::execute(std::shared_ptr<Immediate> map,
|
||||||
exec_result->_success_mark = true;
|
exec_result->_success_mark = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
exec_result->_reason_text = "无法在指定实体(id=%1)获取%1消息,无法正常工作!";
|
exec_result->_reason_text = QString(u8"无法在指定实体(id=%1)获取%2消息,无法正常工作!")
|
||||||
|
.arg(this->_bind_entity.lock()->entityID()).arg(Box3DDesc().topicString());
|
||||||
}
|
}
|
||||||
out << exec_result;
|
out << exec_result;
|
||||||
}
|
}
|
||||||
|
@ -71,7 +72,8 @@ void SurfaceMotionControlPlugin::execute(std::shared_ptr<Immediate> map,
|
||||||
exec_result->_success_mark = true;
|
exec_result->_success_mark = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
exec_result->_reason_text = "无法在指定实体(id=%1)获取%1类型消息,无法正常工作!";
|
exec_result->_reason_text = QString(u8"无法在指定实体(id=%1)获取%2消息,无法正常工作!")
|
||||||
|
.arg(this->_bind_entity.lock()->entityID()).arg(Box3DDesc().topicString());
|
||||||
}
|
}
|
||||||
out << exec_result;
|
out << exec_result;
|
||||||
}
|
}
|
||||||
|
@ -114,7 +116,7 @@ void SurfaceMotionControlPlugin::execute(std::shared_ptr<Immediate> map,
|
||||||
if (QVector3D::crossProduct(conv_pos.normalized(), QVector3D(0, 1, 0)).z() < 0)
|
if (QVector3D::crossProduct(conv_pos.normalized(), QVector3D(0, 1, 0)).z() < 0)
|
||||||
azimuth_target = 360 - azimuth_target;
|
azimuth_target = 360 - azimuth_target;
|
||||||
LonLatAlt deduce_lla;
|
LonLatAlt deduce_lla;
|
||||||
StandardGlobe::getTargetLLAWithDistance(_start_lla, conv_pos.length(), azimuth_target, deduce_lla);
|
StandardGlobe::getLLAWithDistance(_start_lla, conv_pos.length(), azimuth_target, deduce_lla);
|
||||||
|
|
||||||
// 朝向转换,提取方位角
|
// 朝向转换,提取方位角
|
||||||
auto azimuth_self_cos = QVector3D::dotProduct(conv_psr.normalized(), QVector3D(0, 1, 0));
|
auto azimuth_self_cos = QVector3D::dotProduct(conv_psr.normalized(), QVector3D(0, 1, 0));
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 水面平台机动组件
|
/// 水面平台机动组件
|
||||||
/// </summary>
|
/// </summary>
|
||||||
class SurfaceMotionControlPlugin : public ProcList<
|
class COMPONENTBASIC_EXPORT SurfaceMotionControlPlugin : public ProcList<
|
||||||
WsRespond<HorizontalArcMotion, RespondDefault>,
|
WsRespond<HorizontalArcMotion, RespondDefault>,
|
||||||
WsRespond<StrightLineMotion, RespondDefault>,
|
WsRespond<StrightLineMotion, RespondDefault>,
|
||||||
WsRespond<MotionDeduceRequest, RespondDefault>,
|
WsRespond<MotionDeduceRequest, RespondDefault>,
|
||||||
|
|
|
@ -13,7 +13,7 @@ class COMPONENTBASIC_EXPORT VisibleCubePlugin : public ProcList<
|
||||||
WsRespond<Set3DBoxPosture, RespondDefault>
|
WsRespond<Set3DBoxPosture, RespondDefault>
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
private:
|
public:
|
||||||
std::weak_ptr<WsEntity> _bind_entity;
|
std::weak_ptr<WsEntity> _bind_entity;
|
||||||
VolumeData _self_d3;
|
VolumeData _self_d3;
|
||||||
LonLatAlt _self_lla;
|
LonLatAlt _self_lla;
|
||||||
|
|
|
@ -65,6 +65,9 @@ double StrightLineMotion::startTimepoint() const
|
||||||
|
|
||||||
double StrightLineMotion::timeExpend() const
|
double StrightLineMotion::timeExpend() const
|
||||||
{
|
{
|
||||||
|
if(_accerlate_rates == 0.0)
|
||||||
|
return _length_total / _speed_motion;
|
||||||
|
|
||||||
auto sqrt_v = std::sqrt(_speed_motion * _speed_motion + 2 * _accerlate_rates * _length_total);
|
auto sqrt_v = std::sqrt(_speed_motion * _speed_motion + 2 * _accerlate_rates * _length_total);
|
||||||
return (sqrt_v - _speed_motion) / _accerlate_rates;
|
return (sqrt_v - _speed_motion) / _accerlate_rates;
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,15 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MessageBasic", "MessageBasi
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StandardGlobe", "StandardGlobe\StandardGlobe.vcxproj", "{C4A07990-233A-46F5-A3A0-48544CABA594}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StandardGlobe", "StandardGlobe\StandardGlobe.vcxproj", "{C4A07990-233A-46F5-A3A0-48544CABA594}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestProject", "TestProject\TestProject.vcxproj", "{843BF0C3-E18F-42FA-AA90-894AD0E116A2}"
|
||||||
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
|
{20CFC220-4F5B-4D39-97FA-74C70768F1A7} = {20CFC220-4F5B-4D39-97FA-74C70768F1A7}
|
||||||
|
{46E3FBA5-6775-4638-AE2E-935675D3B9CE} = {46E3FBA5-6775-4638-AE2E-935675D3B9CE}
|
||||||
|
{C4A07990-233A-46F5-A3A0-48544CABA594} = {C4A07990-233A-46F5-A3A0-48544CABA594}
|
||||||
|
{DF15B899-B9AE-4EBE-8FCC-436C9DB6CEF0} = {DF15B899-B9AE-4EBE-8FCC-436C9DB6CEF0}
|
||||||
|
{E1104048-F35B-40B7-995C-0320E689BF09} = {E1104048-F35B-40B7-995C-0320E689BF09}
|
||||||
|
EndProjectSection
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|x64 = Debug|x64
|
Debug|x64 = Debug|x64
|
||||||
|
@ -57,6 +66,10 @@ Global
|
||||||
{C4A07990-233A-46F5-A3A0-48544CABA594}.Debug|x64.Build.0 = Debug|x64
|
{C4A07990-233A-46F5-A3A0-48544CABA594}.Debug|x64.Build.0 = Debug|x64
|
||||||
{C4A07990-233A-46F5-A3A0-48544CABA594}.Release|x64.ActiveCfg = Release|x64
|
{C4A07990-233A-46F5-A3A0-48544CABA594}.Release|x64.ActiveCfg = Release|x64
|
||||||
{C4A07990-233A-46F5-A3A0-48544CABA594}.Release|x64.Build.0 = Release|x64
|
{C4A07990-233A-46F5-A3A0-48544CABA594}.Release|x64.Build.0 = Release|x64
|
||||||
|
{843BF0C3-E18F-42FA-AA90-894AD0E116A2}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{843BF0C3-E18F-42FA-AA90-894AD0E116A2}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{843BF0C3-E18F-42FA-AA90-894AD0E116A2}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{843BF0C3-E18F-42FA-AA90-894AD0E116A2}.Release|x64.Build.0 = Release|x64
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <QVector3D>
|
#include <QVector3D>
|
||||||
|
|
||||||
double StandardGlobe::_radius_m = 65000000;
|
double StandardGlobe::_radius_m = 6500000;
|
||||||
|
|
||||||
StandardGlobe::StandardGlobe()
|
StandardGlobe::StandardGlobe()
|
||||||
{
|
{
|
||||||
|
@ -32,6 +32,8 @@ LonLatAlt StandardGlobe::ecefToLLA(const ECEFv3d& v)
|
||||||
rad_lon *= -1;
|
rad_lon *= -1;
|
||||||
auto rx = std::sqrt(v._x_pos * v._x_pos + v._y_pos * v._y_pos + v._z_pos * v._z_pos);
|
auto rx = std::sqrt(v._x_pos * v._x_pos + v._y_pos * v._y_pos + v._z_pos * v._z_pos);
|
||||||
auto rad_lat = asin(v._z_pos / rx);
|
auto rad_lat = asin(v._z_pos / rx);
|
||||||
|
if(v._z_pos < 0)
|
||||||
|
rad_lat *= -1;
|
||||||
|
|
||||||
LonLatAlt ret;
|
LonLatAlt ret;
|
||||||
ret._lon_deg = rad2d(rad_lon);
|
ret._lon_deg = rad2d(rad_lon);
|
||||||
|
@ -41,7 +43,7 @@ LonLatAlt StandardGlobe::ecefToLLA(const ECEFv3d& v)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void StandardGlobe::getDistanceWithTargetLLA(const LonLatAlt& base, const LonLatAlt& target, double& dist, double& azi)
|
void StandardGlobe::getDistanceWithLLA(const LonLatAlt& base, const LonLatAlt& target, double& dist, double& azi)
|
||||||
{
|
{
|
||||||
// ecef矢量
|
// ecef矢量
|
||||||
auto vec_base = llaToEcef(base).getVec3();
|
auto vec_base = llaToEcef(base).getVec3();
|
||||||
|
@ -72,18 +74,18 @@ void StandardGlobe::getDistanceWithTargetLLA(const LonLatAlt& base, const LonLat
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <qquaternion.h>
|
#include <qquaternion.h>
|
||||||
void StandardGlobe::getTargetLLAWithDistance(const LonLatAlt& base, double dist, double azi, LonLatAlt& target)
|
void StandardGlobe::getLLAWithDistance(const LonLatAlt& base, double dist, double azi, LonLatAlt& target)
|
||||||
{
|
{
|
||||||
auto ecef_bvec = llaToEcef(base).getVec3().normalized();
|
auto ecef_basevec = llaToEcef(base).getVec3().normalized();
|
||||||
QQuaternion u0(-deg2a(azi), ecef_bvec);
|
QQuaternion u0 = QQuaternion::fromAxisAndAngle(ecef_basevec, -azi);
|
||||||
|
|
||||||
// 获取切线方向矢量
|
// 获取切线方向矢量
|
||||||
auto vec_hv = u0.rotatedVector(QVector3D(0, 0, 1)).normalized();
|
auto vec_hv = u0.rotatedVector(QVector3D(0, 0, 1)).normalized();
|
||||||
// 获取法线方向矢量
|
// 获取法线方向矢量
|
||||||
auto vec_bv = QVector3D::crossProduct(ecef_bvec, vec_hv).normalized();
|
auto vec_bv = QVector3D::crossProduct(ecef_basevec, vec_hv).normalized();
|
||||||
auto rad_between = dist / _radius_m;
|
auto rad_between = dist / _radius_m;
|
||||||
|
|
||||||
QQuaternion u1(rad_between, vec_bv);
|
QQuaternion u1 = QQuaternion::fromAxisAndAngle(vec_bv, rad2d(rad_between));
|
||||||
auto ecef_t = u1.rotatedVector(llaToEcef(base).getVec3());
|
auto ecef_t = u1.rotatedVector(llaToEcef(base).getVec3());
|
||||||
|
|
||||||
ECEFv3d sv;
|
ECEFv3d sv;
|
||||||
|
@ -112,7 +114,7 @@ PolarPos StandardGlobe::getPolarWithLLA(const LonLatAlt& base, const LonLatAlt&
|
||||||
|
|
||||||
// 180°校验
|
// 180°校验
|
||||||
auto flag_vec = QVector3D::crossProduct(vec_hn, QVector3D(0, 0, 1)).normalized();
|
auto flag_vec = QVector3D::crossProduct(vec_hn, QVector3D(0, 0, 1)).normalized();
|
||||||
if (vec_bn.z() * flag_vec.z() < 0)
|
if (flag_vec.z() < 0)
|
||||||
angle = 2 * PI - angle;
|
angle = 2 * PI - angle;
|
||||||
|
|
||||||
// 返回方位角
|
// 返回方位角
|
||||||
|
@ -124,6 +126,12 @@ PolarPos StandardGlobe::getPolarWithLLA(const LonLatAlt& base, const LonLatAlt&
|
||||||
auto cos_pitch = QVector3D::dotProduct(vec_hn, vec_btn);
|
auto cos_pitch = QVector3D::dotProduct(vec_hn, vec_btn);
|
||||||
auto pit_deg = rad2d(acos(cos_pitch));
|
auto pit_deg = rad2d(acos(cos_pitch));
|
||||||
|
|
||||||
|
auto axis_x = QVector3D::crossProduct(vec_hn, vec_btn).normalized();
|
||||||
|
auto axis_flag = QVector3D::crossProduct(axis_x, vec_hn);
|
||||||
|
if (QVector3D::dotProduct(axis_flag, vec_bn) < 0) {
|
||||||
|
pit_deg *= -1;
|
||||||
|
}
|
||||||
|
|
||||||
PolarPos p;
|
PolarPos p;
|
||||||
p._azimuth_deg = azi_deg;
|
p._azimuth_deg = azi_deg;
|
||||||
p._pitch_deg = pit_deg;
|
p._pitch_deg = pit_deg;
|
||||||
|
@ -133,17 +141,16 @@ PolarPos StandardGlobe::getPolarWithLLA(const LonLatAlt& base, const LonLatAlt&
|
||||||
|
|
||||||
LonLatAlt StandardGlobe::getLLAWithPolar(const LonLatAlt& base, const PolarPos& target)
|
LonLatAlt StandardGlobe::getLLAWithPolar(const LonLatAlt& base, const PolarPos& target)
|
||||||
{
|
{
|
||||||
auto ecef_b = llaToEcef(base).getVec3();
|
auto ecef_bvec = llaToEcef(base).getVec3();
|
||||||
auto u_azi = QQuaternion(-deg2a(target._azimuth_deg), ecef_b.normalized());
|
auto u_azi = QQuaternion::fromAxisAndAngle(ecef_bvec.normalized(),-target._azimuth_deg);
|
||||||
|
|
||||||
auto vec_ts = u_azi.rotatedVector(QVector3D(0, 0, 1)).normalized();
|
auto vec_ts = u_azi.rotatedVector(QVector3D(0, 0, 1)).normalized();
|
||||||
auto axis_pitch = QVector3D::crossProduct(vec_ts, ecef_b.normalized());
|
auto axis_pitch = QVector3D::crossProduct(vec_ts, ecef_bvec.normalized());
|
||||||
auto u_pit = QQuaternion(deg2a(target._pitch_deg), axis_pitch);
|
auto u_pit = QQuaternion::fromAxisAndAngle(axis_pitch, target._pitch_deg);
|
||||||
|
|
||||||
auto r_shadow = target._dist_m * cos(deg2a(target._pitch_deg));
|
auto ts_appv = u_pit.rotatedVector(vec_ts).normalized() * target._dist_m;
|
||||||
auto ts_appv = u_pit.rotatedVector(vec_ts).normalized() * r_shadow;
|
|
||||||
|
|
||||||
auto ecef_target = ecef_b + ts_appv;
|
auto ecef_target = ecef_bvec + ts_appv;
|
||||||
ECEFv3d tt = ECEFv3d::fromVec3(ecef_target);
|
ECEFv3d tt = ECEFv3d::fromVec3(ecef_target);
|
||||||
|
|
||||||
return ecefToLLA(tt);
|
return ecefToLLA(tt);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include "standardglobe_global.h"
|
#include "standardglobe_global.h"
|
||||||
|
|
||||||
#define PI 3.14159265354
|
#define PI 3.14159265358979323846
|
||||||
#define deg2a(v) v / 180.0 * PI
|
#define deg2a(v) v / 180.0 * PI
|
||||||
#define rad2d(v) v / PI * 180.0
|
#define rad2d(v) v / PI * 180.0
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ public:
|
||||||
/// <param name="target"></param>
|
/// <param name="target"></param>
|
||||||
/// <param name="dist"></param>
|
/// <param name="dist"></param>
|
||||||
/// <param name="azi"></param>
|
/// <param name="azi"></param>
|
||||||
static void getDistanceWithTargetLLA(const LonLatAlt& base, const LonLatAlt& target, double& dist, double& azi);
|
static void getDistanceWithLLA(const LonLatAlt& base, const LonLatAlt& target, double& dist, double& azi);
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 根据两点之间的大地线长度和b->t初始方位角,计算目标LLA定位坐标
|
/// 根据两点之间的大地线长度和b->t初始方位角,计算目标LLA定位坐标
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -90,7 +90,7 @@ public:
|
||||||
/// <param name="dist"></param>
|
/// <param name="dist"></param>
|
||||||
/// <param name="azi"></param>
|
/// <param name="azi"></param>
|
||||||
/// <param name="target"></param>
|
/// <param name="target"></param>
|
||||||
static void getTargetLLAWithDistance(const LonLatAlt& base, double dist, double azi, LonLatAlt& target);
|
static void getLLAWithDistance(const LonLatAlt& base, double dist, double azi, LonLatAlt& target);
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 通过LLA坐标,获取目标极坐标
|
/// 通过LLA坐标,获取目标极坐标
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -0,0 +1,110 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|x64">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|x64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectGuid>{843BF0C3-E18F-42FA-AA90-894AD0E116A2}</ProjectGuid>
|
||||||
|
<Keyword>QtVS_v304</Keyword>
|
||||||
|
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">10.0</WindowsTargetPlatformVersion>
|
||||||
|
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">10.0</WindowsTargetPlatformVersion>
|
||||||
|
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Condition="Exists('$(QtMsBuild)\qt_defaults.props')">
|
||||||
|
<Import Project="$(QtMsBuild)\qt_defaults.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
|
||||||
|
<QtInstall>5.12.11_msvc2017_64</QtInstall>
|
||||||
|
<QtModules>core;gui</QtModules>
|
||||||
|
<QtBuildConfig>debug</QtBuildConfig>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="QtSettings">
|
||||||
|
<QtInstall>5.12.11_msvc2017_64</QtInstall>
|
||||||
|
<QtModules>core</QtModules>
|
||||||
|
<QtBuildConfig>release</QtBuildConfig>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')">
|
||||||
|
<Message Importance="High" Text="QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly." />
|
||||||
|
</Target>
|
||||||
|
<ImportGroup Label="ExtensionSettings" />
|
||||||
|
<ImportGroup Label="Shared" />
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(QtMsBuild)\Qt.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(QtMsBuild)\Qt.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||||
|
<IncludePath>$(SolutionDir)StandardGlobe;$(SolutionDir)ComponentBasic;$(SolutionDir)MessageBasic;$(SolutionDir)SimsBasic;$(IncludePath)</IncludePath>
|
||||||
|
<LibraryPath>$(SolutionDir)$(Platform)\$(Configuration);$(LibraryPath)</LibraryPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>StandardGlobe.lib;MessageBasic.lib;ComponentBasic.lib;SimsBasic.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||||
|
<ClCompile>
|
||||||
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||||
|
<ClCompile>
|
||||||
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="main.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
|
||||||
|
<Import Project="$(QtMsBuild)\qt.targets" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
|
@ -0,0 +1,31 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="Source Files">
|
||||||
|
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||||
|
<Extensions>qml;cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Header Files">
|
||||||
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
|
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Resource Files">
|
||||||
|
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||||
|
<Extensions>qrc;rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Form Files">
|
||||||
|
<UniqueIdentifier>{99349809-55BA-4b9d-BF79-8FDBB0286EB3}</UniqueIdentifier>
|
||||||
|
<Extensions>ui</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Translation Files">
|
||||||
|
<UniqueIdentifier>{639EADAA-A684-42e4-A9AD-28FC9BCB8F7C}</UniqueIdentifier>
|
||||||
|
<Extensions>ts</Extensions>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="main.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup />
|
||||||
|
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<QtTouchProperty>
|
||||||
|
</QtTouchProperty>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<QtTouchProperty>
|
||||||
|
</QtTouchProperty>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
|
@ -0,0 +1,47 @@
|
||||||
|
#include <QtCore/QCoreApplication>
|
||||||
|
#include <standardglobe.h>
|
||||||
|
#include <QDebug>
|
||||||
|
#include <memory>
|
||||||
|
#include <motion_access.h>
|
||||||
|
#include <SurfaceMotionPlugin.h>
|
||||||
|
#include <internal_impl.h>
|
||||||
|
#include <VisibleCube.h>
|
||||||
|
|
||||||
|
int main(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
QCoreApplication app(argc, argv);
|
||||||
|
|
||||||
|
auto cmd = std::make_shared<StrightLineMotion>();
|
||||||
|
cmd->_start_time = 0;
|
||||||
|
cmd->_speed_motion = 20;
|
||||||
|
cmd->_length_total = 200000;
|
||||||
|
|
||||||
|
auto enti = std::make_shared<RtWsEntity>();
|
||||||
|
auto motion = std::make_shared<SurfaceMotionControlPlugin>();
|
||||||
|
enti->append(motion);
|
||||||
|
auto box3d = std::make_shared<VisibleCubePlugin>();
|
||||||
|
enti->append(box3d);
|
||||||
|
|
||||||
|
auto immediate = std::make_shared<ImmediateKernel>(enti);
|
||||||
|
QList<std::shared_ptr<RespondDefault>> out;
|
||||||
|
motion->execute(immediate, cmd, out);
|
||||||
|
|
||||||
|
for (auto rst : out)
|
||||||
|
qDebug() << rst->_success_mark << rst->_reason_text;
|
||||||
|
|
||||||
|
|
||||||
|
auto total = cmd->timeExpend();
|
||||||
|
for (auto timepoint = 0; timepoint < 10000; timepoint += 1) {
|
||||||
|
//qDebug() << cmd->posAtTimespan(timepoint);
|
||||||
|
|
||||||
|
auto sync = std::make_shared<SyncRequest>();
|
||||||
|
sync->_time_current = timepoint;
|
||||||
|
motion->execute(immediate, sync, out);
|
||||||
|
|
||||||
|
qDebug() <<QString("L:%1 B:%2 H:%3").arg(box3d->_self_lla._lon_deg).arg(box3d->_self_lla._lat_deg).arg(box3d->_self_lla._alt_m);
|
||||||
|
//qDebug() << box3d->_self_posture._azimuth_deg << box3d->_self_posture._pitch_deg << box3d->_self_posture._roll_deg;
|
||||||
|
//qDebug() << timepoint << "========================";
|
||||||
|
}
|
||||||
|
|
||||||
|
return app.exec();
|
||||||
|
}
|
Loading…
Reference in New Issue