Skip to content
Snippets Groups Projects
Commit d0d9082a authored by Mirko Wächter's avatar Mirko Wächter
Browse files

fixed segfault in KinematicUnitObserver

parent 4c29edfd
No related branches found
No related tags found
No related merge requests found
......@@ -267,9 +267,15 @@ void KinematicUnitObserver::reportJointStatuses(const NameStatusMap& jointStatus
void KinematicUnitObserver::nameValueMapToDataFields(const std::string& channelName, const NameValueMap& nameValueMap, Ice::Long timestamp, bool aValueChanged)
{
// ARMARX_INFO << deactivateSpam(10) << " timestamp is " << (IceUtil::Time::now() - IceUtil::Time::microSeconds(timestamp)).toMicroSecondsDouble() << " µs old";
if (aValueChanged || initializedChannels.count(channelName) == 0)
bool newChannel;
{
ScopedLock lock(initializedChannelsMutex);
newChannel = initializedChannels.count(channelName) == 0;
initializedChannels.insert(channelName);
}
if (aValueChanged || newChannel)
{
boost::unordered_map< ::std::string, ::armarx::VariantBasePtr> map;
if (timestamp < 0)
{
......
......@@ -140,6 +140,7 @@ namespace armarx
protected:
void nameValueMapToDataFields(const std::string& channelName, const NameValueMap& nameValueMap, Ice::Long timestamp, bool aValueChanged);
std::set<std::string> initializedChannels;
Mutex initializedChannelsMutex;
private:
std::string robotNodeSetName;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment