sas
Modularised monitoring, logging, and control of robots.
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
38namespace sas
39{
40
42{
43 std::vector<std::string> robot_driver_client_names;
44 bool override_joint_limits_with_robot_parameter_file;
45 std::string robot_parameter_file_path;
46};
47
48class RobotDriverROSComposer: public RobotDriver
49{
50protected:
51 std::shared_ptr<rclcpp::Node> node_;
52
54 std::vector<std::unique_ptr<sas::RobotDriverClient>> robot_driver_clients_;
55
56 RobotDriverROSComposer()=delete;
57 RobotDriverROSComposer(const RobotDriverROSComposer&)=delete;
58public:
59 RobotDriverROSComposer(const RobotDriverROSComposerConfiguration& configuration,
60 std::shared_ptr<rclcpp::Node>& node,
61 std::atomic_bool *break_loops);
62
63 Eigen::VectorXd get_joint_positions() override;
64 void set_target_joint_positions(const Eigen::VectorXd& set_target_joint_positions_rad) override;
65 std::tuple<Eigen::VectorXd, Eigen::VectorXd> get_joint_limits() override;
66 void set_joint_limits(const std::tuple<Eigen::VectorXd, Eigen::VectorXd>&) override;
67
68 void connect() override;
69 void disconnect() override;
70
71 void initialize() override;
72 void deinitialize() override;
73
74 ~RobotDriverROSComposer();
75
76};
77}
78
79
80
void disconnect() override
Disconnect from the underlying robot/hardware.
Definition sas_robot_driver_ros_composer.cpp:87
void set_joint_limits(const std::tuple< Eigen::VectorXd, Eigen::VectorXd > &) override
Set joint limits (min, max).
Definition sas_robot_driver_ros_composer.cpp:77
std::tuple< Eigen::VectorXd, Eigen::VectorXd > get_joint_limits() override
Get joint limits (min, max).
Definition sas_robot_driver_ros_composer.cpp:115
void set_target_joint_positions(const Eigen::VectorXd &set_target_joint_positions_rad) override
Set target joint positions.
Definition sas_robot_driver_ros_composer.cpp:67
Eigen::VectorXd get_joint_positions() override
Get current joint positions.
Definition sas_robot_driver_ros_composer.cpp:56
void deinitialize() override
Deinitialize the driver resources.
Definition sas_robot_driver_ros_composer.cpp:108
void initialize() override
Initialize the driver resources.
Definition sas_robot_driver_ros_composer.cpp:92
void connect() override
Connect to the underlying robot/hardware.
Definition sas_robot_driver_ros_composer.cpp:82
Definition sas_robot_driver_ros_composer.hpp:42