sas
Modularised monitoring, logging, and control of robots.
Toggle main menu visibility
Loading...
Searching...
No Matches
sas_object_server.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
ObjectServer:
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 target_pose_;
63
64
void
_callback_target_pose(
const
geometry_msgs::msg::PoseStamped& msg);
65
public
:
66
ObjectServer() =
delete
;
67
ObjectServer(
const
ObjectServer&) =
delete
;
68
75
ObjectServer(
const
std::shared_ptr<Node> &node,
76
const
std::string topic_prefix=
"GET_FROM_NODE"
);
77
83
void
send_pose
(
const
DQ& pose);
84
91
DQ
get_target_pose
()
const
;
92
98
bool
is_enabled
()
const
;
99
105
std::string
get_topic_prefix
()
const
;
106
};
107
108
}
sas::ObjectServer::get_topic_prefix
std::string get_topic_prefix() const
Get the configured topic prefix.
Definition
sas_object_server.cpp:77
sas::ObjectServer::get_target_pose
DQ get_target_pose() const
Get the currently stored target pose.
Definition
sas_object_server.cpp:64
sas::ObjectServer::send_pose
void send_pose(const DQ &pose)
Publish the provided pose to the configured topic.
Definition
sas_object_server.cpp:59
sas::ObjectServer::is_enabled
bool is_enabled() const
Query whether the server is enabled.
Definition
sas_object_server.cpp:72
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_server.hpp
Generated by
1.17.0