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

Server only receive first transform #161

Open
terajnol opened this issue Jan 8, 2018 · 6 comments
Open

Server only receive first transform #161

terajnol opened this issue Jan 8, 2018 · 6 comments

Comments

@terajnol
Copy link

terajnol commented Jan 8, 2018

Hi all,

I am simply running the TrackerClient and ReceiveServer examples as described in the tutorial.
Port is set to 18944 and server to "localhost" (I run server and client on the same machine).

If I send X TransformMessage (or PositionMessage) from TrackerClient, I receive X messages to ReceiveServer but their values are all the same (value of the first message sent from TrackerClient). In the provided examples, TrackerClient is supposed to send a different transform matrix for each pack but ReceiveServer only gets the same matrix for each pack.

Sorry if this is really obvious, but I cannot figure out why I am always sending the same pack.
Thanks

@leochan2009
Copy link
Contributor

Hi Terajnol,

Thanks for reporting the bug.
We just fixed the bug by initial the transformMessage before sending the pack.

Best,
Longquan

leochan2009 added a commit that referenced this issue Jan 8, 2018
…device name, device type, header version, message ID or meta information is reset. Update of other message attributes will not set the m_IsBodyPacked flag to false. User is encouraged to call the InitPack() function to reset the flag.
@terajnol
Copy link
Author

terajnol commented Jan 8, 2018

Great !
I was just fixing it by creating a new TransformMessage object in the loop each time but InitPack() function is perfect.
Thanks for the fast fix !

@terajnol terajnol closed this as completed Jan 8, 2018
@leochan2009
Copy link
Contributor

leochan2009 commented Jan 8, 2018

Currently Only the following function will reset the m_IsBodyPacked flag:
SetDeviceName(), SetDeviceType(), SetHeaderVersion(), SetMessageID(), SetMetaDataElement().
In TransformMessage, SetMatrix() function won't reset the m_IsBodyPacked. User need to call InitPack before SetMatrix(), should we help the user by calling the InitPack() in SetMatrix()?
The same is for SetPosition() in PositionMessage and other message types.
@adamrankin @tokjun

Best,
Longquan.

@tokjun
Copy link
Contributor

tokjun commented Oct 23, 2019

Sorry for not following this up. I'm not sure if it's a good idea to call InitPack() in SetMatrix(), because it would be confusing if the class resets the header whenever we set values in the content. Instead, I would just set the m_IsBodyPackedFlag to NULL whenever a new value is set in the content, which will trigger the packing process when Pack() is called.

leochan2009 pushed a commit to leochan2009/OpenIGTLink that referenced this issue Oct 23, 2019
…ullfilled the needs by setting the flag to false. See issue openigtlink#161
leochan2009 pushed a commit to leochan2009/OpenIGTLink that referenced this issue Oct 23, 2019
…ullfilled the needs by setting the flag to false. Tests are also added regarding this new feature. See issue openigtlink#161
@leochan2009
Copy link
Contributor

@tokjun , please review the pull request. m_IsBodyPackedFlag is set to false when data is modified. Tests are also added

@tokjun
Copy link
Contributor

tokjun commented Oct 23, 2019

@leochan2009 Thanks for fixing it quickly. They are looking good.

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

No branches or pull requests

3 participants