-
Notifications
You must be signed in to change notification settings - Fork 201
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
Handle NaN values for Wrench msgs #746
Conversation
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.
Few comments to improve logic.
rviz_default_plugins/src/rviz_default_plugins/displays/wrench/wrench_display.cpp
Outdated
Show resolved
Hide resolved
rviz_default_plugins/src/rviz_default_plugins/displays/wrench/wrench_display.cpp
Outdated
Show resolved
Hide resolved
@@ -96,6 +100,7 @@ void WrenchDisplay::reset() | |||
|
|||
void WrenchDisplay::updateWrenchVisuals() | |||
{ | |||
// bool accept_NaN = accept_NaN_values_->getBool(); |
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.
why is this commented out?
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.
This is kept as part of testing, will remove.
rviz_default_plugins/include/rviz_default_plugins/displays/wrench/wrench_display.hpp
Outdated
Show resolved
Hide resolved
rviz_default_plugins/src/rviz_default_plugins/displays/wrench/wrench_display.cpp
Outdated
Show resolved
Hide resolved
rviz_default_plugins/src/rviz_default_plugins/displays/wrench/wrench_display.cpp
Outdated
Show resolved
Hide resolved
return; | ||
} | ||
} else { | ||
custom_msg->wrench.force.x = (std::isnan(msg->wrench.force.x)) ? 0.0 : msg->wrench.force.x; |
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.
You should also validate if message has inf in it. Use again validate for this and then if true check if there are only NaNs and if not than do nothing/ignore message.
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.
sure, will add the validate part,
…wrench_display.cpp Co-authored-by: Denis Štogl <destogl@users.noreply.github.com>
…wrench_display.cpp Co-authored-by: Denis Štogl <destogl@users.noreply.github.com>
…wrench_display.cpp Co-authored-by: Denis Štogl <destogl@users.noreply.github.com>
…nch/wrench_display.hpp Co-authored-by: Denis Štogl <destogl@users.noreply.github.com>
…wrench_display.cpp Co-authored-by: Denis Štogl <destogl@users.noreply.github.com>
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.
this looks good! Thanks!
rviz_default_plugins/src/rviz_default_plugins/displays/wrench/wrench_display.cpp
Outdated
Show resolved
Hide resolved
rviz_default_plugins/src/rviz_default_plugins/displays/wrench/wrench_display.cpp
Outdated
Show resolved
Hide resolved
@bmagyar can you also give it a look before we trigger RViz-maintainers |
Problems in Rviz
This PR will contain the changes to,