Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions livox_ros2_driver/livox_ros2_driver/lddc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ uint32_t Lddc::PublishPointcloudData(LidarDataQueue *queue, uint32_t packet_num,
return 0;
}

PointCloud cloud;
livox_ros::PointCloud cloud;
cloud.header.frame_id.assign(frame_id_);
cloud.height = 1;
cloud.width = 0;
Expand Down Expand Up @@ -316,11 +316,13 @@ uint32_t Lddc::PublishPointcloudData(LidarDataQueue *queue, uint32_t packet_num,
last_timestamp = timestamp;
}

rclcpp::Publisher<PointCloud>::SharedPtr publisher =
std::dynamic_pointer_cast<rclcpp::Publisher<PointCloud>>
rclcpp::Publisher<sensor_msgs::msg::PointCloud2>::SharedPtr publisher =
std::dynamic_pointer_cast<rclcpp::Publisher<sensor_msgs::msg::PointCloud2>>
(GetCurrentPublisher(handle));
if (kOutputToRos == output_type_) {
publisher->publish(cloud);
sensor_msgs::msg::PointCloud2 msg;
pcl::toROSMsg(cloud, msg);
publisher->publish(msg);
} else {
#if 0
if (bag_) {
Expand Down Expand Up @@ -586,7 +588,7 @@ std::shared_ptr<rclcpp::PublisherBase> Lddc::CreatePublisher(uint8_t msg_type,
sensor_msgs::msg::PointCloud2>(topic_name, queue_size);
} else if (kLivoxCustomMsg == msg_type) {
RCLCPP_INFO(cur_node_->get_logger(),
"%s publish use livox custom format", topic_name);
"%s publish use livox custom format", topic_name.c_str());
return cur_node_->create_publisher<
livox_interfaces::msg::CustomMsg>(topic_name, queue_size);
}
Expand Down
1 change: 1 addition & 0 deletions livox_ros2_driver/timesync/timesync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <thread>
#include <chrono>
#include <functional>
#include <cstdio>

namespace livox_ros {
using namespace std;
Expand Down
1 change: 1 addition & 0 deletions livox_ros2_driver/timesync/timesync.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#define TIMESYNC_TIMESYNC_H_

#include <thread>
#include <memory>
#include "comm_protocol.h"
#include "comm_device.h"
#include "user_uart.h"
Expand Down