Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
vpRobotUniversalRobots.h
1/*
2 * ViSP, open source Visual Servoing Platform software.
3 * Copyright (C) 2005 - 2025 by Inria. All rights reserved.
4 *
5 * This software is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 * See the file LICENSE.txt at the root directory of this source
10 * distribution for additional information about the GNU GPL.
11 *
12 * For using ViSP with software that can not be combined with the GNU
13 * GPL, please contact Inria about acquiring a ViSP Professional
14 * Edition License.
15 *
16 * See https://visp.inria.fr for more information.
17 *
18 * This software was developed at:
19 * Inria Rennes - Bretagne Atlantique
20 * Campus Universitaire de Beaulieu
21 * 35042 Rennes Cedex
22 * France
23 *
24 * If you have questions regarding the use of this file, please contact
25 * Inria at visp@inria.fr
26 *
27 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29 *
30 * Description:
31 * Interface for Universal Robot.
32 */
33
34#ifndef VP_ROBOT_UNIVERSAL_ROBOTS_H
35#define VP_ROBOT_UNIVERSAL_ROBOTS_H
36
37#include <visp3/core/vpConfig.h>
38
39#if defined(VISP_HAVE_UR_RTDE)
40
41#include <memory>
42
43#include <visp3/robot/vpRobot.h>
44#include <visp3/robot/vpRobotException.h>
45
46#include <ur_rtde/dashboard_client.h>
47#include <ur_rtde/rtde_control_interface.h>
48#include <ur_rtde/rtde_receive_interface.h>
49
64 class VISP_EXPORT vpRobotUniversalRobots : public vpRobot
65{
66private: // Not allowed functions
70 vpRobotUniversalRobots(const vpRobotUniversalRobots &robot);
71
72public:
73 vpRobotUniversalRobots();
74 vpRobotUniversalRobots(const std::string &ur_address);
75 virtual ~vpRobotUniversalRobots();
76
77 void connect(const std::string &ur_address);
78 void disconnect();
79
83 std::shared_ptr<ur_rtde::RTDEReceiveInterface> getRTDEReceiveInterfaceHandler() const { return m_rtde_receive; }
84
88 std::shared_ptr<ur_rtde::RTDEControlInterface> getRTDEControlInterfaceHandler() const { return m_rtde_control; }
89
93 std::shared_ptr<ur_rtde::DashboardClient> getDashboardClientHandler() const { return m_db_client; }
94
95 vpHomogeneousMatrix get_fMe();
96 vpHomogeneousMatrix get_fMe(const vpColVector &q);
97 vpHomogeneousMatrix get_fMc();
98 vpHomogeneousMatrix get_eMc() const;
99
100 void getForceTorque(const vpRobot::vpControlFrameType frame, vpColVector &force);
101 std::string getPolyScopeVersion();
102 void getPosition(const vpRobot::vpControlFrameType frame, vpColVector &position) VP_OVERRIDE;
104 int getRobotMode() const;
105 std::string getRobotModel() const;
106
107 void move(const std::string &filename, double velocity_percentage = 10.);
108
109 bool readPosFile(const std::string &filename, vpColVector &q);
110 bool savePosFile(const std::string &filename, const vpColVector &q);
111
112 void setPosition(const vpRobot::vpControlFrameType frame, const vpColVector &position) VP_OVERRIDE;
113 void setPosition(const vpRobot::vpControlFrameType frame, const vpPoseVector &pose);
114 void setPositioningVelocity(double velocity);
115
117 void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel) VP_OVERRIDE;
118
119 void set_eMc(const vpHomogeneousMatrix &eMc);
120
121 void stopMotion();
122
123private:
124 // Not implemented yet
125 void get_eJe(vpMatrix &) VP_OVERRIDE { }
126 void get_fJe(vpMatrix &) VP_OVERRIDE { }
127 void getDisplacement(const vpRobot::vpControlFrameType, vpColVector &) VP_OVERRIDE { }
128
129protected:
130 void init();
131
132 std::shared_ptr<ur_rtde::RTDEReceiveInterface> m_rtde_receive;
133 std::shared_ptr<ur_rtde::RTDEControlInterface> m_rtde_control;
134 std::shared_ptr<ur_rtde::DashboardClient> m_db_client;
142};
143END_VISP_NAMESPACE
144#endif
145#endif
Implementation of column vector and the associated operations.
Implementation of an homogeneous matrix and operations on such kind of matrices.
Implementation of a matrix and operations on matrices.
Definition vpMatrix.h:175
Implementation of a pose vector and operations on poses.
std::shared_ptr< ur_rtde::RTDEControlInterface > getRTDEControlInterfaceHandler() const
std::shared_ptr< ur_rtde::DashboardClient > getDashboardClientHandler() const
std::shared_ptr< ur_rtde::RTDEReceiveInterface > getRTDEReceiveInterfaceHandler() const
void connect(const std::string &ur_address)
std::shared_ptr< ur_rtde::DashboardClient > m_db_client
vpRobot::vpControlFrameType m_vel_control_frame
std::shared_ptr< ur_rtde::RTDEReceiveInterface > m_rtde_receive
std::shared_ptr< ur_rtde::RTDEControlInterface > m_rtde_control
vpControlFrameType
Definition vpRobot.h:74
virtual void get_eJe(vpMatrix &_eJe)=0
Get the robot Jacobian expressed in the end-effector frame.
virtual void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel)=0
virtual void getPosition(const vpRobot::vpControlFrameType frame, vpColVector &position)=0
Get the robot position (frame has to be specified).
vpRobotStateType
Definition vpRobot.h:62
virtual vpRobotStateType setRobotState(const vpRobot::vpRobotStateType newState)
Definition vpRobot.cpp:200
virtual void init()=0
virtual void get_fJe(vpMatrix &_fJe)=0
virtual void getDisplacement(const vpRobot::vpControlFrameType frame, vpColVector &q)=0
vpRobot(void)
Definition vpRobot.cpp:49
virtual void setPosition(const vpRobot::vpControlFrameType frame, const vpColVector &q)=0
Set a displacement (frame has to be specified) in position control.