Classes | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
infinisoleil::FX8DriverNodelet Class Reference

FX8 driver nodelet class. More...

#include <fx8_driver_nodelet.h>

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

Classes

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

Public Member Functions

 FX8DriverNodelet ()
 Constructer. More...
 
virtual ~FX8DriverNodelet ()
 Destructor. More...
 
- Public Member Functions inherited from nodelet::Nodelet
void init (const std::string &name, const M_string &remapping_args, const V_string &my_argv, ros::CallbackQueueInterface *st_queue=NULL, ros::CallbackQueueInterface *mt_queue=NULL)
 
 Nodelet ()
 
virtual ~Nodelet ()
 

Private Types

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

Private Member Functions

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

Static Private Member Functions

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

Private Attributes

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

Additional Inherited Members

- Protected Member Functions inherited from nodelet::Nodelet
ros::CallbackQueueInterfacegetMTCallbackQueue () const
 
ros::NodeHandlegetMTNodeHandle () const
 
ros::NodeHandlegetMTPrivateNodeHandle () const
 
const V_stringgetMyArgv () const
 
const std::string & getName () const
 
ros::NodeHandlegetNodeHandle () const
 
ros::NodeHandlegetPrivateNodeHandle () const
 
const M_stringgetRemappingArgs () const
 
ros::CallbackQueueInterfacegetSTCallbackQueue () const
 
std::string getSuffixedName (const std::string &suffix) const
 

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

infinisoleil::FX8DriverNodelet::FX8DriverNodelet ( )

Constructer.

Definition at line 47 of file fx8_driver_nodelet.cpp.

infinisoleil::FX8DriverNodelet::~FX8DriverNodelet ( )
virtual

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.

void infinisoleil::FX8DriverNodelet::driverThreadFunc ( )
private

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 
)
inlineprivate

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.

void infinisoleil::FX8DriverNodelet::fillDiagnosticStatusByErrorInfo ( diagnostic_updater::DiagnosticStatusWrapper status)
private

Fill diagnostic status by error information of FX8.

Parameters
[in]statusDiagnostic status of FX8.

Definition at line 724 of file fx8_driver_nodelet.cpp.

void infinisoleil::FX8DriverNodelet::fillDiagnosticStatusByReceivedErrorCode ( diagnostic_updater::DiagnosticStatusWrapper status)
private

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.

bool infinisoleil::FX8DriverNodelet::initializeDevice ( )
private

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.

void infinisoleil::FX8DriverNodelet::initializeNodelet ( )
private

Initialize nodelet.

Definition at line 84 of file fx8_driver_nodelet.cpp.

void infinisoleil::FX8DriverNodelet::initializeReconfigureServer ( ros::NodeHandle  param_nh)
private

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 ( )
privatevirtual

Initialize FX8 driver.

Implements nodelet::Nodelet.

Definition at line 58 of file fx8_driver_nodelet.cpp.

void infinisoleil::FX8DriverNodelet::outputDeviceParameters ( )
private

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 
)
staticprivate

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 
)
staticprivate

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.

void infinisoleil::FX8DriverNodelet::setupDiagnostics ( )
private

Setup diagnostics.

Definition at line 155 of file fx8_driver_nodelet.cpp.

void infinisoleil::FX8DriverNodelet::shutdownDevice ( )
private

Shut down device.

Definition at line 351 of file fx8_driver_nodelet.cpp.

void infinisoleil::FX8DriverNodelet::shutdownNodelet ( )
private

Shut down nodelet.

Definition at line 108 of file fx8_driver_nodelet.cpp.

void infinisoleil::FX8DriverNodelet::shutdownReconfigureServer ( )
private

Shut down reconfigure server.

Definition at line 150 of file fx8_driver_nodelet.cpp.

void infinisoleil::FX8DriverNodelet::spin ( )
private

Spin driver thread.

