Ask Your Question

Revision history [back]

As this node is a bit complex to launch and requires remapping and argument passing. I would suggest that you write a roslaunch file. The syntax is way easier to understand than the command line arguments (converting '~' to '_' where needed is tricky).

Here is a a roslaunch file adapted to your needs:

<?xml version="1" encoding="utf-8"?>
<launch>
<node pkg="nodelet" type="nodelet" args="standalone image_proc/crop_decimate">
  <param name="x_offset" type="int" value="1" />
  <param name="y_offset" type="int" value="1" />
  <param name="width" type="int" value="639" />
  <param name="height" type="int" value="439" />

  <!-- edit values here -->
  <remap from="camera/image_raw" to="/you/image/topic"/>
  <remap from="camera/image_info" to="/you/image/info/topic"/>

  <!-- you can also remap the output topics using these lines:
  <remap from="camera_out/image_raw" to="/you/output/image/topic"/>
  <remap from="camera_out/image_info" to="/you/output/camera/info/topic"/>
    -->
</node>
</launch>

Please see the roslaunch wiki page for more information.

click to hide/show revision 2
Add missing name attribute in launch file.

As this node is a bit complex to launch and requires remapping and argument passing. I would suggest that you write a roslaunch file. The syntax is way easier to understand than the command line arguments (converting '~' to '_' where needed is tricky).

Here is a a roslaunch file adapted to your needs:

<?xml version="1" encoding="utf-8"?>
<launch>
<node pkg="nodelet" type="nodelet" type="nodelet"
      args="standalone image_proc/crop_decimate">
image_proc/crop_decimate"
      name="my_decimator">
  <param name="x_offset" type="int" value="1" />
  <param name="y_offset" type="int" value="1" />
  <param name="width" type="int" value="639" />
  <param name="height" type="int" value="439" />

  <!-- edit values here -->
  <remap from="camera/image_raw" to="/you/image/topic"/>
  <remap from="camera/image_info" to="/you/image/info/topic"/>

  <!-- you can also remap the output topics using these lines:
  <remap from="camera_out/image_raw" to="/you/output/image/topic"/>
  <remap from="camera_out/image_info" to="/you/output/camera/info/topic"/>
    -->
</node>
</launch>

Please see the roslaunch wiki page for more information.

As this node is a bit complex to launch and requires remapping and argument passing. I would suggest that you write a roslaunch file. The syntax is way easier to understand than the command line arguments (converting '~' to '_' where needed is tricky).

Here is a a roslaunch file adapted to your needs:

<?xml version="1" encoding="utf-8"?>
<launch>
<node pkg="nodelet" type="nodelet"
      args="standalone image_proc/crop_decimate"
      name="my_decimator">
  <param name="x_offset" type="int" value="1" />
  <param name="y_offset" type="int" value="1" />
  <param name="width" type="int" value="639" />
  <param name="height" type="int" value="439" />

  <!-- edit values here -->
  <remap from="camera/image_raw" to="/you/image/topic"/>
to="/your/image/topic"/>
  <remap from="camera/image_info" to="/you/image/info/topic"/>
to="/your/image/info/topic"/>

  <!-- you can also remap the output topics using these lines:
  <remap from="camera_out/image_raw" to="/you/output/image/topic"/>
  <remap from="camera_out/image_info" to="/you/output/camera/info/topic"/>
    -->
</node>
</launch>

Please see the roslaunch wiki page for more information.

As this node is a bit complex to launch and requires remapping and argument passing. I would suggest that you write a roslaunch file. The syntax is way easier to understand than the command line arguments (converting '~' to '_' where needed is tricky).

Here is a a roslaunch file adapted to your needs:

<?xml version="1" encoding="utf-8"?>
<launch>
<node pkg="nodelet" type="nodelet"
      args="standalone image_proc/crop_decimate"
      name="my_decimator">
  <param name="x_offset" type="int" value="1" />
  <param name="y_offset" type="int" value="1" />
  <param name="width" type="int" value="639" />
  <param name="height" type="int" value="439" />

  <!-- edit values here -->
  <remap from="camera/image_raw" to="/your/image/topic"/>
  <remap from="camera/image_info" to="/your/image/info/topic"/>

  <!-- you can also remap the output topics using these lines:
  <remap from="camera_out/image_raw" to="/you/output/image/topic"/>
