I have been trying to solve this error for a while now but I am not sure what may be causing it. It seems to have popped out of nowhere after I created several actors with the same plugin and animation file. Any help would be appreciated, thanks
gzserver: /var/lib/jenkins/workspace/gazebo8-debbuilder/build/gazebo-8.5.0/gazebo/common/SkeletonAnimation.cc:147: ignition::math::Matrix4d gazebo::common::NodeAnimation::FrameAt(double, bool) const: Assertion `(t >= 0.0 && t <= 1.0)&&("t is not in the range 0.0..1.0")' failed.
My world file
model://sun model://ground_plane -1 1 0.5 0 0 0 moonwalk.dae walk.dae true stand.dae true 1.15 humanone 1.8 5.1 ground_plane -1 2 0.5 0 0 0 moonwalk.dae walk.dae true stand.dae true 1.15 humantwo 1.8 5.1 ground_plane
EDIT:
I managed to find what is triggering my error although I am not sure why that is so. I am using an edited version of the Actor plugin provided in the tutorials (https://bitbucket.org/osrf/gazebo/raw/default/plugins/ActorPlugin.cc). For some reason changing the following in HandleObstacles removes the error.
if (std::find(this->ignoreModels.begin(), this->ignoreModels.end(),
model->GetName()) == this->ignoreModels.end())
{
to (added ! before std)
if (!(std::find(this->ignoreModels.begin(), this->ignoreModels.end(),
model->GetName()) == this->ignoreModels.end()))
{
EDIT:
After further investigation, I managed to pin the line causing this error when the equality signs change in the if statement.
It is due to the following two lines
_pos.X() -= offset.X();
_pos.Y() -= offset.Y();
in this function
void ActorPlugin::HandleObstacles(ignition::math::Vector3d &_pos)
{
for (unsigned int i = 0; i < this->world->ModelCount(); ++i)
{
physics::ModelPtr model = this->world->ModelByIndex(i);
// Do not handle the target to follow as an obstacle. Follow buffer should keep a safe distance.
if(this->mode == "follow" && model->GetName() == this->targetName)
continue;
if ((std::find(this->ignoreModels.begin(), this->ignoreModels.end(),
model->GetName()) != this->ignoreModels.end()))
{
ignition::math::Vector3d offset = model->WorldPose().Pos() -
this->actor->WorldPose().Pos();
double modelDist = offset.Length();
if (modelDist < 4.0)
{
double invModelDist = this->obstacleWeight / modelDist;
offset.Normalize();
offset *= invModelDist;
// Only change the X and Y direction vector components... Unless humans can levitate in the future... That would be cool.
_pos.X() -= offset.X();
_pos.Y() -= offset.Y();
}
}
}
}
However, I am still unsure why this is happening?
↧