9 #include <sync_params/ParameterMsg.h> 25 using sync_params::ParameterMsg;
47 string replaceAll(
string const& original,
string const& from,
string const& to) {
49 string::const_iterator end = original.end();
50 string::const_iterator current = original.begin();
51 string::const_iterator next = std::search( current, end, from.begin(), from.end() );
52 while ( next != end ) {
53 results.append( current, next );
55 current = next + from.size();
56 next = std::search( current, end, from.begin(), from.end() );
58 results.append( current, next );
70 if( regex_match(key, reg) ){
83 if( regex_match(key, reg) ){
107 string key = msg->key;
108 string xml = msg->xml;
110 bool new_entry =
param_map.insert( make_pair(key,xml) ).second;
116 string const &xml2 = xml;
130 param_pub = n.
advertise<sync_params::ParameterMsg>(
"/params", 100);
136 if( n_priv.
getParam(
"whitelist", v) ){
138 for(
int i=0; i < v.
size(); i++) {
143 if( n_priv.
getParam(
"blacklist", v) ){
145 for(
int i=0; i < v.
size(); i++) {
168 int main(
int argc,
char** argv){
180 vector<string> param_keys;
189 for(
int i=0; i<param_keys.size(); i++ ){
205 ROS_INFO(
"SyncParams has finished polling.");
ros::Subscriber param_sub
void publish(const boost::shared_ptr< M > &message) const
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
vector< string > blacklist
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
void publishParam(ParameterMsg param)
bool isOnWhiteList(string key)
bool isOnBlackList(string key)
Type const & getType() const
void subscribeParam(const ParameterMsg::ConstPtr &msg)
std::string toXml() const
void loadSubs(ros::NodeHandle n)
string replaceAll(string const &original, string const &from, string const &to)
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
bool getParamNames(std::vector< std::string > &keys) const
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
vector< string > whitelist
#define ROS_WARN_STREAM(args)
map< string, string > param_map
void loadParams(ros::NodeHandle n_priv)
void loadPubs(ros::NodeHandle n)
bool getParam(const std::string &key, std::string &s) const
ROSCPP_DECL void spinOnce()
int main(int argc, char **argv)
void setParam(const std::string &key, const XmlRpc::XmlRpcValue &v) const