Skip to content

Commit

Permalink
Enable WorldPose component on TrajectoryFollower (#1382)
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <[email protected]>
  • Loading branch information
chapulina authored Mar 10, 2022
1 parent 3969f5b commit fc9cadd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/systems/trajectory_follower/TrajectoryFollower.cc
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ void TrajectoryFollower::PreUpdate(
// We call Load here instead of Configure because we can't be guaranteed
// that all entities have been created when Configure is called
this->dataPtr->Load(_ecm, this->dataPtr->sdfConfig);
enableComponent<components::WorldPose>(_ecm, this->dataPtr->link.Entity());
this->dataPtr->initialized = true;
}

Expand Down Expand Up @@ -379,6 +380,12 @@ void TrajectoryFollower::PreUpdate(

// Transform from world to local frame.
auto comPose = this->dataPtr->link.WorldInertialPose(_ecm);
if (!comPose.has_value())
{
ignerr << "Failed to get CoM pose for link ["
<< this->dataPtr->link.Entity() << "]" << std::endl;
return;
}

// Transform the force and torque to the world frame.
// Move commands. The vehicle always move forward (X direction).
Expand Down

0 comments on commit fc9cadd

Please sign in to comment.