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

View entity frames from the GUI #1105

Merged
merged 9 commits into from
Dec 11, 2021
Merged

Conversation

chapulina
Copy link
Contributor

@chapulina chapulina commented Oct 13, 2021

🎉 New feature

Needs gazebosim/gz-rendering#486

Summary

View entity frames from the context menu. This is similar to Gazebo classic's functionality.

This is an alternative to gazebosim/gz-gui#182

Test it

  1. Right-click an entity
  2. View
  3. Frames

For example:

ign gazebo log_record_dbl_pendulum.sdf -v 4 --render-engine ogre2

frames2

Try models, links or visuals:

frames3

With Ogre 1, it's possible to see the frame names (see gazebosim/gz-rendering#487 for Ogre 2). But Ogre 1 doesn't support transparency, so it's hard to see the frames 🙃

ign gazebo log_record_dbl_pendulum.sdf -v 4 --render-engine ogre

frames4


Usability considerations for the future:

  • Only display names when hovering?
  • Visual differentiation between what's a model frame, a link frame...?

While at it, I updated documentation and naming of some functions in VisualizationCapabiities in the hope of making the usage clearer. I can split that into a separate PR if preferred.

TODO

  • View frames for entities other than links
  • Scale frames to reasonable sizes w.r.t. their parents

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge

🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸

Signed-off-by: Louise Poubel <[email protected]>
@chapulina chapulina added GUI Gazebo's graphical interface (not pure Ignition GUI) close the gap Features from Gazebo-classic labels Oct 13, 2021
@github-actions github-actions bot added 🌱 garden Ignition Garden 🏯 fortress Ignition Fortress labels Oct 13, 2021
@nkoenig
Copy link
Contributor

nkoenig commented Oct 27, 2021

I wasn't able to turn off frame visualization.

Would it be possible to show a frame name when the mouse hovers over the axis?

@chapulina
Copy link
Contributor Author

@nkoenig , this is still a WIP, I started working on it because I needed it to debug a project. I opened the PR for visibility so we don't duplicate the work. I'll let you know when I'm able to clean it up and address comments.

I wasn't able to turn off frame visualization.

It's in my TODO list

Would it be possible to show a frame name when the mouse hovers over the axis?

That would be a nice feature. I'll look into it when I come back to this PR and see if it's trivial to add. If it's not, I'll ticket an issue and leave it out of this PR's scope.

@chapulina chapulina added the needs upstream release Blocked by a release of an upstream library label Nov 5, 2021
@chapulina
Copy link
Contributor Author

I wasn't able to turn off frame visualization.

Fixed, it needs gazebosim/gz-rendering#486

Signed-off-by: Louise Poubel <[email protected]>
@chapulina
Copy link
Contributor Author

Would it be possible to show a frame name when the mouse hovers over the axis?

I made it always show the name, but it only works with Ogre 1. Do you think that's enough for a 1st iteration?

@chapulina chapulina marked this pull request as ready for review November 5, 2021 21:00
@chapulina chapulina removed the 🌱 garden Ignition Garden label Nov 16, 2021
Signed-off-by: Louise Poubel <[email protected]>
/// \param[in] _entity Entity to find children
/// \return Vector of children found for the parent entity
public: std::unordered_set<ignition::gazebo::Entity>
FindChildFrames(const ignition::gazebo::Entity &_entity);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this something that should be in Util.cc?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah good point. It will need to be cleaned up and tested more. I ticketed an issue because there are other functions in this plugin in the same situation:

// https://github.com/ignitionrobotics/ign-rendering/issues/487
if (nullptr != textGeom)
{
textGeom->SetFontName("Liberation Sans");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other QML code uses Roboto is it possible to use Roboto here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately we can only use fonts installed with ign-rendering. We should look into installing Roboto in the future: gazebosim/gz-rendering#512

@chapulina chapulina mentioned this pull request Dec 10, 2021
7 tasks
Signed-off-by: Louise Poubel <[email protected]>
@codecov
Copy link

codecov bot commented Dec 10, 2021

Codecov Report

Merging #1105 (4ac0e70) into ign-gazebo6 (25df299) will decrease coverage by 0.26%.
The diff coverage is 3.81%.

Impacted file tree graph

@@               Coverage Diff               @@
##           ign-gazebo6    #1105      +/-   ##
===============================================
- Coverage        62.22%   61.96%   -0.27%     
===============================================
  Files              276      276              
  Lines            22886    22991     +105     
===============================================
+ Hits             14241    14246       +5     
- Misses            8645     8745     +100     
Impacted Files Coverage Δ
...lization_capabilities/VisualizationCapabilities.cc 3.70% <3.17%> (+0.02%) ⬆️
src/gui/plugins/modules/EntityContextMenu.cc 19.78% <20.00%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 25df299...4ac0e70. Read the comment docs.

@chapulina chapulina merged commit bf9da06 into ign-gazebo6 Dec 11, 2021
@chapulina chapulina deleted the chapulina/view_frames branch December 11, 2021 01:20
@chapulina chapulina removed the needs upstream release Blocked by a release of an upstream library label Dec 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
close the gap Features from Gazebo-classic 🏯 fortress Ignition Fortress GUI Gazebo's graphical interface (not pure Ignition GUI)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants