10 #include <boost/date_time.hpp>
12 #include <ros/message_traits.h>
14 #include <yaml-cpp/yaml.h>
139 boost::posix_time::ptime
getDate();
146 double getSeconds(boost::posix_time::ptime start, boost::posix_time::ptime finish);
159 template <
typename T>
175 template <
typename T>
190 template <
typename T>
195 msg = result.second.as<T>();
205 template <
typename T>
208 return ros::message_traits::md5sum<T>(msg);
bool YAMLToFile(const YAML::Node &node, const std::string &file)
Write the contents of a YAML node out to a potentially new file.
double getSeconds(boost::posix_time::ptime start, boost::posix_time::ptime finish)
Get a duration in seconds from two times.
std::string resolveParent(const std::string &path)
Resolves package:// URLs to get the directory this path is in.
std::set< std::string > findPackageURIs(const std::string &string)
Finds all package URIs within a string.
boost::posix_time::ptime getDate()
Get the current time (up to milliseconds)
std::string resolvePackage(const std::string &path)
Resolves package:// URLs to their canonical form. The path does not need to exist,...
void deleteFile(const std::string &file)
Deletes a file.
std::size_t getProcessID()
Get the process ID of this process.
std::pair< bool, std::vector< YAML::Node > > loadAllFromFileToYAML(const std::string &path)
Loads a file with multiple documents to a vector of YAML nodes.
std::pair< bool, YAML::Node > loadFileToYAML(const std::string &path)
Loads a file to a YAML node.
std::string makeFilepath(const std::string &directory, const std::string &filename)
Concatenates two elements of a path, a directory and a filename.
std::string runCommand(const std::string &cmd)
Runs a command cmd and returns stdout as a string.
std::string getHostname()
Get the hostname of the system.
std::string getMessageMD5(T &msg)
Compute MD5 hash of message.
std::pair< bool, std::vector< std::string > > listDirectory(const std::string &directory)
Lists of the contents of a directory.
std::vector< T > tokenize(const std::string &string, const std::string &separators=" ")
Separates a string into casted tokens, based upon separators.
std::string loadFileToString(const std::string &path)
Loads a file to a string.
std::string generateUUID()
Generates a UUID.
std::size_t getThreadID()
Get the thread ID of the current thread.
std::string createTempFile(std::ofstream &out)
Creates a temporary file and opens an output stream.
std::string resolvePath(const std::string &path)
Resolves package:// URLs and relative file paths to their canonical form.
bool messageToYAMLFile(T &msg, const std::string &file)
Dump a message (or YAML convertable object) to a file.
std::string loadXMLToString(const std::string &path)
Loads an XML or .xacro file to a string.
void createFile(std::ofstream &out, const std::string &file)
Creates a file and opens an output stream. Creates directories if they do not exist.
std::string loadXacroToString(const std::string &path)
Loads a .xacro file to a string.
void threadSleep(double seconds)
Put the current thread to sleep for a desired amount of seconds.
bool YAMLFileToMessage(T &msg, const std::string &file)
Load a message (or YAML convertable object) from a file.
Main namespace. Contains all library classes and functions.