26 #include <boost/thread/locks.hpp> 27 #include <boost/thread/shared_mutex.hpp> 28 #include "pcl/point_cloud.h" 29 #include "pcl/point_types.h" 36 #include "modules/drivers/proto/pointcloud.pb.h" 37 #include "modules/localization/proto/localization.pb.h" 80 void RegisterMessageHandlers();
82 void UpdatePointCloud(
83 const std::shared_ptr<drivers::PointCloud> &point_cloud);
85 void FilterPointCloud(pcl::PointCloud<pcl::PointXYZ>::Ptr pcl_ptr);
87 void UpdateLocalizationTime(
88 const std::shared_ptr<apollo::localization::LocalizationEstimate>
90 pcl::PointCloud<pcl::PointXYZ>::Ptr ConvertPCLPointCloud(
91 const std::shared_ptr<drivers::PointCloud> &point_cloud);
93 constexpr
static float kDefaultLidarHeight = 1.91f;
95 std::unique_ptr<cyber::Node> node_;
99 bool enabled_ =
false;
102 std::string point_cloud_str_;
104 std::future<void> async_future_;
105 std::atomic<bool> future_ready_;
108 std::shared_ptr<cyber::Reader<apollo::localization::LocalizationEstimate>>
109 localization_reader_;
110 std::shared_ptr<cyber::Reader<drivers::PointCloud>> point_cloud_reader_;
111 double last_point_cloud_time_ = 0.0;
112 double last_localization_time_ = 0.0;
114 bool enable_voxel_filter_ =
false;
PointCloudUpdater(WebSocketHandler *websocket, SimulationWorldUpdater *sim_world_updater)
Constructor with the websocket handler.
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
static boost::shared_mutex mutex_
Definition: point_cloud_updater.h:77
Some string util functions.
A wrapper around SimulationWorldService and WebSocketHandler to keep pushing SimulationWorld to front...
Definition: simulation_world_updater.h:56
static void LoadLidarHeight(const std::string &file_path)
static float lidar_height_
Definition: point_cloud_updater.h:73
A wrapper around WebSocketHandler to keep pushing PointCloud to frontend via websocket while handling...
Definition: point_cloud_updater.h:51
The WebSocketHandler, built on top of CivetWebSocketHandler, is a websocket handler that handles diff...
Definition: websocket_handler.h:46
void Start()
Starts to push PointCloud to frontend.