-
Notifications
You must be signed in to change notification settings - Fork 185
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
SensorMessage::SetXYZ methods don't set m_IsBodyPacked #224
Comments
Hi, The library wasn't designed to reuse messages. you can always create a new message if your have new data coming. The messages are created using smart pointer, they will be automatically deleted after usage, so there won't be issue of memory leak. There is some inconsistency as you point out with the SetMatrix function in transformMessage, which is a legacy issue i think. |
@tokjun , what is your opinion about reuse the messages? should we make all message reusable or not? Thanks! |
First, I fixed my code to use new instances every time I send and it works fine. Thank you. I might be abusing IGTL a bit or maybe stretching the field of applications but I'm currently trying to send small messages at rates between 100Hz and 1KHz. Modern PCs seem able to perform all the malloc/free calls without too much trouble but this seems a bit wasteful. Maybe the best approach is not to replicate the "feature" in msg->ForcePack(); Where the method msg->UnsetIsBodyPacked();
msg->Pack(); On the other hand, when addressing issue #161 for In any case, the issue is not critical since I can use the IGTL as-is. |
Hi, Good to know your app works fine. |
The methods
SetValue
,SetLength
forigtl::SensorMessage
don't update the flagm_IsBodyPacked
so when trying to re-use a message, thePack()
has no effect even if the values are changed.Meanwhile:
The text was updated successfully, but these errors were encountered: