Skip to content

Commit

Permalink
Remove deprecations
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Agüero <[email protected]>
  • Loading branch information
caguero committed Dec 2, 2024
1 parent 7543961 commit 5a5f719
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 89 deletions.
4 changes: 0 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@ set(GZ_GUI_PLUGIN_RELATIVE_INSTALL_DIR
${GZ_LIB_INSTALL_DIR}/gz-${GZ_DESIGNATION}-${PROJECT_VERSION_MAJOR}/plugins
)

set(GZ_GUI_PLUGIN_INSTALL_DIR
${CMAKE_INSTALL_PREFIX}/${GZ_GUI_PLUGIN_RELATIVE_INSTALL_DIR}
)

#============================================================================
# Configure the build
#============================================================================
Expand Down
12 changes: 0 additions & 12 deletions examples/standalone/scene_provider/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,3 @@ Update follow offset from track topic:
```bash
gz topic -t /gui/track -m gz.msgs.CameraTrack -p 'track_mode: 2, follow_target: {name: "box_model"}, follow_offset: {x: -1, y: 0, z: 1}'
```

Follow box from service (deprecated):

```bash
gz service -s /gui/follow --reqtype gz.msgs.StringMsg --reptype gz.msgs.Boolean --timeout 2000 --req 'data: "box_model"'
```

Update follow offset from follow offset service (deprecated):

```bash
gz service -s /gui/follow/offset --reqtype gz.msgs.Vector3d --reptype gz.msgs.Boolean --timeout 2000 --req 'x: 5, y: 5, z: 5'
```
2 changes: 0 additions & 2 deletions include/gz/gui/config.hh.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,4 @@

#define GZ_GUI_VERSION_HEADER "Gazebo GUI, version ${PROJECT_VERSION_FULL}\nCopyright (C) 2017 Open Source Robotics Foundation.\nReleased under the Apache 2.0 License.\n\n"

#define GZ_GUI_PLUGIN_INSTALL_DIR _Pragma ("GCC warning \"'GZ_GUI_PLUGIN_INSTALL_DIR' macro is deprecated, use gz::gui::getPluginInstallDir() function instead. \"") "${GZ_GUI_PLUGIN_INSTALL_DIR}"

#endif // GZ_GUI_CONFIG_HH_
64 changes: 0 additions & 64 deletions src/plugins/camera_tracking/CameraTracking.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,27 +69,13 @@ class CameraTracking::Implementation
/// \param[in] _msg Message is of type CameraTrack.
public: void OnTrackSub(const msgs::CameraTrack &_msg);

/// \brief Callback for a follow request
/// \param[in] _msg Request message to set the target to follow.
/// \param[in] _res Response data
/// \return True if the request is received
public: bool OnFollow(const msgs::StringMsg &_msg,
msgs::Boolean &_res);

/// \brief Callback for a move to pose request.
/// \param[in] _msg GUICamera request message.
/// \param[in] _res Response data
/// \return True if the request is received
public: bool OnMoveToPose(const msgs::GUICamera &_msg,
msgs::Boolean &_res);

/// \brief Callback for a follow offset request
/// \param[in] _msg Request message to set the camera's follow offset.
/// \param[in] _res Response data
/// \return True if the request is received
public: bool OnFollowOffset(const msgs::Vector3d &_msg,
msgs::Boolean &_res);

/// \brief Callback when a move to animation is complete
private: void OnMoveToComplete();

Expand Down Expand Up @@ -161,12 +147,6 @@ class CameraTracking::Implementation
/// \brief Move to service
public: std::string moveToService;

/// \brief Follow service (deprecated)
public: std::string followService;

/// \brief Follow offset service (deprecated)
public: std::string followOffsetService;

/// \brief The pose set from the move to pose service.
public: std::optional<math::Pose3d> moveToPoseValue;

Expand Down Expand Up @@ -224,13 +204,6 @@ void CameraTracking::Implementation::Initialize()
gzmsg << "Move to service on ["
<< this->moveToService << "]" << std::endl;

// follow
this->followService = "/gui/follow";
this->node.Advertise(this->followService,
&Implementation::OnFollow, this);
gzmsg << "Follow service on ["
<< this->followService << "] (deprecated)" << std::endl;

// track
this->trackTopic = "/gui/track";
this->node.Subscribe(this->trackTopic,
Expand Down Expand Up @@ -259,13 +232,6 @@ void CameraTracking::Implementation::Initialize()
this->node.Advertise<msgs::Pose>(this->cameraPoseTopic);
gzmsg << "Camera pose topic advertised on ["
<< this->cameraPoseTopic << "]" << std::endl;

// follow offset
this->followOffsetService = "/gui/follow/offset";
this->node.Advertise(this->followOffsetService,
&Implementation::OnFollowOffset, this);
gzmsg << "Follow offset service on ["
<< this->followOffsetService << "] (deprecated)" << std::endl;
}

/////////////////////////////////////////////////
Expand All @@ -279,21 +245,6 @@ bool CameraTracking::Implementation::OnMoveTo(const msgs::StringMsg &_msg,
return true;
}

/////////////////////////////////////////////////
bool CameraTracking::Implementation::OnFollow(const msgs::StringMsg &_msg,
msgs::Boolean &_res)
{
std::lock_guard<std::mutex> lock(this->mutex);
this->selectedFollowTarget = _msg.data();

_res.set_data(true);

this->trackMode = gz::msgs::CameraTrack::FOLLOW;

this->newTrack = true;
return true;
}

/////////////////////////////////////////////////
void CameraTracking::Implementation::OnTrackSub(const msgs::CameraTrack &_msg)
{
Expand Down Expand Up @@ -351,21 +302,6 @@ void CameraTracking::Implementation::OnMoveToPoseComplete()
this->moveToPoseDuration.reset();
}

/////////////////////////////////////////////////
bool CameraTracking::Implementation::OnFollowOffset(const msgs::Vector3d &_msg,
msgs::Boolean &_res)
{
std::lock_guard<std::mutex> lock(this->mutex);
if (!this->selectedFollowTarget.empty())
{
this->newTrack = true;
this->followOffset = msgs::Convert(_msg);
}

_res.set_data(true);
return true;
}

/////////////////////////////////////////////////
bool CameraTracking::Implementation::OnMoveToPose(const msgs::GUICamera &_msg,
msgs::Boolean &_res)
Expand Down
5 changes: 1 addition & 4 deletions src/plugins/camera_tracking/CameraTracking.hh
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,9 @@
namespace gz::gui::plugins
{
/// \brief This plugin provides camera tracking capabilities such as "move to"
/// and "follow".
/// and "track".
///
/// Services:
/// * `/gui/follow`: Set the user camera to follow a given target,
/// identified by name (deprecated).
/// * `/gui/follow/offset`: Set the offset for following (deprecated).
/// * `/gui/move_to`: Move the user camera to look at a given target,
/// identified by name.
/// * `/gui/move_to/pose`: Move the user camera to a given pose.
Expand Down
4 changes: 1 addition & 3 deletions src/plugins/world_control/WorldControl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,7 @@ void WorldControl::ProcessMsg()

// ignore the message if it's associated with a step
const auto &header = this->dataPtr->msg.header();
if (this->dataPtr->msg.stepping() ||
// (deprecated) Remove this check in Gazebo H
((header.data_size() > 0) && (header.data(0).key() == "step")))
if (this->dataPtr->msg.stepping())
{
return;
}
Expand Down

0 comments on commit 5a5f719

Please sign in to comment.