ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Change node name

asked 2018-01-15 07:16:18 -0500

Jeroenvdk gravatar image

Hi, i have this code from visp_auto_tracker, i want to change the name of the node

<!-- -*- xml -*-
     This tutorial relies on a live video sequence acquired with an 
     usb camera in front of a QR code planar target. The model 
     corresponding to this target is given into the models directory 
     of this package.
     Camera parameters are set as rosparam parameters. They need to be changed
     to be the one of your camera.
     See http://www.ros.org/wiki/visp_auto_tracker for more information.
  -->
<launch>
<!-- camera transforms -->
    <node pkg="tf" type="static_transform_publisher" 
        name="jeroen_cam_tf" args="0 0 1.0 -1.570796 0 -1.570796 /map /jeroen_camera 100"/>


  <!-- Launch the tracking node -->
  <node pkg="visp_auto_tracker" type="visp_auto_tracker" name="visp_auto_tracker" output="screen">
    <param name="model_path" value="$(find visp_auto_tracker)/models" />
    <param name="model_name" value="pattern" />
    <param name="debug_display" value="True" />

    <remap from="/visp_auto_tracker/camera_info" to="/usb_cam/camera_info"/>
    <remap from="/visp_auto_tracker/image_raw" to="/usb_cam/image_raw"/>
  </node>

  <!-- Launch the usb camera acquisition node left -->

  <node pkg="usb_cam" type="usb_cam_node" name="usb_cam" output="screen">      
    <param name="image_width" value="640" />
    <param name="image_height" value="480" />
    <param name="video_device" value="/dev/video0" />      
    <param name="pixel_format" value="yuyv" />
    <!-- rename the camera name topic into /camera/image_raw to match the one in visp_auto_tracker/models/calibration.ini file --> 
    <param name="camera_name" value="/camera/image_raw" />
    <param name="camera_info_url" value="package://visp_auto_tracker/models/calibration.ini" type="string" />
  </node>
</launch>

What i want is to change this line:

 <node pkg="usb_cam" type="usb_cam_node" name="usb_cam" output="screen">

Into this:

 <node pkg="usb_cam" type="usb_cam_node" name="usb_cam1" output="screen">

But the launch file won't work after that change..

edit retag flag offensive close merge delete

Comments

1

Please always clarify what it is that you observe when something "won't work after that change".

We can't guess what you see, so that makes it very difficult to help you.

gvdhoorn gravatar image gvdhoorn  ( 2018-01-15 07:32:06 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
3

answered 2018-01-15 07:31:20 -0500

gvdhoorn gravatar image

updated 2018-01-15 07:41:34 -0500

The launch file most likely works fine, but you have to make sure that all the other nodes can still subscribe to the topics they need.

This line for instance:

<remap from="/visp_auto_tracker/camera_info" to="/usb_cam/camera_info"/>

remaps to a /usb_cam namespace, which should probably correspond to the name of the usb_cam node.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-01-15 07:16:18 -0500

Seen: 4,207 times

Last updated: Jan 15 '18