Skip to content

Commit

Permalink
Commenting clnav2z
Browse files Browse the repository at this point in the history
  • Loading branch information
brettpac committed Dec 10, 2024
1 parent 443620f commit 1deb7ab
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 RobosoftAI Inc.
// Copyright 2024 Robosoft Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -12,32 +12,31 @@
// See the License for the specific language governing permissions and
// limitations under the License.

/*****************************************************************************************************************
*
* Authors: Pablo Inigo Blasco, Brett Aldrich
*
******************************************************************************************************************/
#pragma once

#include <nav2_msgs/action/navigate_to_pose.hpp>
#include <smacc2/client_bases/smacc_action_client_base.hpp>
#include <smacc2/smacc.hpp>

#include <nav2_msgs/action/navigate_to_pose.hpp>

// Declare the namespace for the client library.
namespace cl_nav2z
{
// Declare Client class, inherit from SmaccActionClientBase with the action type NavigateToPose.
class ClNav2Z
: public smacc2::client_bases::SmaccActionClientBase<nav2_msgs::action::NavigateToPose>
{
public:
// Bring the SmaccActionClientBase types into the current scope.
using smacc2::client_bases::SmaccActionClientBase<nav2_msgs::action::NavigateToPose>::GoalHandle;
using smacc2::client_bases::SmaccActionClientBase<
nav2_msgs::action::NavigateToPose>::ResultCallback;

// Define "SmaccNavigateResultSignal" as a SmaccSignal that points to the WrappedResult type of SmaccActionClientBase.
typedef smacc2::SmaccSignal<void(const WrappedResult &)> SmaccNavigateResultSignal;

// Declare Client constructor with string set to the right ROS action.
ClNav2Z(std::string navigateToPoseAction = "/navigate_to_pose");

// Declare Client destructor
virtual ~ClNav2Z();
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 RobosoftAI Inc.
// Copyright 2024 Robosoft Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -12,28 +12,26 @@
// See the License for the specific language governing permissions and
// limitations under the License.

/*****************************************************************************************************************
*
* Authors: Pablo Inigo Blasco, Brett Aldrich
*
******************************************************************************************************************/
#include <nav2z_client/nav2z_client.hpp>

#include <string>

#include <pluginlib/class_list_macros.hpp>
#include <string>

// Define the namespace for the client library.
namespace cl_nav2z
{
// Define "Base" as a SmaccActionClientBase specialized for the NavigateToPose action, tie to WrappedResult.
typedef smacc2::client_bases::SmaccActionClientBase<nav2_msgs::action::NavigateToPose> Base;
typedef Base::WrappedResult WrappedResult;

// Define Client constructor.
ClNav2Z::ClNav2Z(std::string moveBaseName) : Base(moveBaseName)
{
// RCLCPP_INFO(getLogger(),"Smacc Move Base Action Client");
}

// Define Client destructor.
ClNav2Z::~ClNav2Z() {}
} // namespace cl_nav2z

// Export the ClNav2Z class as type smacc2::ISmaccClient as an implementation of the ISmaccClient interface.
PLUGINLIB_EXPORT_CLASS(cl_nav2z::ClNav2Z, smacc2::ISmaccClient)

0 comments on commit 1deb7ab

Please sign in to comment.