forked from tier4/hesai_pandar
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from tier4/feature/nodelet
Feature/nodelet
- Loading branch information
Showing
68 changed files
with
2,405 additions
and
4,151 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,93 @@ | ||
cmake_minimum_required(VERSION 3.0.2) | ||
project(pandar_driver) | ||
|
||
add_compile_options(-std=c++14) | ||
|
||
|
||
find_package(catkin REQUIRED COMPONENTS | ||
roscpp | ||
roslib | ||
nodelet | ||
pluginlib | ||
pandar_msgs | ||
) | ||
|
||
catkin_package( | ||
INCLUDE_DIRS | ||
include | ||
CATKIN_DEPENDS | ||
pandar_msgs | ||
LIBRARIES | ||
pandar_input | ||
) | ||
|
||
include_directories( | ||
include | ||
${catkin_INCLUDE_DIRS} | ||
) | ||
|
||
# Target | ||
add_library(pandar_input | ||
src/lib/socket_input.cpp | ||
src/lib/pcap_input.cpp | ||
) | ||
target_link_libraries(pandar_input | ||
pcap | ||
${catkin_LIBRARIES} | ||
) | ||
|
||
## add node | ||
add_executable(pandar_driver_node | ||
src/driver/node.cpp | ||
src/driver/pandar_driver.cpp | ||
) | ||
|
||
target_link_libraries(pandar_driver_node | ||
pandar_input | ||
${catkin_LIBRARIES} | ||
) | ||
|
||
## add nodelet | ||
add_library(pandar_driver_nodelet | ||
src/driver/nodelet.cpp | ||
src/driver/pandar_driver.cpp | ||
) | ||
|
||
target_link_libraries(pandar_driver_nodelet | ||
pandar_input | ||
${catkin_LIBRARIES} | ||
) | ||
|
||
|
||
# Install | ||
## executables and libraries | ||
install( | ||
TARGETS | ||
pandar_driver_node | ||
pandar_driver_nodelet | ||
pandar_input | ||
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} | ||
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} | ||
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} | ||
) | ||
|
||
## files | ||
install( | ||
FILES | ||
nodelet_pandar_driver.xml | ||
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} | ||
) | ||
|
||
## project namespaced headers | ||
install( | ||
DIRECTORY | ||
include/${PROJECT_NAME}/ | ||
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} | ||
) | ||
|
||
## directories | ||
install( | ||
DIRECTORY | ||
launch | ||
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} | ||
) |
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,12 @@ | ||
#pragma once | ||
#include <pandar_msgs/PandarPacket.h> | ||
|
||
namespace pandar_driver | ||
{ | ||
class Input | ||
{ | ||
public: | ||
virtual ~Input(){}; | ||
virtual int getPacket(pandar_msgs::PandarPacket* pkt) = 0; | ||
}; | ||
} // namespace pandar_driver |
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,31 @@ | ||
#pragma once | ||
|
||
#include <ros/ros.h> | ||
|
||
namespace pandar_driver | ||
{ | ||
class Input; | ||
class PandarDriver | ||
{ | ||
public: | ||
PandarDriver(ros::NodeHandle node, ros::NodeHandle private_nh); | ||
~PandarDriver(){}; | ||
bool poll(void); | ||
|
||
private: | ||
std::string device_ip_; | ||
int lidar_port_; | ||
int gps_port_; | ||
double scan_phase_; | ||
size_t azimuth_index_; | ||
|
||
std::string model_; | ||
std::string frame_id_; | ||
std::string pcap_path_; | ||
|
||
ros::Publisher pandar_packet_pub_; | ||
std::shared_ptr<Input> input_; | ||
|
||
std::function<bool(size_t)> is_valid_packet_; | ||
}; | ||
} // namespace pandar_driver |
Oops, something went wrong.