Classes | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes
infinisoleil::FX8DriverNodelet Class Reference

FX8 driver nodelet class. More...

#include <fx8_driver_nodelet.h>

Inheritance diagram for infinisoleil::FX8DriverNodelet:
Inheritance graph
[legend]

List of all members.

Classes

struct  FX8Info
 Struct of fx8 information. More...
struct  FX8Scan
 Struct of fx8 scan data. More...

Public Member Functions

 FX8DriverNodelet ()
 Constructer.
virtual ~FX8DriverNodelet ()
 Destructor.

Private Types

typedef FX8Info Config
 Configurations of FX8.
typedef std::pair< ros::Time,
std::string > 
ErrorInfo
 Error information.
typedef fx8_bool FX8Bool
 Boolean of libfx8.
typedef fx8_handle FX8Handle
 Device handle.
typedef fx8_measure_mode FX8MeasureMode
 Device measure mode.
typedef fx8_sensor_info FX8SensorInfo
 Sensor information.
typedef fx8_xy_data FX8XyData
 Device xy data.
typedef fx8_xy_data_element FX8XyDataElement
 Element of device xy data.
typedef fx8_xy_data_surface FX8XyDataSurface
 Surface of device xy data.
typedef std::pair< ros::Time,
std::vector< unsigned char > > 
ReceivedErrorCodePackets
 Received FX8 error code.
typedef
dynamic_reconfigure::Server
< infinisoleil::FX8Config > 
ReconfigureServer
 Dynamic reconfigure server.
typedef FX8Scan Scan
 Scan data of FX8.
typedef std::vector< unsigned
char > 
ScanDataPackets
 Received FX8 scan data packets.
typedef
diagnostic_updater::HeaderlessTopicDiagnostic 
TopicDiagnostic
 Topic diagnostic.
typedef boost::shared_ptr
< TopicDiagnostic
TopicDiagnosticPtr
 Shared pointer of topic diagnostic.

Private Member Functions

void addDiagnostics (const unsigned char *error_data, size_t size)
 Add obtained error data.
sensor_msgs::ImagePtr createIRImageMessage ()
 Create message for ir_image topic.
sensor_msgs::PointCloud2Ptr createPointCloudMessage ()
 Create message for point_cloud topic.
sensor_msgs::ImagePtr createRangeImageMessage ()
 Create message for range_image topic.
void driverThreadFunc ()
 FX8 driver thread.
void extractRangeAndIntensityFromScanData (int index, const unsigned char *scan_data, unsigned short *range, unsigned short *intensity)
 Extract range and intensity data from scan data packets.
void fillDiagnosticStatusByErrorInfo (diagnostic_updater::DiagnosticStatusWrapper &status)
 Fill diagnostic status by error information of FX8.
void fillDiagnosticStatusByReceivedErrorCode (diagnostic_updater::DiagnosticStatusWrapper &status)
 Fill diagnostic status by received error code of FX8.
bool getDeviceSensorInfo (const FX8Handle device, FX8SensorInfo *sensor_info, FX8XyData *xy_data)
 Get FX8SensorInfo and set these.
bool initializeDevice ()
 Initialize and connect to FX8.
void initializeNodelet ()
 Initialize nodelet.
void initializeReconfigureServer (ros::NodeHandle param_nh)
 Initialize reconfigure server.
virtual void onInit ()
 Initialize FX8 driver.
void outputDeviceParameters ()
 Output FX8 parameters to parameter server.
void publishScanData (const unsigned char *scan_data, size_t size)
 Publish scan data.
void reconfigureFX8Callback (FX8Config config, uint32_t level)
 Reconfigure FX8.
bool setDeviceMeasureMode (const FX8Handle device, const FX8MeasureMode measure_mode, FX8SensorInfo *sensor_info, FX8XyData *xy_data)
 Set measure mode of FX8.
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.
void setupDiagnostics ()
 Setup diagnostics.
void shutdownDevice ()
 Shut down device.
void shutdownNodelet ()
 Shut down nodelet.
void shutdownReconfigureServer ()
 Shut down reconfigure server.
void spin ()
 Spin driver thread.
bool startScan ()
 Start FX8 scan.
void updateTime ()
 Update timestamp.

Static Private Member Functions

static void receiveErrorCodeCallback (const unsigned char *error_data, size_t size, void *user_data)
 Receive FX8 Error code.
