sas
Modularised monitoring, logging, and control of robots.
Toggle main menu visibility
Loading...
Searching...
No Matches
sas_object_client.hpp
1
#pragma once
2
/*
3
# Copyright (c) 2026 Murilo Marques Marinho
4
#
5
# This file is part of sas_common.
6
#
7
# sas_common is free software: you can redistribute it and/or modify
8
# it under the terms of the GNU Lesser General Public License as published by
9
# the Free Software Foundation, either version 3 of the License, or
10
# (at your option) any later version.
11
#
12
# sas_common is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU Lesser General Public License for more details.
16
#
17
# You should have received a copy of the GNU Lesser General Public License
18
# along with sas_common. If not, see <https://www.gnu.org/licenses/>.
19
#
20
# ################################################################
21
#
22
# Author: Murilo M. Marinho, email: murilomarinho@ieee.org
23
#
24
# ################################################################
25
# Contributors:
26
# ---
27
*/
28
29
#include <atomic>
30
31
#include <dqrobotics/DQ.h>
32
33
#include <rclcpp/rclcpp.hpp>
34
#include <geometry_msgs/msg/pose_stamped.hpp>
35
#include <
sas_core/sas_object.hpp
>
36
37
using namespace
rclcpp;
38
using namespace
DQ_robotics;
39
40
namespace
sas
41
{
42
52
class
ObjectClient:
private
sas::Object
53
{
54
private
:
55
std::shared_ptr<Node> node_;
56
57
std::atomic_bool enabled_;
58
std::string topic_prefix_;
59
60
Subscription<geometry_msgs::msg::PoseStamped>::SharedPtr subscriber_pose_;
61
Publisher<geometry_msgs::msg::PoseStamped>::SharedPtr publisher_pose_;
62
DQ pose_;
63
64
void
_callback_pose(
const
geometry_msgs::msg::PoseStamped& msg);
65
public
:
66
ObjectClient() =
delete
;
67
ObjectClient(
const
ObjectClient&) =
delete
;
68
75
ObjectClient(
const
std::shared_ptr<Node> &node,
76
const
std::string topic_prefix=
"GET_FROM_NODE"
);
77
85
void
send_pose
(
const
DQ& pose);
86
93
DQ
get_pose
()
const
;
94
100
bool
is_enabled
()
const
;
101
107
std::string
get_topic_prefix
()
const
;
108
};
109
110
}
sas::ObjectClient::send_pose
void send_pose(const DQ &pose)
Publish the provided pose to the configured topic.
Definition
sas_object_client.cpp:59
sas::ObjectClient::get_topic_prefix
std::string get_topic_prefix() const
Get the configured topic prefix.
Definition
sas_object_client.cpp:77
sas::ObjectClient::is_enabled
bool is_enabled() const
Query whether the client is enabled.
Definition
sas_object_client.cpp:72
sas::ObjectClient::get_pose
DQ get_pose() const
Get the last received pose.
Definition
sas_object_client.cpp:64
sas::Object
Base class for SAS objects.
Definition
sas_object.hpp:40
sas_object.hpp
Base object class for identification and license utilities.
src
sas_common
include
sas_common
sas_object_client.hpp
Generated by
1.17.0