6 #include "../package_registry.h" 13 #include <fmt/format.h> 15 template<
typename... Args>
16 std::runtime_error
error(
const char* format,
const Args& ... args)
18 std::string msg = fmt::format(format, args...);
19 return std::runtime_error(msg);
28 Node::Node(std::string name, std::string package, std::string type)
29 : m_name(
std::move(name))
30 , m_package(
std::move(package))
31 , m_type(
std::move(type))
39 , m_coredumpsEnabled(true)
40 , m_clearParams(false)
42 , m_memoryLimitByte(15e6)
45 , m_stdoutDisplayed(true)
60 std::string
clean = argString;
63 if(c ==
'\n' || c ==
'\r')
70 int ret = wordexp(clean.c_str(), &tokens, WRDE_NOCMD);
72 throw error(
"You're supplying something strange in 'args': '{}' (wordexp ret {})", clean, ret);
74 for(
unsigned int i = 0; i < tokens.we_wordc; ++i)
113 if(c ==
'\n' || c ==
'\r')
120 int ret = wordexp(clean.c_str(), &tokens, WRDE_NOCMD);
122 throw error(
"You're supplying something strange in 'launch-prefix': '{}' (wordexp ret {})", clean, ret);
124 for(
unsigned int i = 0; i < tokens.we_wordc; ++i)
Node(std::string name, std::string package, std::string type)
void setCPULimit(double cpuLimit)
void setCoredumpsEnabled(bool on)
std::map< std::string, std::string > m_remappings
ros::WallDuration respawnDelay() const
uint64_t memoryLimitByte() const
void setStopTimeout(double timeout)
ROSCPP_DECL std::string clean(const std::string &name)
std::map< std::string, std::string > m_extraEnvironment
void setMemoryLimit(uint64_t memoryLimitByte)
std::string m_workingDirectory
ros::WallDuration m_respawnDelay
void setLaunchPrefix(const std::string &launchPrefix)
void setMuted(bool muted)
void setRemappings(const std::map< std::string, std::string > &remappings)
void setRequired(bool required)
void setStdoutDisplayed(bool showStdout)
std::runtime_error error(const char *format, const Args &...args)
std::string env(const std::string &name)
void setClearParams(bool on)
std::vector< std::string > m_extraArgs
void addExtraArguments(const std::string &argString)
std::map< std::string, std::string > remappings() const
uint64_t m_memoryLimitByte
void setExtraEnvironment(const std::map< std::string, std::string > &env)
void setWorkingDirectory(const std::string &workingDirectory)
void setNamespace(const std::string &ns)
void setRespawn(bool respawn)
std::vector< std::string > launchPrefix() const
std::vector< std::string > m_launchPrefix
static std::string getExecutable(const std::string &package, const std::string &name)
void setRespawnDelay(const ros::WallDuration &respawnDelay)