Skip to content

Commit

Permalink
Added actionType to ActionClient.
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanFabian committed Sep 26, 2021
1 parent b7b105c commit a859383
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/qml_ros_plugin/action_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@ Q_OBJECT
// @formatter:off
//! True if the ActionClient is connected to the ActionServer, false otherwise.
Q_PROPERTY( bool connected READ isServerConnected NOTIFY connectedChanged )
//! The type of the action. Example: actionlib_tutorials/FibonacciAction
Q_PROPERTY( QString actionType READ actionType CONSTANT )
// @formatter:on
public:
ActionClient( NodeHandle::Ptr nh, const QString &action_type, const QString &name );

Q_INVOKABLE bool isServerConnected() const;

QString actionType() const;

/*!
* Sends a goal to the action server if it is connected.
*
Expand Down
2 changes: 2 additions & 0 deletions src/action_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ bool ActionClient::isServerConnected() const
return client_ != nullptr && client_->isServerConnected();
}

QString ActionClient::actionType() const { return action_type_; }

void ActionClient::checkServerConnected()
{
if ( !isServerConnected()) return;
Expand Down

0 comments on commit a859383

Please sign in to comment.