jog_api.h
Go to the documentation of this file.
1 // Title : jog_api.h
3 // Project : jog_arm
4 // Created : 3/27/2018
5 // Author : Andy Zelenak
6 // Platforms : Ubuntu 64-bit
7 // Copyright : Copyright© The University of Texas at Austin, 2014-2017. All rights reserved.
8 //
9 // All files within this directory are subject to the following, unless an alternative
10 // license is explicitly included within the text of each file.
11 //
12 // This software and documentation constitute an unpublished work
13 // and contain valuable trade secrets and proprietary information
14 // belonging to the University. None of the foregoing material may be
15 // copied or duplicated or disclosed without the express, written
16 // permission of the University. THE UNIVERSITY EXPRESSLY DISCLAIMS ANY
17 // AND ALL WARRANTIES CONCERNING THIS SOFTWARE AND DOCUMENTATION,
18 // INCLUDING ANY WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
19 // PARTICULAR PURPOSE, AND WARRANTIES OF PERFORMANCE, AND ANY WARRANTY
20 // THAT MIGHT OTHERWISE ARISE FROM COURSE OF DEALING OR USAGE OF TRADE.
21 // NO WARRANTY IS EITHER EXPRESS OR IMPLIED WITH RESPECT TO THE USE OF
22 // THE SOFTWARE OR DOCUMENTATION. Under no circumstances shall the
23 // University be liable for incidental, special, indirect, direct or
24 // consequential damages or loss of profits, interruption of business,
25 // or related expenses which may arise from use of software or documentation,
26 // including but not limited to those resulting from defects in software
27 // and/or documentation, or loss or inaccuracy of data of any kind.
28 //
30 
31 // Provide a C++ interface for sending motion commands to the jog_arm server.
32 
33 #ifndef JOG_API_H
34 #define JOG_API_H
35 
37 #include <ros/ros.h>
38 #include <std_msgs/Float64.h>
39 #include <tf/transform_listener.h>
42 
43 class JogAPI
44 {
45 public:
46  // Constructor
47  JogAPI(const std::string& move_group_name, const std::string& outgoing_jog_topic)
48  : move_group_(move_group_name), tf2_listener_(tf_buffer_)
49  {
50  // TODO: do not hard-code this
51  jog_vel_pub_ = nh_.advertise<geometry_msgs::TwistStamped>(outgoing_jog_topic, 1);
52  }
53 
54  // Publish cmds for a Cartesian motion to bring the robot to the target pose.
55  bool jacobianMove(geometry_msgs::PoseStamped& target_pose, const double trans_tolerance, const double rot_tolerance,
56  const std::vector<double>& speed_scale, const ros::Duration& timeout);
57 
58  // Maintain the current pose in given frame for given duration
59  bool maintainPose(std::string frame, const ros::Duration duration, const std::vector<double>& speed_scale);
60 
61 private:
63 
64  // Used to retrieve the current robot pose, etc.
66 
68 
71 
72  bool transformPose(geometry_msgs::PoseStamped& pose, std::string& desired_frame);
73 
74  // Calculate Euclidean distance between 2 Poses
76  {
78  geometry_msgs::TwistStamped twist;
79  };
80  distanceAndTwist calculateDistanceAndTwist(const geometry_msgs::PoseStamped& current_pose,
81  const geometry_msgs::PoseStamped& target_pose,
82  const std::vector<double>& speed_scale);
83 };
84 
85 #endif
ros::Publisher jog_vel_pub_
Definition: jog_api.h:67
bool jacobianMove(geometry_msgs::PoseStamped &target_pose, const double trans_tolerance, const double rot_tolerance, const std::vector< double > &speed_scale, const ros::Duration &timeout)
Definition: jog_api.cpp:40
bool transformPose(geometry_msgs::PoseStamped &pose, std::string &desired_frame)
Definition: jog_api.cpp:158
tf2_ros::TransformListener tf2_listener_
Definition: jog_api.h:70
distanceAndTwist calculateDistanceAndTwist(const geometry_msgs::PoseStamped &current_pose, const geometry_msgs::PoseStamped &target_pose, const std::vector< double > &speed_scale)
Definition: jog_api.cpp:190
ros::NodeHandle nh_
Definition: jog_api.h:62
bool maintainPose(std::string frame, const ros::Duration duration, const std::vector< double > &speed_scale)
Definition: jog_api.cpp:93
Definition: jog_api.h:43
moveit::planning_interface::MoveGroupInterface move_group_
Definition: jog_api.h:65
tf2_ros::Buffer tf_buffer_
Definition: jog_api.h:69
double rotational_distance
Definition: jog_api.h:77
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
geometry_msgs::TwistStamped twist
Definition: jog_api.h:78
JogAPI(const std::string &move_group_name, const std::string &outgoing_jog_topic)
Definition: jog_api.h:47
double translational_distance
Definition: jog_api.h:77


jog_api
Author(s): Andy Zelenak
autogenerated on Tue Nov 20 2018 03:39:03