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

Fix trajectory follower: enable WorldPose component #1382

Merged
merged 1 commit into from
Mar 10, 2022
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
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