13#include <pcl/pcl_exports.h>
14#include <pcl/console/print.h>
16#include <pcl/io/grabber.h>
18#include <pcl/point_cloud.h>
19#include <boost/asio.hpp>
77 TimGrabber (
const boost::asio::ip::address& ipAddress,
const std::uint16_t port);
115 constexpr static
float angle_start_ = - 1.0 *
M_PI / 4.0;
116 constexpr static
float angle_range_ = 2.0 *
M_PI * 3.0 / 4.0;
120 std::vector<
float> cos_dynamic_lookup_table_;
121 std::vector<
float> sin_dynamic_lookup_table_;
123 std::array<
char, 4000> received_packet_;
125 std::istringstream iss_;
127 std::
size_t amount_of_data_ = 811;
128 std::vector<
float> distances_;
130 boost::asio::ip::tcp::endpoint tcp_endpoint_;
131 boost::asio::io_context tim_io_service_;
132 boost::asio::ip::tcp::socket tim_socket_;
134 unsigned int wait_time_milliseconds_ = 0;
137 mutable std::mutex frequency_mutex_;
139 std::thread grabber_thread_;
140 bool is_running_ = false;
146 getFramesPerSecond () const override;
149 buildLookupTables ();
153 isValidPacket () const;
160 parsePacketHeader (std::
string const& header);
162 parsePacketBody (std::
string const& body);
A helper class to measure frequency of a certain event.
Grabber()=default
Default ctor.
PointCloud represents the base class in PCL for storing collections of 3D points.
shared_ptr< const PointCloud< PointT > > ConstPtr
void stop() override
For devices that are streaming, the streams are stopped.
void processTimPacket(std::string const &packet)
TimGrabber(const boost::asio::ip::address &ipAddress, const std::uint16_t port)
pcl::PointCloud< pcl::PointXYZ >::Ptr point_cloud_xyz_ptr_
void start() override
For devices that are streaming, the streams are started by calling this method.
void updateLookupTables()
std::string getName() const override
returns the name of the concrete subclass.
~TimGrabber() noexcept override
void(const pcl::PointCloud< pcl::PointXYZ >::ConstPtr &) sig_cb_sick_tim_scan_point_cloud_xyz
boost::signals2::signal< sig_cb_sick_tim_scan_point_cloud_xyz > * point_cloud_xyz_signal_
bool isRunning() const override
Indicates whether the grabber is streaming or not.
Defines all the PCL implemented PointT point type structures.
Define methods for measuring time spent in code blocks.
A point structure representing Euclidean xyz coordinates.