Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
prosilica_camera::ProsilicaNodelet Class Reference
Inheritance diagram for prosilica_camera::ProsilicaNodelet:
Inheritance graph
[legend]

Public Member Functions

 ProsilicaNodelet ()
 
virtual ~ProsilicaNodelet ()
 
- 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

enum  CameraState {
  OPENING, CAMERA_NOT_FOUND, FORMAT_ERROR, ERROR,
  OK
}
 
typedef dynamic_reconfigure::Server< prosilica_camera::ProsilicaCameraConfig > ReconfigureServer
 

Private Member Functions

bool frameToImage (tPvFrame *frame, sensor_msgs::Image &image)
 
std::string getAvailableCameras ()
 
void getCurrentState (diagnostic_updater::DiagnosticStatusWrapper &stat)
 
void kill (unsigned long guid)
 
void loadIntrinsics ()
 
virtual void onInit ()
 
void onInitImpl ()
 
void openCamera ()
 
void pollCallback (polled_camera::GetPolledImage::Request &req, polled_camera::GetPolledImage::Response &rsp, sensor_msgs::Image &image, sensor_msgs::CameraInfo &info)
 
bool processFrame (tPvFrame *frame, sensor_msgs::Image &img, sensor_msgs::CameraInfo &cam_info)
 
void publishImage (tPvFrame *frame)
 
void publishImage (tPvFrame *frame, ros::Time time)
 
void reconfigureCallback (prosilica_camera::ProsilicaCameraConfig &config, uint32_t level)
 
bool setCameraInfo (sensor_msgs::SetCameraInfoRequest &req, sensor_msgs::SetCameraInfoResponse &rsp)
 
void start ()
 
void stop ()
 
void syncInCallback (const std_msgs::HeaderConstPtr &msg)
 
void updateCallback (const ros::TimerEvent &event)
 

Private Attributes

bool auto_adjust_stream_bytes_per_second_
 
sensor_msgs::CameraInfo cam_info_
 
boost::shared_ptr< prosilica::Cameracamera_
 
enum prosilica_camera::ProsilicaNodelet::CameraState camera_state_
 
boost::recursive_mutex config_mutex_
 
int count_
 
tPvUint32 dummy
 
std::string frame_id_
 
RollingSum< unsigned long > frames_completed_acc_
 
unsigned long frames_completed_total_
 
RollingSum< unsigned long > frames_dropped_acc_
 
unsigned long frames_dropped_total_
 
unsigned long guid_
 
std::string hw_id_
 
image_transport::CameraPublisher image_publisher_
 
sensor_msgs::Image img_
 
boost::thread init_thread_
 
std::string intrinsics_
 
std::string ip_address_
 
prosilica_camera::ProsilicaCameraConfig last_config_
 
tPvUint32 max_binning_x
 
tPvUint32 max_binning_y
 
double open_camera_retry_period_
 
RollingSum< unsigned long > packets_missed_acc_
 
unsigned long packets_missed_total_
 
RollingSum< unsigned long > packets_received_acc_
 
unsigned long packets_received_total_
 
polled_camera::PublicationServer poll_srv_
 
boost::shared_ptr< ReconfigureServerreconfigure_server_
 
tPvUint32 sensor_height_
 
tPvUint32 sensor_width_
 
ros::ServiceServer set_camera_info_srv_
 
std::string state_info_
 
ros::Time trig_time_
 
std::string trig_timestamp_topic_
 
int trigger_mode_
 
ros::Subscriber trigger_sub_
 
double update_rate_
 
ros::Timer update_timer_
 
diagnostic_updater::Updater updater
 

Static Private Attributes

static const int WINDOW_SIZE = 100
 

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::stringgetName () const
 
ros::NodeHandlegetNodeHandle () const
 
ros::NodeHandlegetPrivateNodeHandle () const
 
const M_stringgetRemappingArgs () const
 
ros::CallbackQueueInterfacegetSTCallbackQueue () const
 
