Skip to content
Snippets Groups Projects
Commit 67aa1caa authored by Lukas Kaul's avatar Lukas Kaul
Browse files

RobotStateComponent: Fixed segfault in reportJointAngles

parent ebb90003
No related branches found
No related tags found
No related merge requests found
......@@ -253,7 +253,7 @@ namespace armarx
float influenceNext = 1.0f - (float)(it->first - time) / deltaT;
float influencePrev = 1.0f - (float)(time - prevIt->first) / deltaT;
auto jointIt = prevIt->second.jointMap.begin();
for (auto & joint : config.jointMap)
for (auto& joint : config.jointMap)
{
joint.second = joint.second * influenceNext + jointIt->second * influencePrev;
jointIt++;
......@@ -279,11 +279,11 @@ namespace armarx
void RobotStateComponent::reportJointAngles(const NameValueMap& jointAngles, Ice::Long timestamp, bool aValueChanged, const Current& c)
{
// IceUtil::Time start = IceUtil::Time::now();
if (timestamp <= 0)
{
timestamp = IceUtil::Time::now().toMicroSeconds();
}
if (aValueChanged)
{
{
......@@ -311,18 +311,16 @@ namespace armarx
_sharedRobotServant->setTimestamp(IceUtil::Time::microSeconds(timestamp));
}
history[timestamp] = {timestamp,
new FramedPose(_synchronized->getGlobalPose(), GlobalFrame, ""),
jointAngles
};
RobotStateConfig config;
config.timestamp = timestamp;
config.globalPose = new FramedPose(_synchronized->getGlobalPose(), GlobalFrame, "");
config.jointMap = jointAngles;
history[timestamp] = config;
if (history.size() > historyLength)
{
history.erase(history.begin());
}
// ARMARX_VERBOSE << deactivateSpam(2) << "my duration: " << (IceUtil::Time::now() - start).toMicroSecondsDouble() << " ms";
}
std::string RobotStateComponent::getRobotFilename(const Ice::Current&) const
......@@ -341,7 +339,7 @@ namespace armarx
auto packages = armarx::Application::GetProjectDependencies();
packages.push_back(Application::GetProjectName());
for (const std::string & projectName : packages)
for (const std::string& projectName : packages)
{
if (projectName.empty())
{
......
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