-
Notifications
You must be signed in to change notification settings - Fork 91
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 line of site sampling along a Spinner Lidar rosette pattern #48
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
|
||
#ifndef SyntheticLidar_H | ||
#define SyntheticLidar_H | ||
|
||
#include <DataProbePostProcessing.h> | ||
|
||
#include <memory> | ||
#include <array> | ||
|
||
namespace sierra { | ||
namespace nalu { | ||
|
||
struct Segment | ||
{ | ||
Segment() = default; | ||
Segment(std::array<double, 3> tip, std::array<double,3> tail) | ||
: tip_{tip}, tail_{tail} {}; | ||
|
||
std::array<double, 3> tip_{{}}; | ||
std::array<double, 3> tail_{{}}; | ||
}; | ||
|
||
struct PrismParameters{ | ||
PrismParameters() = default; | ||
PrismParameters(double theta0, double rot, double azimuth) | ||
: theta0_{theta0}, rot_{rot}, azimuth_{azimuth} | ||
{}; | ||
|
||
double theta0_{0}; // rad | ||
double rot_{0}; // rad / s | ||
double azimuth_{0}; // rad | ||
}; | ||
|
||
class SpinnerLidarSegmentGenerator | ||
{ | ||
public: | ||
|
||
SpinnerLidarSegmentGenerator() = default; | ||
|
||
SpinnerLidarSegmentGenerator( | ||
PrismParameters inner, | ||
PrismParameters outer, | ||
double in_beamLength); | ||
|
||
void load(const YAML::Node& node); | ||
|
||
Segment generate_path_segment(double time) const; | ||
|
||
void set_inner_prism(PrismParameters innerPrism) { innerPrism_ = innerPrism; } | ||
void set_inner_prism(double theta0, double rot, double azi) { innerPrism_ = {theta0, rot, azi}; } | ||
void set_outer_prism(PrismParameters outerPrism) { outerPrism_ = outerPrism; } | ||
void set_outer_prism(double theta0, double rot, double azi) { outerPrism_ = {theta0, rot, azi}; } | ||
void set_lidar_center(Coordinates lidarCenter) { lidarCenter_ = {{lidarCenter.x_, lidarCenter.y_, lidarCenter.z_}}; } | ||
void set_laser_axis(Coordinates laserAxis) { laserAxis_ = {{laserAxis.x_, laserAxis.y_, laserAxis.z_}}; } | ||
void set_ground_normal(Coordinates gNormal) { groundNormal_ = {{gNormal.x_, gNormal.y_, gNormal.z_}}; } | ||
void set_beam_length(double beamLength) { beamLength_ = beamLength; } | ||
|
||
private: | ||
PrismParameters innerPrism_; | ||
PrismParameters outerPrism_; | ||
double beamLength_{1.0}; | ||
|
||
std::array<double, 3> lidarCenter_{{0,0,0}}; | ||
std::array<double, 3> laserAxis_{{1,0,0}}; | ||
std::array<double, 3> groundNormal_{{0,0,1}}; | ||
}; | ||
|
||
class LidarLineOfSite | ||
{ | ||
public: | ||
LidarLineOfSite() = default; | ||
std::unique_ptr<DataProbeSpecInfo> determine_line_of_site_info(const YAML::Node& node); | ||
private: | ||
void load(const YAML::Node& node); | ||
|
||
SpinnerLidarSegmentGenerator segGen; | ||
|
||
double scanTime_{2}; | ||
int nsamples_{984}; | ||
int npoints_{100}; | ||
std::vector<std::string> fromTargetNames_; | ||
|
||
std::string name_{"lidar_line"}; | ||
|
||
}; | ||
|
||
|
||
|
||
} | ||
} | ||
|
||
#endif |
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
Misspelling. Did you mean "line of sight"?
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.
No. Both spellings are valid and the existing capability is called "line of site" in Nalu currently.