-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add parameter period to set the output frequency of XSens device #34
Add parameter period to set the output frequency of XSens device #34
Conversation
xsensmt/XsensMT.cpp
Outdated
} | ||
else | ||
{ | ||
m_outputPeriod = 10; // 10ms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The latest style for most YARP devices is to use seconds to represent periods, see for example https://www.yarp.it//v3.5/classControlBoard__nws__yarp.html#details . Even if some icub devices still use milliseconds, I would try to be consistent with the new devices and use seconds here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok now the expected period is in seconds 28bdd1b
Behavior testI am testing with the following command (selecting the period) yarpdev --device inertial --name /icub/xsens_inertial --period 0.002 --subdevice xsensmt --serial /dev/ttyXsens --xsensmt_period 2.7 It seems that the SDK is able to configure the IMU with the period I am selecting. When I select
This agrees with what @gabrielenava and @affafjunaidMOMIN found in the manual that the max output frequency is But I get the same behavior above (steam of warning regarding magnetometer) when I select the period Instead when selecting the period |
You can also think of having separate parameters for each quantity. |
Update: the actual max period we can get is around
Then
And checking the sender time of the logged data. If I understood correctly from the code, the device publishes new line in the YARP port as soon as it gets a new data samples from the IMU. So the port sending time is indicative of the frequency of IMU (@traversaro can you confirm?) So it seems that the IMU output frequency saturates at |
No, the hardware device make the new measurements available in the C++ methods such as |
Ah okay, then it is strange that port is published in not more than |
I did a quick check, I am suspecting that https://github.com/robotology/yarp/blob/5804efb739319aee0bf1bfe408d80b31e7195238/src/devices/ServerInertial/ServerInertial.cpp#L284 is responsible. |
Good point, we can check in the code: |
I didn't understand,, wrong place? |
Sorry, I wanted to insert the link but I am lagging behind. |
this? #34 (comment) |
Yes! |
@HosameldinMohamed please write me on Teams if you want to quickly align on this to proceed with this PR. |
I am testing with the yarpdev --device inertial --name /fakeHa --period 0.001 --subdevice fakeIMU The response is as expected, and the actual period is close to |
Fixes #33.