From b5e87c37f558091b8159bd15c12ffd5dddc55f84 Mon Sep 17 00:00:00 2001
From: fherrero <fherrero@iri.upc.edu>
Date: Mon, 5 Nov 2018 13:01:09 +0100
Subject: [PATCH] Update launchs (use iri_undistort_pixels), add sample
 fish_eye_camera launch and calibration files

---
 calibration/head_camera_1024x768.yaml | 20 ++++++++++++++++++
 calibration/head_camera_640x480.yaml  | 20 ++++++++++++++++++
 config/params_sim.yaml                | 10 ++++-----
 launch/fish_eye_camera.launch         | 30 +++++++++++++++++++++++++++
 launch/node.launch                    |  2 +-
 launch/real.launch                    | 11 +++++-----
 launch/sim.launch                     | 17 ++++++++++-----
 launch/sim_no_undist.launch           |  8 ++++++-
 8 files changed, 101 insertions(+), 17 deletions(-)
 create mode 100644 calibration/head_camera_1024x768.yaml
 create mode 100644 calibration/head_camera_640x480.yaml
 create mode 100644 launch/fish_eye_camera.launch

diff --git a/calibration/head_camera_1024x768.yaml b/calibration/head_camera_1024x768.yaml
new file mode 100644
index 0000000..c6b70bd
--- /dev/null
+++ b/calibration/head_camera_1024x768.yaml
@@ -0,0 +1,20 @@
+image_width: 1024
+image_height: 768
+camera_name: head_camera
+camera_matrix:
+  rows: 3
+  cols: 3
+  data: [513.238105, 0.000000, 526.104889, 0.000000, 476.752621, 403.143888, 0.000000, 0.000000, 1.000000]
+distortion_model: plumb_bob
+distortion_coefficients:
+  rows: 1
+  cols: 5
+  data: [-0.262853, 0.034736, 0.000539, 0.000405, 0.000000]
+rectification_matrix:
+  rows: 3
+  cols: 3
+  data: [1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000]
+projection_matrix:
+  rows: 3
+  cols: 4
+  data: [340.130188, 0.000000, 533.323878, 0.000000, 0.000000, 349.492493, 426.973587, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000]
diff --git a/calibration/head_camera_640x480.yaml b/calibration/head_camera_640x480.yaml
new file mode 100644
index 0000000..6e78206
--- /dev/null
+++ b/calibration/head_camera_640x480.yaml
@@ -0,0 +1,20 @@
+image_width: 640
+image_height: 480
+camera_name: head_camera
+camera_matrix:
+  rows: 3
+  cols: 3
+  data: [287.598727, 0.000000, 271.711029, 0.000000, 293.075813, 255.759142, 0.000000, 0.000000, 1.000000]
+distortion_model: plumb_bob
+distortion_coefficients:
+  rows: 1
+  cols: 5
+  data: [-0.234308, 0.033185, -0.004716, 0.016389, 0.000000]
+rectification_matrix:
+  rows: 3
+  cols: 3
+  data: [1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000]
+projection_matrix:
+  rows: 3
+  cols: 4
+  data: [191.417130, 0.000000, 294.918463, 0.000000, 0.000000, 230.581131, 259.824962, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000]
diff --git a/config/params_sim.yaml b/config/params_sim.yaml
index 977883e..2f79c94 100644
--- a/config/params_sim.yaml
+++ b/config/params_sim.yaml
@@ -8,8 +8,8 @@ publish_tf: true
 publish_markers: true
 filter_outliers: false
 outliers_max_sq_error: 4.0
-use_manual_params: true
-fx: 70
-fy: 70
-cx: 320.5
-cy: 240.5
\ No newline at end of file
+use_manual_params: false
+  fx: 70
+  fy: 70
+  cx: 320.5
+  cy: 240.5
\ No newline at end of file
diff --git a/launch/fish_eye_camera.launch b/launch/fish_eye_camera.launch
new file mode 100644
index 0000000..92b5c07
--- /dev/null
+++ b/launch/fish_eye_camera.launch
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<launch>
+ <arg name="dev" default="/dev/video0"/>
+ <arg name="w" default="640"/> <!-- 1024 , 640 -->
+ <arg name="h" default="480"/> <!-- 768  , 480 -->
+ <arg name="camera_info_url" default="$(find iri_visual_gps)/calibration/head_camera_$(arg w)x$(arg h).yaml"/>
+ <arg name="exposure"      default="15"/>
+ <arg name="white_balance" default="4000"/>
+ 
+ <node name="usb_cam"
+       pkg ="usb_cam"
+       type="usb_cam_node"
+       output="screen" >
+    <param name="video_device" value="$(arg dev)" />
+    <param name="image_width"  value="$(arg w)" />
+    <param name="image_height" value="$(arg h)" />
+    <param name="pixel_format" value="yuyv" />
+    <param name="camera_frame_id" value="usb_cam" />
+    <param name="io_method" value="mmap"/>
+    <param name="camera_info_url" value="file://$(arg camera_info_url)"/>
+    <param name="autoexposure"       value="false"/>
+    <param name="exposure"           value="$(arg exposure)"/>
+    <param name="auto_white_balance" value="false"/>
+    <param name="white_balance"      value="$(arg white_balance)"/>
+  </node>
+  
+  <node pkg="tf" type="static_transform_publisher" name="static_tf_camera_top"         args="0.128 0 0.187    0      -1.5709 -3.14159  base_link  top_camera         100" />
+  <node pkg="tf" type="static_transform_publisher" name="static_tf_camera_top_optical" args="0     0 0       -1.5709  0      -1.5709   top_camera top_camera_optical 100" />
+
+</launch>
\ No newline at end of file
diff --git a/launch/node.launch b/launch/node.launch
index 266ed9e..2ddb72e 100644
--- a/launch/node.launch
+++ b/launch/node.launch
@@ -2,7 +2,7 @@
 <!-- -->
 <launch>
 
-  <arg name="node_name"      default="iri_visual_gps"/>
+  <arg name="node_name"      default="visual_gps"/>
   <arg name="positions_file" default="position_sample.yaml"/>
   <arg name="param_file"     default="params_sample.yaml"/>
   <arg name="param_path"     default="$(find iri_visual_gps)/config"/>
diff --git a/launch/real.launch b/launch/real.launch
index de71734..ffb227e 100644
--- a/launch/real.launch
+++ b/launch/real.launch
@@ -2,6 +2,7 @@
 <!-- -->
 <launch>
 
+  
   <include file="$(find iri_blob_detector)/launch/node.launch">
     <arg name="node_name"   value="blob_detector_red"/>
     <arg name="param_file"  value="red_lab.yaml"/>
@@ -34,32 +35,32 @@
     <arg name="blobs_topic" value="blob_detector_yellow/blobs"/>
   </include>
   
-  <include file="$(find undistort_pixels)/launch/node.launch">
+  <include file="$(find iri_undistort_pixels)/launch/node.launch">
     <arg name="node_name"       value="undistort_blob_red"/>
     <arg name="topic_blobs_in"  value="blob_detector_red/blobs"/>
     <arg name="topic_blobs_out" value="blob_detector_red/blobs_undist"/>
   </include>
   
-  <include file="$(find undistort_pixels)/launch/node.launch">
+  <include file="$(find iri_undistort_pixels)/launch/node.launch">
     <arg name="node_name"       value="undistort_blob_green"/>
     <arg name="topic_blobs_in"  value="blob_detector_green/blobs"/>
     <arg name="topic_blobs_out" value="blob_detector_green/blobs_undist"/>
   </include>
   
-  <include file="$(find undistort_pixels)/launch/node.launch">
+  <include file="$(find iri_undistort_pixels)/launch/node.launch">
     <arg name="node_name"       value="undistort_blob_blue"/>
     <arg name="topic_blobs_in"  value="blob_detector_blue/blobs"/>
     <arg name="topic_blobs_out" value="blob_detector_blue/blobs_undist"/>
   </include>
   
-  <include file="$(find undistort_pixels)/launch/node.launch">
+  <include file="$(find iri_undistort_pixels)/launch/node.launch">
     <arg name="node_name"       value="undistort_blob_yellow"/>
     <arg name="topic_blobs_in"  value="blob_detector_yellow/blobs"/>
     <arg name="topic_blobs_out" value="blob_detector_yellow/blobs_undist"/>
   </include>
   
   <include file="$(find iri_visual_gps)/launch/node.launch">
