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

Clean the namespace to get rid of double or trailing forward slashes … #1100

Merged
merged 4 commits into from
Jul 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions clients/roscpp/src/libros/this_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,12 @@ void ThisNode::init(const std::string& name, const M_string& remappings, uint32_
namespace_ = it->second;
}

if (namespace_.empty())
namespace_ = names::clean(namespace_);
if (namespace_.empty() || (namespace_[0] != '/'))
{
namespace_ = "/";
namespace_ = "/" + namespace_;
}

namespace_ = (namespace_ == "/")
? std::string("/")
: ("/" + namespace_)
;


std::string error;
if (!names::validate(namespace_, error))
{
Expand Down
2 changes: 2 additions & 0 deletions tools/roslaunch/src/roslaunch/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import os
import logging

import re
import socket
import sys
try:
Expand Down Expand Up @@ -456,6 +457,7 @@ def __init__(self, package, node_type, name=None, namespace='/', \
self.type = node_type
self.name = name or None
self.namespace = rosgraph.names.make_global_ns(namespace or '/')
self.namespace = re.sub("//+", "/", self.namespace)
self.machine_name = machine_name or None
self.respawn = respawn
self.respawn_delay = respawn_delay
Expand Down