static void receiveScanDataCallback (const unsigned char *scan_data, size_t size, void *user_data)
 Receive FX8 scan data.

Private Attributes

Config config_
 Configurations of FX8.
FX8Handle device_
 Handle of FX8.
bool device_running_
 Flag of running device.
boost::shared_ptr
< diagnostic_updater::Updater
diagnostic_updater_
 Diagnostic updater.
bool diagnostics_enable_
 Flag to enable diagnostics.
boost::thread driver_thread_
 FX8 driver thread.
std::vector
< ReceivedErrorCodePackets
error_code_
 Received error code from FX8.
std::vector< ErrorInfoerror_info_
 Error information of FX8.
TopicDiagnosticPtr ir_image_diagnostic_frequency_
 Topic diagnostic for IR image.
ros::Publisher ir_publisher_
 Publisher of IR image.
ros::Time latest_update_time_
 Timestamp for topics.
boost::mutex mutex_diagnostics_
 Mutex for diagnostics.
boost::mutex mutex_scan_
 Mutex for scan data.
TopicDiagnosticPtr point_cloud_diagnostic_frequency_
 Topic diagnostic for point cloud.
ros::Publisher point_cloud_publisher_
 Publisher of point cloud.
TopicDiagnosticPtr range_image_diagnostic_frequency_
 Topic diagnostic for range image.
ros::Publisher range_publisher_
 Publisher of range image.
boost::shared_ptr
< ReconfigureServer
reconfigure_server_
 Server for reconfiguration.
Scan scan_
 Scan data from FX8.
double target_frequency_
 Target frame rate of topics.

Detailed Description

FX8 driver nodelet class.

Definition at line 59 of file fx8_driver_nodelet.h.


Member Typedef Documentation

Configurations of FX8.

Definition at line 100 of file fx8_driver_nodelet.h.

typedef std::pair<ros::Time, std::string> infinisoleil::FX8DriverNodelet::ErrorInfo [private]

Error information.

Definition at line 71 of file fx8_driver_nodelet.h.

typedef fx8_bool infinisoleil::FX8DriverNodelet::FX8Bool [private]

Boolean of libfx8.

Definition at line 63 of file fx8_driver_nodelet.h.

typedef fx8_handle infinisoleil::FX8DriverNodelet::FX8Handle [private]

Device handle.

Definition at line 61 of file fx8_driver_nodelet.h.

typedef fx8_measure_mode infinisoleil::FX8DriverNodelet::FX8MeasureMode [private]

Device measure mode.

Definition at line 62 of file fx8_driver_nodelet.h.

typedef fx8_sensor_info infinisoleil::FX8DriverNodelet::FX8SensorInfo [private]

Sensor information.

Definition at line 64 of file fx8_driver_nodelet.h.

typedef fx8_xy_data infinisoleil::FX8DriverNodelet::FX8XyData [private]

Device xy data.

Definition at line 67 of file fx8_driver_nodelet.h.

typedef fx8_xy_data_element infinisoleil::FX8DriverNodelet::FX8XyDataElement [private]

Element of device xy data.

Definition at line 65 of file fx8_driver_nodelet.h.

typedef fx8_xy_data_surface infinisoleil::FX8DriverNodelet::FX8XyDataSurface [private]

Surface of device xy data.

Definition at line 66 of file fx8_driver_nodelet.h.

typedef std::pair<ros::Time, std::vector<unsigned char> > infinisoleil::FX8DriverNodelet::ReceivedErrorCodePackets [private]

Received FX8 error code.

Definition at line 70 of file fx8_driver_nodelet.h.

typedef dynamic_reconfigure::Server<infinisoleil::FX8Config> infinisoleil::FX8DriverNodelet::ReconfigureServer [private]

Dynamic reconfigure server.

Definition at line 68 of file fx8_driver_nodelet.h.

Scan data of FX8.

Definition at line 101 of file fx8_driver_nodelet.h.

typedef std::vector<unsigned char> infinisoleil::FX8DriverNodelet::ScanDataPackets [private]

Received FX8 scan data packets.

Definition at line 69 of file fx8_driver_nodelet.h.

Topic diagnostic.

Definition at line 72 of file fx8_driver_nodelet.h.

Shared pointer of topic diagnostic.

Definition at line 73 of file fx8_driver_nodelet.h.


Constructor & Destructor Documentation

Constructer.

