title: Doing like roslaunch in C++ : Launch NodeHandle with specific type
body: <p>I'm new to ROS and i'm looking for launching a 'video_stream_opencv' node programatically. </p>
  
  <p>Link below :
  <a href="http://wiki.ros.org/video_stream_opencv" rel="nofollow noreferrer">http://wiki.ros.org/video_stream_opencv</a></p>
  
  <p>the launch file is working well with the commands roslaunch 
  
      
      
      
      
      
      
      
      
      
      
      
      
      
      
          
          
      
      </p>
  
  <pre><code>&lt;!-- images will be published at /camera_name/image with the image transports plugins (e.g.: compressed) installed --&gt;
  &lt;group ns="$(arg camera_name)"&gt;
      &lt;node pkg="video_stream_opencv" type="video_stream" name="$(arg camera_name)_stream" output="screen"&gt; 
          &lt;remap from="camera" to="image_raw" /&gt;
          &lt;param name="camera_name" type="string" value="$(arg camera_name)" /&gt;
          &lt;param name="video_stream_provider" type="string" value="$(arg video_stream_provider)" /&gt;
          &lt;param name="fps" type="int" value="$(arg fps)" /&gt;
          &lt;param name="frame_id" type="string" value="$(arg frame_id)" /&gt;
          &lt;param name="camera_info_url" type="string" value="$(arg camera_info_url)" /&gt;
          &lt;param name="flip_horizontal" type="bool" value="$(arg flip_horizontal)" /&gt;
          &lt;param name="flip_vertical" type="bool" value="$(arg flip_vertical)" /&gt;
          &lt;param name="width" type="int" value="$(arg width)" /&gt;
          &lt;param name="height" type="int" value="$(arg height)" /&gt;
      &lt;/node&gt;
  
      &lt;node if="$(arg visualize)" name="$(arg camera_name)_image_view" pkg="image_view" type="image_view"&gt;
          &lt;remap from="image" to="image_raw" /&gt;
      &lt;/node&gt;
  &lt;/group&gt;
  </code></pre>
  
  <p></p>
  
  <p>But now i'm trying to do the same with C++ code but i don't see how to set the 'type' attributes in my node...</p>
  
  <pre><code>printf("Started ROS thread\n");
  
  //glutInit(&amp;argc, argv);
  
  ros::init(argc, argv, "camera_name);
  ROS_INFO("camera_name started");
  
  
  // MY params to set
  std::string camera_name = "toto";
  std::string video_stream_provider = "toto";
  int  fps  = 30;
  std::string  frame_id= "toto";
  std::string  camera_info_url= "toto";
  bool flip_horizontal= false;
  bool flip_vertical= false;
  int width = 30;
  int height = 30;
  
  ros::NodeHandle nh;
  ros::M_string remappings;
  remappings.insert(std::make_pair("camera", "image_raw"));
  ros::NodeHandle node_handle(nh, "camera_name",remappings);
  
  node_handle.setParam("type",video_stream);
  node_handle.setParam("camera_name",camera_name);
  node_handle.setParam("video_stream_provider",video_stream_provider );
  node_handle.setParam("fps",fps);
  node_handle.setParam("frame_id",frame_id);
  node_handle.setParam("camera_info_url", camera_info_url);
  node_handle.setParam("flip_horizontal", flip_horizontal);
  node_handle.setParam("flip_vertical",flip_vertical);
  node_handle.setParam("width", width);
  node_handle.setParam("height", height);
  </code></pre>