Typedefs | Functions | Variables
ros::package Namespace Reference

Typedefs

typedef std::map< std::string, std::string > M_string
 
typedef std::vector< std::string > V_string
 

Functions

ROSLIB_DECL std::string command (const std::string &cmd)
 Runs a rospack command of the form 'rospack <cmd>', returning the output as a single string. More...
 
ROSLIB_DECL void command (const std::string &cmd, V_string &output)
 Runs a rospack command of the form 'rospack <cmd>', returning the output as a vector of strings, split by newlines. More...
 
ROSLIB_DECL bool getAll (V_string &packages)
 Gets a list of all packages. Returns false if it could not run the command. More...
 
ROSLIB_DECL std::string getPath (const std::string &package_name)
 Returns the fully-qualified path to a package, or an empty string if the package is not found. More...
 
ROSLIB_DECL void getPlugins (const std::string &package, const std::string &attribute, V_string &plugins, bool force_recrawl=false)
 Call the "rospack plugins" command, eg. "rospack plugins --attrib=<attribute> <package>". Returns a vector of strings which are export values. More...
 
static void getPlugins (const std::string &package, const std::string &attribute, V_string &packages, V_string &plugins, bool force_recrawl)
 
ROSLIB_DECL void getPlugins (const std::string &name, const std::string &attribute, std::vector< std::pair< std::string, std::string > > &exports, bool force_recrawl=false)
 Call the "rospack plugins" command, eg. "rospack plugins --attrib=<attribute> <name>". Return a vector of string pairs which are package names and exported values respectively. Note that there can be multiple values for any single package. More...
 
ROS_DEPRECATED ROSLIB_DECL void getPlugins (const std::string &package, const std::string &attribute, M_string &plugins, bool force_recrawl=false)
 Call the "rospack plugins" command, eg. "rospack plugins --attrib=<attribute> <package>". Return a map of package name to export value. More...
 

Variables

static boost::mutex librospack_mutex
 

Typedef Documentation

typedef std::map<std::string, std::string> ros::package::M_string

Definition at line 85 of file package.h.

typedef std::vector<std::string> ros::package::V_string

Definition at line 84 of file package.h.

Function Documentation

std::string ros::package::command ( const std::string &  cmd)

Runs a rospack command of the form 'rospack <cmd>', returning the output as a single string.

Definition at line 47 of file src/package.cpp.

void ros::package::command ( const std::string &  cmd,
V_string output 
)

Runs a rospack command of the form 'rospack <cmd>', returning the output as a vector of strings, split by newlines.

Definition at line 71 of file src/package.cpp.

bool ros::package::getAll ( V_string packages)

Gets a list of all packages. Returns false if it could not run the command.

Definition at line 103 of file src/package.cpp.

std::string ros::package::getPath ( const std::string &  package_name)

Returns the fully-qualified path to a package, or an empty string if the package is not found.

Definition at line 89 of file src/package.cpp.

void ros::package::getPlugins ( const std::string &  package,
const std::string &  attribute,
V_string plugins,
bool  force_recrawl = false 
)

Call the "rospack plugins" command, eg. "rospack plugins --attrib=<attribute> <package>". Returns a vector of strings which are export values.

Definition at line 152 of file src/package.cpp.

static void ros::package::getPlugins ( const std::string &  package,
const std::string &  attribute,
V_string packages,
V_string plugins,
bool  force_recrawl 
)
static

Definition at line 110 of file src/package.cpp.

void ros::package::getPlugins ( const std::string &  name,
const std::string &  attribute,
std::vector< std::pair< std::string, std::string > > &  exports,
bool  force_recrawl = false 
)

Call the "rospack plugins" command, eg. "rospack plugins --attrib=<attribute> <name>". Return a vector of string pairs which are package names and exported values respectively. Note that there can be multiple values for any single package.

Note that while this uses the original rospack 'plugin' terminology, this effectively works for any exported tag with attributes in the catkin package.xml export list. Typical examples include:

1 <export>
2  <nav_core plugin="${prefix}/blp_plugin.xml" /> <!-- name="nav_core", attribute="plugin" -->
3  <rosdoc config="rosdoc.yaml" /> <!-- name="rosdoc", attribute="config" -->
4 </export>
Parameters
name: name of the package export tag (has to be a package name) [in]
attribute: name of the attribute inside the export tag with which to filter results [in]
exports: package/value export pairs resulting from the search [out]
force_recrawl: force rospack to rediscover everything on the system before running the search [in]

Definition at line 137 of file src/package.cpp.

void ros::package::getPlugins ( const std::string &  package,
const std::string &  attribute,
M_string plugins,
bool  force_recrawl = false 
)

Call the "rospack plugins" command, eg. "rospack plugins --attrib=<attribute> <package>". Return a map of package name to export value.

Warning
If there are multiple export values, only the last one is saved in the map.
Deprecated:
Prefer the ::getPlugins(const std::string&, const std::string&, std::vector<std::pair<std::string, std::string>>&, bool) api instead.

Definition at line 158 of file src/package.cpp.

Variable Documentation

boost::mutex ros::package::librospack_mutex
static

Definition at line 45 of file src/package.cpp.



roslib
Author(s): Ken Conley , Morgan Quigley , Josh Faust
autogenerated on Thu Apr 30 2020 06:30:15