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 enviroment system loading mechanism #1842

Merged
merged 33 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ee16b8d
Fix enviroment system loading mechanism
arjo129 Dec 20, 2022
2ce77fc
small changes
arjo129 Dec 21, 2022
3829724
Working on porting the visuals
arjo129 Jan 12, 2023
f0d1866
Actually send message for loading from ui to environment preload plugin.
arjo129 Feb 16, 2023
9b684cf
Rewrite EnvironmentVisualization Widget to be simpler.
arjo129 Feb 17, 2023
dd24227
fix crashes.
arjo129 Feb 17, 2023
712ebe0
Get a different :boom:
arjo129 Feb 17, 2023
d722ad8
Works some times.
arjo129 Feb 17, 2023
87586d7
Fixed synchronization issues.
arjo129 Feb 20, 2023
77f5472
No more :boom:s :tada:
arjo129 Feb 21, 2023
882edbe
style
arjo129 Feb 22, 2023
ea93a1b
Sprinkled with healthy dose of Doxygen
arjo129 Feb 22, 2023
4fd5c9e
Style
arjo129 Feb 23, 2023
d7c34c3
More style fixes
arjo129 Feb 23, 2023
7af4af9
Fix Typo with unit map
arjo129 Apr 14, 2023
57b949b
Address PR feedback
arjo129 Apr 14, 2023
afcf5c6
Style fixes
arjo129 Apr 17, 2023
6b56a43
Fix incorrect use of path.
arjo129 Apr 17, 2023
8779e84
Merge branch 'gz-sim7' into arjo/fix/environment_system
mjcarroll Apr 25, 2023
c2708db
Fix example loading issues.
arjo129 Jul 18, 2023
c30639a
Merge branch 'arjo/fix/environment_system' of github.com:gazebosim/gz…
arjo129 Jul 18, 2023
54c42b2
style
arjo129 Jul 18, 2023
fe1bc7c
Update src/systems/environment_preload/VisualizationTool.cc
arjo129 Aug 22, 2023
3cf7896
Adds a warning regarding loading plugins.
arjo129 Aug 24, 2023
36e7cc4
Merge remote-tracking branch 'origin' into arjo/fix/environment_system
arjo129 Aug 24, 2023
f90ef4f
Merge branch 'arjo/fix/environment_system' of github.com:gazebosim/gz…
arjo129 Aug 24, 2023
6b2c398
Automatically loads plugin if missing
arjo129 Aug 25, 2023
85b6eac
Address some feedback I missed
arjo129 Aug 25, 2023
04a3858
Address some feedback
arjo129 Aug 25, 2023
e3ed11a
Fixes issue described by @iche033.
arjo129 Aug 28, 2023
4d0a034
style
arjo129 Aug 28, 2023
0672777
Fixed failing tests
arjo129 Sep 4, 2023
9daebc8
Merge branch 'gz-sim7' into arjo/fix/environment_system
iche033 Sep 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed synchronization issues.
Now left with one more crash that needs debugging when "play" is hit.

Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
  • Loading branch information
arjo129 committed Feb 20, 2023
commit 87586d786899b52cf04ecd964da2cc1a5f5b36e6
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ EnvironmentVisualization::EnvironmentVisualization()
{
gui::App()->Engine()->rootContext()->setContextProperty(
"EnvironmentVisualization", this);
this->qtimer = new QTimer(this);
connect(qtimer, &QTimer::timeout,
this, &EnvironmentVisualization::ResamplePointcloud);
this->qtimer->start(1000);
}

/////////////////////////////////////////////////
Expand All @@ -118,7 +122,7 @@ void EnvironmentVisualization::Update(const UpdateInfo &_info,
{
this->dataPtr->Initiallize(_ecm);
this->dataPtr->first = false;
//this->ResamplePointcloud();
this->ResamplePointcloud();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ inline namespace GZ_SIM_VERSION_NAMESPACE
public: unsigned int ySamples{10};

public: unsigned int zSamples{10};

private: QTimer* qtimer;
};
}
}
Expand Down
10 changes: 8 additions & 2 deletions src/systems/environment_preload/EnvironmentPreload.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ class gz::sim::systems::EnvironmentPreloadPrivate

public: math::Vector3d samples;

public: bool fileLoaded{false};

public: bool logError{true};

public: std::shared_ptr<components::EnvironmentalData> envData;
Expand All @@ -82,9 +84,12 @@ class gz::sim::systems::EnvironmentPreloadPrivate
public: void OnVisualResChanged(const msgs::Vector3d &_resChanged)
{
std::lock_guard<std::mutex> lock(this->mtx);
this->visualize = true;
this->samples = msgs::Convert(_resChanged);
this->visualizationPtr->resample = true;
if (this->fileLoaded)
{
this->visualize = true;
this->visualizationPtr->resample = true;
}
}

public: void ReadSdf(EntityComponentManager &_ecm)
Expand Down Expand Up @@ -241,6 +246,7 @@ class gz::sim::systems::EnvironmentPreloadPrivate
auto component = ComponentT{std::move(data)};
_ecm.CreateComponent(worldEntity(_ecm), std::move(component));
this->visualizationPtr->resample = true;
this->fileLoaded = true;
}
catch (const std::invalid_argument &exc)
{
Expand Down
2 changes: 2 additions & 0 deletions src/systems/environment_preload/VisualizationTool.hh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class EnvironmentVisualizationTool

public: std::atomic<bool> resample{true};

public: bool finishedTime{false};

/////////////////////////////////////////////////
public: void CreatePointCloudTopics(
std::shared_ptr<components::EnvironmentalData> data) {
Expand Down