-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
[VT]: Add a way to track VT float attributes #482
base: main
Are you sure you want to change the base?
Conversation
351e3a4
to
38a6923
Compare
This lets you use the VT state helper to deal with float attributes. Previously, float values may not have been handled correctly.
38a6923
to
4c83485
Compare
Quality Gate passedIssues Measures |
/// @brief Sets the value of a float attribute of a tracked object. | ||
/// @attention ONLY use this function for float attributes defined in ISO11783-6, | ||
/// otherwise you will get incorrect results. Scale on output numbers, for example, is a float. | ||
/// @note If the to be tracked working set consists of more than the master, | ||
/// this function is incompatible with a VT prior to version 4. For working sets consisting | ||
/// of only the master, this function is compatible with any VT version. | ||
/// @param[in] objectId The object id of the attribute to set. | ||
/// @param[in] attribute The attribute to set. | ||
/// @param[in] value The value to set the attribute to. | ||
/// @return True if the attribute was set successfully, false otherwise. | ||
bool set_attribute(std::uint16_t objectId, std::uint8_t attribute, float value); |
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.
thought: hmm, seems a lot of duplication that we might be able to avoid? With your current implementation we leave the conversion from float value to uint32_t all the way up to the VT client. What if we instead do it in this function directly? And then call the neighbor helper set_attribute
function instead
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.
Hmmm good idea I think, that does sound appealing. I can rework it
Describe your changes
This lets you use the VT state helper to deal with float attributes. Previously, float values were probably not handled correctly.
I was seeing that there were warnings in the seeder example about this:
How has this been tested?