sas
Modularised monitoring, logging, and control of robots.
Toggle main menu visibility
Loading...
Searching...
No Matches
sas_robot_kinematics_server.hpp
1
#pragma once
2
/*
3
# Copyright (c) 2020-2023 Murilo Marques Marinho
4
#
5
# This file is part of sas_robot_kinematics.
6
#
7
# sas_robot_kinematics 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_robot_driver 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_robot_kinematics. If not, see <https://www.gnu.org/licenses/>.
19
#
20
# ################################################################
21
#
22
# Author: Murilo M. Marinho, email: murilomarinho@ieee.org
23
#
24
# ################################################################*/
25
26
#include <atomic>
27
28
#include <dqrobotics/DQ.h>
29
30
#include <rclcpp/rclcpp.hpp>
31
#include <geometry_msgs/msg/pose_stamped.hpp>
32
#include <sas_core/sas_object.hpp>
33
#include <sas_msgs/msg/float64.hpp>
34
35
using namespace
DQ_robotics;
36
37
namespace
sas
38
{
47
class
RobotKinematicsServer:
private
sas::Object
48
{
49
protected
:
50
std::shared_ptr<rclcpp::Node> node_;
51
52
std::atomic_bool enabled_;
53
const
std::string topic_prefix_;
54
55
rclcpp::Publisher<geometry_msgs::msg::PoseStamped>::SharedPtr publisher_pose_;
56
rclcpp::Publisher<geometry_msgs::msg::PoseStamped>::SharedPtr publisher_reference_frame_;
57
58
rclcpp::Subscription<geometry_msgs::msg::PoseStamped>::SharedPtr subscriber_desired_pose_;
59
DQ desired_pose_;
60
rclcpp::Subscription<sas_msgs::msg::Float64>::SharedPtr subscriber_desired_interpolator_speed_;
61
double
desired_interpolator_speed_;
62
63
void
_callback_desired_pose(
const
geometry_msgs::msg::PoseStamped& msg);
64
void
_callback_desired_interpolator_speed(
const
sas_msgs::msg::Float64& msg);
65
public
:
66
RobotKinematicsServer()=
delete
;
67
RobotKinematicsServer(
const
RobotKinematicsServer&)=
delete
;
68
69
#ifdef IS_SAS_PYTHON_BUILD
70
RobotKinematicsServer(
const
std::string& topic_prefix);
71
#endif
72
81
RobotKinematicsServer(
const
std::shared_ptr<rclcpp::Node>& node,
const
std::string& topic_prefix);
82
87
DQ
get_desired_pose
()
const
;
88
93
double
get_desired_interpolator_speed
()
const
;
94
99
bool
is_enabled
()
const
;
100
105
void
send_pose
(
const
DQ& pose)
const
;
106
111
void
send_reference_frame
(
const
DQ& reference_frame)
const
;
112
113
};
114
115
}
marinholab::sas::core::Object
Base class for SAS objects.
Definition
sas_object.hpp:40
sas::RobotKinematicsServer::is_enabled
bool is_enabled() const
Check whether the server is enabled (publishers/subscribers active).
Definition
sas_robot_kinematics_server.cpp:75
sas::RobotKinematicsServer::send_pose
void send_pose(const DQ &pose) const
Publish the current robot pose.
Definition
sas_robot_kinematics_server.cpp:97
sas::RobotKinematicsServer::get_desired_interpolator_speed
double get_desired_interpolator_speed() const
Get the most recently received desired interpolator speed.
Definition
sas_robot_kinematics_server.cpp:92
sas::RobotKinematicsServer::send_reference_frame
void send_reference_frame(const DQ &reference_frame) const
Publish the robot's reference frame pose.
Definition
sas_robot_kinematics_server.cpp:102
sas::RobotKinematicsServer::get_desired_pose
DQ get_desired_pose() const
Get the most recently received desired pose.
Definition
sas_robot_kinematics_server.cpp:80
src
sas_robot_kinematics
include
sas_robot_kinematics
sas_robot_kinematics_server.hpp
Generated by
1.17.0