-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong data streamed by the accelerometer on the iCub3 head #592
Comments
Can you post a few lines of the dump of |
I dumped data by using the The |
Can you read/dump at least a few lines of the port that starts with |
Here is a dump of |
fyi @gabrielenava that also reported strage results from a |
@FabioBergonti suggested me to have a look at @prashanthr05 comment in
I am investigating the comment to understand if this is the problem I am facing |
I have the impression that is related to orientation, while the problem here is on accelerometer and in your case is on angular velocity, but the problem can be related in an indirected way I guess. |
The problem reported in the comment #592 (comment) is due to a corner-case unhandled in Apparently, This problem occurs when we specify the same ids for different sensors as specified here which is the case only for simulation. This must be fixed in The changes will be, YarpSensorBridgeImpldiff --git a/src/RobotInterface/YarpImplementation/include/BipedalLocomotion/RobotInterface/YarpSensorBridgeImpl.h b/src/RobotInterface/YarpImplementation/include/BipedalLocomotion/RobotInterface/YarpSensorBridgeImpl.h
index 2c2f41af..6cc0f294 100644
--- a/src/RobotInterface/YarpImplementation/include/BipedalLocomotion/RobotInterface/YarpSensorBridgeImpl.h
+++ b/src/RobotInterface/YarpImplementation/include/BipedalLocomotion/RobotInterface/YarpSensorBridgeImpl.h
@@ -158,7 +158,10 @@ struct YarpSensorBridge::Impl
std::unordered_map<std::string, StampedYARPVector> wholeBodyFTMeasures;
/**< map holding three axis inertial sensor measures */
- std::unordered_map<std::string, StampedYARPVector> wholeBodyInertialMeasures;
+ std::unordered_map<std::string, StampedYARPVector> wholeBodyInertialAccMeasures;
+ std::unordered_map<std::string, StampedYARPVector> wholeBodyInertialGyroMeasures;
+ std::unordered_map<std::string, StampedYARPVector> wholeBodyInertialOrientMeasures;
+ std::unordered_map<std::string, StampedYARPVector> wholeBodyInertialMagMeasures;
/**< map holding cartesian wrench measures */
std::unordered_map<std::string, StampedYARPVector> wholeBodyCartesianWrenchMeasures;
@@ -1786,7 +1789,7 @@ struct YarpSensorBridge::Impl
return readAllMASSensors(wholeBodyMASInertialsInterface.accelerometers,
masSensorIndexMaps.accelerometer,
- wholeBodyInertialMeasures,
+ wholeBodyInertialAccMeasures,
failedSensorReads,
checkForNAN);
}
@@ -1801,7 +1804,7 @@ struct YarpSensorBridge::Impl
return readAllMASSensors(wholeBodyMASInertialsInterface.gyroscopes,
masSensorIndexMaps.gyroscopes,
- wholeBodyInertialMeasures,
+ wholeBodyInertialGyroMeasures,
failedSensorReads,
checkForNAN);
}
@@ -1816,7 +1819,7 @@ struct YarpSensorBridge::Impl
return readAllMASSensors(wholeBodyMASInertialsInterface.orientationSensors,
masSensorIndexMaps.orientationSensors,
- wholeBodyInertialMeasures,
+ wholeBodyInertialOrientMeasures,
failedSensorReads,
checkForNAN);
}
@@ -1831,7 +1834,7 @@ struct YarpSensorBridge::Impl
return readAllMASSensors(wholeBodyMASInertialsInterface.magnetometers,
masSensorIndexMaps.magnetometers,
- wholeBodyInertialMeasures,
+ wholeBodyInertialMagMeasures,
failedSensorReads,
checkForNAN);
}
YarpSensorBridge.cppdiff --git a/src/RobotInterface/YarpImplementation/src/YarpSensorBridge.cpp b/src/RobotInterface/YarpImplementation/src/YarpSensorBridge.cpp
index 44eea181..3720c19b 100644
--- a/src/RobotInterface/YarpImplementation/src/YarpSensorBridge.cpp
+++ b/src/RobotInterface/YarpImplementation/src/YarpSensorBridge.cpp
@@ -466,13 +466,13 @@ bool YarpSensorBridge::getLinearAccelerometerMeasurement(const std::string& accN
OptionalDoubleRef receiveTimeInSeconds)
{
if (!m_pimpl->checkValidSensorMeasure("YarpSensorBridge::getLinearAccelerometerMeasurement ",
- m_pimpl->wholeBodyInertialMeasures,
+ m_pimpl->wholeBodyInertialAccMeasures,
accName))
{
return false;
}
- auto iter = m_pimpl->wholeBodyInertialMeasures.find(accName);
+ auto iter = m_pimpl->wholeBodyInertialAccMeasures.find(accName);
accMeasurement = yarp::eigen::toEigen(iter->second.first);
if (receiveTimeInSeconds)
receiveTimeInSeconds.value().get() = iter->second.second;
@@ -484,13 +484,13 @@ bool YarpSensorBridge::getGyroscopeMeasure(const std::string& gyroName,
OptionalDoubleRef receiveTimeInSeconds)
{
if (!m_pimpl->checkValidSensorMeasure("YarpSensorBridge::getGyroscopeMeasure ",
- m_pimpl->wholeBodyInertialMeasures,
+ m_pimpl->wholeBodyInertialGyroMeasures,
gyroName))
{
return false;
}
- auto iter = m_pimpl->wholeBodyInertialMeasures.find(gyroName);
+ auto iter = m_pimpl->wholeBodyInertialGyroMeasures.find(gyroName);
gyroMeasurement = yarp::eigen::toEigen(iter->second.first);
if (receiveTimeInSeconds)
receiveTimeInSeconds.value().get() = iter->second.second;
@@ -502,13 +502,13 @@ bool YarpSensorBridge::getOrientationSensorMeasurement(const std::string& rpyNam
OptionalDoubleRef receiveTimeInSeconds)
{
if (!m_pimpl->checkValidSensorMeasure("YarpSensorBridge::getOrientationSensorMeasurement ",
- m_pimpl->wholeBodyInertialMeasures,
+ m_pimpl->wholeBodyInertialOrientMeasures,
rpyName))
{
return false;
}
- auto iter = m_pimpl->wholeBodyInertialMeasures.find(rpyName);
+ auto iter = m_pimpl->wholeBodyInertialOrientMeasures.find(rpyName);
rpyMeasurement = yarp::eigen::toEigen(iter->second.first);
if (receiveTimeInSeconds)
receiveTimeInSeconds.value().get() = iter->second.second;
@@ -520,13 +520,13 @@ bool YarpSensorBridge::getMagnetometerMeasurement(const std::string& magName,
OptionalDoubleRef receiveTimeInSeconds)
{
if (!m_pimpl->checkValidSensorMeasure("YarpSensorBridge::getMagnetometerMeasurement ",
- m_pimpl->wholeBodyInertialMeasures,
+ m_pimpl->wholeBodyInertialMagMeasures,
magName))
{
return false;
}
- auto iter = m_pimpl->wholeBodyInertialMeasures.find(magName);
+ auto iter = m_pimpl->wholeBodyInertialMagMeasures.find(magName);
magMeasurement = yarp::eigen::toEigen(iter->second.first);
if (receiveTimeInSeconds)
receiveTimeInSeconds.value().get() = iter->second.second;
|
Nevertheless, what I see is the accelerometer measurements streamed by For example, the below plot is from the accelerometer on the root link of Data collected after fixing BLF with changes suggested in #592 (comment) Rotating the accelerometer using,
where the RPY values are obtained from the |
This problem has been fixed. Closing. |
Here is what I see logging data received on the yarp port
/icubSim/head/inertials
.I expect to see the gravity in the$10^{-4}$ .
z
direction instead ofI tried with two models:
iCubGazeboV3_fixed (no hands)
andiCubGazeboV3 (no hands)
.cc @prashanthr05 @traversaro
The text was updated successfully, but these errors were encountered: