Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
D
denpends
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xueyimeng
denpends
Commits
71d1ea27
Commit
71d1ea27
authored
Feb 17, 2022
by
xueyimeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
取消对GeographicLib的依赖
parent
f312d14a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
129 deletions
+9
-129
denpends.iml
.idea/denpends.iml
+2
-8
misc.xml
.idea/misc.xml
+3
-0
CMakeLists.txt
cloud_common/CMakeLists.txt
+2
-2
lat_lon_cartersian.hpp
cloud_common/utility/lat_lon_cartersian.hpp
+0
-116
track.cpp
cloud_common/utility/track.cpp
+2
-3
No files found.
.idea/denpends.iml
View file @
71d1ea27
<?xml version="1.0" encoding="UTF-8"?>
<module
type=
"CPP_MODULE"
version=
"4"
>
<component
name=
"NewModuleRootManager"
>
<content
url=
"file://$MODULE_DIR$"
/>
<orderEntry
type=
"inheritedJdk"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
</component>
</module>
\ No newline at end of file
<module
classpath=
"CMake"
type=
"CPP_MODULE"
version=
"4"
/>
\ No newline at end of file
.idea/misc.xml
View file @
71d1ea27
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"CMakeWorkspace"
PROJECT_DIR=
"$PROJECT_DIR$/cloud_common"
>
<contentRoot
DIR=
"$PROJECT_DIR$"
/>
</component>
<component
name=
"JavaScriptSettings"
>
<option
name=
"languageLevel"
value=
"ES6"
/>
</component>
...
...
cloud_common/CMakeLists.txt
View file @
71d1ea27
project
(
CloudCommon
)
cmake_minimum_required
(
VERSION 3.10
)
set
(
CMAKE_CXX_STANDARD 14
)
set
(
CMAKE_BUILD_TYPE Release
)
#ADD_COMPILE_OPTIONS(-std=c++14 )
list
(
APPEND CMAKE_MODULE_PATH
${
CMAKE_SOURCE_DIR
}
/cmake
)
...
...
@@ -73,4 +74,4 @@ add_definitions(${PCL_DEFINITIONS})
add_subdirectory
(
common
)
add_subdirectory
(
utility
)
\ No newline at end of file
add_subdirectory
(
utility
)
cloud_common/utility/lat_lon_cartersian.hpp
deleted
100644 → 0
View file @
f312d14a
#pragma once
#include <memory>
#include <cmath>
#include <GeographicLib/LocalCartesian.hpp>
#include <Eigen/Dense>
namespace
jf
{
class
LatLonCartesian
{
public
:
using
Ptr
=
std
::
shared_ptr
<
LatLonCartesian
>
;
using
ConstPtr
=
std
::
shared_ptr
<
const
LatLonCartesian
>
;
LatLonCartesian
()
:
geographic_local_
(
std
::
numeric_limits
<
double
>::
max
(),
std
::
numeric_limits
<
double
>::
max
(),
std
::
numeric_limits
<
double
>::
max
())
{}
LatLonCartesian
(
double
lat
,
double
lng
,
double
h
)
:
geographic_local_
(
lat
,
lng
,
h
)
{}
inline
bool
isOriginSet
()
const
{
return
std
::
abs
(
geographic_local_
.
LatitudeOrigin
())
<
360.0
;
}
inline
void
setOrigin
(
double
lat0
,
double
lon0
,
double
h0
)
{
geographic_local_
.
Reset
(
lat0
,
lon0
,
h0
);
}
inline
Eigen
::
Vector3d
getOrigin
()
const
{
return
{
geographic_local_
.
LatitudeOrigin
(),
geographic_local_
.
LongitudeOrigin
(),
geographic_local_
.
HeightOrigin
()};
}
/**
* Given another lat lon h, calculate it's coordinates in the local ENU
* coordinate system of origin
* @param lat
* @param lon
* @param h
* @return X, Y, Z
*/
inline
Eigen
::
Vector3d
LocalXYZ
(
double
lat
,
double
lon
,
double
h
)
const
{
Eigen
::
Vector3d
local
;
geographic_local_
.
Forward
(
lat
,
lon
,
h
,
local
[
0
],
local
[
1
],
local
[
2
]);
return
local
;
}
/**
* Given another X, Y, Z, calculate it's coordinates in the LatLon
* coordinate system.
* @param X
* @param Y
* @param Z
* @return lat, lon, height
*/
inline
Eigen
::
Vector3d
LatLonHeight
(
double
x
,
double
y
,
double
z
)
const
{
Eigen
::
Vector3d
latlon
;
// not our navigation is north east earth, but navigation in GeographicLib
// is east north sky
geographic_local_
.
Reverse
(
x
,
y
,
z
,
latlon
[
0
],
latlon
[
1
],
latlon
[
2
]);
return
latlon
;
}
inline
double
getDistance
(
double
lat
,
double
lon
,
double
h
)
const
{
Eigen
::
Vector3d
local
=
LocalXYZ
(
lat
,
lon
,
h
);
return
local
.
norm
();
}
/**
* Given another lat lon position, calculate the relative rotation its NED
* system and the origin's NED system
* @param lat
* @param lon
* @return
*/
inline
Eigen
::
Matrix3d
C_n_no
(
double
lat
,
double
lon
)
const
{
return
(
Eigen
::
AngleAxisd
(
(
lat
-
geographic_local_
.
LatitudeOrigin
())
*
M_PI
/
180.0
,
Eigen
::
Vector3d
::
UnitY
())
*
Eigen
::
AngleAxisd
(
(
geographic_local_
.
LongitudeOrigin
()
-
lon
)
*
M_PI
/
180.0
,
Eigen
::
Vector3d
::
UnitX
()))
.
toRotationMatrix
();
}
/**
* Given another lat lon position, calculate the relative rotation its NED
* system and the origin's NED system
* @param lat
* @param lon
* @return
*/
inline
Eigen
::
Matrix3d
C_no_n
(
double
lat
,
double
lon
)
const
{
return
(
Eigen
::
AngleAxisd
(
(
lon
-
geographic_local_
.
LongitudeOrigin
())
*
M_PI
/
180.0
,
Eigen
::
Vector3d
::
UnitX
())
*
Eigen
::
AngleAxisd
(
(
geographic_local_
.
LatitudeOrigin
()
-
lat
)
*
M_PI
/
180.0
,
Eigen
::
Vector3d
::
UnitY
()))
.
toRotationMatrix
();
}
protected
:
GeographicLib
::
LocalCartesian
geographic_local_
;
};
inline
double
getDistance
(
const
double
lat1
,
const
double
lon1
,
const
double
h1
,
const
double
lat2
,
const
double
lon2
,
const
double
h2
)
{
LatLonCartesian
lat_lon_cartersian
(
lat1
,
lon1
,
h1
);
return
lat_lon_cartersian
.
getDistance
(
lat2
,
lon2
,
h2
);
}
}
// namespace jf
\ No newline at end of file
cloud_common/utility/track.cpp
View file @
71d1ea27
#include "track.h"
#include "ogr_spatialref.h"
#include "utility/lat_lon_cartersian.hpp"
//
#include "utility/lat_lon_cartersian.hpp"
#include "utility/Utility.h"
#include <fstream>
...
...
@@ -200,4 +200,4 @@ bool Track::LocalXYZ2latlon(LocalCoordinate local_xyz, double& lat, double& lng,
return
true
;
}
}
// namespace jf
\ No newline at end of file
}
// namespace jf
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment