servo.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Title : servo.h
3  * Project : moveit_servo
4  * Created : 3/9/2017
5  * Author : Brian O'Neil, Andy Zelenak, Blake Anderson
6  *
7  * BSD 3-Clause License
8  *
9  * Copyright (c) 2019, Los Alamos National Security, LLC
10  * All rights reserved.
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions are met:
14  *
15  * * Redistributions of source code must retain the above copyright notice, this
16  * list of conditions and the following disclaimer.
17  *
18  * * Redistributions in binary form must reproduce the above copyright notice,
19  * this list of conditions and the following disclaimer in the documentation
20  * and/or other materials provided with the distribution.
21  *
22  * * Neither the name of the copyright holder nor the names of its
23  * contributors may be used to endorse or promote products derived from
24  * this software without specific prior written permission.
25  *
26  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29  * ARE
30  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
31  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
33  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
34  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
35  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37  *******************************************************************************/
38 
39 #pragma once
40 
41 // System
42 #include <memory>
43 
44 // MoveIt
48 
49 namespace moveit_servo
50 {
54 class Servo
55 {
56 public:
57  Servo(ros::NodeHandle& nh, const planning_scene_monitor::PlanningSceneMonitorPtr& planning_scene_monitor);
58 
59  ~Servo();
60 
62  void start();
63 
65  void setPaused(bool paused);
66 
74  bool getCommandFrameTransform(Eigen::Isometry3d& transform);
75  bool getCommandFrameTransform(geometry_msgs::TransformStamped& transform);
76 
84  bool getEEFrameTransform(Eigen::Isometry3d& transform);
85  bool getEEFrameTransform(geometry_msgs::TransformStamped& transform);
86 
88  const ServoParameters& getParameters() const;
89 
93  void changeRobotLinkCommandFrame(const std::string& new_command_frame)
94  {
95  servo_calcs_->changeRobotLinkCommandFrame(new_command_frame);
96  }
97 
98  // Give test access to private/protected methods
99  friend class ServoFixture;
100 
101 private:
102  bool readParameters();
103 
105 
106  // Pointer to the collision environment
107  planning_scene_monitor::PlanningSceneMonitorPtr planning_scene_monitor_;
108 
109  // Store the parameters that were read from ROS server
110  ServoParameters parameters_;
111 
112  std::unique_ptr<ServoCalcs> servo_calcs_;
113  std::unique_ptr<CollisionCheck> collision_checker_;
114 };
115 
116 // ServoPtr using alias
117 using ServoPtr = std::shared_ptr<Servo>;
118 
119 } // namespace moveit_servo
planning_scene_monitor
moveit_servo::Servo::changeRobotLinkCommandFrame
void changeRobotLinkCommandFrame(const std::string &new_command_frame)
Change the controlled link. Often, this is the end effector This must be a link on the robot since Mo...
Definition: servo.h:165
moveit_servo::Servo::servo_calcs_
std::unique_ptr< ServoCalcs > servo_calcs_
Definition: servo.h:184
moveit_servo::Servo::setPaused
void setPaused(bool paused)
Pause or unpause processing servo commands while keeping the timers alive.
Definition: servo.cpp:311
moveit_servo::Servo::Servo
Servo(ros::NodeHandle &nh, const planning_scene_monitor::PlanningSceneMonitorPtr &planning_scene_monitor)
Definition: servo.cpp:54
moveit_servo::Servo::getEEFrameTransform
bool getEEFrameTransform(Eigen::Isometry3d &transform)
Definition: servo.cpp:327
moveit_servo::Servo::getParameters
const ServoParameters & getParameters() const
Get the parameters used by servo node.
Definition: servo.cpp:337
moveit_servo::Servo::collision_checker_
std::unique_ptr< CollisionCheck > collision_checker_
Definition: servo.h:185
moveit_servo::Servo::nh_
ros::NodeHandle nh_
Definition: servo.h:176
moveit_servo::ServoPtr
std::shared_ptr< Servo > ServoPtr
Definition: servo.h:153
moveit_servo
Definition: collision_check.h:50
moveit_servo::Servo::ServoFixture
friend class ServoFixture
Definition: servo.h:171
servo_calcs.h
collision_check.h
moveit_servo::Servo::readParameters
bool readParameters()
Definition: servo.cpp:85
moveit_servo::Servo::~Servo
~Servo()
Definition: servo.cpp:306
moveit_servo::Servo::getCommandFrameTransform
bool getCommandFrameTransform(Eigen::Isometry3d &transform)
Definition: servo.cpp:317
servo_parameters.h
moveit_servo::Servo::planning_scene_monitor_
planning_scene_monitor::PlanningSceneMonitorPtr planning_scene_monitor_
Definition: servo.h:179
ros::NodeHandle
moveit_servo::Servo::start
void start()
start servo node
Definition: servo.cpp:294
moveit_servo::Servo::parameters_
ServoParameters parameters_
Definition: servo.h:182


moveit_servo
Author(s): Brian O'Neil, Andy Zelenak , Blake Anderson, Alexander Rössler , Tyler Weaver
autogenerated on Sat May 3 2025 02:27:56