teleop_cob_marker.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9 
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 
18 #ifndef TELEOPCOBMARKER_H_
19 #define TELEOPCOBMARKER_H_
20 
21 #include <ros/ros.h>
23 #include <geometry_msgs/Twist.h>
24 #include <tf/transform_datatypes.h>
25 
28 
29 namespace cob_interactive_teleop
30 {
31 
32 const std::string MARKER_DRIVER_NAME = "marker_driver";
33 const std::string MARKER_NAVIGATOR_NAME = "marker_navigator";
34 const std::string CONTROL_MOVE_NAME = "control_move";
35 const std::string CONTROL_STRAFE_NAME = "control_strafe";
36 const std::string CONTROL_ROTATE_NAME = "control_rotate";
37 const std::string CONTROL_NAVIGATION_NAME = "controle_navigation";
38 
40 
41 
46 {
49  double z_pos;
51 
56  : max_vel_x(DEFAULT_MAX_VEL_X)
57  , max_vel_y(DEFAULT_MAX_VEL_Y)
58  , max_vel_th(DEFAULT_MAX_VEL_TH)
59  , scale_linear(DEFAULT_SCALE_LINEAR)
60  , scale_angular(DEFAULT_SCALE_ANGULAR)
61  , z_pos(DEFAULT_Z_POS)
62  , disable_driver(false)
63  {}
64 };
65 
66 
74 {
75 public:
80 
84  virtual ~TeleopCOBMarker()
85  {
86  server_->erase(MARKER_DRIVER_NAME);
87  server_->erase(MARKER_NAVIGATOR_NAME);
88  server_->applyChanges();
89  }
90 
94  TeleopCOBParams& getParams() { return params_; }
95 
99  void reinitMarkers();
100 
101 private:
105  void processFeedback(const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback);
106 
110  double limitVel(double vel, double limit);
111 
115  int sign(double value);
116 
120  void createMarkers();
121 
122 private:
123  // Interactive Marker Server
124  InteractiveMarkerServerPtr server_;
125 
126  // Movement publisher
128 
129  // Node handles
131 
132  // Initial position
133  geometry_msgs::Pose initial_pose_;
134 
135  // Teleop parameters
137 };
138 
139 }
140 
141 #endif /* TELEOPCOBMARKER_H_ */
142 
const double DEFAULT_MAX_VEL_TH
const double DEFAULT_SCALE_LINEAR
TeleopCOBParams & getParams()
Returns reference to the motion parameters.
This class handles COB driving using Interactive Markers.
double sign(double arg)
const std::string CONTROL_MOVE_NAME
const std::string CONTROL_NAVIGATION_NAME
const double DEFAULT_SCALE_ANGULAR
const double DEFAULT_Z_POS
Motion parameters for the interactive COB teleop.
TeleopCOBParams()
Constructor initializes all parameters to default values.
const std::string CONTROL_ROTATE_NAME
void processFeedback(const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback)
const double DEFAULT_MAX_VEL_X
const std::string CONTROL_STRAFE_NAME
boost::shared_ptr< interactive_markers::InteractiveMarkerServer > InteractiveMarkerServerPtr
const double DEFAULT_MAX_VEL_Y
const std::string MARKER_DRIVER_NAME
const std::string MARKER_NAVIGATOR_NAME


cob_interactive_teleop
Author(s): Michal Spanel
autogenerated on Wed Apr 7 2021 03:03:04