Changeset 142 in pacpussensors for trunk/Vislab/VislabCamera.cpp
- Timestamp:
- Mar 30, 2017, 4:18:32 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Vislab/VislabCamera.cpp
r134 r142 10 10 11 11 // Includes lib3dv 12 #include <lib3dv -1.2.0/lib3dv/device.h>12 #include <lib3dv/device.h> 13 13 #include "DiskWriter.h" 14 14 #include "Display.h" … … 43 43 void VislabCamera::open() 44 44 { 45 46 curr_devices = lib3dv::device::enumerate(boost::asio::ip::address_v4::from_string("192.168.0.1"), 1, error); 47 if(error != lib3dv::error::NONE) 48 std::cout << "[EE] 3dv-client: error detected: " << error << std::endl; 45 curr_devices = lib3dv::device::enumerate(boost::asio::ip::address_v4::from_string("192.168.0.2"), 0); 46 if (error != lib3dv::error::NONE) 47 { 48 std::cout << "[EE] 3dv-client: error detected: " << error << std::endl; 49 return; 50 } 49 51 50 52 if(curr_devices.empty()) 51 53 { 52 54 std::cout << "[EE] 3dv-client: no devices found" << std::endl; 55 return; 53 56 //return lib3dv::error::NONE; 54 57 } 55 58 //disk_writer = boost::shared_ptr< ::disk_writer>(new ::disk_writer(paths, data_format, autonumber, params, guid_type, log_level)); 56 curr_devices[0].log_level(2); 57 curr_devices[0].timeout(boost::posix_time::milliseconds(5000)); 58 curr_devices[0].connect_image_callback(boost::function<void(boost::shared_ptr< const lib3dv::image>, unsigned int)>(boost::bind(&::VislabImageProcessor::image_callback, &displayVideo, _1, _2))); 59 curr_devices[0].connect_image_callback(boost::function<void(boost::shared_ptr< const lib3dv::image>, unsigned int)>(boost::bind(&::VislabImageProcessor::image_callback, &displayDisparite, _1, _2))); 60 curr_devices[0].connect_image_callback(boost::function<void(boost::shared_ptr< const lib3dv::image>, unsigned int)>(boost::bind(&::VislabImageProcessor::image_callback, &diskwriterVideo, _1, _2))); 61 curr_devices[0].connect_image_callback(boost::function<void(boost::shared_ptr< const lib3dv::image>, unsigned int)>(boost::bind(&::VislabImageProcessor::image_callback, &diskwriterDisparite, _1, _2))); 62 curr_devices[0].start_transmission(error); 59 60 //curr_devices[0].connect_image_callback(boost::function<void(boost::shared_ptr< const lib3dv::image>)>(boost::bind(&::VislabImageProcessor::image_callback, &displayVideo, _1))); 61 //curr_devices[0].connect_image_callback(boost::function<void(boost::shared_ptr< const lib3dv::image>)>(boost::bind(&::VislabImageProcessor::image_callback, &displayDisparite, _1))); 62 //curr_devices[0].connect_image_callback(boost::function<void(boost::shared_ptr< const lib3dv::image>)>(boost::bind(&::VislabImageProcessor::image_callback, &diskwriterVideo, _1))); 63 //curr_devices[0].connect_image_callback(boost::function<void(boost::shared_ptr< const lib3dv::image>)>(boost::bind(&::VislabImageProcessor::image_callback, &diskwriterDisparite, _1))); 64 curr_devices[0].connect_image_callback(boost::function<void(boost::shared_ptr< const lib3dv::image>)>(boost::bind(&::VislabImageProcessor::image_callback, &outputVideo, _1))); 65 curr_devices[0].connect_image_callback(boost::function<void(boost::shared_ptr< const lib3dv::image>)>(boost::bind(&::VislabImageProcessor::image_callback, &outputDisparite, _1))); 66 curr_devices[0].start_transmission(false); 63 67 if(error != lib3dv::error::NONE) 64 68 std::cout << "[EE] 3dv-client: error detected: " << error << std::endl; … … 69 73 void VislabCamera::close() 70 74 { 71 curr_devices[0].stop_transmission(error); 72 //curr_devices[0].poweroff(error); 75 if (curr_devices.empty()) 76 { 77 std::cout << "[EE] 3dv-client: no devices found" << std::endl; 78 return; 79 //return lib3dv::error::NONE; 80 } 81 else 82 { 83 curr_devices[0].stop_transmission(); 84 } 85 86 //curr_devices[0].poweroff(); 73 87 } 74 88
Note:
See TracChangeset
for help on using the changeset viewer.