-    <arg name="node_name"       value="iri_visual_gps"/>
+    <arg name="node_name"       value="visual_gps"/>
     <arg name="positions_file"  value="position_lab.yaml"/>
     <arg name="param_file"      value="params_lab.yaml"/>
     <arg name="param_path"      value="$(find iri_visual_gps)/config"/>
diff --git a/launch/sim.launch b/launch/sim.launch
index 6799cb4..343035e 100644
--- a/launch/sim.launch
+++ b/launch/sim.launch
@@ -1,6 +1,12 @@
 <?xml version="1.0"?>
 <!-- -->
 <launch>
+  
+  <!--
+  <include file="$(find seat_car_gazebo)/launch/sim.launch">
+    <arg name="fake_localization" value="false"/>
+  </include>
+  -->
 
   <include file="$(find iri_blob_detector)/launch/node.launch">
     <arg name="node_name"   value="blob_detector_red"/>
@@ -34,32 +40,33 @@
     <arg name="blobs_topic" value="blob_detector_yellow/blobs"/>
   </include>
   
-  <include file="$(find undistort_pixels)/launch/node.launch">
+  <include file="$(find iri_undistort_pixels)/launch/node.launch">
     <arg name="node_name"       value="undistort_blob_red"/>
     <arg name="topic_blobs_in"  value="blob_detector_red/blobs"/>
     <arg name="topic_blobs_out" value="blob_detector_red/blobs_undist"/>
   </include>
   
-  <include file="$(find undistort_pixels)/launch/node.launch">
+  <include file="$(find iri_undistort_pixels)/launch/node.launch">
     <arg name="node_name"       value="undistort_blob_green"/>
     <arg name="topic_blobs_in"  value="blob_detector_green/blobs"/>
     <arg name="topic_blobs_out" value="blob_detector_green/blobs_undist"/>
   </include>
   
-  <include file="$(find undistort_pixels)/launch/node.launch">
+  <include file="$(find iri_undistort_pixels)/launch/node.launch">
     <arg name="node_name"       value="undistort_blob_blue"/>
     <arg name="topic_blobs_in"  value="blob_detector_blue/blobs"/>
     <arg name="topic_blobs_out" value="blob_detector_blue/blobs_undist"/>
   </include>
   
-  <include file="$(find undistort_pixels)/launch/node.launch">
+  <include file="$(find iri_undistort_pixels)/launch/node.launch">
     <arg name="node_name"       value="undistort_blob_yellow"/>
     <arg name="topic_blobs_in"  value="blob_detector_yellow/blobs"/>
     <arg name="topic_blobs_out" value="blob_detector_yellow/blobs_undist"/>
+    <arg name="config_file" value="params_image.yaml"/>
   </include>
   
   <include file="$(find iri_visual_gps)/launch/node.launch">
-    <arg name="node_name"       value="iri_visual_gps"/>
+    <arg name="node_name"       value="visual_gps"/>
     <arg name="positions_file"  value="position_sim.yaml"/>
     <arg name="param_file"      value="params_sim.yaml"/>
     <arg name="param_path"      value="$(find iri_visual_gps)/config"/>
diff --git a/launch/sim_no_undist.launch b/launch/sim_no_undist.launch
index c040052..a24ded5 100644
--- a/launch/sim_no_undist.launch
+++ b/launch/sim_no_undist.launch
@@ -1,6 +1,12 @@
 <?xml version="1.0"?>
 <!-- -->
 <launch>
+  
+  <!--
+  <include file="$(find seat_car_gazebo)/launch/sim.launch">
+    <arg name="fake_localization" value="false"/>
+  </include>
+  -->
 
   <include file="$(find iri_blob_detector)/launch/node.launch">
     <arg name="node_name"   value="blob_detector_red"/>
@@ -35,7 +41,7 @@
   </include>
   
   <include file="$(find iri_visual_gps)/launch/node.launch">
-    <arg name="node_name"       value="iri_visual_gps"/>
+    <arg name="node_name"       value="visual_gps"/>
     <arg name="positions_file"  value="position_sim.yaml"/>
     <arg name="param_file"      value="params_sim.yaml"/>
     <arg name="param_path"      value="$(find iri_visual_gps)/config"/>
-- 
GitLab