@@ -91,12 +91,12 @@ SensorParserMap getSensorParsers(const std::vector<std::string> &allowed)
91
91
{
92
92
static boost::mutex PARSER_PLUGIN_LOCK;
93
93
static boost::shared_ptr<pluginlib::ClassLoader<urdf::SensorParser> > PARSER_PLUGIN_LOADER;
94
- static SensorParserMap defaultParserMap;
95
-
96
94
boost::mutex::scoped_lock _ (PARSER_PLUGIN_LOCK);
95
+
96
+ SensorParserMap parserMap;
97
97
try
98
98
{
99
- if (!PARSER_PLUGIN_LOADER) {
99
+ if (!PARSER_PLUGIN_LOADER)
100
100
PARSER_PLUGIN_LOADER.reset (new pluginlib::ClassLoader<urdf::SensorParser>(" urdf" , " urdf::SensorParser" ));
101
101
102
102
const std::vector<std::string> &classes = PARSER_PLUGIN_LOADER->getDeclaredClasses ();
@@ -112,18 +112,17 @@ SensorParserMap getSensorParsers(const std::vector<std::string> &allowed)
112
112
} catch (const pluginlib::PluginlibException& ex) {
113
113
ROS_ERROR_STREAM (" Failed to create sensor parser: " << classes[i] << " \n " << ex.what ());
114
114
}
115
- defaultParserMap .insert (std::make_pair (classes[i], parser));
115
+ parserMap .insert (std::make_pair (classes[i], parser));
116
116
ROS_DEBUG_STREAM (" added sensor parser: " << classes[i]);
117
117
}
118
- if (defaultParserMap .empty ())
118
+ if (parserMap .empty ())
119
119
ROS_WARN_STREAM (" No sensor parsers found" );
120
- }
121
120
}
122
121
catch (const pluginlib::PluginlibException& ex)
123
122
{
124
123
ROS_ERROR_STREAM (" Exception while creating sensor plugin loader " << ex.what ());
125
124
}
126
- return defaultParserMap ;
125
+ return parserMap ;
127
126
}
128
127
129
128
SensorParserMap getSensorParser (const std::string &name)
0 commit comments