Ask Your Question

Change node name

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

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 for more information.
<!-- 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"/>

  <!-- 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" />

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



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 imagegvdhoorn ( 2018-01-15 07:32:06 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

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

gvdhoorn gravatar image

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

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


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

Seen: 2,392 times

Last updated: Jan 15 '18