sas
Modularised monitoring, logging, and control of robots.
Toggle main menu visibility
Loading...
Searching...
No Matches
sas_robot_kinematics_client.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
{
48
class
RobotKinematicsClient:
private
sas::Object
49
{
50
private
:
51
std::shared_ptr<rclcpp::Node> node_;
52
53
std::atomic_bool enabled_;
54
const
std::string topic_prefix_;
55
56
rclcpp::Subscription<geometry_msgs::msg::PoseStamped>::SharedPtr subscriber_pose_;
57
DQ pose_;
58
rclcpp::Subscription<geometry_msgs::msg::PoseStamped>::SharedPtr subscriber_reference_frame_;
59
DQ reference_frame_;
60
61
rclcpp::Publisher<geometry_msgs::msg::PoseStamped>::SharedPtr publisher_desired_pose_;
62
rclcpp::Publisher<sas_msgs::msg::Float64>::SharedPtr publisher_desired_interpolator_speed_;
63
64
void
_callback_pose(
const
geometry_msgs::msg::PoseStamped& msg);
65
void
_callback_reference_frame(
const
geometry_msgs::msg::PoseStamped& msg);
66
public
:
67
RobotKinematicsClient()=
delete
;
68
RobotKinematicsClient(
const
RobotKinematicsClient&)=
delete
;
69
70
//#ifdef IS_SAS_PYTHON_BUILD
71
// RobotKinematicsInterface(const std::string& topic_prefix);
72
//#endif
81
RobotKinematicsClient(
const
std::shared_ptr<rclcpp::Node> &node,
const
std::string& topic_prefix);
82
87
bool
is_enabled
()
const
;
88
93
DQ
get_pose
()
const
;
94
99
DQ
get_reference_frame
()
const
;
100
105
void
send_desired_pose
(
const
DQ& desired_pose)
const
;
106
112
void
send_desired_interpolator_speed
(
const
double
& interpolator_speed)
const
;
113
};
114
}
marinholab::sas::core::Object
Base class for SAS objects.
Definition
sas_object.hpp:40
sas::RobotKinematicsClient::send_desired_interpolator_speed
void send_desired_interpolator_speed(const double &interpolator_speed) const
Publish a desired interpolator speed value.
Definition
sas_robot_kinematics_client.cpp:116
sas::RobotKinematicsClient::get_reference_frame
DQ get_reference_frame() const
Get the last received reference frame pose.
Definition
sas_robot_kinematics_client.cpp:101
sas::RobotKinematicsClient::send_desired_pose
void send_desired_pose(const DQ &desired_pose) const
Publish a desired pose for the robot.
Definition
sas_robot_kinematics_client.cpp:111
sas::RobotKinematicsClient::is_enabled
bool is_enabled() const
Check whether the client is enabled (subscribers/publishers active).
Definition
sas_robot_kinematics_client.cpp:83
sas::RobotKinematicsClient::get_pose
DQ get_pose() const
Get the last received robot pose.
Definition
sas_robot_kinematics_client.cpp:89
src
sas_robot_kinematics
include
sas_robot_kinematics
sas_robot_kinematics_client.hpp
Generated by
1.17.0