Definition at line 47 of file fx8_driver_nodelet.cpp.

Destructor.

Definition at line 65 of file fx8_driver_nodelet.cpp.


Member Function Documentation

void infinisoleil::FX8DriverNodelet::addDiagnostics ( const unsigned char *  error_data,
size_t  size 
) [private]

Add obtained error data.

Parameters:
[in]error_dataError data from FX8.
[in]sizeSize of error data.

Definition at line 802 of file fx8_driver_nodelet.cpp.

sensor_msgs::ImagePtr infinisoleil::FX8DriverNodelet::createIRImageMessage ( ) [private]

Create message for ir_image topic.

Definition at line 605 of file fx8_driver_nodelet.cpp.

sensor_msgs::PointCloud2Ptr infinisoleil::FX8DriverNodelet::createPointCloudMessage ( ) [private]

Create message for point_cloud topic.

Definition at line 623 of file fx8_driver_nodelet.cpp.

sensor_msgs::ImagePtr infinisoleil::FX8DriverNodelet::createRangeImageMessage ( ) [private]

Create message for range_image topic.

Definition at line 587 of file fx8_driver_nodelet.cpp.

FX8 driver thread.

Definition at line 177 of file fx8_driver_nodelet.cpp.

void infinisoleil::FX8DriverNodelet::extractRangeAndIntensityFromScanData ( int  index,
const unsigned char *  scan_data,
unsigned short *  range,
unsigned short *  intensity 
) [inline, private]

Extract range and intensity data from scan data packets.

Parameters:
[in]indexIndex of scan data packets.
[in]scan_dataScan data.
[out]rangeRange data.
[out]intensityIntensity data.

Definition at line 697 of file fx8_driver_nodelet.cpp.

Fill diagnostic status by error information of FX8.

Parameters:
[in]statusDiagnostic status of FX8.

Definition at line 724 of file fx8_driver_nodelet.cpp.

Fill diagnostic status by received error code of FX8.

Parameters:
[in]statusDiagnostic status of FX8.

Definition at line 746 of file fx8_driver_nodelet.cpp.

bool infinisoleil::FX8DriverNodelet::getDeviceSensorInfo ( const FX8Handle  device,
FX8SensorInfo sensor_info,
FX8XyData xy_data 
) [private]

Get FX8SensorInfo and set these.

Parameters:
[in]deviceFX8 handle.
[out]sensor_infoSensor information of FX8.
[out]xy_dataXY data of FX8.
Returns:
True if FX8SensorInfo is obtained, false if it is not.

Definition at line 405 of file fx8_driver_nodelet.cpp.

Initialize and connect to FX8.

Returns:
True if initialization is succeeded, false if it is not.

Definition at line 211 of file fx8_driver_nodelet.cpp.

Initialize nodelet.

Definition at line 84 of file fx8_driver_nodelet.cpp.

Initialize reconfigure server.

Parameters:
[in]param_nhPrivate node handle of FX8DriverNodelet.

Definition at line 144 of file fx8_driver_nodelet.cpp.

void infinisoleil::FX8DriverNodelet::onInit ( ) [private, virtual]

Initialize FX8 driver.

Implements nodelet::Nodelet.

Definition at line 58 of file fx8_driver_nodelet.cpp.

Output FX8 parameters to parameter server.

Definition at line 426 of file fx8_driver_nodelet.cpp.

void infinisoleil::FX8DriverNodelet::publishScanData ( const unsigned char *  scan_data,
size_t  size 
) [private]

Publish scan data.

Parameters:
[in]scan_dataFX8 scan data.
[in]sizeSize of scan data.

Definition at line 515 of file fx8_driver_nodelet.cpp.

void infinisoleil::FX8DriverNodelet::receiveErrorCodeCallback ( const unsigned char *  error_data,
size_t  size,
void *  user_data 
) [static, private]

Receive FX8 Error code.

Parameters:
[in]error_dataError data.
[in]sizeSize of error data.
[in]user_dataUser-defined data.

Definition at line 908 of file fx8_driver_nodelet.cpp.

void infinisoleil::FX8DriverNodelet::receiveScanDataCallback ( const unsigned char *  scan_data,
size_t  size,
void *  user_data 
) [static, private]

Receive FX8 scan data.

Parameters:
[in]scan_dataScan data.
[in]sizeSize of scan data.
[in]user_dataUser-defined data.

