25 #include "Eigen/Dense" 26 #include "Eigen/StdVector" 31 #include "modules/drivers/proto/sensor_image.pb.h" 36 #include "modules/perception/camera/app/proto/perception.pb.h" 43 #include "modules/perception/onboard/proto/lane_perception_component.pb.h" 45 #include "modules/perception/proto/motion_service.pb.h" 46 #include "modules/perception/proto/perception_lane.pb.h" 50 typedef std::shared_ptr<apollo::perception::Motion_Service>
54 namespace perception {
63 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
78 void OnReceiveImage(
const std::shared_ptr<apollo::drivers::Image>& in_message,
79 const std::string& camera_name);
83 int InitAlgorithmPlugin();
84 int InitCameraFrames();
85 int InitProjectMatrix();
86 int InitMotionService();
87 int InitCameraListeners();
88 void SetCameraHeightAndPitch();
91 const std::shared_ptr<apollo::drivers::Image const>& in_message,
92 const std::string& camera_name, apollo::common::ErrorCode* error_code,
94 apollo::perception::PerceptionLanes* out_message);
96 int ConvertLaneToCameraLaneline(
98 apollo::perception::camera::CameraLaneLine* camera_laneline);
100 int MakeProtobufMsg(
double msg_timestamp,
const std::string& camera_name,
102 apollo::perception::PerceptionLanes* lanes_msg);
108 std::vector<std::shared_ptr<cyber::Node>> camera_listener_nodes_;
110 std::vector<std::string> camera_names_;
111 std::vector<std::string> input_camera_channel_names_;
114 std::map<std::string, base::SensorInfo> sensor_info_map_;
117 std::map<std::string, float> camera_height_map_;
120 std::map<std::string, float> name_camera_pitch_angle_diff_map_;
123 std::map<std::string, std::string> tf_camera_frame_id_map_;
124 std::map<std::string, std::shared_ptr<TransformWrapper>>
125 camera2world_trans_wrapper_map_;
128 std::map<std::string, std::shared_ptr<camera::DataProvider>>
132 EigenMap<std::string, Eigen::Matrix4d> extrinsic_map_;
133 EigenMap<std::string, Eigen::Matrix3f> intrinsic_map_;
139 std::unique_ptr<camera::LaneCameraPerception> camera_lane_pipeline_;
142 int frame_capacity_ = 20;
144 EigenVector<camera::CameraFrame> camera_frames_;
147 int image_width_ = 1920;
148 int image_height_ = 1080;
149 int image_channel_num_ = 3;
150 int image_data_size_ = -1;
153 float default_camera_pitch_ = 0.f;
154 float default_camera_height_ = 1.6f;
157 bool enable_undistortion_ =
false;
159 double timestamp_offset_ = 0.0;
161 bool enable_visualization_ =
false;
162 std::string visual_debug_folder_;
163 std::string visual_camera_;
165 std::string output_lanes_channel_name_;
168 double pitch_diff_ = 0.0;
170 double last_timestamp_ = 0.0;
171 double ts_diff_ = 1.0;
173 std::shared_ptr<apollo::cyber::Writer<apollo::perception::PerceptionLanes>>
177 const int motion_buffer_size_ = 100;
180 bool write_visual_img_;
181 static FunInfoType init_func_arry_[];
Definition: lane_struct.h:69
std::vector< EigenType, Eigen::aligned_allocator< EigenType > > EigenVector
Definition: eigen_defs.h:32
Definition: camera_frame.h:33
LaneDetectionComponent()
Definition: lane_detection_component.h:66
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
Eigen::Matrix4d Matrix4d
Definition: base_map_fwd.h:32
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: visualizer.h:39
Definition: lane_detection_component.h:61
~LaneDetectionComponent()
Eigen::Matrix4d MotionType
Definition: lane_detection_component.h:57
std::shared_ptr< MotionBuffer > MotionBufferPtr
Definition: object_supplement.h:203
FunctionInfo< LaneDetectionComponent > FunInfoType
Definition: lane_detection_component.h:59
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
CYBER_REGISTER_COMPONENT(CameraObstacleDetectionComponent)
LaneDetectionComponent & operator=(const LaneDetectionComponent &)=delete
std::shared_ptr< apollo::perception::Motion_Service > MotionServiceMsgType
Definition: lane_detection_component.h:51