generated from tier4/ros2-project-template
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(nebula_ros): combine Hesai wrapper nodes into one
This is step one of the single node refactoring of Nebula. In this step, only the three Hesai wrapper nodes were combined into one, and no optimizations have been done that are made possible by this refactoring. The next step is to do those optimizations (e.g. get rid of unnecessary pointcloud copying).
- Loading branch information
Showing
12 changed files
with
1,476 additions
and
2,034 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
nebula_ros/include/nebula_ros/common/nebula_ros_wrapper_base.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#pragma once | ||
|
||
#include "nebula_common/nebula_common.hpp" | ||
#include "nebula_common/nebula_status.hpp" | ||
|
||
#include <diagnostic_updater/diagnostic_updater.hpp> | ||
#include <rclcpp/rclcpp.hpp> | ||
#include <rclcpp_components/register_node_macro.hpp> | ||
|
||
#include <sensor_msgs/msg/point_cloud2.hpp> | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
namespace nebula | ||
{ | ||
namespace ros | ||
{ | ||
/// @brief Base class for ros wrapper of each sensor driver | ||
class NebulaRosWrapperBase | ||
{ | ||
public: | ||
NebulaRosWrapperBase() = default; | ||
|
||
NebulaRosWrapperBase(NebulaRosWrapperBase && c) = delete; | ||
NebulaRosWrapperBase & operator=(NebulaRosWrapperBase && c) = delete; | ||
NebulaRosWrapperBase(const NebulaRosWrapperBase & c) = delete; | ||
NebulaRosWrapperBase & operator=(const NebulaRosWrapperBase & c) = delete; | ||
|
||
/// @brief Start point cloud streaming (Call CloudInterfaceStart of HwInterface) | ||
/// @return Resulting status | ||
virtual Status StreamStart() = 0; | ||
|
||
/// @brief Stop point cloud streaming (not used) | ||
/// @return Resulting status | ||
virtual Status StreamStop() = 0; | ||
|
||
/// @brief Shutdown (not used) | ||
/// @return Resulting status | ||
virtual Status Shutdown() = 0; | ||
|
||
private: | ||
/// @brief Virtual function for initializing hardware interface ros wrapper | ||
/// @param sensor_configuration SensorConfiguration for this driver | ||
/// @return Resulting status | ||
virtual Status InitializeHwInterface( | ||
const drivers::SensorConfigurationBase & sensor_configuration) = 0; | ||
|
||
/// @brief Virtual function for initializing hardware monitor ros wrapper | ||
/// @param sensor_configuration SensorConfiguration for this driver | ||
/// @return Resulting status | ||
virtual Status InitializeHwMonitor( | ||
const drivers::SensorConfigurationBase & sensor_configuration) = 0; | ||
|
||
/// @brief Virtual function for initializing ros wrapper | ||
/// @param sensor_configuration SensorConfiguration for this driver | ||
/// @param calibration_configuration CalibrationConfiguration for this driver | ||
/// @return Resulting status | ||
virtual Status InitializeCloudDriver( | ||
std::shared_ptr<drivers::SensorConfigurationBase> sensor_configuration, | ||
std::shared_ptr<drivers::CalibrationConfigurationBase> calibration_configuration) = 0; | ||
|
||
/// @brief Point cloud publisher | ||
rclcpp::Publisher<sensor_msgs::msg::PointCloud2>::SharedPtr cloud_pub_; | ||
}; | ||
|
||
} // namespace ros | ||
} // namespace nebula |
106 changes: 0 additions & 106 deletions
106
nebula_ros/include/nebula_ros/hesai/hesai_decoder_ros_wrapper.hpp
This file was deleted.
Oops, something went wrong.
100 changes: 0 additions & 100 deletions
100
nebula_ros/include/nebula_ros/hesai/hesai_hw_interface_ros_wrapper.hpp
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.