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

Turtlebot3 LiDAR laser_filter package error "Reason: new node registered with same name"

asked 2022-01-27 19:43:13 -0500

distro gravatar image

updated 2022-01-29 14:45:07 -0500

tryan gravatar image

i'm trying to use a laser_filter package to help my turtlebot3 LiDAR data. This is my launch file:

<launch>
  <arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>

  <include file="$(find turtlebot3_bringup)/launch/turtlebot3_remote.launch">
    <arg name="model" value="$(arg model)" />
  </include>

  <node pkg="laser_filters" type="scan_to_scan_filter_chain" output="screen" name="laser_filter">
    <rosparam command="load" file="$(find test)/my_laser_config.yaml" />
    <param name="~tf_message_filter_target_frame" type="str" value="base_scan" />
    <remap from="scan" to="base_scan" />
    <remap from="scan_filtered" to="/scan_filtered" />
  </node>
</launch>

I get this error when I launch it:

[ WARN] [1643321298.168853230]: Shutdown request received.
[ WARN] [1643321298.169861311]: Reason given for shutdown: [[/robot_state_publisher] Reason: new node registered with same name]

I dont know where in my files I would have nodes with the same name that I assume publish to /robot_state_plusher or are named robot_state_publisher. I need help fixing this issue

edit retag flag offensive close merge delete

Comments

1

robot_state_publisher is the name of the duplicate node--not topic. Your included launch file (turtlebaot3_remote.launch) contains one such node. If you're running any other launch files, they may also contain a node with the same name. This error also arises if you have a node leftover from a previous launch, e.g., you run a test with your launch file, decide to change a parameter, and try to launch the test again without first stopping the previous run.

tryan gravatar image tryan  ( 2022-01-29 14:55:52 -0500 )edit

@tryan The only other launch file I have to run beforehand is the turtlebot3_robot.launch file here:

<launch>
  <arg name="multi_robot_name" default=""/>
  <arg name="set_lidar_frame_id" default="base_scan"/>

  <include file="$(find turtlebot3_bringup)/launch/turtlebot3_core.launch">
    <arg name="multi_robot_name" value="$(arg multi_robot_name)"/>
  </include>
  <include file="$(find turtlebot3_bringup)/launch/turtlebot3_lidar.launch">
    <arg name="set_frame_id" value="$(arg set_lidar_frame_id)"/>
  </include>

  <node pkg="turtlebot3_bringup" type="turtlebot3_diagnostics" name="turtlebot3_diagnostics" output="screen"/>
</launch>
distro gravatar image distro  ( 2022-01-30 01:38:00 -0500 )edit

@tryan Which includes turtlebot3_core.launch:

<launch>
  <arg name="multi_robot_name" default=""/>

  <node pkg="rosserial_python" type="serial_node.py" name="turtlebot3_core" output="screen">
    <param name="port" value="/dev/ttyACM0"/>
    <param name="baud" value="115200"/>
    <param name="tf_prefix" value="$(arg multi_robot_name)"/>
  </node>
</launch>

And turtlebot3_lidar.launch:

<launch>
  <arg name="set_frame_id" default="base_scan"/>

  <node pkg="hls_lfcd_lds_driver" type="hlds_laser_publisher" name="turtlebot3_lds" output="screen">
    <param name="port" value="/dev/ttyUSB0"/>
    <param name="frame_id" value="$(arg set_frame_id)"/>
  </node>
</launch>

None of which as you can see contain any node of name robot_state_publisher

distro gravatar image distro  ( 2022-01-30 01:40:30 -0500 )edit

@tryan Any other ideas to what could be going on?

distro gravatar image distro  ( 2022-01-30 01:45:05 -0500 )edit

The launch files, indeed, look fine. This may have been implicit in your reply, but are you starting a fresh session each time? If you don't shut down the master and you happen to have left a robot_state_publisher running in a different launch/terminal, it would cause this error. As noted by @ljaniec, rosnode list is a good way to see which nodes are running. You could look at the list before launching anything to make sure no errant nodes are there, then after each launch to see what has changed.

tryan gravatar image tryan  ( 2022-01-31 19:59:51 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2022-01-30 08:02:35 -0500

ljaniec gravatar image

updated 2022-02-01 17:13:42 -0500

This means you have used the same node name more than once in your Python or launch files, or you’re trying to launch the same program when it’s already running. Please check the following for this repetition:

  • Your rospy.init_node() statements
  • Your launch file node declaration: <node name="whatever" ... />

It’s about the name for your node in your Python code and launch files.

You should check with rostopic list and rosnode list what each launcher starts separately, topics and nodes. The node called robot_state_publisher could be buried in these.

Side note: AFAIK from https://emanual.robotis.com/docs/en/p... you should just connect with ssh to your TB3 and launch bringup scripts. Why do you use turtlebot3_remote.launch too?

laser_filters/LaserScanSpeckleFilter
  params:
    # Select which filter type to use.
    # 0: Range based filtering (distance between consecutive points)
    # 1: Euclidean filtering based on radius outlier search
    filter_type:0

    # Only ranges smaller than this range are taken into account
    max_range: 2.0

    # filter_type[0] (Distance): max distance between consecutive points
    # filter_type[1] (RadiusOutlier): max distance between points
    max_range_difference: 0.1

    # filter_type[0] (Distance): Number of consecutive ranges that will be tested for max_distance
    # filter_type[1] (RadiusOutlier): Minimum number of neighbors
    filter_window: 2
edit flag offensive delete link more

Comments

@ljaniec I'm not directly using the turtlebot3_remote.launch , I am trying to make a launch file that runs the laser_filter package to clean up my LiDAR data, I got the idea for the launch file here, as it is specific for the turtlebot3. When I look at the script(scan_to_scan_filter) in said launch file: type="scan_to_scan_filter_chain"., which you can see here. I don't see any node of the name robot_state_publisher here. I always ssh my TB3 and use the command roslaunch turtlebot3_bringup turtlebot3_robot.launch. Im not using ROS2, I use ROS1. Not sure why you say I should ros2 topic list -t .

distro gravatar image distro  ( 2022-01-30 14:36:05 -0500 )edit

I wrote the commands too fast and made a mistake, I mainly work with ROS2 now, sorry. I edited the commands - the info will still be useful to pinpoint the problematic node. ROBOTIS launchfile seems fine. Maybe it is a problem with ROS packages? Did you try to do clean & rebuild?

ljaniec gravatar image ljaniec  ( 2022-01-30 15:39:45 -0500 )edit

This project has an example launcher with laser_filters, maybe it could help you analyze your case

ljaniec gravatar image ljaniec  ( 2022-01-30 15:51:01 -0500 )edit

@ljaniec So I launch my turtlebot3_robot.launch first and then rostopic list and rosnode list. Then I note what info that gives me. In another terminal i launch the file I wanna use for my filter and then rostopic list and rosnode list again?

distro gravatar image distro  ( 2022-01-30 20:45:26 -0500 )edit

Yeah, sort of. You want to see where second robot_state_publisher come from.

ljaniec gravatar image ljaniec  ( 2022-01-31 04:36:02 -0500 )edit

@ljaniec You were right, launching my_laser_filter launch file activated a node robot_state_publisher, launcing my Rviz also activated a node of same name. This is because of this part of my launch file here:

 <include file="$(find turtlebot3_bringup)/launch/turtlebot3_remote.launch">
    <arg name="model" value="$(arg model)" />
  </include>

When I remove that part it's fine, however, the filter seems to not do anything though. This is my .yaml file. I was informed that the speckle filter was what would help me.

scan_filter_chain:
- name: speckle_filter
  type: laser_filters/LaserScanSpeckleFilter
  params:
    filter_type: 0
    max_range: 4.0
    max_range_difference: 0.1
    filter_window: 2
distro gravatar image distro  ( 2022-02-01 03:29:20 -0500 )edit

@ljaniec Do I change the scan topic in Rviz to scan_filtered?

distro gravatar image distro  ( 2022-02-01 03:31:12 -0500 )edit

By the example project I linked above you can see that there is a remap indeed:

<node pkg="laser_filters" type="scan_to_scan_filter_chain" name="laser_filter"><rosparam command="load" file="$(find laser_filters)/turtlebot3_range_filter.yaml"/><remap from="scan_filtered" to="/laserscan_filtered" /></node>

I assume with RViz it should be something similar, just check every scan related topic in RViz.

ljaniec gravatar image ljaniec  ( 2022-02-01 04:05:00 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-01-27 19:43:13 -0500

Seen: 262 times

Last updated: Feb 01 '22