Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
344ec1b3
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,发现更多精彩内容 >>
提交
344ec1b3
编写于
9月 24, 2018
作者:
C
Calvin Miao
提交者:
Jiangtao Hu
9月 24, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Perception: fixed lib/util build issues
上级
c4e0c294
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
81 addition
and
18 deletion
+81
-18
modules/perception/lib/utils/BUILD
modules/perception/lib/utils/BUILD
+64
-0
modules/perception/lib/utils/string_util.cc
modules/perception/lib/utils/string_util.cc
+3
-3
modules/perception/lib/utils/string_util.h
modules/perception/lib/utils/string_util.h
+4
-3
modules/perception/lib/utils/string_util_test.cc
modules/perception/lib/utils/string_util_test.cc
+0
-0
modules/perception/lib/utils/time_util.h
modules/perception/lib/utils/time_util.h
+3
-3
modules/perception/lib/utils/time_util_test.cc
modules/perception/lib/utils/time_util_test.cc
+0
-4
modules/perception/lib/utils/timer.cc
modules/perception/lib/utils/timer.cc
+3
-2
modules/perception/lib/utils/timer.h
modules/perception/lib/utils/timer.h
+4
-3
modules/perception/lib/utils/timer_test.cc
modules/perception/lib/utils/timer_test.cc
+0
-0
未找到文件。
modules/perception/lib/utils/BUILD
0 → 100644
浏览文件 @
344ec1b3
load
(
"//tools:cpplint.bzl"
,
"cpplint"
)
package
(
default_visibility
=
[
"//visibility:public"
])
cc_library
(
name
=
"perception_perf"
,
hdrs
=
[
"perf.h"
],
)
cc_library
(
name
=
"perception_timer"
,
srcs
=
[
"timer.cc"
],
hdrs
=
[
"timer.h"
],
deps
=
[
"//framework:cybertron"
,
":perception_perf"
,
],
)
cc_test
(
name
=
"perception_timer_test"
,
size
=
"small"
,
srcs
=
[
"timer_test.cc"
],
deps
=
[
":perception_timer"
,
"@gtest//:main"
,
],
)
cc_library
(
name
=
"perception_time_util"
,
hdrs
=
[
"time_util.h"
],
)
cc_test
(
name
=
"perception_time_util_test"
,
size
=
"small"
,
srcs
=
[
"time_util_test.cc"
],
deps
=
[
":perception_time_util"
,
"@gtest//:main"
,
],
)
cc_library
(
name
=
"perception_string_util"
,
srcs
=
[
"string_util.cc"
],
hdrs
=
[
"string_util.h"
],
deps
=
[
"//framework:cybertron"
,
],
)
cc_test
(
name
=
"perception_string_util_test"
,
size
=
"small"
,
srcs
=
[
"string_util_test.cc"
],
deps
=
[
":perception_string_util"
,
"@gtest//:main"
,
],
)
cpplint
()
modules/perception/lib/utils/string_util.cc
浏览文件 @
344ec1b3
...
...
@@ -17,7 +17,7 @@
#include <algorithm>
#include "
modules/perception/base
/log.h"
#include "
cybertron/common
/log.h"
namespace
apollo
{
namespace
perception
{
...
...
@@ -63,7 +63,7 @@ void StringUtil::Trim(TrimType type, string *result_str) {
Trim
(
TRIM_RIGHT
,
result_str
);
break
;
default:
LOG_
ERROR
<<
"Invalid trim type, type: "
<<
type
;
A
ERROR
<<
"Invalid trim type, type: "
<<
type
;
break
;
}
}
...
...
@@ -121,7 +121,7 @@ bool StringUtil::StrToInt(const string &str, int *ret_val) {
*
ret_val
=
std
::
stoi
(
str
);
return
true
;
}
catch
(...)
{
LOG_
ERROR
<<
"std::stoi() failed.str:"
<<
str
;
A
ERROR
<<
"std::stoi() failed.str:"
<<
str
;
return
false
;
}
}
...
...
modules/perception/lib/utils/string_util.h
浏览文件 @
344ec1b3
...
...
@@ -13,8 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#ifndef PERCEPTION_LIB_UTILS_STRING_UTIL_H_
#define PERCEPTION_LIB_UTILS_STRING_UTIL_H_
#ifndef MODULES_PERCEPTION_LIB_UTILS_STRING_UTIL_H_
#define MODULES_PERCEPTION_LIB_UTILS_STRING_UTIL_H_
#include <string>
#include <vector>
...
...
@@ -96,4 +97,4 @@ std::string StringUtil::Digit2String(T number) {
}
// namespace perception
}
// namespace apollo
#endif // PERCEPTION_LIB_UTILS_STRING_UTIL_H_
#endif //
MODULES_
PERCEPTION_LIB_UTILS_STRING_UTIL_H_
modules/perception/lib/
test/lib_
string_util_test.cc
→
modules/perception/lib/
utils/
string_util_test.cc
浏览文件 @
344ec1b3
文件已移动
modules/perception/lib/utils/time_util.h
浏览文件 @
344ec1b3
...
...
@@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#ifndef PERCEPTION_LIB_UTILS_TIME_UTIL_H_
#define PERCEPTION_LIB_UTILS_TIME_UTIL_H_
#ifndef
MODULES_
PERCEPTION_LIB_UTILS_TIME_UTIL_H_
#define
MODULES_
PERCEPTION_LIB_UTILS_TIME_UTIL_H_
#include <sys/time.h>
...
...
@@ -63,4 +63,4 @@ class TimeUtil {
}
// namespace perception
}
// namespace apollo
#endif // PERCEPTION_LIB_UTILS_TIME_UTIL_H_
#endif //
MODULES_
PERCEPTION_LIB_UTILS_TIME_UTIL_H_
modules/perception/lib/
test/lib_
time_util_test.cc
→
modules/perception/lib/
utils/
time_util_test.cc
浏览文件 @
344ec1b3
...
...
@@ -17,7 +17,6 @@
#include <cmath>
#include "modules/perception/base/log.h"
#include "modules/perception/lib/utils/time_util.h"
namespace
apollo
{
...
...
@@ -49,9 +48,6 @@ TEST(TimeUtilTest, TestGetCurrentTime) {
uint64_t
current_time
=
::
time
(
NULL
);
if
(
std
::
fabs
(
unix_time
-
current_time
)
<
1
)
{
return
;
}
else
{
LOG_INFO
<<
"unix_time="
<<
unix_time
<<
" , current_time="
<<
current_time
;
}
usleep
(
50000
);
// 50ms
}
...
...
modules/perception/lib/utils/timer.cc
浏览文件 @
344ec1b3
...
...
@@ -13,9 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#include <sys/time.h>
#include "
modules/perception/base
/log.h"
#include "
cybertron/common
/log.h"
#include "modules/perception/lib/utils/timer.h"
namespace
apollo
{
...
...
@@ -37,7 +38,7 @@ uint64_t Timer::End(const string &msg) {
end_time_
=
tv
.
tv_sec
*
1000
+
tv
.
tv_usec
/
1000
;
uint64_t
elapsed_time
=
end_time_
-
start_time_
;
LOG_INFO
<<
"TIMER "
<<
msg
<<
" elapsed_time: "
<<
elapsed_time
<<
" ms"
;
ADEBUG
<<
"TIMER "
<<
msg
<<
" elapsed_time: "
<<
elapsed_time
<<
" ms"
;
// start new timer.
start_time_
=
end_time_
;
...
...
modules/perception/lib/utils/timer.h
浏览文件 @
344ec1b3
...
...
@@ -13,8 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#ifndef PERCEPTION_LIB_UTILS_TIMER_H_
#define PERCEPTION_LIB_UTILS_TIMER_H_
#ifndef MODULES_PERCEPTION_LIB_UTILS_TIMER_H_
#define MODULES_PERCEPTION_LIB_UTILS_TIMER_H_
#include <stdint.h>
#include <string>
...
...
@@ -63,4 +64,4 @@ class TimerWrapper {
}
// namespace perception
}
// namespace apollo
#endif // PERCEPTION_LIB_UTILS_TIMER_H_
#endif //
MODULES_
PERCEPTION_LIB_UTILS_TIMER_H_
modules/perception/lib/
test/lib_
timer_test.cc
→
modules/perception/lib/
utils/
timer_test.cc
浏览文件 @
344ec1b3
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录