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

Adds OriginDisplay plugin to draw the inertial axes in the scene. #375

Merged
merged 3 commits into from
Apr 6, 2021

Conversation

agalbachicar
Copy link
Collaborator

@agalbachicar agalbachicar commented Apr 5, 2021

Part of #332

Implements OriginDisplay plugin with ign-gui3. Note that there are no DisplayPlugins anymore so I had to retrieve the ScenePtr myself. I expect something similar for agent_info_display

origin_axes

@scpeters
Copy link
Contributor

scpeters commented Apr 5, 2021

the old visualizer has check boxes to toggle the axes. it's optional, but we could probably add one to the rectangle created by the plugin?

@scpeters
Copy link
Contributor

scpeters commented Apr 5, 2021

the old visualizer has check boxes to toggle the axes. it's optional, but we could probably add one to the rectangle created by the plugin?

I was trying to figure out how to do this for the agent info display, but am a little slow at qml

@agalbachicar
Copy link
Collaborator Author

the old visualizer has check boxes to toggle the axes. it's optional, but we could probably add one to the rectangle created by the plugin?

I missed that.

I think I know how to do it. We should call a function from QML to C++. Something like:

I imagine that you are trying to build some kind of checkbox. It inherits from Button so you can implement a function in the onClicked event:

Checkbox {
  id: checkboxId
  checked: Qt.Checked
  onClicked : {
    if (checkboxId.checked == Qt.Checked) {
      checkboxId.checked = Qt.Unchecked;
      AgentPlugin.YourSlotFunction(false);
    } else {
      checkboxId.checked = Qt.Checked;
      AgentPlugin.YourSlotFunction(true);
    }
  }
}

@agalbachicar
Copy link
Collaborator Author

I'll implement the checkbox to toggle frame visibility

@agalbachicar
Copy link
Collaborator Author

Toggle visibility was implemented in 5049e95

toggle_visibility.mp4

francocipollone
francocipollone previously approved these changes Apr 6, 2021
Copy link
Collaborator

@francocipollone francocipollone left a comment

Choose a reason for hiding this comment

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

LGTM

}

void OriginDisplay::ChangeAxesVisibility() {
bool newIsVisibleValue = isVisible;
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: could be const.

btw why isVisible can't be used directly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it might change while changing the visibility of the axes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done in 9fd1057

@agalbachicar agalbachicar merged commit e514d59 into master Apr 6, 2021
@scpeters scpeters deleted the agalbachicar/#332_origin_display_ign_gui_3 branch April 6, 2021 16:54
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

Successfully merging this pull request may close these issues.

3 participants