Skip to content

Commit

Permalink
restore collision
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume Doisy <[email protected]>
  • Loading branch information
Guillaume Doisy committed Jan 6, 2021
1 parent 2ae6fc7 commit 28dd4c7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 51 deletions.
38 changes: 0 additions & 38 deletions src/Collision.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ class sdf::CollisionPrivate

/// \brief Weak pointer to model's Pose Relative-To Graph.
public: std::weak_ptr<const sdf::PoseRelativeToGraph> poseRelativeToGraph;

/// \brief True indicates the lidar reflective intensity was set.
public: bool hasLaserRetro{false};

/// \brief Lidar reflective intensity
public: double laserRetro = 0;
};

/////////////////////////////////////////////////
Expand Down Expand Up @@ -142,14 +136,6 @@ Errors Collision::Load(ElementPtr _sdf)
this->dataPtr->surface.Load(_sdf->GetElement("surface"));
}

// Load the lidar reflective intensity if it is given
if (_sdf->HasElement("laser_retro"))
{
this->SetHasLaserRetro(true);
this->SetLaserRetro(_sdf->Get<double>("laser_retro"));
std::cerr << "laser_retro: " << this->LaserRetro() << std::endl;
}

return errors;
}

Expand Down Expand Up @@ -265,27 +251,3 @@ sdf::ElementPtr Collision::Element() const
{
return this->dataPtr->sdf;
}

//////////////////////////////////////////////////
void Collision::SetHasLaserRetro(bool _laserRetro)
{
this->dataPtr->hasLaserRetro = _laserRetro;
}

//////////////////////////////////////////////////
bool Collision::HasLaserRetro() const
{
return this->dataPtr->hasLaserRetro;
}

//////////////////////////////////////////////////
double Collision::LaserRetro() const
{
return this->dataPtr->laserRetro;
}

//////////////////////////////////////////////////
void Collision::SetLaserRetro(double _laserRetro)
{
this->dataPtr->laserRetro = _laserRetro;
}
13 changes: 0 additions & 13 deletions src/Collision_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,3 @@ TEST(DOMcollision, SetSurface)
ASSERT_NE(nullptr, collision.Surface()->Contact());
EXPECT_EQ(collision.Surface()->Contact()->CollideBitmask(), 0x2);
}

/////////////////////////////////////////////////
TEST(DOMcollision, SetLaserRetro)
{
sdf::Collision collision;
EXPECT_EQ(nullptr, collision.Element());
EXPECT_TRUE(collision.Name().empty());

collision.SetLaserRetro(150);

EXPECT_TRUE(collision.HasLaserRetro());
EXPECT_DOUBLE_EQ(150, collision.LaserRetro());
}

0 comments on commit 28dd4c7

Please sign in to comment.