提交 665f765f 编写于 作者: X xiaohuitu 提交者: Jiangtao Hu

perception: fix export_sensor_data bug and fix visualizing first frame bug

上级 ad8e8e17
......@@ -46,11 +46,6 @@ bool OpenglVisualizer::Init() {
}
void OpenglVisualizer::Render(const FrameContent &content) {
Eigen::Vector3d camera_world_pos(
camera_center_world_.x, camera_center_world_.y, camera_center_world_.z);
Eigen::Vector3d camera_scene_center(view_point_world_.x, view_point_world_.y,
view_point_world_.z);
Eigen::Vector3d camera_up_vector(up_world_.x, up_world_.y, up_world_.z);
opengl_vs_->SetCameraPara(
Eigen::Vector3d(camera_center_world_.x, camera_center_world_.y,
camera_center_world_.z),
......
......@@ -44,7 +44,7 @@ ObstacleShowType GetObstacleShowType(const std::string& show_type_string) {
}
}
ObstaclePerception::ObstaclePerception() {}
ObstaclePerception::ObstaclePerception() : lidar_pose_inited_(false) {}
ObstaclePerception::~ObstaclePerception() {}
......@@ -140,6 +140,7 @@ bool ObstaclePerception::Process(SensorRawFrame* frame,
if (obstacle_show_type_ == SHOW_LIDAR) {
frame_content_.SetTrackedObjects(sensor_objects->objects);
}
lidar_pose_inited_ = true;
}
} else if (frame->sensor_type_ == RADAR) {
/// radar obstacle detection
......@@ -190,9 +191,11 @@ bool ObstaclePerception::Process(SensorRawFrame* frame,
return true;
}
}
if (lidar_pose_inited_) {
frame_visualizer_->UpdateCameraSystem(&frame_content_);
frame_visualizer_->Render(frame_content_);
}
}
return true;
}
......
......@@ -58,6 +58,7 @@ class ObstaclePerception {
std::unique_ptr<OpenglVisualizer> frame_visualizer_ = nullptr;
ObstacleShowType obstacle_show_type_;
FrameContent frame_content_;
bool lidar_pose_inited_;
DISALLOW_COPY_AND_ASSIGN(ObstaclePerception);
}; // class ObstaclePerception
......
......@@ -3,81 +3,16 @@
--config_manager_path=conf/config_manager.config
####################################################################
# Flags from obstacle/lidar/test/offline_lidar_perception_test.cpp
# Flags from tool/export_sensor_data/export_sensor_data.cc
# pcd path
# type: string
# default: /apollo/data/pcd/
--pcd_path=/apollo/data/pcd/
# default: /apollo/data/lidar/
--lidar_path=/apollo/data/lidar/
# pose path
# radar path
# type: string
# default: /apollo/data/pose/
--pose_path=/apollo/data/pose/
# output path
# type: string
# default: /apollo/data/output/
--save_obstacles=false
--output_path=/apollo/data/output/
# enable visualization
# type: bool
# default: true
--enable_visualization=true
####################################################################
# Flags from obstacle/onboard/hdmap_input.cc
# roi distance of car center
# type: double
# default: 60.0
--map_radius=60.0
# step for sample road boundary points
# type: int32
# default: 1
--map_sample_step=1
--flagfile=modules/common/data/global_flagfile.txt
####################################################################
# Flags from obstacle/onboard/lidar_process.cc
# enable hdmap input for roi filter
# type: bool
# default: false
--enable_hdmap_input=true
# roi filter before GroundDetector.
# type: string
# candidate: DummyROIFilter, HdmapROIFilter
--onboard_roi_filter=HdmapROIFilter
# the segmentation algorithm for onboard
# type: string
# candidate: DummySegmentation, CNNSegmentation
--onboard_segmentor=CNNSegmentation
# the object build algorithm for onboard
# type: string
# candidate: DummyObjectBuilder, MinBoxObjectBuilder
--onboard_object_builder=MinBoxObjectBuilder
# the tracking algorithm for onboard
# type: string
# candidate: DummyTracker, HmObjectTracker
--onboard_tracker=HmObjectTracker
--onboard_radar_detector=ModestRadarDetector
# the perception module's output topic name.
# type: string
# default: perception_obstacle
--obstacle_module_name=perception_obstacle
# Query Ros TF timeout in ms. ros::Duration time.
# type: int
# default: 10
--tf2_buff_in_ms=10
# default: /apollo/data/radar/
--radar_path=/apollo/data/radar/
# ros TF2 quary frame id. tf2_buffer.lookupTransform.
# type: string
......@@ -89,4 +24,12 @@
# default: velodyne64
--lidar_tf2_child_frame_id=velodyne64
--v=4
# radar tf2 frame_id
# type: string
# default: novatel
--radar_tf2_frame_id=novatel
# radar tf2 child frame id
# type: string
# default: radar
--radar_tf2_child_frame_id=radar
......@@ -101,7 +101,7 @@ void ExportSensorData::WriteVelocityInfo(const std::string &file_pre,
AINFO << "Failed to write velocity.";
}
fout << std::setprecision(16) << seq_num << " " << timestamp << " "
<< velocity(0) << " " << velocity(1) << " " << velocity(2);
<< velocity(0) << " " << velocity(1) << " " << velocity(2) << std::endl;
fout.close();
}
......
......@@ -7,13 +7,13 @@
# /offline_sequential_obstacle_perception_test.cc
# lidar data path
# type: string
# default: ./modules/perception/tool/export_sensor_data/lidar/
--lidar_path=./modules/perception/tool/export_sensor_data/lidar/
# default: /apollo/data/lidar/
--lidar_path=/apollo/data/lidar/
# radar data path
# type: string
# default: ./modules/perception/tool/export_sensor_data/radar/
--radar_path=./modules/perception/tool/export_sensor_data/radar/
# default: /apollo/data/radar/
--radar_path=/apollo/data/radar/
# the radar detector for onboard
# type: string
......
......@@ -29,10 +29,8 @@
#include "pcl/io/pcd_io.h"
DECLARE_string(flagfile);
DEFINE_string(lidar_path, "./modules/perception/tool/export_sensor_data/lidar/",
"lidar path");
DEFINE_string(radar_path, "./modules/perception/tool/export_sensor_data/radar/",
"radar path");
DEFINE_string(lidar_path, "/apollo/data/lidar/", "lidar path");
DEFINE_string(radar_path, "/apollo/data/radar/", "radar path");
namespace apollo {
namespace perception {
......@@ -185,6 +183,7 @@ class SequentialPerceptionTest {
<< "Pass file: " << file_path;
return false;
}
AINFO << "Process radar";
/// read pose and timestamp
Eigen::Matrix4d pose;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册