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

Ensure the model base link is set to the correct model #9

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
2 changes: 1 addition & 1 deletion src/ArduPilotPlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,6 @@ void ignition::gazebo::systems::ArduPilotPlugin::PreUpdate(
{
// The parent of the imu is imu_link
ignition::gazebo::Entity parent = _ecm.ParentEntity(_imu_entity);
this->dataPtr->modelLink = parent;
if (parent != ignition::gazebo::kNullEntity)
{
// The grandparent of the imu is the quad itself, which is where this plugin is attached
Expand All @@ -774,6 +773,7 @@ void ignition::gazebo::systems::ArduPilotPlugin::PreUpdate(
ignition::gazebo::Model gparent_model(gparent);
if (gparent_model.Name(_ecm) == this->dataPtr->modelName)
{
this->dataPtr->modelLink = parent;
imuTopicName = ignition::gazebo::scopedName(_imu_entity, _ecm) + "/imu";
igndbg << "Computed IMU topic to be: " << imuTopicName << std::endl;
}
Expand Down