to="/image_rect_color"/>
  <remap from="camera_out/image_info" to="/you/output/camera/info/topic"/>
    -->
</node>
</launch>

Please see the roslaunch wiki page for more information.

As this node is a bit complex to launch and requires remapping and argument passing. I would suggest that you write a roslaunch file. The syntax is way easier to understand than the command line arguments (converting '~' to '_' where needed is tricky).

Here is a a roslaunch file adapted to your needs:

<?xml version="1" encoding="utf-8"?>
<launch>
<node pkg="nodelet" type="nodelet"
      args="standalone image_proc/crop_decimate"
      name="my_decimator">
  <param name="x_offset" type="int" value="1" />
  <param name="y_offset" type="int" value="1" />
  <param name="width" type="int" value="639" />
  <param name="height" type="int" value="439" />

  <!-- edit values here remap input topics -->
  <remap from="camera/image_raw" to="/your/image/topic"/>
to="/image_rect_color"/>
  <remap from="camera/image_info" to="/your/image/info/topic"/>
to="/gscam/camera_info"/>

  <!-- you can also remap the output topics using these lines:
-->
  <remap from="camera_out/image_raw" to="/image_rect_color"/>
to="/camera_crop/image_rect_color"/>
  <remap from="camera_out/image_info" to="/you/output/camera/info/topic"/>
    -->
to="/camera_crop/camera_info"/>
</node>
</launch>

Please see the roslaunch wiki page for more information.

As this node is a bit complex to launch and requires remapping and argument passing. I would suggest that you write a roslaunch file. The syntax is way easier to understand than the command line arguments (converting '~' to '_' where needed is tricky).

Here is a a roslaunch file adapted to your needs:

<?xml version="1" encoding="utf-8"?>
<launch>
<node pkg="nodelet" type="nodelet"
      args="standalone image_proc/crop_decimate"
      name="my_decimator">
  <param name="x_offset" type="int" value="1" />
  <param name="y_offset" type="int" value="1" />
  <param name="width" type="int" value="639" />
  <param name="height" type="int" value="439" />

  <!-- remap input topics -->
  <remap from="camera/image_raw" to="/image_rect_color"/>
  <remap from="camera/image_info" to="/gscam/camera_info"/>

  <!-- remap output topics -->
  <remap from="camera_out/image_raw" to="/camera_crop/image_rect_color"/>
  <remap from="camera_out/image_info" to="/camera_crop/camera_info"/>
</node>
</launch>

Please see the roslaunch wiki page for more information.

Here is a complete ROS launch file which works on my computer (Ubuntu 10.04 / Electric):

<?xml version="1" encoding="utf-8"?>
<launch>

<node pkg="gscam" type="gscam"
      name="gscam"
      cwd="node">
  <env name="GSCAM_CONFIG"
       value="v4l2src device=/dev/video0 ! video/x-raw-rgb,framerate=30/1 ! ffmpegcolorspace"/>

</node>

<node pkg="image_proc" type="image_proc"
      ns="gscam"
      name="image_proc">
</node>

<node pkg="nodelet" type="nodelet"
      args="standalone image_proc/crop_decimate"
      name="my_decimator">
  <param name="x_offset" type="int" value="1" />
  <param name="y_offset" type="int" value="1" />
  <param name="width" type="int" value="639" />
  <param name="height" type="int" value="439" />

  <!-- remap input topics -->
  <remap from="camera/image_raw" to="/gscam/image_rect_color"/>
  <remap from="camera/image_info" to="/gscam/camera_info"/>

  <!-- remap output topics -->
  <remap from="camera_out/image_raw" to="/camera_crop/image_rect_color"/>
  <remap from="camera_out/image_info" to="/camera_crop/camera_info"/>
</node>
</launch>