Go to the documentation of this file.00001
00012 #ifndef HARDWARE_SENSOR_CAMERA_FIREWIRE_HPP_
00013 #define HARDWARE_SENSOR_CAMERA_FIREWIRE_HPP_
00014
00015 #include <jafarConfig.h>
00016
00017 #ifdef HAVE_VIAM
00018 #include <viam/viamlib.h>
00019 #endif
00020
00021 #include "rtslam/hardwareSensorCamera.hpp"
00022 #include "rtslam/rawImage.hpp"
00023
00024
00025 namespace jafar {
00026 namespace rtslam {
00027 namespace hardware {
00028
00033 class HardwareSensorCameraFirewire: public HardwareSensorCamera
00034 {
00035 private:
00036 #ifdef HAVE_VIAM
00037 viam_bank_t bank;
00038 viam_handle_t handle;
00039
00040 double transmit_date, first_image_timestamp, first_image_arrival;
00041
00042 struct ViamFormat
00043 {
00044 viam_hwmode_t hwmode;
00045 std::list<viam_filterformat_t> filters;
00046 };
00047 #endif
00048
00049 virtual void preloadTask(void);
00050
00051 #ifdef HAVE_VIAM
00052 cv::Size viamSize_to_size(viam_hwsize_t hwsize);
00053 double viamFreq_to_freq(viam_hwfps_t hwfreq);
00054
00055 viam_hwsize_t size_to_viamSize(cv::Size size);
00056 viam_hwfps_t freq_to_viamFreq(double freq);
00057 void format_to_viamFormat(cv::Size size, int format, viam_hwcrop_t crop, double freq, int trigger, ViamFormat & viam_format);
00058 viam_hwtrigger_t trigger_to_viamTrigger(int trigger);
00059 #endif
00060 void setDataTransmit(bool val);
00061
00062 void init(Mode mode, std::string dump_path, cv::Size imgSize);
00063 #ifdef HAVE_VIAM
00064 void init(const std::string &camera_id, ViamFormat &viam_format, double shutter, Mode mode, std::string calib_file, std::string dump_path);
00065 #endif
00066 public:
00067
00068 #ifdef HAVE_VIAM
00069
00088 HardwareSensorCameraFirewire(kernel::VariableCondition<int> *condition, int bufferSize, const std::string &camera_id,
00089 cv::Size size, int format, viam_hwcrop_t crop, double freq, int trigger, double shutter, Mode mode, int cam_id,
00090 std::string calib_file = "", std::string dump_path = ".", kernel::LoggerTask *loggerTask = NULL);
00091 #endif
00092
00095 HardwareSensorCameraFirewire(kernel::VariableCondition<int> *condition, int cam_id, cv::Size imgSize, std::string dump_path = ".");
00096
00097 ~HardwareSensorCameraFirewire();
00098
00099 void assessFirstImage(double originTrigger = -1);
00100 virtual void start();
00101 virtual void showInfos()
00102 {
00103 double period, delay;
00104 getTimingInfos(period, delay);
00105 std::cout << "Firewire: arrival_delay " << delay*1000 << " milliseconds." << std::endl;
00106 }
00107
00108 };
00109
00110 typedef boost::shared_ptr<HardwareSensorCameraFirewire> hardware_sensor_firewire_ptr_t;
00111
00112 }}}
00113
00114 #endif