Skip to content
Closed
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
11 changes: 10 additions & 1 deletion src/systems/lift_drag/LiftDrag.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ class ignition::gazebo::systems::LiftDragPrivate
void LiftDragPrivate::Load(const EntityComponentManager &_ecm,
const sdf::ElementPtr &_sdf)
{
if (!this->model.Valid(_ecm))
{
gzerr << "The LiftDrag system should be attached to a model entity. "
<< "Failed to initialize." << std::endl;
return;
}
this->cla = _sdf->Get<double>("cla", this->cla).first;
this->cda = _sdf->Get<double>("cda", this->cda).first;
this->cma = _sdf->Get<double>("cma", this->cma).first;
Expand Down Expand Up @@ -498,15 +504,18 @@ void LiftDragPrivate::Update(EntityComponentManager &_ecm)
//////////////////////////////////////////////////
void LiftDrag::Configure(const Entity &_entity,
const std::shared_ptr<const sdf::Element> &_sdf,
EntityComponentManager &_ecm, EventManager &)
EntityComponentManager &, EventManager &)
{
this->dataPtr->model = Model(_entity);
<<<<<<< HEAD
if (!this->dataPtr->model.Valid(_ecm))
{
ignerr << "The LiftDrag system should be attached to a model entity. "
<< "Failed to initialize." << std::endl;
return;
}
=======
>>>>>>> 049c19e9 (Fixes issue #2903 (#2907))
this->dataPtr->sdfConfig = _sdf->Clone();
}

Expand Down
Loading