-
Notifications
You must be signed in to change notification settings - Fork 100
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
Add scatter ratio parameter to Particle Emitter DOM #547
Conversation
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Codecov Report
@@ Coverage Diff @@
## sdf10 #547 +/- ##
=======================================
Coverage 87.26% 87.26%
=======================================
Files 63 63
Lines 9880 9888 +8
=======================================
+ Hits 8622 8629 +7
- Misses 1258 1259 +1
Continue to review full report at Codecov.
|
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.
Just a few minor comments
///////////////////////////////////////////////// | ||
void ParticleEmitter::SetScatterRatio(float _ratio) | ||
{ | ||
this->dataPtr->scatterRatio = _ratio; |
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.
this->dataPtr->scatterRatio = _ratio; | |
if (_ratio <= 0.0f) | |
{ | |
ignwarn << "Scatter ratio must be > 0, but a value of " << _ratio << " was given. Using a value of " << this->dataPtr->scatterRatio << " instead" << std::endl; | |
return; | |
} | |
this->dataPtr->scatterRatio = _ratio; |
Since the scatter ratio must be > 0, should we only set it if the value passed in is > 0? If so, we should also update the documentation to indicate this in ParticleEmitter.hh
.
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.
after thinking about it more, I removed the requirement on the value needs to be > 0. It's more of an implementation limitation on the ignition end. Since we should keep the spec as general as possible, I think someone could decide to use 0 to simulate 0 scattering for certain sensors.
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.
That's a good point. Everything looks good to me, so feel free to merge unless you're waiting for someone else to look over this as well 👍
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.
alright, will merge after CI builds are done
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen [email protected]
🎉 New feature
Summary
Add particle scatter parameter to the Particle Emitter DOM. This affects how noisy / scattered the sensors readings are affected by the particle emitter.
Checklist
sh tools/code_check.sh
)another open pull request
to support the maintainers
Note to maintainers: Remember to use Squash-Merge