std::string getSuffixedName (const std::string &suffix) const
 

Detailed Description

Definition at line 63 of file prosilica_nodelet.cpp.

Member Typedef Documentation

typedef dynamic_reconfigure::Server<prosilica_camera::ProsilicaCameraConfig> prosilica_camera::ProsilicaNodelet::ReconfigureServer
private

Definition at line 142 of file prosilica_nodelet.cpp.

Member Enumeration Documentation

Enumerator
OPENING 
CAMERA_NOT_FOUND 
FORMAT_ERROR 
ERROR 
OK 

Definition at line 146 of file prosilica_nodelet.cpp.

Constructor & Destructor Documentation

virtual prosilica_camera::ProsilicaNodelet::~ProsilicaNodelet ( )
inlinevirtual

Make sure we interrupt initialization (if it happened to still execute).

Definition at line 68 of file prosilica_nodelet.cpp.

prosilica_camera::ProsilicaNodelet::ProsilicaNodelet ( )
inline

Definition at line 95 of file prosilica_nodelet.cpp.

Member Function Documentation

bool prosilica_camera::ProsilicaNodelet::frameToImage ( tPvFrame frame,
sensor_msgs::Image &  image 
)
inlineprivate

Definition at line 609 of file prosilica_nodelet.cpp.

std::string prosilica_camera::ProsilicaNodelet::getAvailableCameras ( )
inlineprivate

Definition at line 316 of file prosilica_nodelet.cpp.

void prosilica_camera::ProsilicaNodelet::getCurrentState ( diagnostic_updater::DiagnosticStatusWrapper stat)
inlineprivate

Definition at line 884 of file prosilica_nodelet.cpp.

void prosilica_camera::ProsilicaNodelet::kill ( unsigned long  guid)
inlineprivate

Make sure we interrupt initialization (if it happened to still execute).

Definition at line 422 of file prosilica_nodelet.cpp.

void prosilica_camera::ProsilicaNodelet::loadIntrinsics ( )
inlineprivate

Definition at line 327 of file prosilica_nodelet.cpp.

virtual void prosilica_camera::ProsilicaNodelet::onInit ( )
inlineprivatevirtual

We will be retrying to open camera until it is open, which may block the thread. Nodelet::onInit() should not block, hence spawning a new thread to do initialization.

Implements nodelet::Nodelet.

Definition at line 165 of file prosilica_nodelet.cpp.

void prosilica_camera::ProsilicaNodelet::onInitImpl ( )
inlineprivate

initialize prosilica if necessary

Retrieve parameters from server

Definition at line 174 of file prosilica_nodelet.cpp.

void prosilica_camera::ProsilicaNodelet::openCamera ( )
inlineprivate

Definition at line 235 of file prosilica_nodelet.cpp.

void prosilica_camera::ProsilicaNodelet::pollCallback ( polled_camera::GetPolledImage::Request &  req,
polled_camera::GetPolledImage::Response &  rsp,
sensor_msgs::Image &  image,
sensor_msgs::CameraInfo &  info 
)
inlineprivate

Definition at line 500 of file prosilica_nodelet.cpp.

bool prosilica_camera::ProsilicaNodelet::processFrame ( tPvFrame frame,
sensor_msgs::Image &  img,
sensor_msgs::CameraInfo &  cam_info 
)
inlineprivate
Todo:
Match time stamp from frame to ROS time?
Todo:
Binning values retrieved here may differ from the ones used to actually capture the frame! Maybe need to clear queue when changing binning and/or stuff binning values into context?

Definition at line 561 of file prosilica_nodelet.cpp.

void prosilica_camera::ProsilicaNodelet::publishImage ( tPvFrame frame)
inlineprivate

Definition at line 443 of file prosilica_nodelet.cpp.

void prosilica_camera::ProsilicaNodelet::publishImage ( tPvFrame frame,
ros::Time  time 
)
inlineprivate

Definition at line 448 of file prosilica_nodelet.cpp.

void prosilica_camera::ProsilicaNodelet::reconfigureCallback ( prosilica_camera::ProsilicaCameraConfig &  config,
uint32_t  level 
)
inlineprivate

Trigger mode

Todo:
Replicating logic from polledCallback

If exception thrown due to bad settings, it will fail to start camera Reload last good config

Definition at line 689 of file prosilica_nodelet.cpp.

bool prosilica_camera::ProsilicaNodelet::setCameraInfo ( sensor_msgs::SetCameraInfoRequest &  req,
sensor_msgs::SetCameraInfoResponse &  rsp 
)
inlineprivate

Definition at line 632 of file prosilica_nodelet.cpp.

void prosilica_camera::ProsilicaNodelet::start ( )
inlineprivate

Definition at line 366 of file prosilica_nodelet.cpp.

void prosilica_camera::ProsilicaNodelet::stop ( )
inlineprivate

Definition at line 412 of file prosilica_nodelet.cpp.

void prosilica_camera::ProsilicaNodelet::syncInCallback ( const std_msgs::HeaderConstPtr msg)
inlineprivate

Definition at line 547 of file prosilica_nodelet.cpp.

void prosilica_camera::ProsilicaNodelet::updateCallback ( const ros::TimerEvent event)
inlineprivate

Definition at line 473 of file prosilica_nodelet.cpp.

Member Data Documentation

bool prosilica_camera::ProsilicaNodelet::auto_adjust_stream_bytes_per_second_
private

Definition at line 133 of file prosilica_nodelet.cpp.

sensor_msgs::CameraInfo prosilica_camera::ProsilicaNodelet::cam_info_
private

Definition at line 120 of file prosilica_nodelet.cpp.

boost::shared_ptr<prosilica::Camera> prosilica_camera::ProsilicaNodelet::camera_
private

Definition at line 110 of file prosilica_nodelet.cpp.

enum prosilica_camera::ProsilicaNodelet::CameraState prosilica_camera::ProsilicaNodelet::camera_state_
private
boost::recursive_mutex prosilica_camera::ProsilicaNodelet::config_mutex_
private

Definition at line 141 of file prosilica_nodelet.cpp.

int prosilica_camera::ProsilicaNodelet::count_
private

Definition at line 137 of file prosilica_nodelet.cpp.

tPvUint32 prosilica_camera::ProsilicaNodelet::dummy
private

Definition at line 136 of file prosilica_nodelet.cpp.

std::string prosilica_camera::ProsilicaNodelet::frame_id_
private

Definition at line 122 of file prosilica_nodelet.cpp.

RollingSum<unsigned long> prosilica_camera::ProsilicaNodelet::frames_completed_acc_
private

Definition at line 158 of file prosilica_nodelet.cpp.

unsigned long prosilica_camera::ProsilicaNodelet::frames_completed_total_
private

Definition at line 157 of file prosilica_nodelet.cpp.

RollingSum<unsigned long> prosilica_camera::ProsilicaNodelet::frames_dropped_acc_
private

Definition at line 158 of file prosilica_nodelet.cpp.

unsigned long prosilica_camera::ProsilicaNodelet::frames_dropped_total_
private

Definition at line 157 of file prosilica_nodelet.cpp.

unsigned long prosilica_camera::ProsilicaNodelet::guid_
private

Definition at line 123 of file prosilica_nodelet.cpp.

std::string prosilica_camera::ProsilicaNodelet::hw_id_
private

Definition at line 124 of file prosilica_nodelet.cpp.

image_transport::CameraPublisher prosilica_camera::ProsilicaNodelet::image_publisher_
private

Definition at line 114 of file prosilica_nodelet.cpp.

sensor_msgs::Image prosilica_camera::ProsilicaNodelet::img_
private

Definition at line 119 of file prosilica_nodelet.cpp.

boost::thread prosilica_camera::ProsilicaNodelet::init_thread_
private

Definition at line 111 of file prosilica_nodelet.cpp.

std::string prosilica_camera::ProsilicaNodelet::intrinsics_
private

Definition at line 155 of file prosilica_nodelet.cpp.

std::string prosilica_camera::ProsilicaNodelet::ip_address_
private

Definition at line 125 of file prosilica_nodelet.cpp.

prosilica_camera::ProsilicaCameraConfig prosilica_camera::ProsilicaNodelet::last_config_
private

Definition at line 140 of file prosilica_nodelet.cpp.

tPvUint32 prosilica_camera::ProsilicaNodelet::max_binning_x
private

Definition at line 136 of file prosilica_nodelet.cpp.

tPvUint32 prosilica_camera::ProsilicaNodelet::max_binning_y
private

Definition at line 136 of file prosilica_nodelet.cpp.

double prosilica_camera::ProsilicaNodelet::open_camera_retry_period_
private

Definition at line 126 of file prosilica_nodelet.cpp.

RollingSum<unsigned long> prosilica_camera::ProsilicaNodelet::packets_missed_acc_
private

Definition at line 160 of file prosilica_nodelet.cpp.

unsigned long prosilica_camera::ProsilicaNodelet::packets_missed_total_
private

Definition at line 159 of file prosilica_nodelet.cpp.

RollingSum<unsigned long> prosilica_camera::ProsilicaNodelet::packets_received_acc_
private

Definition at line 160 of file prosilica_nodelet.cpp.

unsigned long prosilica_camera::ProsilicaNodelet::packets_received_total_
private

Definition at line 159 of file prosilica_nodelet.cpp.

polled_camera::PublicationServer prosilica_camera::ProsilicaNodelet::poll_srv_
private

Definition at line 115 of file prosilica_nodelet.cpp.

boost::shared_ptr<ReconfigureServer> prosilica_camera::ProsilicaNodelet::reconfigure_server_
private

Definition at line 143 of file prosilica_nodelet.cpp.

tPvUint32 prosilica_camera::ProsilicaNodelet::sensor_height_
private

Definition at line 135 of file prosilica_nodelet.cpp.

tPvUint32 prosilica_camera::ProsilicaNodelet::sensor_width_
private

Definition at line 135 of file prosilica_nodelet.cpp.

ros::ServiceServer prosilica_camera::ProsilicaNodelet::set_camera_info_srv_
private

Definition at line 116 of file prosilica_nodelet.cpp.

std::string prosilica_camera::ProsilicaNodelet::state_info_
private

Definition at line 154 of file prosilica_nodelet.cpp.

ros::Time prosilica_camera::ProsilicaNodelet::trig_time_
private

Definition at line 128 of file prosilica_nodelet.cpp.

std::string prosilica_camera::ProsilicaNodelet::trig_timestamp_topic_
private

Definition at line 127 of file prosilica_nodelet.cpp.

int prosilica_camera::ProsilicaNodelet::trigger_mode_
private

Definition at line 132 of file prosilica_nodelet.cpp.

ros::Subscriber prosilica_camera::ProsilicaNodelet::trigger_sub_
private

Definition at line 117 of file prosilica_nodelet.cpp.

double prosilica_camera::ProsilicaNodelet::update_rate_
private

Definition at line 131 of file prosilica_nodelet.cpp.

ros::Timer prosilica_camera::ProsilicaNodelet::update_timer_
private

Definition at line 112 of file prosilica_nodelet.cpp.

diagnostic_updater::Updater prosilica_camera::ProsilicaNodelet::updater
private

Definition at line 162 of file prosilica_nodelet.cpp.

const int prosilica_camera::ProsilicaNodelet::WINDOW_SIZE = 100
staticprivate

Definition at line 156 of file prosilica_nodelet.cpp.


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


prosilica_camera
Author(s): Maintained by William Woodall - wwoodall@willowgarage.com, Contributions by Allison Thackston - allison.thackston@nasa.gov
autogenerated on Mon Jun 10 2019 14:20:19