From afbe09d227a55e8918962f90a9c8293a1936705e Mon Sep 17 00:00:00 2001 From: fherrero <fherrero@iri.upc.edu> Date: Mon, 17 Sep 2018 17:44:06 +0200 Subject: [PATCH] Updated color yaml files and added non-nodelet launch example --- config/blue_conf.yaml | 6 ++-- config/sim_position.yaml | 4 +-- launch/visual_gps.launch | 9 +++--- launch/visual_gps_sim.launch | 41 +++++++++++++++++++-------- launch/visual_gps_sim_nodelets.launch | 41 +++++++++++++++++++++++++++ 5 files changed, 80 insertions(+), 21 deletions(-) create mode 100644 launch/visual_gps_sim_nodelets.launch diff --git a/config/blue_conf.yaml b/config/blue_conf.yaml index beeba6d..87d1cd2 100644 --- a/config/blue_conf.yaml +++ b/config/blue_conf.yaml @@ -1,9 +1,9 @@ color_id: blue H_center: 240 H_window: 10 -S_center: 250 +S_center: 255 S_window: 10 V_center: 102 -V_window: 8 +V_window: 10 max_area: 100000 -min_area: 10 +min_area: 10 \ No newline at end of file diff --git a/config/sim_position.yaml b/config/sim_position.yaml index 99d7282..5652a75 100644 --- a/config/sim_position.yaml +++ b/config/sim_position.yaml @@ -9,9 +9,9 @@ color2_z: 4.0 color3_id: yellow color3_x: -2.5 color3_y: -5.0 -color3_z: 2.0 +color3_z: 4.0 color4_id: blue color4_x: 0.0 color4_y: -7.5 -color4_z: 2.0 +color4_z: 4.0 diff --git a/launch/visual_gps.launch b/launch/visual_gps.launch index ed0c943..22bcbb4 100644 --- a/launch/visual_gps.launch +++ b/launch/visual_gps.launch @@ -1,3 +1,4 @@ +<!-- --> <launch> <node pkg="nodelet" type="nodelet" name="visual_gps_nodelet" args="manager" output="screen"> @@ -7,25 +8,25 @@ <remap from="~/image_in/image_raw" to="/usb_cam/image_raw"/> <remap from="~/image_in/camera_info" to="/usb_cam/camera_info"/> <remap from="~/blobs" to="/visual_gps/color1_blobs"/> - <rosparam file="$(find iri_blob_detector)/config/default_params.yaml" command="load" /> + <rosparam file="$(find iri_blob_detector)/config/red_conf.yaml" command="load" /> </node> <node pkg="nodelet" type="nodelet" name="blob_detector_color2" args="load iri_blob_detector/BlobDetectorNodelet visual_gps_nodelet" output="screen"> <remap from="~/image_in/image_raw" to="/usb_cam/image_raw"/> <remap from="~/image_in/camera_info" to="/usb_cam/camera_info"/> <remap from="~/blobs" to="/visual_gps/color2_blobs"/> - <rosparam file="$(find iri_blob_detector)/config/default_params.yaml" command="load" /> + <rosparam file="$(find iri_blob_detector)/config/blue_conf.yaml" command="load" /> </node> <node pkg="nodelet" type="nodelet" name="blob_detector_color3" args="load iri_blob_detector/BlobDetectorNodelet visual_gps_nodelet" output="screen"> <remap from="~/image_in/image_raw" to="/usb_cam/image_raw"/> <remap from="~/image_in/camera_info" to="/usb_cam/camera_info"/> <remap from="~/blobs" to="/visual_gps/color3_blobs"/> - <rosparam file="$(find iri_blob_detector)/config/default_params.yaml" command="load" /> + <rosparam file="$(find iri_blob_detector)/config/green_conf.yaml" command="load" /> </node> <node pkg="nodelet" type="nodelet" name="blob_detector_color4" args="load iri_blob_detector/BlobDetectorNodelet visual_gps_nodelet" output="screen"> <remap from="~/image_in/image_raw" to="/usb_cam/image_raw"/> <remap from="~/image_in/camera_info" to="/usb_cam/camera_info"/> <remap from="~/blobs" to="/visual_gps/color4_blobs"/> - <rosparam file="$(find iri_blob_detector)/config/default_params.yaml" command="load" /> + <rosparam file="$(find iri_blob_detector)/config/yellow_conf.yaml" command="load" /> </node> <node pkg="nodelet" type="nodelet" name="camera" args="load libuvc_camera/driver visual_gps_nodelet" output="screen"> <!-- <param name="vendor" value="0x046d"/> diff --git a/launch/visual_gps_sim.launch b/launch/visual_gps_sim.launch index b4a5e0b..75c7f08 100644 --- a/launch/visual_gps_sim.launch +++ b/launch/visual_gps_sim.launch @@ -1,32 +1,49 @@ +<!-- --> <launch> - <node pkg="nodelet" type="nodelet" name="visual_gps_nodelet" args="manager" output="screen"> - - </node> + <arg name="positions_file" default="sim_position_track18.yaml"/> + <arg name="positions_path" default="$(find iri_visual_gps)/config"/> + + <arg name="config_yaml_file_location" default="$(find iri_visual_gps)/config"/> - <node pkg="nodelet" type="nodelet" name="blob_detector_color1" args="load iri_blob_detector/BlobDetectorNodelet visual_gps_nodelet" output="screen"> + <node name="blob1" + pkg="iri_blob_detector" + type="iri_blob_detector" + output="screen"> <remap from="~/image_in/image_raw" to="/usb_cam/image_raw"/> <remap from="~/image_in/camera_info" to="/usb_cam/camera_info"/> <remap from="~/blobs" to="/visual_gps/color1_blobs"/> - <rosparam file="$(find iri_visual_gps)/config/green_conf.yaml" command="load" /> + <rosparam file="$(arg config_yaml_file_location)/green_conf.yaml" command="load" /> </node> - <node pkg="nodelet" type="nodelet" name="blob_detector_color2" args="load iri_blob_detector/BlobDetectorNodelet visual_gps_nodelet" output="screen"> + + <node name="blob2" + pkg="iri_blob_detector" + type="iri_blob_detector" + output="screen"> <remap from="~/image_in/image_raw" to="/usb_cam/image_raw"/> <remap from="~/image_in/camera_info" to="/usb_cam/camera_info"/> <remap from="~/blobs" to="/visual_gps/color2_blobs"/> - <rosparam file="$(find iri_visual_gps)/config/red_conf.yaml" command="load" /> + <rosparam file="$(arg config_yaml_file_location)/red_conf.yaml" command="load" /> </node> - <node pkg="nodelet" type="nodelet" name="blob_detector_color3" args="load iri_blob_detector/BlobDetectorNodelet visual_gps_nodelet" output="screen"> + + <node name="blob3" + pkg="iri_blob_detector" + type="iri_blob_detector" + output="screen"> <remap from="~/image_in/image_raw" to="/usb_cam/image_raw"/> <remap from="~/image_in/camera_info" to="/usb_cam/camera_info"/> <remap from="~/blobs" to="/visual_gps/color3_blobs"/> - <rosparam file="$(find iri_visual_gps)/config/yellow_conf.yaml" command="load" /> + <rosparam file="$(arg config_yaml_file_location)/yellow_conf.yaml" command="load" /> </node> - <node pkg="nodelet" type="nodelet" name="blob_detector_color4" args="load iri_blob_detector/BlobDetectorNodelet visual_gps_nodelet" output="screen"> + + <node name="blob4" + pkg="iri_blob_detector" + type="iri_blob_detector" + output="screen"> <remap from="~/image_in/image_raw" to="/usb_cam/image_raw"/> <remap from="~/image_in/camera_info" to="/usb_cam/camera_info"/> <remap from="~/blobs" to="/visual_gps/color4_blobs"/> - <rosparam file="$(find iri_visual_gps)/config/blue_conf.yaml" command="load" /> + <rosparam file="$(arg config_yaml_file_location)/blue_conf.yaml" command="load" /> </node> <node pkg="iri_visual_gps" @@ -35,6 +52,6 @@ output="screen"> <remap from="~/camera/camera_info" to="/usb_cam/camera_info"/> <remap from="~/set_camera_params" to="/usb_cam/set_parameters"/> - <rosparam file="$(find iri_visual_gps)/config/sim_position.yaml" command="load" /> + <rosparam file="$(arg positions_path)/$(arg positions_file)" command="load" /> </node> </launch> diff --git a/launch/visual_gps_sim_nodelets.launch b/launch/visual_gps_sim_nodelets.launch new file mode 100644 index 0000000..aa0f395 --- /dev/null +++ b/launch/visual_gps_sim_nodelets.launch @@ -0,0 +1,41 @@ +<!-- --> +<launch> + + <node pkg="nodelet" type="nodelet" name="visual_gps_nodelet" args="manager" output="screen"> + + </node> + + <node pkg="nodelet" type="nodelet" name="blob_detector_color1" args="load iri_blob_detector/BlobDetectorNodelet visual_gps_nodelet" output="screen"> + <remap from="~/image_in/image_raw" to="/usb_cam/image_raw"/> + <remap from="~/image_in/camera_info" to="/usb_cam/camera_info"/> + <remap from="~/blobs" to="/visual_gps/color1_blobs"/> + <rosparam file="$(find iri_visual_gps)/config/green_conf.yaml" command="load" /> + </node> + <node pkg="nodelet" type="nodelet" name="blob_detector_color2" args="load iri_blob_detector/BlobDetectorNodelet visual_gps_nodelet" output="screen"> + <remap from="~/image_in/image_raw" to="/usb_cam/image_raw"/> + <remap from="~/image_in/camera_info" to="/usb_cam/camera_info"/> + <remap from="~/blobs" to="/visual_gps/color2_blobs"/> + <rosparam file="$(find iri_visual_gps)/config/red_conf.yaml" command="load" /> + </node> + <node pkg="nodelet" type="nodelet" name="blob_detector_color3" args="load iri_blob_detector/BlobDetectorNodelet visual_gps_nodelet" output="screen"> + <remap from="~/image_in/image_raw" to="/usb_cam/image_raw"/> + <remap from="~/image_in/camera_info" to="/usb_cam/camera_info"/> + <remap from="~/blobs" to="/visual_gps/color3_blobs"/> + <rosparam file="$(find iri_visual_gps)/config/yellow_conf.yaml" command="load" /> + </node> + <node pkg="nodelet" type="nodelet" name="blob_detector_color4" args="load iri_blob_detector/BlobDetectorNodelet visual_gps_nodelet" output="screen"> + <remap from="~/image_in/image_raw" to="/usb_cam/image_raw"/> + <remap from="~/image_in/camera_info" to="/usb_cam/camera_info"/> + <remap from="~/blobs" to="/visual_gps/color4_blobs"/> + <rosparam file="$(find iri_visual_gps)/config/blue_conf.yaml" command="load" /> + </node> + + <node pkg="iri_visual_gps" + type="iri_visual_gps" + name="visual_gps" + output="screen"> + <remap from="~/camera/camera_info" to="/usb_cam/camera_info"/> + <remap from="~/set_camera_params" to="/usb_cam/set_parameters"/> + <rosparam file="$(find iri_visual_gps)/config/sim_position.yaml" command="load" /> + </node> +</launch> -- GitLab