/home/laradmin/lar/sensors/camera/xb3/src/xb3.cpp File Reference

the actual cpp code for the xb3 module More...

#include "xb3.h"
#include <ros/ros.h>
#include <image_transport/image_transport.h>
#include <cv_bridge/cv_bridge.h>
#include <sensor_msgs/image_encodings.h>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <boost/function.hpp>
#include <boost/thread/recursive_mutex.hpp>
#include <ros/node_handle.h>
#include <string>
#include <vector>
#include <map>
#include <ostream>
#include "ros/serialization.h"
#include "ros/builtin_message_traits.h"
#include "ros/message_operations.h"
#include "ros/time.h"
#include "ros/macros.h"
#include "ros/assert.h"
#include "dynamic_reconfigure/Config.h"
#include "ros/service_traits.h"
#include <boost/thread/mutex.hpp>
#include <stdarg.h>
#include <cstdio>
#include <sensor_msgs/CameraInfo.h>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <sstream>
#include <stdexcept>
#include <list>
#include "std_msgs/Header.h"
#include "geometry_msgs/Vector3.h"
#include "geometry_msgs/Quaternion.h"
#include "geometry_msgs/Point.h"
#include "btMatrix3x3.h"
#include "ros/console.h"
#include "tf/exceptions.h"
#include "LinearMath/btTransform.h"
#include <boost/unordered_map.hpp>
#include <boost/signals.hpp>
#include "geometry_msgs/TransformStamped.h"
#include <signal.h>
#include "pgr_registers.h"
#include "pgr_stereocam.h"
#include <xb3/xb3Config.h>
Include dependency graph for xb3.cpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void clean_dc1394 (void)
 stop camera captur stops camera capture using dc1394
int copy_img_buffer_to_cvMat (unsigned char *Buffer, cv::Mat left, cv::Mat center, cv::Mat right)
 copy an unsigned char buffer to cv::Mat
void copy_pixels_to_image_msg_data (unsigned char *in, sensor_msgs::Image *image, int size)
 Copy image pixel data to ros sensor image message.
int init_camera (dc1394_t *d, PGRStereoCamera_t *stereoCamera, dc1394camera_t **camera, unsigned int nThisCam)
 initialize camera initializes camera with dc1394
int main (int argc, char **argv)
void reconfig (xb3::xb3Config &config, uint32_t level)
 necessary function for dynamic_reconfigure (I guess :))
void set_fixed_camera_info (sensor_msgs::CameraInfo *info, int height, int width, char *frame_id)
 This function will set all the fixed parameters on image camera info messages.
void set_fixed_fields_image_msg (sensor_msgs::Image *msg, int height, int width, char *encoding, int is_bigendian, char *frame_id)
 This function will set all the fixed parameters on image sensor messages.
void signal_handler (int sig)
 signal handler function This handles with SIGINT and SIGSEGV signals

Detailed Description

the actual cpp code for the xb3 module

Definition in file xb3.cpp.


Function Documentation

void clean_dc1394 ( void   ) 

stop camera captur stops camera capture using dc1394

Returns:
(void)

Definition at line 42 of file xb3.cpp.

int copy_img_buffer_to_cvMat ( unsigned char *  Buffer,
cv::Mat  left,
cv::Mat  center,
cv::Mat  right 
)

copy an unsigned char buffer to cv::Mat

Parameters:
[in] Buffer Buffer with the 3 images
[in] left left image
[in] center center image
[in] right right image
Returns:
1

Definition at line 210 of file xb3.cpp.

void copy_pixels_to_image_msg_data ( unsigned char *  in,
sensor_msgs::Image *  image,
int  size 
)

Copy image pixel data to ros sensor image message.

Parameters:
[in] in 
[in] image 
[in] size 
Returns:
(void)

Definition at line 286 of file xb3.cpp.

int init_camera ( dc1394_t *  d,
PGRStereoCamera_t stereoCamera,
dc1394camera_t **  camera,
unsigned int  nThisCam 
)

initialize camera initializes camera with dc1394

Parameters:
[in] d 
[in] stereoCamera 
[in] camera 
[in] nThisCam 
Returns:
Success

Definition at line 102 of file xb3.cpp.

int main ( int  argc,
char **  argv 
)

Set default values of variables, init pointers, etc

Initialize ROS coms

Setup the signals

Get the parameters for image resolution

Set the fixed fields of the info msg

Set the fixed fields of the image msgs Check http://www.ros.org/doc/api/sensor_msgs/html/msg/Image.html for all fields

Create the image transport and advertise the image and info msgs

Initialize camera using libdc1394. Searches for cameras on the bus and connects to a stereo camera.

Allocate all the buffers. size of buffer for all images at mono8

Create windows for showing the image if in debug

In ROS I think the reference is the left camera.

Definition at line 316 of file xb3.cpp.

void reconfig ( xb3::xb3Config &  config,
uint32_t  level 
)

necessary function for dynamic_reconfigure (I guess :))

Parameters:
[in] config 
[in] level 
Returns:
(void)

Definition at line 309 of file xb3.cpp.

void set_fixed_camera_info ( sensor_msgs::CameraInfo *  info,
int  height,
int  width,
char *  frame_id 
)

This function will set all the fixed parameters on image camera info messages.

Parameters:
[in] info 
[in] height 
[in] width 
[in] frame_id 
Returns:
(void)

Definition at line 272 of file xb3.cpp.

void set_fixed_fields_image_msg ( sensor_msgs::Image *  msg,
int  height,
int  width,
char *  encoding,
int  is_bigendian,
char *  frame_id 
)

This function will set all the fixed parameters on image sensor messages.

Parameters:
[in] msg the image message
[in] height 
[in] width 
[in] encoding 
[in] is_bigendian 
[in] frame_id 
Returns:
(void)

Definition at line 253 of file xb3.cpp.

void signal_handler ( int  sig  ) 

signal handler function This handles with SIGINT and SIGSEGV signals

Parameters:
[in] sig signal
Returns:
(void)

Definition at line 66 of file xb3.cpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines


xb3
Author(s): Miguel Oliveira, Tiago Talhada
autogenerated on Wed Jul 23 04:35:09 2014