mirror of
https://github.com/moveit/moveit_task_constructor.git
synced 2025-11-04 14:49:57 +08:00
getTaskId(): Replace '-' in hostname with '_' (#223)
This commit is contained in:
parent
9f18219993
commit
8a913d8bf3
@ -57,6 +57,8 @@ std::string getTaskId(const TaskPrivate* task) {
|
|||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
char our_hostname[256] = { 0 };
|
char our_hostname[256] = { 0 };
|
||||||
gethostname(our_hostname, sizeof(our_hostname) - 1);
|
gethostname(our_hostname, sizeof(our_hostname) - 1);
|
||||||
|
// Hostname could have `-` as a character but this is an invalid character in ROS so we replace it with `_`
|
||||||
|
std::replace(std::begin(our_hostname), std::end(our_hostname), '-', '_');
|
||||||
oss << our_hostname << "_" << getpid() << "_" << reinterpret_cast<std::size_t>(task);
|
oss << our_hostname << "_" << getpid() << "_" << reinterpret_cast<std::size_t>(task);
|
||||||
return oss.str();
|
return oss.str();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user