This class wraps the implementation of the runCommand service. More...
#include <dynamic_graph_bridge/ros_interpreter.hh>
Public Types | |
typedef boost::function< bool(dynamic_graph_bridge_msgs::RunCommand::Request &, dynamic_graph_bridge_msgs::RunCommand::Response &)> | runCommandCallback_t |
typedef boost::function< bool(dynamic_graph_bridge_msgs::RunPythonFile::Request &, dynamic_graph_bridge_msgs::RunPythonFile::Response &)> | runPythonFileCallback_t |
Public Member Functions | |
Interpreter (ros::NodeHandle &nodeHandle) | |
void | runCommand (const std::string &command, std::string &result, std::string &out, std::string &err) |
Method to start python interpreter and deal with messages. More... | |
void | runPythonFile (std::string ifilename) |
Method to parse python scripts. More... | |
void | startRosService () |
Initialize service run_command. More... | |
Protected Member Functions | |
bool | runCommandCallback (dynamic_graph_bridge_msgs::RunCommand::Request &req, dynamic_graph_bridge_msgs::RunCommand::Response &res) |
Run a Python command and return result, stderr and stdout. More... | |
bool | runPythonFileCallback (dynamic_graph_bridge_msgs::RunPythonFile::Request &req, dynamic_graph_bridge_msgs::RunPythonFile::Response &res) |
Run a Python file. More... | |
This class wraps the implementation of the runCommand service.
This takes as input a ROS node handle and do not handle the callback so that the service behavior can be controlled from the outside.
typedef boost::function< bool (dynamic_graph_bridge_msgs::RunCommand::Request&, dynamic_graph_bridge_msgs::RunCommand::Response&)> dynamicgraph::Interpreter::runCommandCallback_t |
typedef boost::function< bool (dynamic_graph_bridge_msgs::RunPythonFile::Request&, dynamic_graph_bridge_msgs::RunPythonFile::Response&)> dynamicgraph::Interpreter::runPythonFileCallback_t |
|
explicit |
void dynamicgraph::Interpreter::runCommand | ( | const std::string & | command, |
std::string & | result, | ||
std::string & | out, | ||
std::string & | err | ||
) |
Method to start python interpreter and deal with messages.
Command | string to execute, result, stdout, stderr strings. |
|
protected |
Run a Python command and return result, stderr and stdout.
void dynamicgraph::Interpreter::runPythonFile | ( | std::string | ifilename | ) |
Method to parse python scripts.
Input | file name to parse. |
|
protected |
Run a Python file.
void dynamicgraph::Interpreter::startRosService | ( | ) |
Initialize service run_command.