Skip to content
Snippets Groups Projects
Commit 165457f2 authored by Christian Dreher's avatar Christian Dreher
Browse files

Merge branch 'fix/robotunit-timestamps' into 'master'

Resolve "components/RobotUnitSimulation: Wrong timestamps in 'RobotState/Proprioception'-memory"

Closes #26

See merge request !69
parents c0df839b 66262f81
No related branches found
No related tags found
1 merge request!69Resolve "components/RobotUnitSimulation: Wrong timestamps in 'RobotState/Proprioception'-memory"
...@@ -642,7 +642,11 @@ void RobotUnitSimulation::rtUpdateSensors(bool wait) ...@@ -642,7 +642,11 @@ void RobotUnitSimulation::rtUpdateSensors(bool wait)
} }
// This should be the timestamp from the time where the data was queried // This should be the timestamp from the time where the data was queried
const IceUtil::Time now = TimeUtil::GetTime(); // We have to use armarx::rtNow() now because of changes in the framework to assess the timestamp in
// a realtime-conform way (using MONOTONIC_RAW clock, which is the time difference since last boot).
// This probably breaks simulation speeds faster than realtime, but this feature probably was broken
// before anyways. See https://git.h2t.iar.kit.edu/sw/armarx/armarx-simulation/-/issues/26.
const IceUtil::Time now = armarx::rtNow();
//const IceUtil::Time now = IceUtil::Time::microSeconds(simulationDataTimestampInMicroSeconds); //const IceUtil::Time now = IceUtil::Time::microSeconds(simulationDataTimestampInMicroSeconds);
const IceUtil::Time timeSinceLastIteration = now - sensorValuesTimestamp; const IceUtil::Time timeSinceLastIteration = now - sensorValuesTimestamp;
const float dt = static_cast<float>(timeSinceLastIteration.toSecondsDouble()); const float dt = static_cast<float>(timeSinceLastIteration.toSecondsDouble());
......
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