Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
7cc253a6
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,发现更多精彩内容 >>
未验证
提交
7cc253a6
编写于
2月 14, 2019
作者:
X
Xiangquan Xiao
提交者:
GitHub
2月 14, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
All: Final clean up of old file util usages. (#6865)
上级
e9f5e64a
变更
21
显示空白变更内容
内联
并排
Showing
21 changed file
with
45 addition
and
63 deletion
+45
-63
modules/common/configs/vehicle_config_helper.cc
modules/common/configs/vehicle_config_helper.cc
+2
-2
modules/common/kv_db/kv_db.cc
modules/common/kv_db/kv_db.cc
+0
-1
modules/common/util/file.h
modules/common/util/file.h
+0
-11
modules/common/util/message_util.h
modules/common/util/message_util.h
+4
-4
modules/common/util/message_util_test.cc
modules/common/util/message_util_test.cc
+2
-2
modules/common/vehicle_state/vehicle_state_provider_test.cc
modules/common/vehicle_state/vehicle_state_provider_test.cc
+2
-2
modules/control/common/leadlag_controller_test.cc
modules/control/common/leadlag_controller_test.cc
+2
-2
modules/control/control_component_test.cc
modules/control/control_component_test.cc
+2
-2
modules/control/integration_tests/control_test_base.cc
modules/control/integration_tests/control_test_base.cc
+1
-1
modules/data/data_component.cc
modules/data/data_component.cc
+4
-9
modules/dreamview/backend/dreamview.cc
modules/dreamview/backend/dreamview.cc
+1
-2
modules/dreamview/backend/hmi/hmi_worker.cc
modules/dreamview/backend/hmi/hmi_worker.cc
+3
-3
modules/dreamview/backend/simulation_world/simulation_world_updater.cc
...view/backend/simulation_world/simulation_world_updater.cc
+2
-1
modules/localization/rtk/rtk_localization_test.cc
modules/localization/rtk/rtk_localization_test.cc
+2
-1
modules/map/relative_map/tools/navigator.cc
modules/map/relative_map/tools/navigator.cc
+2
-2
modules/monitor/hardware/resource_monitor.cc
modules/monitor/hardware/resource_monitor.cc
+1
-1
modules/monitor/software/process_monitor.cc
modules/monitor/software/process_monitor.cc
+3
-3
modules/perception/camera/app/lane_camera_perception.cc
modules/perception/camera/app/lane_camera_perception.cc
+2
-2
modules/perception/onboard/component/lane_detection_component.cc
.../perception/onboard/component/lane_detection_component.cc
+2
-2
modules/planning/integration_tests/planning_test_base.cc
modules/planning/integration_tests/planning_test_base.cc
+6
-8
modules/prediction/pipeline/feature_proto_file_to_model_features.cc
...ediction/pipeline/feature_proto_file_to_model_features.cc
+2
-2
未找到文件。
modules/common/configs/vehicle_config_helper.cc
浏览文件 @
7cc253a6
...
...
@@ -19,8 +19,8 @@
#include <algorithm>
#include <cmath>
#include "cyber/common/file.h"
#include "modules/common/configs/config_gflags.h"
#include "modules/common/util/file.h"
namespace
apollo
{
namespace
common
{
...
...
@@ -34,7 +34,7 @@ void VehicleConfigHelper::Init() { Init(FLAGS_vehicle_config_path); }
void
VehicleConfigHelper
::
Init
(
const
std
::
string
&
config_file
)
{
VehicleConfig
params
;
CHECK
(
apollo
::
common
::
util
::
GetProtoFromFile
(
config_file
,
&
params
))
CHECK
(
cyber
::
common
::
GetProtoFromFile
(
config_file
,
&
params
))
<<
"Unable to parse vehicle config file "
<<
config_file
;
Init
(
params
);
}
...
...
modules/common/kv_db/kv_db.cc
浏览文件 @
7cc253a6
...
...
@@ -20,7 +20,6 @@
#include "gflags/gflags.h"
#include "cyber/common/log.h"
#include "modules/common/util/file.h"
#include "modules/common/util/string_util.h"
#include "modules/common/util/util.h"
...
...
modules/common/util/file.h
浏览文件 @
7cc253a6
...
...
@@ -35,21 +35,10 @@ namespace util {
// usages we'll retire the aliases here.
using
apollo
::
cyber
::
common
::
SetProtoToASCIIFile
;
using
apollo
::
cyber
::
common
::
GetProtoFromASCIIFile
;
using
apollo
::
cyber
::
common
::
SetProtoToBinaryFile
;
using
apollo
::
cyber
::
common
::
GetProtoFromBinaryFile
;
using
apollo
::
cyber
::
common
::
GetProtoFromFile
;
using
apollo
::
cyber
::
common
::
GetContent
;
using
apollo
::
cyber
::
common
::
GetAbsolutePath
;
using
apollo
::
cyber
::
common
::
PathExists
;
using
apollo
::
cyber
::
common
::
DirectoryExists
;
using
apollo
::
cyber
::
common
::
Glob
;
using
apollo
::
cyber
::
common
::
CopyFile
;
using
apollo
::
cyber
::
common
::
CopyDir
;
using
apollo
::
cyber
::
common
::
Copy
;
using
apollo
::
cyber
::
common
::
EnsureDirectory
;
using
apollo
::
cyber
::
common
::
RemoveAllFiles
;
using
apollo
::
cyber
::
common
::
ListSubPaths
;
using
apollo
::
cyber
::
common
::
GetFileName
;
}
// namespace util
}
// namespace common
...
...
modules/common/util/message_util.h
浏览文件 @
7cc253a6
...
...
@@ -24,9 +24,9 @@
#include <memory>
#include <string>
#include "cyber/common/file.h"
#include "google/protobuf/message.h"
#include "modules/common/time/time.h"
#include "modules/common/util/file.h"
#include "modules/common/util/string_util.h"
/**
...
...
@@ -75,8 +75,8 @@ bool DumpMessage(const std::shared_ptr<T>& msg,
auto
type_name
=
T
::
descriptor
()
->
full_name
();
std
::
string
dump_path
=
dump_dir
+
"/"
+
type_name
;
if
(
!
DirectoryExists
(
dump_path
))
{
if
(
!
EnsureDirectory
(
dump_path
))
{
if
(
!
cyber
::
common
::
DirectoryExists
(
dump_path
))
{
if
(
!
cyber
::
common
::
EnsureDirectory
(
dump_path
))
{
AERROR
<<
"Cannot enable dumping for '"
<<
type_name
<<
"' because the path "
<<
dump_path
<<
" cannot be created or is not a directory."
;
...
...
@@ -85,7 +85,7 @@ bool DumpMessage(const std::shared_ptr<T>& msg,
}
auto
sequence_num
=
msg
->
header
().
sequence_num
();
return
util
::
SetProtoToASCIIFile
(
return
cyber
::
common
::
SetProtoToASCIIFile
(
*
msg
,
util
::
StrCat
(
dump_path
,
"/"
,
sequence_num
,
".pb.txt"
));
}
...
...
modules/common/util/message_util_test.cc
浏览文件 @
7cc253a6
...
...
@@ -31,8 +31,8 @@ TEST(MessageUtilTest, DumpMessage) {
auto
simple_msg
=
std
::
make_shared
<
test
::
SimpleMessage
>
();
FillHeader
(
"test"
,
simple_msg
.
get
());
EXPECT_TRUE
(
DumpMessage
(
simple_msg
));
EXPECT_TRUE
(
PathExists
(
"/tmp/apollo.common.util.test.SimpleMessage/0.pb.txt"
));
EXPECT_TRUE
(
cyber
::
common
::
PathExists
(
"/tmp/apollo.common.util.test.SimpleMessage/0.pb.txt"
));
}
TEST
(
MessageUtilTest
,
MessageFingerprint
)
{
...
...
modules/common/vehicle_state/vehicle_state_provider_test.cc
浏览文件 @
7cc253a6
...
...
@@ -21,8 +21,8 @@
#include "Eigen/Core"
#include "gtest/gtest.h"
#include "cyber/common/file.h"
#include "modules/canbus/proto/chassis.pb.h"
#include "modules/common/util/file.h"
#include "modules/localization/common/localization_gflags.h"
#include "modules/localization/proto/localization.pb.h"
...
...
@@ -38,7 +38,7 @@ class VehicleStateProviderTest : public ::testing::Test {
virtual
void
SetUp
()
{
std
::
string
localization_file
=
"modules/localization/testdata/3_localization_result_1.pb.txt"
;
CHECK
(
c
ommon
::
util
::
GetProtoFromFile
(
localization_file
,
&
localization_
));
CHECK
(
c
yber
::
common
::
GetProtoFromFile
(
localization_file
,
&
localization_
));
chassis_
.
set_speed_mps
(
3.0
);
chassis_
.
set_gear_location
(
canbus
::
Chassis
::
GEAR_DRIVE
);
FLAGS_enable_map_reference_unify
=
false
;
...
...
modules/control/common/leadlag_controller_test.cc
浏览文件 @
7cc253a6
...
...
@@ -19,8 +19,8 @@
#include <iostream>
#include <string>
#include "cyber/common/file.h"
#include "gtest/gtest.h"
#include "modules/common/util/file.h"
#include "modules/control/proto/control_conf.pb.h"
#include "modules/control/proto/leadlag_conf.pb.h"
...
...
@@ -32,7 +32,7 @@ class LeadlagControllerTest : public ::testing::Test {
virtual
void
SetUp
()
{
std
::
string
control_conf_file
=
"/apollo/modules/control/testdata/conf/control_conf.pb.txt"
;
CHECK
(
c
ommon
::
util
::
GetProtoFromFile
(
control_conf_file
,
&
control_conf_
));
CHECK
(
c
yber
::
common
::
GetProtoFromFile
(
control_conf_file
,
&
control_conf_
));
lon_controller_conf_
=
control_conf_
.
lon_controller_conf
();
}
...
...
modules/control/control_component_test.cc
浏览文件 @
7cc253a6
...
...
@@ -201,8 +201,8 @@ bool ControlComponentTest::RunControl(const std::string& test_case_name) {
cyber
::
common
::
SetProtoToASCIIFile
(
control_command_
,
golden_result_file
);
}
else
{
ControlCommand
golden_result
;
bool
load_success
=
common
::
util
::
GetProtoFromASCIIFile
(
full_golden_path
,
&
golden_result
);
bool
load_success
=
cyber
::
common
::
GetProtoFromASCIIFile
(
full_golden_path
,
&
golden_result
);
if
(
!
load_success
)
{
AERROR
<<
"Failed to load golden file: "
<<
full_golden_path
;
cyber
::
common
::
SetProtoToASCIIFile
(
control_command_
,
tmp_golden_path
);
...
...
modules/control/integration_tests/control_test_base.cc
浏览文件 @
7cc253a6
...
...
@@ -160,7 +160,7 @@ bool ControlTestBase::test_control(const std::string &test_case_name,
cyber
::
common
::
GetProtoFromASCIIFile
(
full_golden_path
,
&
golden_result
);
if
(
!
load_success
)
{
AERROR
<<
"Failed to load golden file: "
<<
full_golden_path
;
c
ommon
::
util
::
SetProtoToASCIIFile
(
control_command_
,
tmp_golden_path
);
c
yber
::
common
::
SetProtoToASCIIFile
(
control_command_
,
tmp_golden_path
);
AINFO
<<
"Current result is written to "
<<
tmp_golden_path
;
return
false
;
}
...
...
modules/data/data_component.cc
浏览文件 @
7cc253a6
...
...
@@ -16,7 +16,6 @@
#include "modules/data/data_component.h"
#include "cyber/common/log.h"
#include "modules/common/adapters/adapter_gflags.h"
#include "modules/common/util/message_util.h"
#include "modules/data/common/data_gflags.h"
...
...
@@ -26,8 +25,7 @@ namespace apollo {
namespace
data
{
bool
DataComponent
::
Init
()
{
CHECK
(
apollo
::
common
::
util
::
GetProtoFromFile
(
FLAGS_data_conf_file
,
&
data_conf_
))
CHECK
(
cyber
::
common
::
GetProtoFromFile
(
FLAGS_data_conf_file
,
&
data_conf_
))
<<
"Unable to load data conf file: "
<<
FLAGS_data_conf_file
;
if
(
!
data_conf_
.
data_enabled
())
{
...
...
@@ -45,8 +43,7 @@ bool DataComponent::Init() {
bool
DataComponent
::
Proc
(
const
std
::
shared_ptr
<
DataInputCommand
>
&
request
)
{
ADEBUG
<<
"Received data input command: "
<<
request
->
DebugString
();
ADEBUG
<<
"Received data input command: "
<<
request
->
DebugString
();
OnDataInputCommand
(
request
);
...
...
@@ -58,9 +55,7 @@ bool DataComponent::Proc(
void
DataComponent
::
CreateReader
()
{
data_input_cmd_reader_
=
node_
->
CreateReader
<
DataInputCommand
>
(
FLAGS_data_topic
,
std
::
bind
(
&
DataComponent
::
OnDataInputCommand
,
this
,
std
::
bind
(
&
DataComponent
::
OnDataInputCommand
,
this
,
std
::
placeholders
::
_1
));
CHECK
(
data_input_cmd_reader_
!=
nullptr
);
}
...
...
modules/dreamview/backend/dreamview.cc
浏览文件 @
7cc253a6
...
...
@@ -21,7 +21,6 @@
#include "cyber/common/file.h"
#include "modules/common/configs/vehicle_config_helper.h"
#include "modules/common/time/time.h"
#include "modules/dreamview/backend/common/dreamview_gflags.h"
namespace
apollo
{
...
...
@@ -29,7 +28,7 @@ namespace dreamview {
using
apollo
::
common
::
Status
;
using
apollo
::
common
::
VehicleConfigHelper
;
using
apollo
::
common
::
util
::
PathExists
;
using
cyber
::
common
::
PathExists
;
Dreamview
::~
Dreamview
()
{
Stop
();
}
...
...
modules/dreamview/backend/hmi/hmi_worker.cc
浏览文件 @
7cc253a6
...
...
@@ -85,7 +85,7 @@ std::string TitleCase(const std::string& origin) {
// List subdirs and return a dict of {subdir_title: subdir_path}.
Map
<
std
::
string
,
std
::
string
>
ListDirAsDict
(
const
std
::
string
&
dir
)
{
Map
<
std
::
string
,
std
::
string
>
result
;
const
auto
subdirs
=
apollo
::
common
::
util
::
ListSubPaths
(
dir
);
const
auto
subdirs
=
cyber
::
common
::
ListSubPaths
(
dir
);
for
(
const
auto
&
subdir
:
subdirs
)
{
const
auto
subdir_title
=
TitleCase
(
subdir
);
const
auto
subdir_path
=
StrCat
(
dir
,
"/"
,
subdir
);
...
...
@@ -99,9 +99,9 @@ Map<std::string, std::string> ListFilesAsDict(const std::string& dir,
const
std
::
string
&
extension
)
{
Map
<
std
::
string
,
std
::
string
>
result
;
const
std
::
string
pattern
=
StrCat
(
dir
,
"/*"
,
extension
);
for
(
const
std
::
string
&
file_path
:
apollo
::
common
::
util
::
Glob
(
pattern
))
{
for
(
const
std
::
string
&
file_path
:
cyber
::
common
::
Glob
(
pattern
))
{
// Remove the extention and convert to title case as the file title.
const
std
::
string
filename
=
apollo
::
common
::
util
::
GetFileName
(
file_path
);
const
std
::
string
filename
=
cyber
::
common
::
GetFileName
(
file_path
);
const
std
::
string
file_title
=
TitleCase
(
filename
.
substr
(
0
,
filename
.
length
()
-
extension
.
length
()));
result
.
insert
({
file_title
,
file_path
});
...
...
modules/dreamview/backend/simulation_world/simulation_world_updater.cc
浏览文件 @
7cc253a6
...
...
@@ -16,6 +16,7 @@
#include "modules/dreamview/backend/simulation_world/simulation_world_updater.h"
#include "cyber/common/file.h"
#include "google/protobuf/util/json_util.h"
#include "modules/common/util/json_util.h"
#include "modules/common/util/map_util.h"
...
...
@@ -27,7 +28,7 @@ namespace dreamview {
using
apollo
::
common
::
monitor
::
MonitorMessageItem
;
using
apollo
::
common
::
util
::
ContainsKey
;
using
apollo
::
c
ommon
::
util
::
GetProtoFromASCIIFile
;
using
apollo
::
c
yber
::
common
::
GetProtoFromASCIIFile
;
using
apollo
::
hdmap
::
EndWayPointFile
;
using
apollo
::
relative_map
::
NavigationInfo
;
using
apollo
::
routing
::
RoutingRequest
;
...
...
modules/localization/rtk/rtk_localization_test.cc
浏览文件 @
7cc253a6
...
...
@@ -19,6 +19,7 @@
#include "google/protobuf/text_format.h"
#include "gtest/gtest.h"
#include "cyber/common/file.h"
#include "cyber/common/log.h"
#include "modules/common/util/util.h"
...
...
@@ -32,7 +33,7 @@ class RTKLocalizationTest : public ::testing::Test {
protected:
template
<
class
T
>
void
load_data
(
const
std
::
string
&
filename
,
T
*
data
)
{
CHECK
(
c
ommon
::
util
::
GetProtoFromFile
(
filename
,
data
))
CHECK
(
c
yber
::
common
::
GetProtoFromFile
(
filename
,
data
))
<<
"Failed to open file "
<<
filename
;
}
...
...
modules/map/relative_map/tools/navigator.cc
浏览文件 @
7cc253a6
...
...
@@ -53,7 +53,7 @@ int main(int argc, char** argv) {
NavigatorConfig
navigator_config
;
AINFO
<<
"The navigator configuration filename is: "
<<
FLAGS_navigator_config_filename
;
if
(
!
apollo
::
c
ommon
::
util
::
GetProtoFromFile
(
FLAGS_navigator_config_filename
,
if
(
!
apollo
::
c
yber
::
common
::
GetProtoFromFile
(
FLAGS_navigator_config_filename
,
&
navigator_config
))
{
AERROR
<<
"Failed to parse "
<<
FLAGS_navigator_config_filename
;
return
-
1
;
...
...
modules/monitor/hardware/resource_monitor.cc
浏览文件 @
7cc253a6
...
...
@@ -64,7 +64,7 @@ void ResourceMonitor::UpdateStatus(
status
->
clear_status
();
// Monitor available disk space.
for
(
const
auto
&
disk_space
:
config
.
disk_spaces
())
{
for
(
const
auto
&
path
:
apollo
::
common
::
util
::
Glob
(
disk_space
.
path
()))
{
for
(
const
auto
&
path
:
cyber
::
common
::
Glob
(
disk_space
.
path
()))
{
const
auto
space
=
boost
::
filesystem
::
space
(
path
);
const
int
available_gb
=
static_cast
<
int
>
(
space
.
available
>>
30
);
if
(
available_gb
<
disk_space
.
insufficient_space_error
())
{
...
...
modules/monitor/software/process_monitor.cc
浏览文件 @
7cc253a6
...
...
@@ -27,7 +27,7 @@ DEFINE_string(process_monitor_name, "ProcessMonitor",
"Name of the process monitor."
);
DEFINE_double
(
process_monitor_interval
,
1.5
,
"Process status checking interval
(s)
."
);
"Process status checking interval
in seconds
."
);
namespace
apollo
{
namespace
monitor
{
...
...
@@ -40,10 +40,10 @@ ProcessMonitor::ProcessMonitor()
void
ProcessMonitor
::
RunOnce
(
const
double
current_time
)
{
// Get running processes.
std
::
vector
<
std
::
string
>
running_processes
;
for
(
const
auto
&
cmd_file
:
apollo
::
common
::
util
::
Glob
(
"/proc/*/cmdline"
))
{
for
(
const
auto
&
cmd_file
:
cyber
::
common
::
Glob
(
"/proc/*/cmdline"
))
{
// Get process command string.
std
::
string
cmd_string
;
if
(
apollo
::
common
::
util
::
GetContent
(
cmd_file
,
&
cmd_string
)
&&
if
(
cyber
::
common
::
GetContent
(
cmd_file
,
&
cmd_string
)
&&
!
cmd_string
.
empty
())
{
// In /proc/<PID>/cmdline, the parts are seperated with \0, which will be
// converted back to whitespaces here.
...
...
modules/perception/camera/app/lane_camera_perception.cc
浏览文件 @
7cc253a6
...
...
@@ -23,8 +23,8 @@
#include <utility>
#include <vector>
#include "cyber/common/file.h"
#include "cyber/common/log.h"
#include "modules/common/util/file.h"
#include "modules/perception/base/object.h"
#include "modules/perception/camera/app/debug_info.h"
#include "modules/perception/camera/common/global_config.h"
...
...
@@ -48,7 +48,7 @@ bool LaneCameraPerception::Init(
std
::
string
config_file
=
GetAbsolutePath
(
options
.
root_dir
,
options
.
conf_file
);
config_file
=
GetAbsolutePath
(
work_root
,
config_file
);
CHECK
(
apollo
::
common
::
util
::
GetProtoFromFile
(
CHECK
(
cyber
::
common
::
GetProtoFromFile
(
config_file
,
&
perception_param_
))
<<
"Read config failed: "
;
CHECK
(
inference
::
CudaUtil
::
set_device_id
(
perception_param_
.
gpu_id
()));
...
...
modules/perception/onboard/component/lane_detection_component.cc
浏览文件 @
7cc253a6
...
...
@@ -28,10 +28,10 @@
#include <string>
#include <tuple>
#include "cyber/common/file.h"
#include "cyber/common/log.h"
#include "modules/common/math/math_utils.h"
#include "modules/common/time/time_util.h"
#include "modules/common/util/file.h"
#include "modules/perception/common/perception_gflags.h"
#include "modules/perception/common/sensor_manager/sensor_manager.h"
#include "modules/perception/lib/utils/time_util.h"
...
...
@@ -53,7 +53,7 @@ static int GetGpuId(const camera::CameraPerceptionInitOptions &options) {
std
::
string
config_file
=
GetAbsolutePath
(
options
.
root_dir
,
options
.
conf_file
);
config_file
=
GetAbsolutePath
(
work_root
,
config_file
);
if
(
!
apollo
::
common
::
util
::
GetProtoFromFile
(
config_file
,
&
perception_param
))
{
if
(
!
cyber
::
common
::
GetProtoFromFile
(
config_file
,
&
perception_param
))
{
AERROR
<<
"Read config failed: "
<<
config_file
;
return
-
1
;
}
...
...
modules/planning/integration_tests/planning_test_base.cc
浏览文件 @
7cc253a6
...
...
@@ -20,14 +20,13 @@
#include "cyber/common/log.h"
#include "modules/canbus/proto/chassis.pb.h"
#include "modules/common/adapters/adapter_gflags.h"
#include "modules/localization/proto/localization.pb.h"
#include "modules/perception/proto/traffic_light_detection.pb.h"
#include "modules/planning/common/planning_gflags.h"
#include "modules/prediction/proto/prediction_obstacle.pb.h"
#include "modules/routing/proto/routing.pb.h"
#include "modules/common/adapters/adapter_gflags.h"
#include "modules/planning/common/planning_gflags.h"
namespace
apollo
{
namespace
planning
{
...
...
@@ -163,8 +162,7 @@ void PlanningTestBase::SetUp() {
CHECK
(
FeedTestData
())
<<
"Failed to feed test data"
;
CHECK
(
apollo
::
cyber
::
common
::
GetProtoFromFile
(
FLAGS_planning_config_file
,
&
config_
))
CHECK
(
cyber
::
common
::
GetProtoFromFile
(
FLAGS_planning_config_file
,
&
config_
))
<<
"failed to load planning config file "
<<
FLAGS_planning_config_file
;
CHECK
(
planning_
->
Init
(
config_
).
ok
())
<<
"Failed to init planning module"
;
...
...
@@ -243,17 +241,17 @@ bool PlanningTestBase::RunPlanning(const std::string& test_case_name,
TrimPlanning
(
&
adc_trajectory_
,
no_trajectory_point
);
if
(
FLAGS_test_update_golden_log
)
{
AINFO
<<
"The golden file is regenerated:"
<<
full_golden_path
;
c
ommon
::
util
::
SetProtoToASCIIFile
(
adc_trajectory_
,
full_golden_path
);
c
yber
::
common
::
SetProtoToASCIIFile
(
adc_trajectory_
,
full_golden_path
);
}
else
{
ADCTrajectory
golden_result
;
bool
load_success
=
c
ommon
::
util
::
GetProtoFromASCIIFile
(
full_golden_path
,
&
golden_result
);
c
yber
::
common
::
GetProtoFromASCIIFile
(
full_golden_path
,
&
golden_result
);
TrimPlanning
(
&
golden_result
,
no_trajectory_point
);
if
(
!
load_success
||
!
common
::
util
::
IsProtoEqual
(
golden_result
,
adc_trajectory_
))
{
char
tmp_fname
[
100
]
=
"/tmp/XXXXXX"
;
int
fd
=
mkstemp
(
tmp_fname
);
if
(
!
c
ommon
::
util
::
SetProtoToASCIIFile
(
adc_trajectory_
,
fd
))
{
if
(
!
c
yber
::
common
::
SetProtoToASCIIFile
(
adc_trajectory_
,
fd
))
{
AERROR
<<
"Failed to write to file "
<<
tmp_fname
;
}
AERROR
<<
"found error
\n
diff -y "
<<
tmp_fname
<<
" "
<<
full_golden_path
;
...
...
modules/prediction/pipeline/feature_proto_file_to_model_features.cc
浏览文件 @
7cc253a6
...
...
@@ -138,8 +138,8 @@ void OfflineProcessFeatureProtoFile(
if
(
list_data_for_learning
.
data_for_learning_size
()
<=
0
)
{
ADEBUG
<<
"Skip writing empty data_for_learning."
;
}
else
{
apollo
::
c
ommon
::
util
::
SetProtoToBinaryFile
(
list_data_for_learning
,
output_filename
);
apollo
::
c
yber
::
common
::
SetProtoToBinaryFile
(
list_data_for_learning
,
output_filename
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录