Functions | Variables
ros::message Namespace Reference

Functions

std::vector< std::string > getFieldNames (const std::string &messageType)
 Return the names of fields of the message type (non-recursive). More...
 
std::vector< std::string > getFieldTypes (const std::string &messageType)
 Return the types of fields of the message type (non-recursive). More...
 
std::string getFullDef (const std::string &messageType)
 Return the full recursive definition of the message type - the same as genpy generates. More...
 
std::string getMD5Sum (const std::string &messageType)
 Return the MD5 sum of the message type - the same as genpy generates. More...
 
std::string getMD5Text (const std::string &messageType)
 Return the exact text from which the MD5 sum of the message is computed. More...
 
PyObject * getMsgField (const std::string &messageType, const std::string &field)
 
std::string getMsgFile (const std::string &messageType)
 Get the path to the .msg file corresponding to the given message type. More...
 
bool hasHeader (const std::string &messageType)
 Tell whether the given message type has a header field. More...
 
void printPythonError ()
 
PyObject * pythonBorrowAttrString (PyObject *o, const std::string &name)
 
std::string stringFromPython (PyObject *input)
 
PyObject * stringToPython (const std::string &input)
 

Variables

static bool pythonInitialized
 

Function Documentation

◆ getFieldNames()

std::vector< std::string > ros::message::getFieldNames ( const std::string &  messageType)

Return the names of fields of the message type (non-recursive).

Parameters
messageTypeType of the message.
Returns
The names of the fields.

Definition at line 172 of file rosmsg_cpp.cpp.

◆ getFieldTypes()

std::vector< std::string > ros::message::getFieldTypes ( const std::string &  messageType)

Return the types of fields of the message type (non-recursive).

Parameters
messageTypeType of the message.
Returns
The types of the fields.

Definition at line 188 of file rosmsg_cpp.cpp.

◆ getFullDef()

std::string ros::message::getFullDef ( const std::string &  messageType)

Return the full recursive definition of the message type - the same as genpy generates.

Parameters
messageTypeType of the message.
Returns
The definition. If the definition could not be found, empty string is returned.

Definition at line 146 of file rosmsg_cpp.cpp.

◆ getMD5Sum()

std::string ros::message::getMD5Sum ( const std::string &  messageType)

Return the MD5 sum of the message type - the same as genpy generates.

Parameters
messageTypeType of the message.
Returns
The MD5 sum. If the message could not be found, empty string is returned.

Definition at line 154 of file rosmsg_cpp.cpp.

◆ getMD5Text()

std::string ros::message::getMD5Text ( const std::string &  messageType)

Return the exact text from which the MD5 sum of the message is computed.

Parameters
messageTypeType of the message.
Returns
The MD5 sum source text.
Note
This function might be slow (a few seconds at worst).

Definition at line 256 of file rosmsg_cpp.cpp.

◆ getMsgField()

PyObject* ros::message::getMsgField ( const std::string &  messageType,
const std::string &  field 
)

Definition at line 73 of file rosmsg_cpp.cpp.

◆ getMsgFile()

std::string ros::message::getMsgFile ( const std::string &  messageType)

Get the path to the .msg file corresponding to the given message type.

Parameters
messageTypeType of the message.
Returns
Path to the .msg file corresponding to the given message type.

Definition at line 204 of file rosmsg_cpp.cpp.

◆ hasHeader()

bool ros::message::hasHeader ( const std::string &  messageType)

Tell whether the given message type has a header field.

Parameters
messageTypeType of the message.
Returns
Whether the given message type has a header field.

Definition at line 162 of file rosmsg_cpp.cpp.

◆ printPythonError()

void ros::message::printPythonError ( )

Definition at line 67 of file rosmsg_cpp.cpp.

◆ pythonBorrowAttrString()

PyObject* ros::message::pythonBorrowAttrString ( PyObject *  o,
const std::string &  name 
)

Definition at line 60 of file rosmsg_cpp.cpp.

◆ stringFromPython()

std::string ros::message::stringFromPython ( PyObject *  input)

Definition at line 45 of file rosmsg_cpp.cpp.

◆ stringToPython()

PyObject* ros::message::stringToPython ( const std::string &  input)

Definition at line 36 of file rosmsg_cpp.cpp.

Variable Documentation

◆ pythonInitialized

bool ros::message::pythonInitialized
static
Initial value:
= [](){
std::string tmp;
if (!ros::get_environment_variable(tmp, "ROS_ROOT"))
{
std::cerr << "ROS_ROOT not found" << std::endl;
std::string rosDistro;
if (!ros::get_environment_variable(rosDistro, "ROS_DISTRO"))
{
rosDistro = ROS_DISTRO;
std::cerr << "ROS_DISTRO not found, setting " << rosDistro << std::endl;
}
const auto rosRoot = "/opt/ros/" + rosDistro + "/share/ros";
std::cerr << "Setting ROS_ROOT to " << rosRoot << std::endl;
::setenv("ROS_ROOT", rosRoot.c_str(), false);
}
Py_Initialize();
return true;
}()

Definition at line 16 of file rosmsg_cpp.cpp.

ros::get_environment_variable
bool get_environment_variable(std::string &str, const char *environment_variable)


rosmsg_cpp
Author(s): Martin Pecka
autogenerated on Mon Apr 17 2023 02:30:24