You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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.
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, sons_env
is notNULL
, so node name which is passed toros::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 toros::init
byros::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 byroslaunch
does also not work at all.ros::init
?::naoqi::ros_env::getPrefix()
, not by ROS remapping?The text was updated successfully, but these errors were encountered: