Compiling the code with a recent compiler, I got this warning in Xsens provided code:
/home/straversaro/src/robotology-superbuild/robotology/xsensmt-yarp-driver/extern/xcommunication/legacydatapacket.cpp: In member function ‘bool LegacyDataPacket::setRawTemperature(uint16_t, int32_t, int)’:
/home/straversaro/src/robotology-superbuild/robotology/xsensmt-yarp-driver/extern/xcommunication/legacydatapacket.cpp:1030:53: warning: iteration 3 invokes undefined behavior [-Waggressive-loop-optimizations]
m_fixedData->m_infoList[index].m_rawGyroTemp[i] = (uint16_t) m_msg.getDataSize();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/straversaro/src/robotology-superbuild/robotology/xsensmt-yarp-driver/extern/xcommunication/legacydatapacket.cpp:1028:21: note: within this loop
for(int i = 0; i <= XS_EXTRA_TEMPERATURE_CHANNELS; ++i)
^
/home/straversaro/src/robotology-superbuild/robotology/xsensmt-yarp-driver/extern/xcommunication/legacydatapacket.cpp: In member function ‘bool LegacyDataPacket::setTemperature(double, int32_t, int)’:
/home/straversaro/src/robotology-superbuild/robotology/xsensmt-yarp-driver/extern/xcommunication/legacydatapacket.cpp:1407:50: warning: iteration 3 invokes undefined behavior [-Waggressive-loop-optimizations]
m_fixedData->m_infoList[index].m_gyroTemp[i] = (uint16_t) m_msg.getDataSize();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/straversaro/src/robotology-superbuild/robotology/xsensmt-yarp-driver/extern/xcommunication/legacydatapacket.cpp:1405:21: note: within this loop
for(int i = 0; i <= XS_EXTRA_TEMPERATURE_CHANNELS; ++i)
^
Compiling the code with a recent compiler, I got this warning in Xsens provided code:
It is possible that this issue is solved in a more recent version of the Xsens software, see https://github.com/robotology/xsensmt-yarp-driver/pull/9 for a similar update in the past.