-
Notifications
You must be signed in to change notification settings - Fork 93
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
[ros_env.hpp] delete std::getenv(ROS_NAMESPACE) #81
[ros_env.hpp] delete std::getenv(ROS_NAMESPACE) #81
Conversation
src/ros_env.hpp
Outdated
@@ -89,8 +89,7 @@ static void setMasterURI( const std::string& uri, const std::string& network_int | |||
remap["__master"] = uri; | |||
remap["__ip"] = ::naoqi::ros_env::getROSIP(network_interface); | |||
// init ros without a sigint-handler in order to shutdown correctly by naoqi | |||
const char* ns_env = std::getenv("ROS_NAMESPACE"); | |||
ros::init( remap, (ns_env==NULL)?(std::string("naoqi_driver_node")):(::naoqi::ros_env::getPrefix()) , ros::init_options::NoSigintHandler ); | |||
ros::init(remap, std::string("naoqi_driver_node"), ros::init_options::NoSigintHandler); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, we should still consider the namespace and the prefix option.
The prefix option is meant to be set once the naoqi driver is loaded as a naoqi module.
When loaded externally (as a ros module), we should still have the option of namespacing. Have a look at this one: http://wiki.ros.org/Remapping%20Arguments
Since we anyway use the remapping options, we can then also set the __ns field.
Does this make sense what I am saying?
We could
0a074af
to
d38fed4
Compare
Thank you very much for your advice. case1: use ROS_NAMESPACE (something wrong) case1.
case2.
case3.
|
I'm very sorry. case1: prefix: default, ROS_NAMESPACE: x
case2: prefix: "test", ROS_NAMESPACE: x
case3: prefix: default, ROS_NAMESPACE: "pepepe"
case4: prefix: "test", ROS_NAMESPACE: "pepepe"
|
I intended to create this and ros-naoqi/pepper_robot#37 for ros-naoqi/pepper_robot#35. |
This PR looks good to me? Why is this closed? Maybe you can cross-reference with the other open PRs for not duplicating work. |
Hi,
I encountered the same issue as ros-naoqi/pepper_robot#35.
My environment is ubuntu 16.04, ros kinetic, naoqi 2.4.3.28.
I use source of naoqi_driver and pepper_robot package.
If there are any comments, please let me know.
=>
From #73, I learned that we can set ROS_NAMESPACE as a environmental variable, but in this case, we have to change the codes to use
std::getenv(ROS_NAMESPACE)
.(I didn't know how to change them...)