-
Notifications
You must be signed in to change notification settings - Fork 36
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
[GUI] Fix display of Visual's scaleV #430
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.
Hi @arntanguy
No problem with this PR except for the small backward compatibility issue
In addition, I do not see the point of keeping both scale and scaleV properties. They are somewhat contradictory, and scaleV contains all of the necessary information. Thus I suggest the corresponding PR in RBDyn to remove scale
This was done to introduce the vector form of scale
without breaking existing code but it should be fine to retire scale
(as suggested in the RBDyn PR)
@@ -685,15 +685,15 @@ rbd::parsers::Geometry::Mesh ConfigurationLoader<rbd::parsers::Geometry::Mesh>:: | |||
{ | |||
rbd::parsers::Geometry::Mesh m; | |||
m.filename = static_cast<std::string>(config("filename")); | |||
m.scale = config("scale"); | |||
m.scaleV = config("scaleV"); |
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.
To keep it compatible if people update mc_rtc without updating the GUI implementations
m.scaleV = config("scaleV"); | |
if(auto scale = config.find("scale")) | |
{ | |
m.scale = scale->operator<double>(); | |
m.scaleV.setConstant(m.scale); | |
} | |
else | |
{ | |
m.scaleV = config("scaleV"); | |
m.scale = m.scaleV(0); | |
} |
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.
m.scale
won't exist after the RBDyn PR, so I'm not sure what you are suggesting 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.
Oh yes. I guess we can skip this then release a new version of mc_rtc that does not require scale
and then release a version of RBDyn
without scale?
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.
Yes as is it works without updating RBDyn
, it's just less confusing not to have both properties in the future ;)
Thanks @arntanguy If everything builds feel free to (in that order):
I'll release new versions of RBDyn/mc_rtc/mc_rtc_ros on Monday |
Added -- - [mc_rbdyn/GUI] Add helpers to visualize surfaces and convexes (#431) - [mc_rtc/GUI] Added RobotMsg: a complete view of the robot state (#425) - [mc_rtc] Add path helpers (#431) - [utils/RobotVisualizer] Add a new tool to visualize a robot built on mc_rtc GUI (#431) Changes -- - [mc_rtc/GUI] Send scale vector for visual mesh instead of scalar (#430) Fixes -- - [mc_rbdyn] Always use default_attitude to initialize the attitude (#424) - [mc_tasks] Clarify usage of targetSurface/targetFrame in ImpedanceTask
This PR modifies
mc_rtc::gui::Visual
to publish thescaleV
property (scale along x,y,z axes) instead of thescale
property (global scale for all axes). This allows the display interface to properly display scaled meshes. For example:This publishes all of the robot visuals and allows to rescale individiual axes of its meshes online. Note that this is displayed correctly in rviz, but currently not in magnum (as the scale is taken into account only at mesh creation).
In addition, I do not see the point of keeping both
scale
andscaleV
properties. They are somewhat contradictory, andscaleV
contains all of the necessary information. Thus I suggest the corresponding PR in RBDyn to removescale
.