cartesian_trajectory_controller.h
Go to the documentation of this file.
1 // -- BEGIN LICENSE BLOCK ----------------------------------------------
2 // Copyright 2020 FZI Forschungszentrum Informatik
3 // Created on behalf of Universal Robots A/S
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 // -- END LICENSE BLOCK ------------------------------------------------
17 
18 //-----------------------------------------------------------------------------
25 //-----------------------------------------------------------------------------
26 
27 #pragma once
28 
32 #include <cartesian_control_msgs/FollowCartesianTrajectoryAction.h>
33 #include <cartesian_control_msgs/CartesianTolerance.h>
34 #include <atomic>
35 #include <mutex>
38 
40 {
41 template <class HWInterface>
43 {
44 public:
46 
48 
49  bool init(hardware_interface::RobotHW* hw, ros::NodeHandle& root_nh, ros::NodeHandle& controller_nh) override;
50 
51  void starting(const ros::Time& time) override;
52 
53  void stopping(const ros::Time& time) override;
54 
55  void update(const ros::Time& time, const ros::Duration& period) override;
56 
57  void executeCB(const cartesian_control_msgs::FollowCartesianTrajectoryGoalConstPtr& goal);
58 
59  void preemptCB();
60 
61 protected:
63 
65  {
66  TrajectoryDuration() : now(0.0), end(0.0)
67  {
68  }
69 
72  };
73 
74  void timesUp();
75 
77 
79  const cartesian_control_msgs::CartesianTolerance& tolerance);
80 
81 private:
82  std::unique_ptr<scaled_controllers::SpeedScalingHandle> speed_scaling_;
83  std::unique_ptr<actionlib::SimpleActionServer<cartesian_control_msgs::FollowCartesianTrajectoryAction> >
85  std::atomic<bool> done_;
86  std::mutex lock_;
89  cartesian_control_msgs::CartesianTolerance path_tolerances_;
90  cartesian_control_msgs::CartesianTolerance goal_tolerances_;
91 };
92 
93 } // namespace cartesian_trajectory_controller
94 
std::unique_ptr< actionlib::SimpleActionServer< cartesian_control_msgs::FollowCartesianTrajectoryAction > > action_server_
void update(const ros::Time &time, const ros::Duration &period) override
void monitorExecution(const ros_controllers_cartesian::CartesianState &error)
bool withinTolerances(const ros_controllers_cartesian::CartesianState &error, const cartesian_control_msgs::CartesianTolerance &tolerance)
void executeCB(const cartesian_control_msgs::FollowCartesianTrajectoryGoalConstPtr &goal)
bool init(hardware_interface::RobotHW *hw, ros::NodeHandle &root_nh, ros::NodeHandle &controller_nh) override
std::unique_ptr< scaled_controllers::SpeedScalingHandle > speed_scaling_


cartesian_trajectory_controller
Author(s):
autogenerated on Thu Feb 23 2023 03:10:48