trajectory_point_interface.h
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 // Copyright 2021 FZI Forschungszentrum Informatik
5 // Created on behalf of Universal Robots A/S
6 //
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 // http://www.apache.org/licenses/LICENSE-2.0
12 //
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 // -- END LICENSE BLOCK ------------------------------------------------
19 
20 //----------------------------------------------------------------------
27 //----------------------------------------------------------------------
28 
29 #ifndef UR_CLIENT_LIBRARY_TRAJECTORY_INTERFACE_H_INCLUDED
30 #define UR_CLIENT_LIBRARY_TRAJECTORY_INTERFACE_H_INCLUDED
31 
35 #include "ur_client_library/log.h"
36 
37 namespace urcl
38 {
39 namespace control
40 {
44 enum class TrajectoryResult : int32_t
45 {
46 
50 };
51 
55 enum class TrajectorySplineType : int32_t
56 {
57  SPLINE_CUBIC = 1,
58  SPLINE_QUINTIC = 2
59 };
60 
64 enum class TrajectoryMotionType : int32_t
65 {
66  JOINT_POINT = 0,
67  CARTESIAN_POINT = 1,
69 };
70 
76 {
77 public:
78  static const int32_t MULT_TIME = 1000;
79 
80  TrajectoryPointInterface() = delete;
86  TrajectoryPointInterface(uint32_t port);
87 
91  virtual ~TrajectoryPointInterface() = default;
92 
103  bool writeTrajectoryPoint(const vector6d_t* positions, const float goal_time, const float blend_radius,
104  const bool cartesian);
105 
118  bool writeTrajectorySplinePoint(const vector6d_t* positions, const vector6d_t* velocities,
119  const vector6d_t* accelerations, const float goal_time);
120 
121  void setTrajectoryEndCallback(std::function<void(TrajectoryResult)> callback)
122  {
123  handle_trajectory_end_ = callback;
124  }
125 
126 protected:
127  virtual void connectionCallback(const int filedescriptor) override;
128 
129  virtual void disconnectionCallback(const int filedescriptor) override;
130 
131  virtual void messageCallback(const int filedescriptor, char* buffer, int nbytesrecv) override;
132 
133 private:
134  static const int MESSAGE_LENGTH = 21;
135  std::function<void(TrajectoryResult)> handle_trajectory_end_;
136 };
137 
138 } // namespace control
139 } // namespace urcl
140 
141 #endif // UR_CLIENT_LIBRARY_TRAJECTORY_INTERFACE_H_INCLUDED
TrajectoryResult
Types for encoding trajectory execution result.
The TrajectoryPointInterface class handles trajectory forwarding to the robot. Full trajectories are ...
void setTrajectoryEndCallback(std::function< void(TrajectoryResult)> callback)
Aborted due to error during execution.
std::function< void(TrajectoryResult)> handle_trajectory_end_
std::array< double, 6 > vector6d_t
Definition: types.h:30
The ReverseInterface class handles communication to the robot. It starts a server and waits for the r...


ur_client_library
Author(s): Thomas Timm Andersen, Simon Rasmussen, Felix Exner, Lea Steffen, Tristan Schnell
autogenerated on Tue Jul 4 2023 02:09:47