23 #include "modules/drivers/proto/sensor_image.pb.h" 24 #include "modules/perception/camera/app/proto/perception.pb.h" 25 #include "modules/perception/onboard/proto/fusion_camera_detection_component.pb.h" 26 #include "modules/perception/proto/motion_service.pb.h" 27 #include "modules/perception/proto/perception_camera.pb.h" 28 #include "modules/perception/proto/perception_obstacle.pb.h" 44 typedef std::shared_ptr<apollo::perception::Motion_Service>
50 namespace perception {
55 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
67 void OnReceiveImage(
const std::shared_ptr<apollo::drivers::Image>& in_message,
68 const std::string& camera_name);
73 int InitAlgorithmPlugin();
74 int InitCameraFrames();
75 int InitProjectMatrix();
76 int InitCameraListeners();
77 int InitMotionService();
78 void SetCameraHeightAndPitch();
82 const std::shared_ptr<apollo::drivers::Image const>& in_message,
83 const std::string& camera_name, apollo::common::ErrorCode* error_code,
85 apollo::perception::PerceptionObstacles* out_message);
87 int MakeProtobufMsg(
double msg_timestamp,
int seq_num,
88 const std::vector<base::ObjectPtr>& objects,
89 const std::vector<base::LaneLine>& lane_objects,
90 const apollo::common::ErrorCode error_code,
91 apollo::perception::PerceptionObstacles* obstacles);
94 apollo::perception::PerceptionObstacle* pb_msg);
96 int ConvertObjectToCameraObstacle(
98 apollo::perception::camera::CameraObstacle* camera_obstacle);
100 int ConvertLaneToCameraLaneline(
102 apollo::perception::camera::CameraLaneLine* camera_laneline);
104 int MakeCameraDebugMsg(
105 double msg_timestamp,
const std::string& camera_name,
107 apollo::perception::camera::CameraDebug* camera_debug_msg);
113 std::vector<std::shared_ptr<cyber::Node>> camera_listener_nodes_;
115 std::vector<std::string> camera_names_;
116 std::vector<std::string> input_camera_channel_names_;
119 std::map<std::string, base::SensorInfo> sensor_info_map_;
122 std::map<std::string, float> camera_height_map_;
126 std::map<std::string, float> name_camera_pitch_angle_diff_map_;
129 std::map<std::string, std::string> tf_camera_frame_id_map_;
130 std::map<std::string, std::shared_ptr<TransformWrapper>>
131 camera2world_trans_wrapper_map_;
134 std::map<std::string, std::shared_ptr<camera::DataProvider>>
138 EigenMap<std::string, Eigen::Matrix4d> extrinsic_map_;
139 EigenMap<std::string, Eigen::Matrix3f> intrinsic_map_;
145 std::unique_ptr<camera::ObstacleDetectionCamera> camera_obstacle_pipeline_;
148 int frame_capacity_ = 20;
150 EigenVector<camera::CameraFrame> camera_frames_;
153 int image_width_ = 1920;
154 int image_height_ = 1080;
155 int image_channel_num_ = 3;
156 int image_data_size_ = -1;
159 float default_camera_pitch_ = 0.f;
160 float default_camera_height_ = 1.6f;
163 bool enable_undistortion_ =
false;
165 double timestamp_offset_ = 0.0;
167 std::string prefused_channel_name_;
169 bool enable_visualization_ =
false;
170 std::string camera_perception_viz_message_channel_name_;
171 std::string visual_debug_folder_;
172 std::string visual_camera_;
174 bool output_final_obstacles_ =
false;
175 std::string output_obstacles_channel_name_;
177 bool output_camera_debug_msg_ =
false;
178 std::string camera_debug_channel_name_;
181 double pitch_diff_ = 0.0;
183 double last_timestamp_ = 0.0;
184 double ts_diff_ = 1.0;
190 std::shared_ptr<apollo::cyber::Writer<SensorFrameMessage>>
193 std::shared_ptr<apollo::cyber::Writer<CameraPerceptionVizMessage>>
198 camera_debug_writer_;
202 const int motion_buffer_size_ = 100;
205 bool enable_cipv_ =
false;
206 std::unique_ptr<camera::BaseCipv> cipv_;
208 std::string cipv_name_;
212 bool write_visual_img_;
Definition: lane_struct.h:69
CameraObstacleDetectionComponent & operator=(const CameraObstacleDetectionComponent &)=delete
std::vector< EigenType, Eigen::aligned_allocator< EigenType > > EigenVector
Definition: eigen_defs.h:32
~CameraObstacleDetectionComponent()
Definition: camera_frame.h:33
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Definition: base_camera_perception.h:28
std::map< T, EigenType, std::less< T >, Eigen::aligned_allocator< std::pair< const T, EigenType > >> EigenMap
Definition: eigen_defs.h:36
Definition: inner_component_messages.h:49
Definition: camera_obstacle_detection_component.h:53
Definition: visualizer.h:39
CameraObstacleDetectionComponent()
Definition: camera_obstacle_detection_component.h:58
void OnReceiveImage(const std::shared_ptr< apollo::drivers::Image > &in_message, const std::string &camera_name)
std::shared_ptr< MotionBuffer > MotionBufferPtr
Definition: object_supplement.h:203
std::shared_ptr< apollo::perception::Motion_Service > MotionServiceMsgType
Definition: camera_obstacle_detection_component.h:45
Eigen::Matrix3d Matrix3d
Definition: base_map_fwd.h:33
Definition: base_camera_perception.h:34
The Component can process up to four channels of messages. The message type is specified when the com...
Definition: component.h:58
Definition: base_cipv.h:35
CYBER_REGISTER_COMPONENT(CameraObstacleDetectionComponent)
std::shared_ptr< Object > ObjectPtr
Definition: object.h:123