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)
58 std::string
clean = argString;
61 if(c ==
'\n' || c ==
'\r')
68 int ret = wordexp(clean.c_str(), &tokens, WRDE_NOCMD);
70 throw error(
"You're supplying something strange in 'args': '{}' (wordexp ret {})", clean, ret);
72 for(
unsigned int i = 0; i < tokens.we_wordc; ++i)
111 if(c ==
'\n' || c ==
'\r')
118 int ret = wordexp(clean.c_str(), &tokens, WRDE_NOCMD);
120 throw error(
"You're supplying something strange in 'launch-prefix': '{}' (wordexp ret {})", clean, ret);
122 for(
unsigned int i = 0; i < tokens.we_wordc; ++i)
Node(std::string name, std::string package, std::string type)
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 setRemappings(const std::map< std::string, std::string > &remappings)
void setRequired(bool required)
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
void setCPULimit(float cpuLimit)
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)