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

Merge 9 -> main #2641

Merged
merged 45 commits into from
Oct 9, 2024
Merged
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
1d6651d
Update readme, changelog and prepare for 9.0.0pre1 release (#2554)
iche033 Aug 29, 2024
a20bf25
Fix doxygen page links (#2553)
azeey Aug 29, 2024
4ecdb43
Update migration_plugins.md (#2564)
EnzoGhisoni Sep 2, 2024
040acb2
Add world name to documentation (#2571)
avanmalleghem Sep 2, 2024
0dccd06
Fix lander tutorial (#2576)
avanmalleghem Sep 2, 2024
c4906f8
Fix looking up camera name in camera lens system (#2559)
iche033 Sep 2, 2024
f7afdf5
Fixed warning joint trayectory sdf (#2580)
ahcorde Sep 2, 2024
51819ae
Video recorder tutorial fixes. (#2582)
caguero Sep 2, 2024
5a94050
Removed actor population due bad merge (#2581)
ahcorde Sep 2, 2024
7b3d182
Fix hydrodynamics deprecation warning. (#2579)
arjo129 Sep 3, 2024
faebf12
Fix issue #2566: Prevent follow actor plugin from crashing when actor…
arjo129 Sep 3, 2024
8a3d999
Enhance readme (#2573)
avanmalleghem Sep 3, 2024
e5faf77
Update migration_sdf.md (#2563)
EnzoGhisoni Sep 3, 2024
1ff9082
Fix typo plugins to plugin directory in README.md (#2574)
avanmalleghem Sep 3, 2024
6e7f2a0
Update tutorial (#2562)
alesof Sep 3, 2024
4597293
Fix crash when running the optical tactile sensor world (#2561)
iche033 Sep 3, 2024
c04a7d9
Fix logic in actor system (#2584)
iche033 Sep 3, 2024
f0a0e2d
use ogre2 for dem worlds (#2586)
iche033 Sep 4, 2024
20b87f2
Fix crash on windows due to invalid log directory path (#2589)
azeey Sep 4, 2024
5482778
Update particle emitter tutorial (#2585)
iche033 Sep 4, 2024
fec31aa
Fix empty gui tutorial (#2591)
avanmalleghem Sep 4, 2024
8b74a43
Fix particle emitter color range image path warning (#2560)
iche033 Sep 4, 2024
96e1b03
Fix xml and image in create maritime vehicle tutorial (#2592)
alexandrosnic Sep 4, 2024
f8f8a80
Fix configuring global illumination GUI plugin parameters (#2594)
iche033 Sep 5, 2024
518cc31
Fixed typo in gz sim python api (#2578)
ahcorde Sep 5, 2024
086e08d
fix adding system plugins tutorial (#2602)
avanmalleghem Sep 6, 2024
3977d65
Fix known issue section in README (#2603)
avanmalleghem Sep 6, 2024
c1f379e
Update physics system error msg when plugin can not be loaded (#2604)
iche033 Sep 6, 2024
c4f95c4
fix CMakeList example + add link to working example (#2601)
avanmalleghem Sep 9, 2024
96775c8
tutorials: headless_rendering: Little fixes (#2607)
peci1 Sep 9, 2024
712643f
tutorials: Updated point_cloud_to_mesh tutorial to reflect new UI in …
peci1 Sep 9, 2024
9b161db
Fix making breadcrumb static if it's a nested model (#2593)
iche033 Sep 10, 2024
b1f919b
Add tutorial + example SDF for shadow texture size (#2597)
athenaz2 Sep 10, 2024
ca40c1d
Fix log playback GUI display (#2611)
azeey Sep 12, 2024
0f16949
Adds a regression test for logplayback fix in #2611 (#2619)
arjo129 Sep 12, 2024
3765579
Fix typos in joint-tutorial readme. (#2622)
bperseghetti Sep 13, 2024
43b435a
tutorials/terminology: Fixed type (#2625)
peci1 Sep 16, 2024
4c5a914
tutorials/physics: Small fixes and Windows support (#2627)
peci1 Sep 16, 2024
b32c890
README: Windows-related improvements (#2631)
peci1 Sep 16, 2024
0e1f254
tutorials/install: Added Windows instructions (#2628)
peci1 Sep 16, 2024
76305df
Update links in point cloud to mesh tutorial and fix screenshot link …
iche033 Sep 17, 2024
cdca1f1
tutorials/video_recorder: Added note about OGV support (#2634)
peci1 Sep 23, 2024
bbe2cc6
Prepare for 9.0.0 release (#2635)
iche033 Sep 27, 2024
546d5aa
Merge branch 'gz-sim9' into merge_9_main_20241007
iche033 Oct 8, 2024
5755cae
update readme badge
iche033 Oct 8, 2024
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
Fix crash when running the optical tactile sensor world (#2561)
Signed-off-by: Ian Chen <ichen@openrobotics.org>
iche033 authored Sep 3, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 4597293e6c6f3b3a3bda8c389fe891d8b5d23953
38 changes: 20 additions & 18 deletions src/systems/optical_tactile_plugin/OpticalTactilePlugin.cc
Original file line number Diff line number Diff line change
@@ -530,6 +530,7 @@ void OpticalTactilePluginPrivate::Load(const EntityComponentManager &_ecm)
int contactSensorCounter = 0;
sdf::Sensor depthCameraSdf;
components::Pose depthCameraPose = components::Pose();
std::string depthCameraTopic;
for (const Entity &sensor : sensorsInsideLink)
{
if (_ecm.EntityHasComponentType(sensor, components::DepthCamera::typeId))
@@ -538,6 +539,10 @@ void OpticalTactilePluginPrivate::Load(const EntityComponentManager &_ecm)
depthCameraSdf =
_ecm.Component<components::DepthCamera>(sensor)->Data();
depthCameraPose = *(_ecm.Component<components::Pose>(sensor));
auto depthCameraTopicComp =
_ecm.Component<components::SensorTopic>(sensor);
if (depthCameraTopicComp)
depthCameraTopic = depthCameraTopicComp->Data();
}

if (_ecm.EntityHasComponentType(sensor, components::ContactSensor::typeId))
@@ -558,16 +563,6 @@ void OpticalTactilePluginPrivate::Load(const EntityComponentManager &_ecm)
}

// Store depth camera update rate
if (!depthCameraSdf.Element()->HasElement("update_rate"))
{
if (!this->initErrorPrinted)
{
gzerr << "Depth camera should have an <update_rate> value "
<< "(only printed once)" << std::endl;
this->initErrorPrinted = true;
}
return;
}
this->cameraUpdateRate = depthCameraSdf.UpdateRate();

// Depth camera data is float, so convert Pose3d to Pose3f
@@ -581,20 +576,27 @@ void OpticalTactilePluginPrivate::Load(const EntityComponentManager &_ecm)
depthCameraPose.Data().Rot().Z());

// Configure subscriber for depth camera images
if (!depthCameraSdf.Element()->HasElement("topic"))
if (depthCameraTopic.empty())
{
gzwarn << "Depth camera publishing to __default__ topic. "
<< "It's possible that two depth cameras are publishing into the same "
<< "topic" << std::endl;
// get the topic from sdf if the one in sensor topic component is empty
depthCameraTopic = depthCameraSdf.Topic();
}
else

if (depthCameraTopic.empty())
{
gzdbg << "Depth camera publishing to "
<< depthCameraSdf.Topic() << " topic" << std::endl;
if (!this->initErrorPrinted)
{
gzerr << "Depth camera topic is empty. " << std::endl;
this->initErrorPrinted = true;
}
return;
}

gzdbg << "Depth camera publishing to "
<< depthCameraTopic << " topic" << std::endl;

std::string topic =
"/" + depthCameraSdf.Topic() + "/points";
"/" + depthCameraTopic + "/points";
if (!this->node.Subscribe(topic,
&OpticalTactilePluginPrivate::DepthCameraCallback, this))
{