sas
Modularised monitoring, logging, and control of robots.
Loading...
Searching...
No Matches
sas_robot_driver_coppeliasim.hpp
1#pragma once
2/*
3# Copyright (c) 2016-2025 Murilo Marques Marinho
4#
5# This file is part of sas_robot_driver_coppeliasim.
6#
7# sas_robot_driver_coppeliasim 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_coppeliasim 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_coppeliasim. If not, see <https://www.gnu.org/licenses/>.
19#
20# ################################################################
21#
22# Author: Murilo M. Marinho, email: murilomarinho@ieee.org
23# Based on `sas` ros composer.
24#
25# ################################################################*/
26
27#include <atomic>
28#include <memory>
29
31
32#include <dqrobotics/interfaces/coppeliasim/DQ_CoppeliaSimInterfaceZMQ.h>
33
34using namespace Eigen;
35
36namespace sas
37{
38
40{
41 int port;
42 std::string ip;
43 int timeout = 1000;
44 std::vector<std::string> robot_joint_names;
45};
46
47
49{
50private:
52
53 VectorXd joint_positions_;
54 std::shared_ptr<DQ_CoppeliaSimInterfaceZMQ> csi_;
55public:
56
57 // Prevent copies as usually drivers have threads
61
62 // This boilderplate constructor usually does the job well and prevent big changes when
63 // parameters change
64 RobotDriverCoppeliaSim(const RobotDriverCoppeliaSimConfiguration &configuration, std::atomic_bool* break_loops);
65
68 VectorXd get_joint_positions() override;
69 void set_target_joint_positions(const VectorXd& desired_joint_positions_rad) override;
70 std::tuple<VectorXd, VectorXd> get_joint_limits() override;
71
72 void connect() override;
73 void disconnect() override;
74
75 void initialize() override;
76 void deinitialize() override;
77
78};
79}
Definition sas_robot_driver_coppeliasim.hpp:49
VectorXd get_joint_positions() override
RobotDriverMyrobot::get_joint_positions This method should always throw an exception if the user trie...
Definition sas_robot_driver_coppeliasim.cpp:57
void deinitialize() override
RobotDriverCoppeliaSim::deinitialize. Nothing to do.
Definition sas_robot_driver_coppeliasim.cpp:104
void set_target_joint_positions(const VectorXd &desired_joint_positions_rad) override
RobotDriverCoppeliaSim::set_target_joint_positions Sets the joint positions and the target joint posi...
Definition sas_robot_driver_coppeliasim.cpp:68
void connect() override
RobotDriverCoppeliaSim::connect.
Definition sas_robot_driver_coppeliasim.cpp:79
void disconnect() override
RobotDriverCoppeliaSim::disconnect Disconnects from CoppeliaSim.
Definition sas_robot_driver_coppeliasim.cpp:113
void initialize() override
RobotDriverCoppeliaSim::initialize.
Definition sas_robot_driver_coppeliasim.cpp:95
std::tuple< VectorXd, VectorXd > get_joint_limits() override
Get joint limits (min, max)
Definition sas_robot_driver_coppeliasim.cpp:118
Definition sas_robot_driver.hpp:54
Abstract RobotDriver interface and watchdog support.
Definition sas_robot_driver_coppeliasim.hpp:40