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

Fix/py color support osg viewer #1398

Merged
merged 8 commits into from
Aug 17, 2019

Conversation

chhinze
Copy link
Contributor

@chhinze chhinze commented Aug 16, 2019

Fixes issue #1393. Allows to set the background color in dartpy.gui.osg.Viewer and dartpy.gui.osg.ImGuiViewer with a type convertible to an Eigen::Vector4d, e.g.

# set background to white
viewer = dartpy.gui.osg.Viewer(np.array([1,1,1,1]) 
# or even by using python lists, that get implicitly converted
viewer2 = dartpy.gui.osg.Viewer([1,1,1,1])

Should we add the new possibility to one of the dartpy examples?

The argument type is now Eigen::Vector4d(instead of Eigen::Vector4f), because it allows passing a list as well (as in the creation of viewer2above).


Before creating a pull request

  • document new methods and classes
  • Format new code files using clang-format

Before merging a pull request

  • Set version target by selecting a milestone on the right side
  • Summarize this change in CHANGELOG.md
  • Add unit test(s) for this change

An Eigen::Vector4f can be passed to the viewer constructor to set the background color.
@jslee02 jslee02 added this to the DART 6.10.0 milestone Aug 16, 2019
@codecov
Copy link

codecov bot commented Aug 16, 2019

Codecov Report

Merging #1398 into master will decrease coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1398      +/-   ##
==========================================
- Coverage   57.38%   57.37%   -0.02%     
==========================================
  Files         366      366              
  Lines       27405    27405              
==========================================
- Hits        15726    15723       -3     
- Misses      11679    11682       +3
Impacted Files Coverage Δ
dart/dynamics/EulerJoint.cpp 69.32% <0%> (-3.69%) ⬇️
dart/dynamics/Skeleton.cpp 66.22% <0%> (+0.16%) ⬆️

Copy link
Member

@jslee02 jslee02 left a comment

Choose a reason for hiding this comment

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

Should we add the new possibility to one of the dartpy examples?

Yeah, it'd be worth to test it in at least one dartpy example (maybe hello_world_gui).

Copy link
Member

@jslee02 jslee02 left a comment

Choose a reason for hiding this comment

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

LGTM!

@jslee02 jslee02 merged commit 96f864b into dartsim:master Aug 17, 2019
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.

2 participants