How to start creating a package/node in ROS?
Hello,
I started some weeks ago with ROS, now I want to write a node (or nodelet or package) for my stereo-camera-system (2 Point Grey Flea3 GigE-Cameras).
The pointgrey-camera-driver for ROS doesnt let me handle things like the polarity of the trigger or setting a fixed IP.
Basically my program already exists as a Visual Studio 2010 (yes, PointGrey doesnot support VS2012) project. The program checks the system for exisiting cameras and then sets them up with fixed IP's, enables a trigger, selects a ROI and so on. In the end the settings are stored to the cameras' memory channels where they persist.
Basically I have the problem that I dont know with which ROS tutorial to start and whether I want to create an own ROS package or if it makes sense to define my program as a node/nodelet of the pointgrey-camera package.
I think my node should not subscribe to any topics, it really is more of a c++ program working on its own. I have the compiled library files (eqivalent to windows dlls in Linux I guess) for the FlyCap SDK.
So my idea is to put that node (if succesfully) into my launch file before starting the camera, ideally the node should return a boolean true/false on sucess/failure to the system. How can that be done?
My supervisor told me for Linux there exists a good IDE called QtCreator, so far I have used VS and eclipse in Windows.
Do you have any ideas/suggestions for me?
----UPDATE---
This is the code of my node "stereo_setup" in stereo_setup.cpp. What happens to lines like std::cout << "xyz" or printf(...) in ROS?
I am still uncertain how to set the info that the camera_setup was successfull.
#include <ros.h>
#include<iostream>
#include "FlyCapture2_Axel.h"
using namespace std;
using namespace FlyCapture2;
const char * const mac_address_char_12062824 = "00:B0:9D:B8:10:68";
const char * const mac_address_char_12062828 = "00:B0:9D:B8:10:6C";
const char * const ip_address_char_12062824 = "192.168.1.2";
const char * const ip_address_char_12062828 = "192.168.1.3";
const char * const ip_address_char_submask = "255.255.0.0";
const char * const ip_address_char_gateway= "0.0.0.0";
const unsigned int SN_12062824 = 12062824;
const unsigned int SN_12062828 = 12062828;
const Mode k_fmt7Mode = MODE_0;
const unsigned int image_width = 1344;
const unsigned int image_height = 1032;
const unsigned int MAX_image_width = 1384;
const unsigned int MAX_image_height = 1032;
const PixelFormat pixel_format = PIXEL_FORMAT_RGB;
//turn shutter to manual mode
const bool SHUTTER_MANUAL_MODE = false;
//shutter duration in milliseconds
const unsigned int SHUTTER_DURATION = 8;
//turn on filewriting
//const bool WRITE_TO_FILE = true;
// File Format
// File Format
//const char * file_format = "bmp";
bool initialize_cameras();
bool connect_cameras(Camera * cam_12062824, Camera * cam_12062828, PGRGuid * pgr_guid_12062824, PGRGuid * pgr_guid_12062828);
bool setup_cameras(Camera * cam_12062824, Camera * cam_12062828);
void PrintBuildInfo();
void PrintError( Error error );
void PrintCameraInfo( CameraInfo* pCamInfo );
void PrintFormat7Capabilities( Format7Info fmt7Info);
int main(int argc, char** argv )
{
ros::init(argc, argv, "stereo_setup");
PrintBuildInfo();
Error error;
//BusManager busmanager;
Camera cam_12062824, cam_12062828;
PGRGuid pgr_guid_12062824, pgr_guid_12062828;
bool ini = initialize_cameras();
if(ini == false)
{
std::cout << "Could not successfully initialize the two cameras!" << std ...