Skip to content
This repository has been archived by the owner on Feb 3, 2025. It is now read-only.

Fixed crash when collision size is zero #2768

Merged
Merged
Changes from all commits
Commits
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
13 changes: 10 additions & 3 deletions gazebo/rendering/Visual.cc
Original file line number Diff line number Diff line change
Expand Up @@ -811,9 +811,16 @@ void Visual::SetScale(const ignition::math::Vector3d &_scale)

this->dataPtr->scale = _scale;

this->dataPtr->sceneNode->setScale(
Conversions::Convert(this->dataPtr->scale));

if (!ignition::math::isnan(this->dataPtr->scale.X())
&& !ignition::math::isnan(this->dataPtr->scale.Y())
&& !ignition::math::isnan(this->dataPtr->scale.Z()))
{
this->dataPtr->sceneNode->setScale(
Conversions::Convert(this->dataPtr->scale));
} else {
gzerr << Name() << ": Size of the collision contains one or several zeros." <<
" Collisions may not visualize properly." << std::endl;
}
// Scale selection object in case we have one attached. Other children were
// scaled from UpdateGeomSize
for (auto child : this->dataPtr->children)
Expand Down