xb3.cpp File Reference

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

#include "xb3.h"
Include dependency graph for xb3.cpp:

Go to the source code of this file.

#define _XB3_CPP_
 
void clean_dc1394 (void)
 stop camera captur stops camera capture using dc1394 More...
 
void signal_handler (int sig)
 signal handler function This handles with SIGINT and SIGSEGV signals More...
 
int init_camera (dc1394_t *d, PGRStereoCamera_t *stereoCamera, dc1394camera_t **camera, unsigned int nThisCam)
 initialize camera initializes camera with dc1394 More...
 
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 More...
 
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. More...
 
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. More...
 
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. More...
 
void reconfig (xb3::xb3Config &config, uint32_t level)
 necessary function for dynamic_reconfigure (I guess :)) More...
 
int main (int argc, char **argv)
 

Detailed Description

the actual cpp code for the xb3 module

Definition in file xb3.cpp.

Macro Definition Documentation

#define _XB3_CPP_

Definition at line 34 of 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]BufferBuffer with the 3 images
[in]leftleft image
[in]centercenter image
[in]rightright image
Returns
1

Definition at line 203 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 279 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 95 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 309 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 302 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 265 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]msgthe image message
[in]height
[in]width
[in]encoding
[in]is_bigendian
[in]frame_id
Returns
(void)

Definition at line 246 of file xb3.cpp.

void signal_handler ( int  sig)

signal handler function This handles with SIGINT and SIGSEGV signals

Parameters
[in]sigsignal
Returns
(void)

Definition at line 59 of file xb3.cpp.



xb3
Author(s): Miguel Oliveira, Tiago Talhada
autogenerated on Mon Mar 2 2015 01:33:02