38 #ifndef _FX8_DRIVER_H_ 39 #define _FX8_DRIVER_H_ 43 #include <dynamic_reconfigure/server.h> 47 #include <boost/thread.hpp> 50 #include <infinisoleil/FX8Config.h> 71 typedef std::pair<ros::Time, std::string>
ErrorInfo;
152 FX8SensorInfo* sensor_info, FX8XyData*
xy_data);
199 sensor_msgs::ImagePtr range_msg, sensor_msgs::ImagePtr ir_msg, sensor_msgs::PointCloud2Ptr point_cloud_msg,
200 unsigned char surface_number);
210 unsigned short* range,
unsigned short* intensity);
229 void addDiagnostics(
const unsigned char* error_data,
size_t size);
288 #endif // _FX8_DRIVER_H_ boost::mutex mutex_scan_
Mutex for scan data.
fx8_xy_data_surface FX8XyDataSurface
Surface of device xy data.
Struct of fx8 information.
fx8_sensor_info FX8SensorInfo
Sensor information.
FX8Scan Scan
Scan data of FX8.
std::vector< ErrorInfo > error_info_
Error information of FX8.
ScanDataPackets scan_data
Scan data.
sensor_msgs::ImagePtr createRangeImageMessage()
Create message for range_image topic.
dynamic_reconfigure::Server< infinisoleil::FX8Config > ReconfigureServer
Dynamic reconfigure server.
fx8_handle FX8Handle
Device handle.
void shutdownDevice()
Shut down device.
virtual ~FX8DriverNodelet()
Destructor.
void extractRangeAndIntensityFromScanData(int index, const unsigned char *scan_data, unsigned short *range, unsigned short *intensity)
Extract range and intensity data from scan data packets.
std::vector< unsigned char > ScanDataPackets
Received FX8 scan data packets.
sensor_msgs::ImagePtr createIRImageMessage()
Create message for ir_image topic.
boost::shared_ptr< TopicDiagnostic > TopicDiagnosticPtr
Shared pointer of topic diagnostic.
FX8Info Config
Configurations of FX8.
void shutdownReconfigureServer()
Shut down reconfigure server.
std::vector< ReceivedErrorCodePackets > error_code_
Received error code from FX8.
void addDiagnostics(const unsigned char *error_data, size_t size)
Add obtained error data.
TopicDiagnosticPtr point_cloud_diagnostic_frequency_
Topic diagnostic for point cloud.
static void receiveScanDataCallback(const unsigned char *scan_data, size_t size, void *user_data)
Receive FX8 scan data.
fx8_xy_data_element FX8XyDataElement
Element of device xy data.
ros::Publisher ir_publisher_
Publisher of IR image.
std::string range_frame_id
Range frame id.
Config config_
Configurations of FX8.
boost::shared_ptr< diagnostic_updater::Updater > diagnostic_updater_
Diagnostic updater.
diagnostic_updater::HeaderlessTopicDiagnostic TopicDiagnostic
Topic diagnostic.
ros::Publisher point_cloud_publisher_
Publisher of point cloud.
FX8Handle device_
Handle of FX8.
void reconfigureFX8Callback(FX8Config config, uint32_t level)
Reconfigure FX8.
FX8XyData xy_data
FX8 xy data.
std::pair< ros::Time, std::vector< unsigned char > > ReceivedErrorCodePackets
Received FX8 error code.
bool setDeviceMeasureMode(const FX8Handle device, const FX8MeasureMode measure_mode, FX8SensorInfo *sensor_info, FX8XyData *xy_data)
Set measure mode of FX8.
void spin()
Spin driver thread.
void fillDiagnosticStatusByErrorInfo(diagnostic_updater::DiagnosticStatusWrapper &status)
Fill diagnostic status by error information of FX8.
std::string point_cloud_frame_id
Point cloud frame id.
FX8DriverNodelet()
Constructer.
boost::mutex mutex_diagnostics_
Mutex for diagnostics.
FX8SensorInfo sensor_info
Sensor information.
ros::Time latest_update_time_
Timestamp for topics.
static void receiveErrorCodeCallback(const unsigned char *error_data, size_t size, void *user_data)
Receive FX8 Error code.
virtual void onInit()
Initialize FX8 driver.
sensor_msgs::PointCloud2Ptr createPointCloudMessage()
Create message for point_cloud topic.
fx8_measure_mode FX8MeasureMode
Device measure mode.
Scan scan_
Scan data from FX8.
fx8_bool FX8Bool
Boolean of libfx8.
void driverThreadFunc()
FX8 driver thread.
boost::thread driver_thread_
FX8 driver thread.
bool device_running_
Flag of running device.
int receive_timeout
Receive timeout.
std::string ir_frame_id
IR frame id.
bool initializeDevice()
Initialize and connect to FX8.
void publishScanData(const unsigned char *scan_data, size_t size)
Publish scan data.
void fillDiagnosticStatusByReceivedErrorCode(diagnostic_updater::DiagnosticStatusWrapper &status)
Fill diagnostic status by received error code of FX8.
TopicDiagnosticPtr ir_image_diagnostic_frequency_
Topic diagnostic for IR image.
void setMessageData(sensor_msgs::ImagePtr range_msg, sensor_msgs::ImagePtr ir_msg, sensor_msgs::PointCloud2Ptr point_cloud_msg, unsigned char surface_number)
Set data of range image, IR image and point cloud.
Namespace containing driver.
void initializeReconfigureServer(ros::NodeHandle param_nh)
Initialize reconfigure server.
void updateTime()
Update timestamp.
std::pair< ros::Time, std::string > ErrorInfo
Error information.
void initializeNodelet()
Initialize nodelet.
boost::shared_ptr< ReconfigureServer > reconfigure_server_
Server for reconfiguration.
void outputDeviceParameters()
Output FX8 parameters to parameter server.
double target_frequency_
Target frame rate of topics.
int connect_timeout
Connect timeout.
bool startScan()
Start FX8 scan.
void setupDiagnostics()
Setup diagnostics.
TopicDiagnosticPtr range_image_diagnostic_frequency_
Topic diagnostic for range image.
void shutdownNodelet()
Shut down nodelet.
bool diagnostics_enable_
Flag to enable diagnostics.
ros::Publisher range_publisher_
Publisher of range image.
fx8_xy_data FX8XyData
Device xy data.
int send_timeout
Send timeout.
FX8 driver nodelet class.
bool getDeviceSensorInfo(const FX8Handle device, FX8SensorInfo *sensor_info, FX8XyData *xy_data)
Get FX8SensorInfo and set these.