Definition at line 901 of file fx8_driver_nodelet.cpp.

void infinisoleil::FX8DriverNodelet::reconfigureFX8Callback ( FX8Config  config,
uint32_t  level 
) [private]

Reconfigure FX8.

Parameters:
[in]configParameters for reconfiguration.
[in]levelBitmask for changed parameters.

Definition at line 812 of file fx8_driver_nodelet.cpp.

bool infinisoleil::FX8DriverNodelet::setDeviceMeasureMode ( const FX8Handle  device,
const FX8MeasureMode  measure_mode,
FX8SensorInfo sensor_info,
FX8XyData xy_data 
) [private]

Set measure mode of FX8.

Parameters:
[in]deviceFX8 handle.
[in]measure_modeMeasure mode of FX8.
[out]sensor_infoSensor information of FX8.
[out]xy_dataXY data of FX8.

Definition at line 365 of file fx8_driver_nodelet.cpp.

void infinisoleil::FX8DriverNodelet::setMessageData ( sensor_msgs::ImagePtr  range_msg,
sensor_msgs::ImagePtr  ir_msg,
sensor_msgs::PointCloud2Ptr  point_cloud_msg,
unsigned char  surface_number 
) [private]

Set data of range image, IR image and point cloud.

Parameters:
[in]range_msgMessage for range_image topic.
[in]ir_msgMessage for ir_image topic.
[in]point_cloud_msgMessage for point_cloud topic.
[in]surface_numberSurface number of xy data.

Definition at line 655 of file fx8_driver_nodelet.cpp.

Setup diagnostics.

Definition at line 155 of file fx8_driver_nodelet.cpp.

Shut down device.

Definition at line 351 of file fx8_driver_nodelet.cpp.

Shut down nodelet.

Definition at line 108 of file fx8_driver_nodelet.cpp.

Shut down reconfigure server.

Definition at line 150 of file fx8_driver_nodelet.cpp.

Spin driver thread.

Definition at line 504 of file fx8_driver_nodelet.cpp.

Start FX8 scan.

Returns:
True if starting scan is succeeded, false if it is not.

Definition at line 463 of file fx8_driver_nodelet.cpp.

void infinisoleil::FX8DriverNodelet::updateTime ( ) [inline, private]

Update timestamp.

Definition at line 896 of file fx8_driver_nodelet.cpp.


Member Data Documentation

Configurations of FX8.

Definition at line 260 of file fx8_driver_nodelet.h.

Handle of FX8.

Definition at line 258 of file fx8_driver_nodelet.h.

Flag of running device.

Definition at line 265 of file fx8_driver_nodelet.h.

Diagnostic updater.

Definition at line 275 of file fx8_driver_nodelet.h.

Flag to enable diagnostics.

Definition at line 280 of file fx8_driver_nodelet.h.

FX8 driver thread.

Definition at line 264 of file fx8_driver_nodelet.h.

Received error code from FX8.

Definition at line 261 of file fx8_driver_nodelet.h.

Error information of FX8.

Definition at line 262 of file fx8_driver_nodelet.h.

Topic diagnostic for IR image.

Definition at line 277 of file fx8_driver_nodelet.h.

Publisher of IR image.

Definition at line 269 of file fx8_driver_nodelet.h.

Timestamp for topics.

Definition at line 272 of file fx8_driver_nodelet.h.

Mutex for diagnostics.

Definition at line 279 of file fx8_driver_nodelet.h.

Mutex for scan data.

Definition at line 271 of file fx8_driver_nodelet.h.

Topic diagnostic for point cloud.

Definition at line 278 of file fx8_driver_nodelet.h.

Publisher of point cloud.

Definition at line 270 of file fx8_driver_nodelet.h.

Topic diagnostic for range image.

Definition at line 276 of file fx8_driver_nodelet.h.

Publisher of range image.

Definition at line 268 of file fx8_driver_nodelet.h.

Server for reconfiguration.

Definition at line 284 of file fx8_driver_nodelet.h.

Scan data from FX8.

Definition at line 259 of file fx8_driver_nodelet.h.

Target frame rate of topics.

Definition at line 281 of file fx8_driver_nodelet.h.


The documentation for this class was generated from the following files:


infinisoleil
Author(s): NCS 3D Sensing Team <3d-sensing@nippon-control-system.co.jp>
autogenerated on Thu Jun 6 2019 22:05:50