Added threadpool to laser plugin, fixed bug with plugin enabled param…#47
Merged
Conversation
josephduchesne
commented
Jun 6, 2018
Collaborator
- added threadpool to laser plugin (~5x speedup of flatland on 4C/8T i7-4790k)
- fixed bug with plugin enabled parameter
- added better documentation about third party libraries and licenses used
- bumped version number to 1.1.1
lichunshang
approved these changes
Jun 6, 2018
| laser_point.y = m_world_laser_points_(1, i); | ||
| LaserCallback cb(this); | ||
|
|
||
| GetModel()->GetPhysicsWorld()->RayCast(&cb, laser_origin_point, |
Collaborator
There was a problem hiding this comment.
I guess this is thread safe?
Collaborator
Author
There was a problem hiding this comment.
I looked into it and it doesn't seem to modify the physics world state at all
kubuqi
reviewed
Jun 6, 2018
| return std::make_pair<double, double>(NAN, 0); | ||
| } else { | ||
| return std::make_pair<double, double>( | ||
| cb.fraction_ * this->range_ + this->noise_gen_(this->rng_), |
There was a problem hiding this comment.
std::normal_distribution might not be thread safe. Is it possible to move this noise generator to cb object so that nobody shares it?
Collaborator
Author
There was a problem hiding this comment.
I can move the noise out of the thread
kubuqi
approved these changes
Jun 6, 2018
kubuqi
reviewed
Jun 6, 2018
| for (unsigned int i = 0; i < laser_scan_.ranges.size(); ++i) { | ||
| auto result = results[i].get(); // Pull the result from the future | ||
| laser_scan_.ranges[i] = result.first; | ||
| laser_scan_.ranges[i] = result.first + this->noise_gen_(this->rng_); |
JoaoCostaIFG
pushed a commit
to JoaoCostaIFG/flatland
that referenced
this pull request
Nov 30, 2022
Added threadpool to laser plugin, fixed bug with plugin enabled param…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.