sas
Modularised monitoring, logging, and control of robots.
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>
36
37using namespace rclcpp;
38using namespace DQ_robotics;
39
40namespace sas
41{
42
53{
54private:
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);
65public:
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
92 DQ get_pose() const;
93
99 bool is_enabled() const;
100
106 std::string get_topic_prefix() const;
107};
108
109}
Client wrapper for object pose.
Definition sas_object_client.hpp:53
void send_pose(const DQ &pose)
Publish the provided pose to the configured topic.
Definition sas_object_client.cpp:59
std::string get_topic_prefix() const
Get the configured topic prefix.
Definition sas_object_client.cpp:77
bool is_enabled() const
Query whether the client is enabled.
Definition sas_object_client.cpp:72
DQ get_pose() const
Get the last received pose.
Definition sas_object_client.cpp:64
Definition sas_object.hpp:39
Base object class for identification and license utilities.