To record .avi video, I am using video_recorder for the image_view package. I want to do this through the launch file. Here is the how I put it in there

<node pkg="image_view" type="video_recorder" name="video_record_$(arg camera_name)" machine="$(arg machine)" if="$(eval record and enable_camera)">
             <arg name="fps" value="$(arg frame_rate)" />
             <arg name="codec" value="HFYU" />
             <arg name="encoding" value="$(arg image_encoding)" />

     </node>

I get error:

WARNING: WARN: unrecognized 'arg' child tag in the parent element:

Unfortunately I could not find a go-to syntax for this and I am new to ROS. Any help is appreciated. Feel free to ask for more details.

Here is the reference you are looking for: http://wiki.ros.org/roslaunch/XML

In this particular case, you probably want to use the args attribute inside the <node> node. From this page on the <node> node:

args="arg1 arg2 arg3"(optional)
Pass arguments to node.

Those values are parameters, not arguments. You can refer to http://wiki.ros.org/image_view#image_view.2BAC8-diamondback.video_recorder for documentation about video_recorder. In that case, your launch file should treat them as parameters with the <param> tag.

<node pkg="image_view" type="video_recorder" name="video_record_$(arg camera_name)" machine="$(arg machine)" if="$(eval record and enable_camera)">
     <param name="fps" value="$(arg frame_rate)" />
     <param name="codec" value="HFYU" />
     <param name="encoding" value="$(arg image_encoding)" />    
</node>

Notice the distinction between param and arg. 'arg' is an argument you're receiving from the commandline, which you're encoding as a parameter and sending to the node.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.