minimum_sick_scan_api_client.cpp
Go to the documentation of this file.
1 #include <chrono>
2 #include <iostream>
3 #include <thread>
4 
6 
7 // Implement a callback to process pointcloud messages
9 {
10  std::cout << "C++ PointCloudMsgCb: " << msg->width << " x " << msg->height << " pointcloud message received" << std::endl; // data processing to be done
11 }
12 
13 int main(int argc, char** argv)
14 {
15  // Create a sick_scan instance and initialize lidar with commandline arguments
16 #ifdef _MSC_VER
17  const char* sick_scan_api_lib = "sick_scan_xd_shared_lib.dll";
18 #else
19  const char* sick_scan_api_lib = "libsick_scan_xd_shared_lib.so";
20 #endif
21  SickScanApiLoadLibrary(sick_scan_api_lib);
22  SickScanApiHandle apiHandle = SickScanApiCreate(argc, argv);
23  SickScanApiInitByCli(apiHandle, argc, argv);
24 
25  // Register for pointcloud messages
27 
28  // Run application or main loop
29  // getchar();
30  std::this_thread::sleep_for(std::chrono::seconds(15));
31  // std::this_thread::sleep_for(std::chrono::hours(24));
32 
33  // Close lidar and release sick_scan api
35  SickScanApiClose(apiHandle);
36  SickScanApiRelease(apiHandle);
38 }
msg
msg
SickScanApiDeregisterCartesianPointCloudMsg
int32_t SickScanApiDeregisterCartesianPointCloudMsg(SickScanApiHandle apiHandle, SickScanPointCloudMsgCallback callback)
Definition: api_impl.cpp:892
SickScanApiInitByCli
int32_t SickScanApiInitByCli(SickScanApiHandle apiHandle, int argc, char **argv)
Definition: api_impl.cpp:765
SickScanApiUnloadLibrary
int32_t SICK_SCAN_XD_API_CALLING_CONVENTION SickScanApiUnloadLibrary()
Definition: sick_scan_xd_api_wrapper.c:234
main
int main(int argc, char **argv)
Definition: minimum_sick_scan_api_client.cpp:13
SickScanApiLoadLibrary
int32_t SICK_SCAN_XD_API_CALLING_CONVENTION SickScanApiLoadLibrary(const char *library_filepath)
Definition: sick_scan_xd_api_wrapper.c:218
SickScanApiRelease
int32_t SickScanApiRelease(SickScanApiHandle apiHandle)
Definition: api_impl.cpp:674
SickScanApiClose
int32_t SickScanApiClose(SickScanApiHandle apiHandle)
Definition: api_impl.cpp:830
sick_scan_api.h
customizedPointCloudMsgCb
void customizedPointCloudMsgCb(SickScanApiHandle apiHandle, const SickScanPointCloudMsg *msg)
Definition: minimum_sick_scan_api_client.cpp:8
SickScanPointCloudMsgType
Definition: sick_scan_api.h:137
SickScanApiHandle
void * SickScanApiHandle
Definition: sick_scan_api.h:456
SickScanApiCreate
SickScanApiHandle SickScanApiCreate(int argc, char **argv)
Definition: api_impl.cpp:637
ROS::seconds
double seconds(ROS::Duration duration)
Definition: ros_wrapper.cpp:180
SickScanApiRegisterCartesianPointCloudMsg
int32_t SickScanApiRegisterCartesianPointCloudMsg(SickScanApiHandle apiHandle, SickScanPointCloudMsgCallback callback)
Definition: api_impl.cpp:868


sick_scan_xd
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Fri Oct 25 2024 02:47:09