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 gazebo8 warnings part 10: ifdefs for GetModel, GetEntity, Light (lunar-devel) #657

Merged
merged 5 commits into from
Dec 22, 2017
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions gazebo_plugins/src/gazebo_ros_imu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,11 @@ void GazeboRosIMU::LoadThread()

// assert that the body by link_name_ exists
this->link = boost::dynamic_pointer_cast<physics::Link>(
#if GAZEBO_MAJOR_VERSION >= 8
this->world_->EntityByName(this->link_name_));
#else
this->world_->GetEntity(this->link_name_));
#endif
if (!this->link)
{
ROS_FATAL_NAMED("imu", "gazebo_ros_imu plugin error: bodyName: %s does not exist\n",
Expand Down
12 changes: 12 additions & 0 deletions gazebo_plugins/src/gazebo_ros_joint_pose_trajectory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,11 @@ void GazeboRosJointPoseTrajectory::SetTrajectory(
this->reference_link_name_ != "map")
{
physics::EntityPtr ent =
#if GAZEBO_MAJOR_VERSION >= 8
this->world_->EntityByName(this->reference_link_name_);
#else
this->world_->GetEntity(this->reference_link_name_);
#endif
if (ent)
this->reference_link_ = boost::dynamic_pointer_cast<physics::Link>(ent);
if (!this->reference_link_)
Expand Down Expand Up @@ -250,7 +254,11 @@ bool GazeboRosJointPoseTrajectory::SetTrajectory(
this->reference_link_name_ != "map")
{
physics::EntityPtr ent =
#if GAZEBO_MAJOR_VERSION >= 8
this->world_->EntityByName(this->reference_link_name_);
#else
this->world_->GetEntity(this->reference_link_name_);
#endif
if (ent)
this->reference_link_ = boost::dynamic_pointer_cast<physics::Link>(ent);
if (!this->reference_link_)
Expand All @@ -267,7 +275,11 @@ bool GazeboRosJointPoseTrajectory::SetTrajectory(
" inertially", this->reference_link_->GetName().c_str());
}

#if GAZEBO_MAJOR_VERSION >= 8
this->model_ = this->world_->ModelByName(req.model_name);
#else
this->model_ = this->world_->GetModel(req.model_name);
#endif
if (!this->model_) // look for it by frame_id name
{
this->model_ = this->reference_link_->GetParentModel();
Expand Down
12 changes: 12 additions & 0 deletions gazebo_plugins/src/gazebo_ros_joint_trajectory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,11 @@ void GazeboRosJointTrajectory::SetTrajectory(
this->reference_link_name_ != "map")
{
physics::EntityPtr ent =
#if GAZEBO_MAJOR_VERSION >= 8
this->world_->EntityByName(this->reference_link_name_);
#else
this->world_->GetEntity(this->reference_link_name_);
#endif
if (ent)
this->reference_link_ = boost::dynamic_pointer_cast<physics::Link>(ent);
if (!this->reference_link_)
Expand Down Expand Up @@ -252,7 +256,11 @@ bool GazeboRosJointTrajectory::SetTrajectory(
this->reference_link_name_ != "map")
{
physics::EntityPtr ent =
#if GAZEBO_MAJOR_VERSION >= 8
this->world_->EntityByName(this->reference_link_name_);
#else
this->world_->GetEntity(this->reference_link_name_);
#endif
if (ent)
this->reference_link_ = boost::shared_dynamic_cast<physics::Link>(ent);
if (!this->reference_link_)
Expand All @@ -269,7 +277,11 @@ bool GazeboRosJointTrajectory::SetTrajectory(
" inertially", this->reference_link_->GetName().c_str());
}

#if GAZEBO_MAJOR_VERSION >= 8
this->model_ = this->world_->ModelByName(req.model_name);
#else
this->model_ = this->world_->GetModel(req.model_name);
#endif
if (!this->model_) // look for it by frame_id name
{
this->model_ = this->reference_link_->GetParentModel();
Expand Down
Loading