Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
3e538ed1
A
apollo
项目概览
Pinoxchio
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3e538ed1
编写于
2月 24, 2018
作者:
Z
zhouyao
提交者:
Qi Luo
2月 26, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
localizaiton result add vehicle orientation term
上级
d96c88ad
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
135 addition
and
9 deletion
+135
-9
modules/localization/common/localization_gflags.cc
modules/localization/common/localization_gflags.cc
+13
-0
modules/localization/common/localization_gflags.h
modules/localization/common/localization_gflags.h
+8
-0
modules/localization/conf/localization.conf
modules/localization/conf/localization.conf
+25
-0
modules/localization/msf/msf_localization.cc
modules/localization/msf/msf_localization.cc
+56
-4
modules/localization/msf/msf_localization.h
modules/localization/msf/msf_localization.h
+4
-1
modules/localization/msf/params/vehicle_params/vehicle_imu_extrinsics.yaml
...ion/msf/params/vehicle_params/vehicle_imu_extrinsics.yaml
+10
-0
modules/localization/msf/params/vehicle_params/vehicle_imu_extrinsics.yaml~
...on/msf/params/vehicle_params/vehicle_imu_extrinsics.yaml~
+10
-0
modules/localization/proto/pose.proto
modules/localization/proto/pose.proto
+9
-4
未找到文件。
modules/localization/common/localization_gflags.cc
浏览文件 @
3e538ed1
...
...
@@ -130,6 +130,19 @@ DEFINE_bool(gnss_only_init, false,
DEFINE_bool
(
enable_lidar_localization
,
true
,
"Enable lidar-based localization."
);
// imu vehicle extrinsic
DEFINE_string
(
vehicle_imu_file
,
"modules/localization/msf/params"
"/vehicle_params/vehicle_imu_extrinsics.yaml"
,
"Vehicle coord to imu coord."
);
DEFINE_bool
(
if_vehicle_imu_from_file
,
true
,
"Whether load vehicle imu extrinsic from yaml file"
);
DEFINE_double
(
imu_vehicle_qx
,
0.0
,
"Vehicle imu quaternion qx"
);
DEFINE_double
(
imu_vehicle_qy
,
0.0
,
"Vehicle imu quaternion qy"
);
DEFINE_double
(
imu_vehicle_qz
,
0.0
,
"Vehicle imu quaternion qz"
);
DEFINE_double
(
imu_vehicle_qw
,
1.0
,
"Vehicle imu quaternion qw"
);
// debug
DEFINE_bool
(
use_visualize
,
false
,
""
);
...
...
modules/localization/common/localization_gflags.h
浏览文件 @
3e538ed1
...
...
@@ -98,6 +98,14 @@ DECLARE_bool(imu_coord_rfu);
DECLARE_bool
(
gnss_only_init
);
DECLARE_bool
(
enable_lidar_localization
);
// imu vehicle extrinsic
DECLARE_string
(
vehicle_imu_file
);
DECLARE_bool
(
if_vehicle_imu_from_file
);
DECLARE_double
(
imu_vehicle_qx
);
DECLARE_double
(
imu_vehicle_qy
);
DECLARE_double
(
imu_vehicle_qz
);
DECLARE_double
(
imu_vehicle_qw
);
// Debug
DECLARE_bool
(
use_visualize
);
...
...
modules/localization/conf/localization.conf
浏览文件 @
3e538ed1
...
...
@@ -194,5 +194,30 @@
# default: 0.0
--
imu_to_ant_offset_uz
=
0
.
08
# Whether load vehicle coord to imu coord quaternion from yaml file
# type: bool
# default: true
--
if_vehicle_imu_from_file
=
true
# vehicle coord to imu coord quaternion qx
# type: double
# default: 0.0
--
imu_vehicle_qx
=
0
.
0
# vehicle coord to imu coord quaternion qy
# type: double
# default: 0.0
--
imu_vehicle_qy
=
0
.
0
# vehicle coord to imu coord quaternion qz
# type: double
# default: 0.0
--
imu_vehicle_qz
=
0
.
0
# vehicle coord to imu coord quaternion qw
# type: double
# default: 1.0
--
imu_vehicle_qw
=
1
.
0
# The tem folder for localziation visualziation
--
map_visual_dir
=
data
/
map_visual
modules/localization/msf/msf_localization.cc
浏览文件 @
3e538ed1
...
...
@@ -167,16 +167,47 @@ void MSFLocalization::InitParams() {
AERROR
<<
"lidar_height: "
<<
localizaiton_param_
.
lidar_height_file
;
localizaiton_param_
.
utm_zone_id
=
FLAGS_local_utm_zone_id
;
// try load zone id from
config file in
local_map folder
// try load zone id from local_map folder
if
(
FLAGS_if_utm_zone_id_from_folder
)
{
bool
success
=
LoadZoneIdFromF
ile
(
localizaiton_param_
.
map_path
,
bool
success
=
LoadZoneIdFromF
older
(
localizaiton_param_
.
map_path
,
&
localizaiton_param_
.
utm_zone_id
);
if
(
!
success
)
{
AWARN
<<
"Can't load utm zone id from
config file
, use default value."
;
AWARN
<<
"Can't load utm zone id from
map folder
, use default value."
;
}
}
AINFO
<<
"utm zone id: "
<<
localizaiton_param_
.
utm_zone_id
;
// vehicle imu extrinsic
localizaiton_param_
.
imu_vehicle_quat
[
0
]
=
FLAGS_imu_vehicle_qx
;
localizaiton_param_
.
imu_vehicle_quat
[
1
]
=
FLAGS_imu_vehicle_qy
;
localizaiton_param_
.
imu_vehicle_quat
[
2
]
=
FLAGS_imu_vehicle_qz
;
localizaiton_param_
.
imu_vehicle_quat
[
3
]
=
FLAGS_imu_vehicle_qw
;
// try to load imu vehicle quat from file
if
(
FLAGS_if_vehicle_imu_from_file
)
{
double
qx
=
0.0
;
double
qy
=
0.0
;
double
qz
=
0.0
;
double
qw
=
0.0
;
std
::
string
vehicle_imu_file
=
common
::
util
::
TranslatePath
(
FLAGS_vehicle_imu_file
);
AINFO
<<
"Vehile imu file: "
<<
vehicle_imu_file
;
if
(
LoadImuVehicleExtrinsic
(
vehicle_imu_file
,
&
qx
,
&
qy
,
&
qz
,
&
qw
))
{
localizaiton_param_
.
imu_vehicle_quat
[
0
]
=
qx
;
localizaiton_param_
.
imu_vehicle_quat
[
1
]
=
qy
;
localizaiton_param_
.
imu_vehicle_quat
[
2
]
=
qz
;
localizaiton_param_
.
imu_vehicle_quat
[
3
]
=
qw
;
}
else
{
AWARN
<<
"Can't load imu vehicle quat from file, use default value."
;
}
}
AINFO
<<
"imu_vehicle_quat: "
<<
localizaiton_param_
.
imu_vehicle_quat
[
0
]
<<
" "
<<
localizaiton_param_
.
imu_vehicle_quat
[
1
]
<<
" "
<<
localizaiton_param_
.
imu_vehicle_quat
[
2
]
<<
" "
<<
localizaiton_param_
.
imu_vehicle_quat
[
3
];
// common
localizaiton_param_
.
imu_rate
=
FLAGS_imu_rate
;
localizaiton_param_
.
enable_lidar_localization
=
...
...
@@ -389,7 +420,28 @@ bool MSFLocalization::LoadGnssAntennaExtrinsic(
return
false
;
}
bool
MSFLocalization
::
LoadZoneIdFromFile
(
const
std
::
string
&
folder_path
,
bool
MSFLocalization
::
LoadImuVehicleExtrinsic
(
const
std
::
string
&
file_path
,
double
*
quat_qx
,
double
*
quat_qy
,
double
*
quat_qz
,
double
*
quat_qw
)
{
if
(
!
common
::
util
::
PathExists
(
file_path
))
{
return
false
;
}
YAML
::
Node
config
=
YAML
::
LoadFile
(
file_path
);
if
(
config
[
"transform"
])
{
if
(
config
[
"transform"
][
"translation"
])
{
if
(
config
[
"transform"
][
"rotation"
])
{
*
quat_qx
=
config
[
"transform"
][
"rotation"
][
"x"
].
as
<
double
>
();
*
quat_qy
=
config
[
"transform"
][
"rotation"
][
"y"
].
as
<
double
>
();
*
quat_qz
=
config
[
"transform"
][
"rotation"
][
"z"
].
as
<
double
>
();
*
quat_qw
=
config
[
"transform"
][
"rotation"
][
"w"
].
as
<
double
>
();
return
true
;
}
}
}
return
false
;
}
bool
MSFLocalization
::
LoadZoneIdFromFolder
(
const
std
::
string
&
folder_path
,
int
*
zone_id
)
{
std
::
string
map_zone_id_folder
;
if
(
common
::
util
::
DirectoryExists
(
folder_path
+
"/map/000/north"
))
{
...
...
modules/localization/msf/msf_localization.h
浏览文件 @
3e538ed1
...
...
@@ -87,7 +87,10 @@ class MSFLocalization : public LocalizationBase {
double
*
offset_y
,
double
*
offset_z
,
double
*
uncertainty_x
,
double
*
uncertainty_y
,
double
*
uncertainty_z
);
bool
LoadZoneIdFromFile
(
const
std
::
string
&
folder_path
,
int
*
zone_id
);
bool
LoadImuVehicleExtrinsic
(
const
std
::
string
&
file_path
,
double
*
quat_qx
,
double
*
quat_qy
,
double
*
quat_qz
,
double
*
quat_qw
);
bool
LoadZoneIdFromFolder
(
const
std
::
string
&
folder_path
,
int
*
zone_id
);
private:
apollo
::
common
::
monitor
::
MonitorLogger
monitor_logger_
;
...
...
modules/localization/msf/params/vehicle_params/vehicle_imu_extrinsics.yaml
0 → 100644
浏览文件 @
3e538ed1
transform
:
translation
:
x
:
0.0
y
:
0.0
z
:
0.0
rotation
:
x
:
0.0
y
:
0.0
z
:
0.0
w
:
1.0
modules/localization/msf/params/vehicle_params/vehicle_imu_extrinsics.yaml~
0 → 100644
浏览文件 @
3e538ed1
transform:
translation:
x: 0.0
y: 0.0
z: 0.0
rotation:
x: 0.0
y: 0.0
z: 0.0
w: 1.0
modules/localization/proto/pose.proto
浏览文件 @
3e538ed1
...
...
@@ -25,9 +25,9 @@ message Pose {
// The VRP is the center of rear axle.
optional
apollo.common.PointENU
position
=
1
;
// A quaternion that represents the rotation from the
map
coordinate
// (
East/North
/Up) to the
//
vehicle coordinate (Right/Forward
/Up).
// A quaternion that represents the rotation from the
IMU
coordinate
// (
Right/Forward
/Up) to the
//
world coordinate (East/North
/Up).
optional
apollo.common.Quaternion
orientation
=
2
;
// Linear velocity of the VRP in the map reference frame.
...
...
@@ -49,7 +49,7 @@ message Pose {
// Right/forward/up in meters per square second.
optional
apollo.common.Point3D
linear_acceleration_vrf
=
7
;
// Angular velocity of the
vehicle
in the vehicle reference frame.
// Angular velocity of the
VRP
in the vehicle reference frame.
// Around right/forward/up axes in radians per second.
optional
apollo.common.Point3D
angular_velocity_vrf
=
8
;
...
...
@@ -57,4 +57,9 @@ message Pose {
// Roll/pitch/yaw in radians.
optional
apollo.common.Point3D
euler_angles
=
9
;
// A quaternion that represents the rotation from the vehicle coordinate
// (Right/Forward/Up) to the
// world coordinate (East/North/Up).
optional
apollo.common.Quaternion
orientation_vehicle_world
=
10
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录