Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

empty string can be passed to ros::init as node name #73

Open
furushchev opened this issue Sep 11, 2016 · 2 comments
Open

empty string can be passed to ros::init as node name #73

furushchev opened this issue Sep 11, 2016 · 2 comments

Comments

@furushchev
Copy link
Contributor

furushchev commented Sep 11, 2016

In the current code, ros node is initialized at https://github.com/ros-naoqi/naoqi_driver/blob/master/src/ros_env.hpp#L93.
In this line, when this node is launched by roslaunch, ROS_NAMESPACE is set on environment variable, so ns_env is not NULL, so node name which is passed to ros::init is a return value of ::naoqi::ros_env::getPrefix(), but without passing argument --namespace=, ::naoqi::ros_env::getPrefix() returns empty string (https://github.com/ros-naoqi/naoqi_driver/blob/master/src/external_registration.cpp#L73), which means ros node is initialized with empty node name.
Since, initializing ros node with empty string is totally invalid (see ros/ros_comm#891), current naoqi_driver advertises topics under wrong namespace and also is registered to ros graph with invalid name.

In current code, also arguments passed from ROS tools (e.g. roslaunch) are totally removed before passing them to ros::init by ros::removeROSArgs (https://github.com/ros-naoqi/naoqi_driver/blob/master/src/external_registration.cpp#L34, (I really cannot understand why it is necessary)), so remapping node name by roslaunch does also not work at all.

  • Why arguments from command line are not just passed through ros::init?
  • Why ros node name must be specified by ::naoqi::ros_env::getPrefix(), not by ROS remapping?
@PacoDu
Copy link
Contributor

PacoDu commented Feb 8, 2017

Hi, i'm facing this issue when launching naoqi for Pepper robot. naoqi-driver thread is crashing with this error :

terminate called after throwing an instance of 'ros::InvalidNameException'
  what():  The node name must not be empty

Did you manage to overcome this error ?

(I'm using pepper_robot repo with pepper_full.launch)

@Karsten1987
Copy link
Contributor

From what I understand, this is looks like a clear flaw to me. Do you mind opening a pull request?
The latest change in this regard, was made here:
d325cda

Also, the reasoning for all this complex behavior of removing ros args etc. comes due to the fact that the initial code ought to be executed completely ROS agnostic within a libqi framework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants