Skip to content
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

WholeBodyDynamicsDevice: Remove meaningless check that total number FTs in attached device match the total number of FTs consired by estimation #193

Merged
merged 1 commit into from
Jul 5, 2024

Conversation

traversaro
Copy link
Member

@traversaro traversaro commented Jul 5, 2024

This is a bug found by @LoreMoretti , basically he was trying to remote just the upper_leg FTs from ergocub from the estimation, but the wbd launch was failing with:

        yError() << "WholeBodyDynamicsDevice::attachAll Invalid number of MAS FT sensors after remapper";

However, the check does not make a lot of sense. nrMASFTSensors is the total number of FT sensors in all the devices attached to wbd (for ergocub 8), while remappedMASInterfaces.ftMultiSensors->getNrOfSixAxisForceTorqueSensors() and ftMultipleAnalogSensorNames.size() are the actual number of sensors considered (removing the upper_leg fts as @LoreMoretti was doing, 6).

To be honest, I am wondering how we were removing the FT from the estimation with this bug. Perhaps in all other cases were also either avoiding to pass the upper_leg FTs devices to the attach list, or we removed the FT sensors from the devices opened by the yarprobotinterface?

…Ts in attached device match the total number of FTs consired by estimation
@S-Dafarra
Copy link
Collaborator

To be honest, I am wondering how we were removing the FT from the estimation with this bug. Perhaps in all other cases were also either avoiding to pass the upper_leg FTs devices to the attach list, or we removed the FT sensors from the devices opened by the yarprobotinterface?

Both 😅

@S-Dafarra
Copy link
Collaborator

I was looking at this piece of code

for (auto ftDx = 0; ftDx < nrMASFTSensors; ftDx++)
{
std::string sensorName;
remappedMASInterfaces.ftMultiSensors->getSixAxisForceTorqueSensorName(ftDx, sensorName);
auto ftIter = std::find(ftMultipleAnalogSensorNames.begin(), ftMultipleAnalogSensorNames.end(), sensorName);
if (ftIter != ftMultipleAnalogSensorNames.end())
{
auto ftMapIdx = std::distance(ftMultipleAnalogSensorNames.begin(), ftIter);
ftMultipleAnalogSensorIdxMapping[ftMapIdx] = ftDx;
}
}

Maybe it should throw an error if the name is not found?

@traversaro
Copy link
Member Author

Maybe it should throw an error if the name is not found?

I am preparing a different PR to drop the support for reading FT sensor data from IAnalogSensor interfaces, I think it is more appropriate to keep that change there.

@traversaro
Copy link
Member Author

Maybe it should throw an error if the name is not found?

I am preparing a different PR to drop the support for reading FT sensor data from IAnalogSensor interfaces, I think it is more appropriate to keep that change there.

Actually that was already removed in #181 . However I indeed preparing a different cleanup PR.

@traversaro traversaro merged commit 8db1926 into master Jul 5, 2024
3 checks passed
@traversaro traversaro deleted the fixwbdwithlessfts branch July 9, 2024 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants