main.cpp
Go to the documentation of this file.
00001 /*
00002  * Software License Agreement (BSD License)
00003  *
00004  * Copyright (c) 2015, IAV Automotive Engineering
00005  * All rights reserved.
00006  *
00007  * Redistribution and use in source and binary forms, with or without 
00008  * modification, are permitted provided that the following conditions are met:
00009  *
00010  * 1. Redistributions of source code must retain the above copyright notice, 
00011  *    this list of conditions and the following disclaimer.
00012  *
00013  * 2. Redistributions in binary form must reproduce the above copyright notice, 
00014  *    this list of conditions and the following disclaimer in the documentation 
00015  *    and/or other materials provided with the distribution.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
00018  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
00019  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
00020  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 
00021  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
00022  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
00023  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 
00024  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
00025  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 
00026  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
00027  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00028  *
00029  */
00030 /*
00031  *  IAV Team
00032  *  http://www.iav.com
00033  *
00034  */
00035 
00036 
00037 
00038 #include "../include/DTL_ROS.h"
00039 
00041 // Main program /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
00043 
00044 int main(int argc, char** argv)
00045     {                   
00046         ros::init(argc, argv, "iav_depthimage_to_laserscan");
00047         ros::NodeHandle n;      
00048 
00049         iav_depthimage_to_laserscan::CParam CParam1;
00050         iav_depthimage_to_laserscan::CParam CParam2;
00051         iav_depthimage_to_laserscan::LSParam laser_param;
00052 
00053         double height_max; // value > 0 (considering 0 the laser_height), wich limits the height above the laser scan
00054         double height_min; // value < 0 (considering 0 the laser_height), wich limits the height below the laser scan
00055 
00056         n.param<double>("height_max", height_max, 0.20);
00057         n.param<double>("height_min", height_min, -0.65);
00058 
00059         n.param<double>("cam_1_AOV_h", CParam1.cam_AOV_h, 1.01229097);
00060         n.param<double>("cam_1_AOV_v", CParam1.cam_AOV_v, 0.785398163);
00061         n.param<double>("cam_1_yaw", CParam1.cam_yaw, 0.0);
00062         n.param<double>("cam_1_pitch", CParam1.cam_pitch, 0.0);
00063         n.param<double>("cam_1_offset", CParam1.cam_offset, 0.0);
00064         n.param<int>("cam_1_image_width", CParam1.cam_image_width, 640);
00065         n.param<int>("cam_1_image_height", CParam1.cam_image_height, 480);
00066         n.param<double>("cam_1_focal_length_x", CParam1.cam_focal_length_x, 570);
00067         n.param<double>("cam_1_focal_length_y", CParam1.cam_focal_length_y, 570);
00068         n.param<std::string>("cam_1_frame_id", CParam1.cam_frame_id, "camera389_link");
00069 
00070         n.param<double>("cam_2_AOV_h", CParam2.cam_AOV_h, 1.01229097);
00071         n.param<double>("cam_2_AOV_v", CParam2.cam_AOV_v, 0.785398163);
00072         n.param<double>("cam_2_yaw", CParam2.cam_yaw, 1.009744261); // It is lagged by 57° (default value) to the left in relation to the first camera
00073         n.param<double>("cam_2_pitch", CParam2.cam_pitch, 0.0);
00074         n.param<double>("cam_2_offset", CParam2.cam_offset, 0.0);
00075         n.param<int>("cam_2_image_width", CParam2.cam_image_width, 640);
00076         n.param<int>("cam_2_image_height", CParam2.cam_image_height, 480);
00077         n.param<double>("cam_2_focal_length_x", CParam2.cam_focal_length_x, 570);
00078         n.param<double>("cam_2_focal_length_y", CParam2.cam_focal_length_y, 570);
00079         n.param<std::string>("cam_2_frame_id", CParam2.cam_frame_id, "camera568_link");
00080 
00081         n.param<double>("laser_max_range", laser_param.laser_max_range, 5);
00082         n.param<double>("laser_min_range", laser_param.laser_min_range, 0.5);
00083         n.param<double>("laser_max_angle", laser_param.laser_max_angle, 3.14);
00084         n.param<double>("laser_min_angle", laser_param.laser_min_angle, -3.14);
00085         n.param<int>("laser_rays", laser_param.laser_rays, 640);
00086         n.param<std::string>("laser_output_frame_id", laser_param.laser_output_frame_id, "laser_link");
00087 
00088         // create and adding tf to m_tf
00089         CParam1.createTF(laser_param.laser_output_frame_id, CParam1.cam_frame_id);   
00090         CParam2.createTF(laser_param.laser_output_frame_id, CParam2.cam_frame_id);   
00091 
00092         // Initializes the parameters of each camera
00093         CParam1.init_parameter(CParam1, laser_param, height_max, height_min);
00094         CParam2.init_parameter(CParam2, laser_param, height_max, height_min);
00095 
00096         iav_depthimage_to_laserscan::DTL_ROS dtl(n, CParam1, CParam2, laser_param);
00097         
00098         ros::spin();    
00099 
00100         return 0;
00101 }


iav_depthimage_to_laserscan
Author(s): Jan Obermueller
autogenerated on Thu Jun 6 2019 20:28:38