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

Line setColor getting ignored #820

Closed
stonier opened this issue Oct 3, 2014 · 4 comments
Closed

Line setColor getting ignored #820

stonier opened this issue Oct 3, 2014 · 4 comments

Comments

@stonier
Copy link
Contributor

stonier commented Oct 3, 2014

The rviz::Line class in ogre_helpers/line.hpp is not faithfully setting the setColor command. Currently if it gets drawn in rviz, but will always show as white. My current setup:

  • vanilla style rviz display plugin based off the imu display plugin tutorial
  • Using Line instead of the Arrow class.
  • Calling setColor on creation, or every time the visual gets updated doesn't matter too much.

I might be missing some api usage though. One thing I found does work is to subclass the Line class and recreate my own setColor command setting diffuse and ambient (note the original only sets diffuse) colours.

# instead of:
manual_object_material_->getTechnique(0)->getPass(0)->setDiffuse(r,g,b,a);
# set the following:
Ogre::ColourValue c(r, g, b, a);
manual_object_material_->getTechnique(0)->setDiffuse(c);
manual_object_material_->getTechnique(0)->setAmbient(c);
@wjwwood
Copy link
Member

wjwwood commented Oct 3, 2014

Thanks for the report, it will be next week before I can look into this.

@wjwwood
Copy link
Member

wjwwood commented Oct 10, 2014

@stonier I had look around the code and naively it looks like your suggestion could just be pushed down into the rviz::Line class. Admittedly though, I'm not super familiar with the Ogre API's and I'm not entirely sure how your approach is different.

Have you had any time to look into it further or do you care to propose an exact change as a pull request?

@stonier
Copy link
Contributor Author

stonier commented Oct 27, 2014

@wjwwood Yes, if I had to make a PR I would have also tried pushing into the line class. I refrained from making a PR this time however for the same reasons as yourself - I'm not super familiar with the Ogre API, as well as what is technically correct when setting up opengl lighting conditions.

If it helps to go forward, we could naively make such a PR and add some comments in case some 'expert' revisits this in the future. How does this sound?

@wjwwood
Copy link
Member

wjwwood commented Oct 27, 2014

If you get a chance to post your current idea for a patch that would be good.

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

No branches or pull requests

2 participants