sas
Modularised monitoring, logging, and control of robots.
Loading...
Searching...
No Matches
sas_robot_driver_ur.hpp
1#pragma once
2/*
3# Copyright (c) 2016-2024 Murilo Marques Marinho
4#
5# This file is part of sas_robot_driver_kuka.
6#
7# sas_robot_driver_kuka 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_kuka 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_kuka. If not, see <https://www.gnu.org/licenses/>.
19#
20# ################################################################
21#
22# Author: Murilo M. Marinho, email: murilomarinho@ieee.org
23# Based on sas_robot_driver_denso.h
24#
25# ################################################################*/
26
27#include <atomic>
28#include <thread>
29
31
32using namespace Eigen;
33
34namespace sas
35{
36//Declared internally
37class DriverBcap;
38
40{
41 // Examples from UR
42 //const std::string DEFAULT_ROBOT_IP = "192.168.56.101";
43 //const std::string SCRIPT_FILE = "resources/external_control.urscript";
44 //const std::string OUTPUT_RECIPE = "examples/resources/rtde_output_recipe.txt";
45 //const std::string INPUT_RECIPE = "examples/resources/rtde_input_recipe.txt";
46 //const std::string CALIBRATION_CHECKSUM = "calib_12788084448423163542";
47
48 std::string ip;
49 std::string script_file;
50 std::string output_recipe;
51 std::string input_recipe;
52 std::string calibration_checksum;
53 std::tuple<VectorXd,VectorXd> joint_limits;
54};
55
57{
58private:
59 RobotDriverURConfiguration configuration_;
60 std::thread fri_thread_;
61
62 //Implementation details that depend on FRI source files.
63 class Impl;
64 std::unique_ptr<Impl> impl_;
65public:
66
67 RobotDriverUR(const RobotDriverUR&)=delete;
68 RobotDriverUR()=delete;
70
71 RobotDriverUR(const RobotDriverURConfiguration &configuration, std::atomic_bool* break_loops);
72
73 VectorXd get_joint_positions() override;
74 void set_target_joint_positions(const VectorXd& desired_joint_positions_rad) override;
75
76 VectorXd get_joint_velocities() override;
77 //void set_target_joint_velocities(const VectorXd& desired_joint_velocities_rads) override; //Not possible (yet?)
78
79 void connect() override;
80 void disconnect() override;
81
82 void initialize() override;
83 void deinitialize() override;
84
85};
86}
Definition sas_robot_driver_ur.hpp:57
void initialize() override
Initialize the driver resources.
void disconnect() override
Disconnect from the underlying robot/hardware.
void connect() override
Connect to the underlying robot/hardware.
VectorXd get_joint_velocities() override
Get current joint velocities.
VectorXd get_joint_positions() override
Get current joint positions.
void deinitialize() override
Deinitialize the driver resources.
void set_target_joint_positions(const VectorXd &desired_joint_positions_rad) override
Set target joint positions.
Definition sas_robot_driver.hpp:54
Abstract RobotDriver interface and watchdog support.
Definition sas_robot_driver_ur.hpp:40