Definition at line 504 of file fx8_driver_nodelet.cpp.

bool infinisoleil::FX8DriverNodelet::startScan ( )
private

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 ( )
inlineprivate

Update timestamp.

Definition at line 896 of file fx8_driver_nodelet.cpp.

Member Data Documentation

Config infinisoleil::FX8DriverNodelet::config_
private

Configurations of FX8.

Definition at line 260 of file fx8_driver_nodelet.h.

FX8Handle infinisoleil::FX8DriverNodelet::device_
private

Handle of FX8.

Definition at line 258 of file fx8_driver_nodelet.h.

bool infinisoleil::FX8DriverNodelet::device_running_
private

Flag of running device.

Definition at line 265 of file fx8_driver_nodelet.h.

boost::shared_ptr<diagnostic_updater::Updater> infinisoleil::FX8DriverNodelet::diagnostic_updater_
private

Diagnostic updater.

Definition at line 275 of file fx8_driver_nodelet.h.

bool infinisoleil::FX8DriverNodelet::diagnostics_enable_
private

Flag to enable diagnostics.

Definition at line 280 of file fx8_driver_nodelet.h.

boost::thread infinisoleil::FX8DriverNodelet::driver_thread_
private

FX8 driver thread.

Definition at line 264 of file fx8_driver_nodelet.h.

std::vector<ReceivedErrorCodePackets> infinisoleil::FX8DriverNodelet::error_code_
private

Received error code from FX8.

Definition at line 261 of file fx8_driver_nodelet.h.

std::vector<ErrorInfo> infinisoleil::FX8DriverNodelet::error_info_
private

Error information of FX8.

Definition at line 262 of file fx8_driver_nodelet.h.

TopicDiagnosticPtr infinisoleil::FX8DriverNodelet::ir_image_diagnostic_frequency_
private

Topic diagnostic for IR image.

Definition at line 277 of file fx8_driver_nodelet.h.

ros::Publisher infinisoleil::FX8DriverNodelet::ir_publisher_
private

Publisher of IR image.

Definition at line 269 of file fx8_driver_nodelet.h.

ros::Time infinisoleil::FX8DriverNodelet::latest_update_time_
private

Timestamp for topics.

Definition at line 272 of file fx8_driver_nodelet.h.

boost::mutex infinisoleil::FX8DriverNodelet::mutex_diagnostics_
private

Mutex for diagnostics.

Definition at line 279 of file fx8_driver_nodelet.h.

boost::mutex infinisoleil::FX8DriverNodelet::mutex_scan_
private

Mutex for scan data.

Definition at line 271 of file fx8_driver_nodelet.h.

TopicDiagnosticPtr infinisoleil::FX8DriverNodelet::point_cloud_diagnostic_frequency_
private

Topic diagnostic for point cloud.

Definition at line 278 of file fx8_driver_nodelet.h.

ros::Publisher infinisoleil::FX8DriverNodelet::point_cloud_publisher_
private

Publisher of point cloud.

Definition at line 270 of file fx8_driver_nodelet.h.

TopicDiagnosticPtr infinisoleil::FX8DriverNodelet::range_image_diagnostic_frequency_
private

Topic diagnostic for range image.

Definition at line 276 of file fx8_driver_nodelet.h.

ros::Publisher infinisoleil::FX8DriverNodelet::range_publisher_
private

Publisher of range image.

Definition at line 268 of file fx8_driver_nodelet.h.

boost::shared_ptr<ReconfigureServer> infinisoleil::FX8DriverNodelet::reconfigure_server_
private

Server for reconfiguration.

Definition at line 284 of file fx8_driver_nodelet.h.

Scan infinisoleil::FX8DriverNodelet::scan_
private

Scan data from FX8.

Definition at line 259 of file fx8_driver_nodelet.h.

double infinisoleil::FX8DriverNodelet::target_frequency_
private

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 Mon Jun 10 2019 13:34:27