Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
J
jfx_kalman_filter_src
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
oscar
jfx_kalman_filter_src
Commits
c1672f53
Commit
c1672f53
authored
Oct 18, 2022
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交加入8个顶点的经纬高逻辑
parent
d544325c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
10 deletions
+48
-10
TrackingRos.cpp
TrackingRos.cpp
+48
-10
No files found.
TrackingRos.cpp
View file @
c1672f53
...
...
@@ -84,7 +84,7 @@ void my_compute_box_3d(Eigen::Vector3d center, double heading, Eigen::Vector3d s
}
#ifdef _ABUZHABI_
void
CalculateUTMPos
(
jfx_common_msgs
::
det_tracking
&
obj
,
std
::
vector
<
double
>
&
wgs84_station
,
std
::
vector
<
double
>
&
UTM_station
,
std
::
vector
<
std
::
vector
<
double
>>
&
trans2station
,
std
::
vector
<
std
::
vector
<
double
>>
&
kitti2origin
,
double
&
lon
,
double
&
lat
)
void
CalculateUTMPos
(
jfx_common_msgs
::
det_tracking
&
obj
,
std
::
vector
<
double
>
&
wgs84_station
,
std
::
vector
<
double
>
&
UTM_station
,
std
::
vector
<
std
::
vector
<
double
>>
&
trans2station
,
std
::
vector
<
std
::
vector
<
double
>>
&
kitti2origin
,
double
&
lon
,
double
&
lat
,
double
(
&
loc_lon
)[
8
],
double
(
&
loc_lat
)[
8
],
double
(
&
loc_alt
)[
8
]
)
{
Eigen
::
Vector3d
center
(
obj
.
x
,
obj
.
y
,
obj
.
z
);
double
heading
=
obj
.
rot_y
;
...
...
@@ -98,17 +98,17 @@ void CalculateUTMPos(jfx_common_msgs::det_tracking &obj, std::vector<double> &wg
Eigen
::
Vector3d
res3
(
res_corners_3d
(
3
,
0
),
res_corners_3d
(
3
,
1
),
res_corners_3d
(
3
,
2
));
Eigen
::
Vector3d
res6
(
res_corners_3d
(
6
,
0
),
res_corners_3d
(
6
,
1
),
res_corners_3d
(
6
,
2
));
Eigen
::
Vector3d
head_pnt
=
(
res3
+
res2
)
/
2
;
Eigen
::
Vector3d
tail_pnt
=
(
res0
+
res3
)
/
2
;
//
Eigen::Vector3d head_pnt = (res3 + res2) / 2;
//
Eigen::Vector3d tail_pnt = (res0 + res3) / 2;
Eigen
::
Vector3d
center_pnt
=
(
res0
+
res6
)
/
2
;
double
inter_len
=
5.0
f
;
double
total_len
=
6.0
f
;
Eigen
::
Vector3d
lidar_loc
=
(
tail_pnt
-
head_pnt
)
*
inter_len
/
(
1.0
*
total_len
)
+
head_pnt
;
//
double inter_len = 5.0f;
//
double total_len = 6.0f;
//
Eigen::Vector3d lidar_loc = (tail_pnt - head_pnt) * inter_len / (1.0 * total_len) + head_pnt;
Eigen
::
Vector4d
tranTmp
;
//
tranTmp << center_pnt[0], center_pnt[1], center_pnt[2], 1;
tranTmp
<<
lidar_loc
[
0
],
lidar_loc
[
1
],
lidar_loc
[
2
],
1
;
tranTmp
<<
center_pnt
[
0
],
center_pnt
[
1
],
center_pnt
[
2
],
1
;
//
tranTmp << lidar_loc[0], lidar_loc[1], lidar_loc[2], 1;
Eigen
::
Matrix4d
Trans2station
=
Eigen
::
Matrix4d
::
Zero
();
for
(
int
i
=
0
;
i
<
4
;
i
++
)
...
...
@@ -135,6 +135,22 @@ void CalculateUTMPos(jfx_common_msgs::det_tracking &obj, std::vector<double> &wg
}
UVUTMLLAPtr
->
UTM2WGS84
(
UTM_pos
,
lonlatH_pos
);
for
(
int
i
=
0
;
i
<
8
;
i
++
)
{
Eigen
::
Vector4d
tmp
;
tmp
<<
res_corners_3d
(
i
,
0
),
res_corners_3d
(
i
,
1
),
res_corners_3d
(
i
,
2
),
1
;
auto
loc_pos
=
Trans2station
*
tmp
;
std
::
vector
<
double
>
UTM_tmp
=
{
loc_pos
(
0
)
+
UTM_station
[
0
],
loc_pos
(
1
)
+
UTM_station
[
1
],
loc_pos
(
2
)
+
UTM_station
[
2
]
};
std
::
vector
<
double
>
lonlatalt_pos
=
{
0
,
0
,
UTM_tmp
[
2
]};
UVUTMLLAPtr
->
UTM2WGS84
(
UTM_tmp
,
lonlatalt_pos
);
loc_lon
[
i
]
=
lonlatalt_pos
[
0
];
loc_lat
[
i
]
=
lonlatalt_pos
[
1
];
loc_alt
[
i
]
=
lonlatalt_pos
[
2
];
}
lon
=
lonlatH_pos
[
0
];
lat
=
lonlatH_pos
[
1
];
...
...
@@ -560,13 +576,24 @@ void TrackingRos::ThreadTrackingProcess()
#ifdef _ABUZHABI_
double
lon
=
0.0
f
;
double
lat
=
0.0
f
;
double
loc_lon
[
8
]
=
{};
double
loc_lat
[
8
]
=
{};
double
loc_alt
[
8
]
=
{};
// CalculateGuassPos(obj, m_trans, m_kitti2origin, gx, gy);
CalculateUTMPos
(
obj
,
m_wgs84_station
,
m_UTM_station
,
m_trans2station
,
m_kitti2origin
,
lon
,
lat
);
CalculateUTMPos
(
obj
,
m_wgs84_station
,
m_UTM_station
,
m_trans2station
,
m_kitti2origin
,
lon
,
lat
,
loc_lon
,
loc_lat
,
loc_alt
);
// SDK_LOG(SDK_INFO, "CalculateGuassPos x = %f,y = %f, gx = %f, gy = %f,prob = %f", obj.x, obj.y, gx, gy, iter.second->GetProb());
// jfx::Array gpos = {gx, gy};
// jfx::Array pos = jfx::Inverse(gpos);
obj
.
Lat
=
lat
;
obj
.
Long
=
lon
;
for
(
int
i
=
0
;
i
<
8
;
i
++
)
{
jfx_common_msgs
::
Point64
loc
=
{};
loc
.
lon
=
loc_lon
[
i
];
loc
.
lat
=
loc_lat
[
i
];
loc
.
alt
=
loc_alt
[
i
];
obj
.
points
.
emplace_back
(
loc
);
}
#else
double
gx
=
0.0
f
;
double
gy
=
0.0
f
;
...
...
@@ -630,13 +657,24 @@ void TrackingRos::ThreadTrackingProcess()
#ifdef _ABUZHABI_
double
lon
=
0.0
f
;
double
lat
=
0.0
f
;
double
loc_lon
[
8
]
=
{};
double
loc_lat
[
8
]
=
{};
double
loc_alt
[
8
]
=
{};
// CalculateGuassPos(obj, m_trans, m_kitti2origin, gx, gy);
CalculateUTMPos
(
obj
,
m_wgs84_station
,
m_UTM_station
,
m_trans2station
,
m_kitti2origin
,
lon
,
lat
);
CalculateUTMPos
(
obj
,
m_wgs84_station
,
m_UTM_station
,
m_trans2station
,
m_kitti2origin
,
lon
,
lat
,
loc_lon
,
loc_lat
,
loc_alt
);
// SDK_LOG(SDK_INFO, "CalculateGuassPos x = %f,y = %f, gx = %f, gy = %f,prob = %f", obj.x, obj.y, gx, gy, iter.second->GetProb());
// jfx::Array gpos = {gx, gy};
// jfx::Array pos = jfx::Inverse(gpos);
obj
.
Lat
=
lat
;
obj
.
Long
=
lon
;
for
(
int
i
=
0
;
i
<
8
;
i
++
)
{
jfx_common_msgs
::
Point64
loc
=
{};
loc
.
lon
=
loc_lon
[
i
];
loc
.
lat
=
loc_lat
[
i
];
loc
.
alt
=
loc_alt
[
i
];
obj
.
points
.
emplace_back
(
loc
);
}
#else
double
gx
=
0.0
f
;
double
gy
=
0.0
f
;
...
...
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