Closed rohanpsingh closed 2 years ago
Hi @rohanpsingh
Would you still consider this a draft?
Hi @gergondet This is an important functionality that we need and definitely must be merged. However, there is a problem in the current implementation that I must fix. (specifically, this is apparently not the correct way to map from bodystat to mc-rtc)
I plan to work on this over the next few days~!
specifically, this is apparently not the correct way to map from bodystat to mc-rtc
Assuming m_motorTempNames
and m_motorTempIn
have the same lengths that should work?
Assuming m_motorTempNames and m_motorTempIn have the same lengths that should work?
From the issue in HRP4CR private repo I see what you mean now: you could have less joint sensors than readings because some joints are filtered by the module.
In that case what you should do is create a mapping (but really it's an std::vector<size_t>
) from the sensors' name index to the reference joint order index then use that when you fetch the temperature in the OpenRTM data vector so:
motorTempIn[m_motorTempNames[i]] = m_motorTempIn.data[i];
becomes:
motorTempIn[m_motorTempNames[i]] = m_motorTempIn.data[m_motorTempToRJOIndex[i]];
Thanks, I tested this on the robot, and it worked fine. I think we can merge this PR now.
Currently, I do nothing with the received data (waiting for reply on https://github.com/isri-aist/hrg-soft-environment/issues/20#issuecomment-1154731581).