sas
Modularised monitoring, logging, and control of robots.
Toggle main menu visibility
Loading...
Searching...
No Matches
sas_robot_driver_ros_composer.hpp
1
#pragma once
2
/*
3
# Copyright (c) 2016-2025 Murilo Marques Marinho
4
#
5
# This file is part of sas_robot_driver.
6
#
7
# sas_robot_driver 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_driver. If not, see <https://www.gnu.org/licenses/>.
19
#
20
# ################################################################
21
#
22
# Author: Murilo M. Marinho, email: murilomarinho@ieee.org
23
#
24
# ################################################################
25
# 2025.07.10: Removing CoppeliaSim and moving it to sas_robot_driver_coppeliasim
26
*/
27
28
#include <atomic>
29
#include <memory>
30
#include <mutex>
31
32
#include <eigen3/Eigen/Dense>
33
34
#include <
sas_core/sas_robot_driver.hpp
>
35
#include <sas_robot_driver/sas_robot_driver_client.hpp>
36
37
using namespace
Eigen;
38
39
namespace
sas
40
{
41
42
struct
RobotDriverROSComposerConfiguration
43
{
44
std::vector<std::string> robot_driver_client_names;
45
bool
override_joint_limits_with_robot_parameter_file;
46
std::string robot_parameter_file_path;
47
};
48
49
class
RobotDriverROSComposer:
public
RobotDriver
50
{
51
protected
:
52
std::shared_ptr<Node> node_;
53
54
RobotDriverROSComposerConfiguration
configuration_;
55
std::vector<std::unique_ptr<sas::RobotDriverClient>> robot_driver_clients_;
56
57
RobotDriverROSComposer()=
delete
;
58
RobotDriverROSComposer(
const
RobotDriverROSComposer&)=
delete
;
59
public
:
60
RobotDriverROSComposer(
const
RobotDriverROSComposerConfiguration
& configuration,
61
std::shared_ptr<Node>& node,
62
std::atomic_bool *break_loops);
63
64
VectorXd
get_joint_positions
()
override
;
65
void
set_target_joint_positions
(
const
VectorXd& set_target_joint_positions_rad)
override
;
66
std::tuple<VectorXd, VectorXd>
get_joint_limits
()
override
;
67
void
set_joint_limits
(
const
std::tuple<VectorXd, VectorXd>&)
override
;
68
69
void
connect
()
override
;
70
void
disconnect
()
override
;
71
72
void
initialize
()
override
;
73
void
deinitialize
()
override
;
74
75
~RobotDriverROSComposer();
76
77
};
78
}
79
80
81
sas::RobotDriverROSComposer::get_joint_limits
std::tuple< VectorXd, VectorXd > get_joint_limits() override
Get joint limits (min, max).
Definition
sas_robot_driver_ros_composer.cpp:115
sas::RobotDriverROSComposer::get_joint_positions
VectorXd get_joint_positions() override
Get current joint positions.
Definition
sas_robot_driver_ros_composer.cpp:56
sas::RobotDriverROSComposer::disconnect
void disconnect() override
Disconnect from the underlying robot/hardware.
Definition
sas_robot_driver_ros_composer.cpp:87
sas::RobotDriverROSComposer::set_target_joint_positions
void set_target_joint_positions(const VectorXd &set_target_joint_positions_rad) override
Set target joint positions.
Definition
sas_robot_driver_ros_composer.cpp:67
sas::RobotDriverROSComposer::deinitialize
void deinitialize() override
Deinitialize the driver resources.
Definition
sas_robot_driver_ros_composer.cpp:108
sas::RobotDriverROSComposer::initialize
void initialize() override
Initialize the driver resources.
Definition
sas_robot_driver_ros_composer.cpp:92
sas::RobotDriverROSComposer::connect
void connect() override
Connect to the underlying robot/hardware.
Definition
sas_robot_driver_ros_composer.cpp:82
sas::RobotDriverROSComposer::set_joint_limits
void set_joint_limits(const std::tuple< VectorXd, VectorXd > &) override
Set joint limits (min, max).
Definition
sas_robot_driver_ros_composer.cpp:77
sas_robot_driver.hpp
Abstract RobotDriver interface and watchdog support.
sas::RobotDriverROSComposerConfiguration
Definition
sas_robot_driver_ros_composer.hpp:43
src
sas_robot_driver
src
sas_robot_driver_ros_composer.hpp
Generated by
1.17.0