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

Reason given for shutdown: [new node registered with same name]

asked 2018-07-25 14:08:06 -0500

hamzh.albar@gmail.com gravatar image

Hello Here is what I'm trying to : I'm using an rplidar, arduino connected to Raspberry with ROS kinetic, to do autonomous mapping and navigation.

First, i run the rplidar with

roslaunch rplidar_ros view_rplidar.launch

then , slam mapping with

roslaunch rplidar_ros view_slam.launch

then I used hector_exploration with

roslaunch hector_exploration_node exploration_planner.launch

Final, to publish the cmd_vel topic I run

rosrun hector_exploration_controller simple_exploration_controller

My question, when I try to send cmd_vel values to Arduino through this code below

#include <ArduinoHardware.h>
#include <ros.h>
#include <geometry_msgs/Twist.h>

ros::NodeHandle nh;

geometry_msgs::Twist msg;

ros::Publisher pub("cmd_vel", &msg);

void setup()
{
 nh.initNode();
 nh.advertise(pub);
} void loop()
{

pub.publish(&msg);
nh.spinOnce();
}

Once I run this code on arduino, my rplidar stop spinning and give me this error message

[ WARN] [1532545086.000125786]: Shutdown request received.
[ WARN] [1532545086.000656149]: Reason given for shutdown: [new node registered with same name]
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2018-07-25 14:24:14 -0500

jayess gravatar image

Node names need to be unique. You have more than one node with the same name. Make sure that every node name is unique and you won't get this behavior.

edit flag offensive delete link more

Comments

Make sense, in this case the only node should be cmd_vel since everything working fine before running the arduino code ? If so, how can I change the node name and send to arduino in the same time ??

hamzh.albar@gmail.com gravatar image hamzh.albar@gmail.com  ( 2018-07-25 14:36:28 -0500 )edit

It depends on which nodes are giving you trouble. The full error should say what the name of the node is.

jayess gravatar image jayess  ( 2018-07-25 16:31:57 -0500 )edit

@hamzh.albar@gmail.com">@hamzh.albar@gmail.com if this answered your question, please click on the check mark to mark this answer as correct.

jayess gravatar image jayess  ( 2018-07-26 15:04:37 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2018-07-25 14:08:06 -0500

Seen: 15,311 times

Last updated: Jul 25 '18