RAII-pattern for starting up ROS.
More...
#include <util.h>
|
| | ROS (int argc, char **argv, const std::string &name="robowflex", unsigned int threads=1) |
| | Constructor. Start-up ROS. If Boost version is greater than 1.64, rosmaster is started if it is not already running. A signal handler or SIGINT and SIGSEGV is installed to gracefully exit. More...
|
| |
| | ~ROS () |
| | Destructor. Shutdown ROS. More...
|
| |
| std::vector< std::string > | getArgs () const |
| | Get command-line arguments without ROS parameters. More...
|
| |
| void | wait () const |
| | Waits for the process to be killed via some means (normally Ctrl-C) More...
|
| |
RAII-pattern for starting up ROS.
Definition at line 51 of file util.h.
◆ ROS()
| ROS::ROS |
( |
int |
argc, |
|
|
char ** |
argv, |
|
|
const std::string & |
name = "robowflex", |
|
|
unsigned int |
threads = 1 |
|
) |
| |
Constructor. Start-up ROS. If Boost version is greater than 1.64, rosmaster is started if it is not already running. A signal handler or SIGINT and SIGSEGV is installed to gracefully exit.
- Parameters
-
| [in] | argc | Argument count forwarded to ros::init |
| [in] | argv | Arguments forwarded to ros::init |
| [in] | name | Name of ROS node. |
| [in] | threads | Threads to use for ROS spinning. If 0 no spinner is created. |
Definition at line 68 of file util.cpp.
70 ros::init(argc, argv, name, ros::init_options::NoSigintHandler);
78 SPINNER.reset(
new ros::AsyncSpinner(threads));
◆ ~ROS()
Destructor. Shutdown ROS.
Definition at line 83 of file util.cpp.
◆ getArgs()
Get command-line arguments without ROS parameters.
- Returns
- Vector of command line arguments as strings.
Definition at line 88 of file util.cpp.
◆ wait()
Waits for the process to be killed via some means (normally Ctrl-C)
Definition at line 96 of file util.cpp.
98 ros::waitForShutdown();
◆ argc_
| int robowflex::ROS::argc_ |
|
private |
Argument count.
Definition at line 78 of file util.h.
◆ argv_
| char** robowflex::ROS::argv_ |
|
private |
Arguments.
Definition at line 79 of file util.h.
The documentation for this class was generated from the following files: