FX8 driver nodelet class. More...
#include <fx8_driver_nodelet.h>
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< ErrorInfo > | error_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. |
FX8 driver nodelet class.
Definition at line 59 of file fx8_driver_nodelet.h.
typedef FX8Info infinisoleil::FX8DriverNodelet::Config [private] |
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.
typedef FX8Scan infinisoleil::FX8DriverNodelet::Scan [private] |
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.
typedef diagnostic_updater::HeaderlessTopicDiagnostic infinisoleil::FX8DriverNodelet::TopicDiagnostic [private] |
Topic diagnostic.
Definition at line 72 of file fx8_driver_nodelet.h.
typedef boost::shared_ptr<TopicDiagnostic> infinisoleil::FX8DriverNodelet::TopicDiagnosticPtr [private] |
Shared pointer of topic diagnostic.
Definition at line 73 of file fx8_driver_nodelet.h.
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.
void infinisoleil::FX8DriverNodelet::addDiagnostics | ( | const unsigned char * | error_data, |
size_t | size | ||
) | [private] |
Add obtained error data.
[in] | error_data | Error data from FX8. |
[in] | size | Size 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 | ||
) | [inline, private] |
Extract range and intensity data from scan data packets.
[in] | index | Index of scan data packets. |
[in] | scan_data | Scan data. |
[out] | range | Range data. |
[out] | intensity | Intensity 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.
[in] | status | Diagnostic 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.
[in] | status | Diagnostic 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.
[in] | device | FX8 handle. |
[out] | sensor_info | Sensor information of FX8. |
[out] | xy_data | XY data of FX8. |
Definition at line 405 of file fx8_driver_nodelet.cpp.
bool infinisoleil::FX8DriverNodelet::initializeDevice | ( | ) | [private] |
Initialize and connect to FX8.
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.
[in] | param_nh | Private 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.
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.
[in] | scan_data | FX8 scan data. |
[in] | size | Size 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.
[in] | error_data | Error data. |
[in] | size | Size of error data. |
[in] | user_data | User-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.
[in] | scan_data | Scan data. |
[in] | size | Size of scan data. |
[in] | user_data | User-defined data. |
Definition at line 901 of file fx8_driver_nodelet.cpp.
void infinisoleil::FX8DriverNodelet::reconfigureFX8Callback | ( | FX8Config | config, |
uint32_t | level | ||
) | [private] |
Reconfigure FX8.
[in] | config | Parameters for reconfiguration. |
[in] | level | Bitmask 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.
[in] | device | FX8 handle. |
[in] | measure_mode | Measure mode of FX8. |
[out] | sensor_info | Sensor information of FX8. |
[out] | xy_data | XY 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.
[in] | range_msg | Message for range_image topic. |
[in] | ir_msg | Message for ir_image topic. |
[in] | point_cloud_msg | Message for point_cloud topic. |
[in] | surface_number | Surface 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.
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.
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.
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.
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.
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.
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.
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.