Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
00f663e9
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,发现更多精彩内容 >>
提交
00f663e9
编写于
9月 25, 2018
作者:
L
Liangliang Zhang
提交者:
Jiangtao Hu
9月 25, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Perception: done with lidar common. (#497)
上级
af16c0e8
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
65 addition
and
44 deletion
+65
-44
modules/perception/common/sensor_manager/sensor_manager.cc
modules/perception/common/sensor_manager/sensor_manager.cc
+10
-16
modules/perception/common/sensor_manager/sensor_manager.h
modules/perception/common/sensor_manager/sensor_manager.h
+7
-7
modules/perception/lidar/common/BUILD
modules/perception/lidar/common/BUILD
+27
-0
modules/perception/lidar/common/lidar_timer.h
modules/perception/lidar/common/lidar_timer.h
+3
-3
modules/perception/onboard/transform_wrapper/transform_wrapper.cc
...perception/onboard/transform_wrapper/transform_wrapper.cc
+11
-13
modules/perception/onboard/transform_wrapper/transform_wrapper.h
.../perception/onboard/transform_wrapper/transform_wrapper.h
+4
-2
modules/planning/BUILD
modules/planning/BUILD
+3
-3
未找到文件。
modules/perception/common/sensor_manager/sensor_manager.cc
浏览文件 @
00f663e9
...
...
@@ -15,17 +15,16 @@
*****************************************************************************/
#include "modules/perception/common/sensor_manager/sensor_manager.h"
#include <google/protobuf/text_format.h>
#include <string>
#include <utility>
#include "cybertron/common/log.h"
#include "google/protobuf/text_format.h"
#include "modules/perception/proto/sensor_meta_schema.pb.h"
// #include "modules/perception/common/io/io_util.h"
#include "modules/perception/lib/config_manager/config_manager.h"
#include "modules/perception/lib/io/file_util.h"
#include "modules/perception/proto/sensor_meta_schema.pb.h"
namespace
apollo
{
namespace
perception
{
...
...
@@ -36,9 +35,7 @@ using apollo::perception::base::SensorInfo;
using
apollo
::
perception
::
base
::
SensorOrientation
;
using
apollo
::
perception
::
base
::
SensorType
;
SensorManager
::
SensorManager
()
{
CHECK_EQ
(
this
->
Init
(),
true
);
}
SensorManager
::
SensorManager
()
{
CHECK_EQ
(
this
->
Init
(),
true
);
}
bool
SensorManager
::
Init
()
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
mutex_
);
...
...
@@ -59,7 +56,7 @@ bool SensorManager::Init() {
std
::
string
content
;
if
(
!
lib
::
FileUtil
::
GetFileContent
(
file_path
,
&
content
))
{
AERROR
<<
"Failed to get SensorManager config path: "
<<
FLAGS_obs_sensor_meta_path
;
<<
FLAGS_obs_sensor_meta_path
;
return
false
;
}
...
...
@@ -95,10 +92,9 @@ bool SensorManager::Init() {
return false;
}
*/
distort_model_map_
.
insert
(
make_pair
(
sensor_meta_proto
.
name
(),
std
::
dynamic_pointer_cast
<
BaseCameraDistortionModel
>
(
distort_model
)));
distort_model_map_
.
insert
(
make_pair
(
sensor_meta_proto
.
name
(),
std
::
dynamic_pointer_cast
<
BaseCameraDistortionModel
>
(
distort_model
)));
undistort_model_map_
.
insert
(
make_pair
(
sensor_meta_proto
.
name
(),
distort_model
->
get_camera_model
()));
}
...
...
@@ -173,8 +169,7 @@ bool SensorManager::IsHdLidar(const std::string& name) const {
}
bool
SensorManager
::
IsHdLidar
(
const
SensorType
&
type
)
const
{
return
type
==
SensorType
::
VELODYNE_64
||
type
==
SensorType
::
VELODYNE_32
||
return
type
==
SensorType
::
VELODYNE_64
||
type
==
SensorType
::
VELODYNE_32
||
type
==
SensorType
::
VELODYNE_16
;
}
...
...
@@ -189,8 +184,7 @@ bool SensorManager::IsLdLidar(const std::string& name) const {
}
bool
SensorManager
::
IsLdLidar
(
const
SensorType
&
type
)
const
{
return
type
==
SensorType
::
LDLIDAR_4
||
type
==
SensorType
::
LDLIDAR_1
;
return
type
==
SensorType
::
LDLIDAR_4
||
type
==
SensorType
::
LDLIDAR_1
;
}
bool
SensorManager
::
IsLidar
(
const
std
::
string
&
name
)
const
{
...
...
modules/perception/common/sensor_manager/sensor_manager.h
浏览文件 @
00f663e9
...
...
@@ -23,8 +23,8 @@
#include <vector>
#include "modules/perception/base/camera.h"
#include "modules/perception/base/sensor_meta.h"
#include "modules/perception/base/distortion_model.h"
#include "modules/perception/base/sensor_meta.h"
#include "modules/perception/common/perception_gflags.h"
#include "modules/perception/lib/singleton/singleton.h"
...
...
@@ -87,12 +87,12 @@ class SensorManager {
std
::
mutex
mutex_
;
bool
inited_
=
false
;
std
::
unordered_map
<
std
::
string
,
apollo
::
perception
::
base
::
SensorInfo
>
sensor_info_map_
;
std
::
unordered_map
<
std
::
string
,
std
::
shared_ptr
<
BaseCameraDistortionModel
>>
distort_model_map_
;
std
::
unordered_map
<
std
::
string
,
std
::
shared_ptr
<
BaseCameraModel
>>
undistort_model_map_
;
std
::
unordered_map
<
std
::
string
,
apollo
::
perception
::
base
::
SensorInfo
>
sensor_info_map_
;
std
::
unordered_map
<
std
::
string
,
std
::
shared_ptr
<
BaseCameraDistortionModel
>>
distort_model_map_
;
std
::
unordered_map
<
std
::
string
,
std
::
shared_ptr
<
BaseCameraModel
>>
undistort_model_map_
;
};
}
// namespace common
...
...
modules/perception/lidar/common/BUILD
浏览文件 @
00f663e9
...
...
@@ -2,6 +2,19 @@ load("//tools:cpplint.bzl", "cpplint")
package
(
default_visibility
=
[
"//visibility:public"
])
cc_library
(
name
=
"common"
,
deps
=
[
":cloud_mask"
,
":lidar_frame"
,
":lidar_log"
,
":lidar_object_util"
,
":lidar_point_label"
,
":lidar_timer"
,
":pcl_util"
,
],
)
cc_library
(
name
=
"cloud_mask"
,
srcs
=
[
...
...
@@ -77,6 +90,20 @@ cc_library(
],
)
cc_library
(
name
=
"lidar_point_label"
,
hdrs
=
[
"lidar_point_label.h"
,
],
)
cc_library
(
name
=
"lidar_timer"
,
hdrs
=
[
"lidar_timer.h"
,
],
)
cc_library
(
name
=
"pcl_util"
,
hdrs
=
[
...
...
modules/perception/lidar/common/lidar_timer.h
浏览文件 @
00f663e9
...
...
@@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#ifndef
PERCEPIT
ON_LIDAR_COMMON_LIDAR_TIMER_H_
#define
PERCEPIT
ON_LIDAR_COMMON_LIDAR_TIMER_H_
#ifndef
MODULES_PERCEPTI
ON_LIDAR_COMMON_LIDAR_TIMER_H_
#define
MODULES_PERCEPTI
ON_LIDAR_COMMON_LIDAR_TIMER_H_
#include <chrono>
...
...
@@ -43,4 +43,4 @@ class Timer {
}
// namespace perception
}
// namespace apollo
#endif //
PERCEPIT
ON_LIDAR_COMMON_LIDAR_TIMER_H_
#endif //
MODULES_PERCEPTI
ON_LIDAR_COMMON_LIDAR_TIMER_H_
modules/perception/onboard/transform_wrapper/transform_wrapper.cc
浏览文件 @
00f663e9
...
...
@@ -68,7 +68,7 @@ bool TransformCache::QueryTransform(double timestamp,
double
delt
=
timestamp
-
transforms_
.
back
().
timestamp
;
if
(
delt
>
max_duration
)
{
AINFO
<<
"ERROR: query timestamp is "
<<
delt
<<
"s later than cached timestamp"
;
<<
"s later than cached timestamp"
;
return
false
;
}
else
if
(
delt
<
0.0
)
{
AINFO
<<
"ERROR: query earlier timestamp than transform cache"
;
...
...
@@ -79,9 +79,8 @@ bool TransformCache::QueryTransform(double timestamp,
if
(
size
==
1
)
{
(
*
transform
)
=
transforms_
.
back
();
transform
->
timestamp
=
timestamp
;
AINFO
<<
"use transform at "
<<
std
::
to_string
(
transforms_
.
back
().
timestamp
)
<<
" for "
<<
std
::
to_string
(
timestamp
);
AINFO
<<
"use transform at "
<<
std
::
to_string
(
transforms_
.
back
().
timestamp
)
<<
" for "
<<
std
::
to_string
(
timestamp
);
}
else
{
double
ratio
=
(
timestamp
-
transforms_
[
size
-
2
].
timestamp
)
/
...
...
@@ -101,9 +100,9 @@ bool TransformCache::QueryTransform(double timestamp,
transforms_
[
size
-
1
].
translation
.
z
()
*
ratio
;
AINFO
<<
"estimate pose at "
<<
std
::
to_string
(
timestamp
)
<<
" from poses at "
<<
std
::
to_string
(
transforms_
[
size
-
2
].
timestamp
)
<<
" and "
<<
std
::
to_string
(
transforms_
[
size
-
1
].
timestamp
);
<<
" from poses at "
<<
std
::
to_string
(
transforms_
[
size
-
2
].
timestamp
)
<<
" and "
<<
std
::
to_string
(
transforms_
[
size
-
1
].
timestamp
);
}
return
true
;
}
...
...
@@ -137,7 +136,7 @@ bool TransformWrapper::GetSensor2worldTrans(
Eigen
::
Affine3d
*
novatel2world_trans
)
{
if
(
!
inited_
)
{
AERROR
<<
"TransformWrapper not Initialized,"
<<
" unable to call GetSensor2worldTrans."
;
<<
" unable to call GetSensor2worldTrans."
;
return
false
;
}
...
...
@@ -180,8 +179,8 @@ bool TransformWrapper::GetSensor2worldTrans(
*
novatel2world_trans
=
novatel2world
;
}
AINFO
<<
"Get pose timestamp: "
<<
std
::
to_string
(
timestamp
)
<<
", pose: "
<<
std
::
endl
<<
(
*
sensor2world_trans
).
matrix
();
<<
", pose: "
<<
std
::
endl
<<
(
*
sensor2world_trans
).
matrix
();
return
true
;
}
...
...
@@ -224,9 +223,8 @@ bool TransformWrapper::QueryTrans(double timestamp, StampedTransform* trans,
if
(
!
tf2_buffer_
->
canTransform
(
frame_id
,
child_frame_id
,
query_time
,
FLAGS_obs_tf2_buff_size
,
&
err_string
))
{
AERROR
<<
"Can not find transform. "
<<
std
::
to_string
(
timestamp
)
<<
" frame_id: "
<<
frame_id
<<
" child_frame_id: "
<<
child_frame_id
<<
" Error info: "
<<
err_string
;
<<
" frame_id: "
<<
frame_id
<<
" child_frame_id: "
<<
child_frame_id
<<
" Error info: "
<<
err_string
;
return
false
;
}
...
...
modules/perception/onboard/transform_wrapper/transform_wrapper.h
浏览文件 @
00f663e9
...
...
@@ -16,11 +16,13 @@
#ifndef MODULES_PERCEPTION_ONBOARD_TRANSFORM_WRAPPER_H_
#define MODULES_PERCEPTION_ONBOARD_TRANSFORM_WRAPPER_H_
#include <Eigen/Core>
#include <Eigen/Dense>
#include <deque>
#include <memory>
#include <string>
#include "Eigen/Core"
#include "Eigen/Dense"
#include "modules/transform/buffer.h"
namespace
apollo
{
...
...
modules/planning/BUILD
浏览文件 @
00f663e9
...
...
@@ -35,15 +35,15 @@ cc_test(
"//modules/planning:planning_testdata"
,
],
deps
=
[
"@gtest//:main"
,
":planning_component_lib"
,
"@gtest//:main"
,
],
)
cc_binary
(
name
=
"libplanning_component.so"
,
deps
=
[
":planning_component_lib"
],
linkshared
=
True
,
deps
=
[
":planning_component_lib"
],
)
cc_library
(
...
...
@@ -58,6 +58,7 @@ cc_library(
"planning_base.h"
,
"std_planning.h"
,
],
copts
=
[
"-DMODULE_NAME=
\\\"
planning
\\\"
"
],
deps
=
[
"//modules/common"
,
"//modules/common/configs:config_gflags"
,
...
...
@@ -79,7 +80,6 @@ cc_library(
"//modules/planning/toolkits/deciders"
,
"//modules/prediction/proto:prediction_proto"
,
],
copts
=
[
"-DMODULE_NAME=
\\\"
planning
\\\"
"
],
)
filegroup
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录