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>
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 |
the actual cpp code for the xb3 module
Definition in file xb3.cpp.
void clean_dc1394 | ( | void | ) |
int copy_img_buffer_to_cvMat | ( | unsigned char * | Buffer, | |
cv::Mat | left, | |||
cv::Mat | center, | |||
cv::Mat | right | |||
) |
void copy_pixels_to_image_msg_data | ( | unsigned char * | in, | |
sensor_msgs::Image * | image, | |||
int | size | |||
) |
int init_camera | ( | dc1394_t * | d, | |
PGRStereoCamera_t * | stereoCamera, | |||
dc1394camera_t ** | camera, | |||
unsigned int | nThisCam | |||
) |
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.
void reconfig | ( | xb3::xb3Config & | config, | |
uint32_t | level | |||
) |
void set_fixed_camera_info | ( | sensor_msgs::CameraInfo * | info, | |
int | height, | |||
int | width, | |||
char * | frame_id | |||
) |
void set_fixed_fields_image_msg | ( | sensor_msgs::Image * | msg, | |
int | height, | |||
int | width, | |||
char * | encoding, | |||
int | is_bigendian, | |||
char * | frame_id | |||
) |