pose_base_controller.h
Go to the documentation of this file.
1 /*********************************************************************
2 *
3 * Software License Agreement (BSD License)
4 *
5 * Copyright (c) 2009, Willow Garage, Inc.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * * Redistributions in binary form must reproduce the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer in the documentation and/or other materials provided
17 * with the distribution.
18 * * Neither the name of Willow Garage, Inc. nor the names of its
19 * contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
34 *
35 * Author: Eitan Marder-Eppstein
36 *********************************************************************/
37 #ifndef POSE_BASE_CONTROLLER_POSE_BASE_CONTROLLER_H_
38 #define POSE_BASE_CONTROLLER_POSE_BASE_CONTROLLER_H_
39 #include <ros/ros.h>
40 #include <tf2/convert.h>
42 #include <tf2/utils.h>
44 #include <tf2_ros/buffer.h>
47 #include <move_base_msgs/MoveBaseAction.h>
48 #include <geometry_msgs/PoseStamped.h>
49 #include <geometry_msgs/Pose.h>
50 #include <geometry_msgs/Twist.h>
51 #include <nav_msgs/Odometry.h>
52 
53 #include <boost/thread.hpp>
54 
56  class PoseBaseController {
57  private:
59 
60  public:
62 
64 
65  void execute(const move_base_msgs::MoveBaseGoalConstPtr& user_goal);
66  bool controlLoop(const move_base_msgs::MoveBaseGoal& current_goal);
68 
69  inline double sign(double n){
70  return n < 0.0 ? -1.0 : 1.0;
71  }
72 
73  geometry_msgs::Twist diff2D(const tf2::Transform& pose1, const tf2::Transform& pose2);
74  geometry_msgs::Twist limitTwist(const geometry_msgs::Twist& twist);
75  double headingDiff(double pt_x, double pt_y, double x, double y, double heading);
76  move_base_msgs::MoveBaseGoal goalToFixedFrame(const move_base_msgs::MoveBaseGoal& goal);
77 
78  private:
79  void odomCallback(const nav_msgs::Odometry::ConstPtr& msg);
80  bool stopped();
81 
87  double tolerance_timeout_, freq_;
88  double max_vel_lin_, max_vel_th_;
89  double min_vel_lin_, min_vel_th_;
92  std::string fixed_frame_, base_frame_;
93  bool holonomic_;
94  boost::mutex odom_lock_;
96  nav_msgs::Odometry base_odom_;
98  };
99 };
100 #endif
pose_base_controller::PoseBaseController::base_odom_
nav_msgs::Odometry base_odom_
Definition: pose_base_controller.h:166
pose_base_controller::PoseBaseController::limitTwist
geometry_msgs::Twist limitTwist(const geometry_msgs::Twist &twist)
Definition: pose_base_controller.cpp:316
pose_base_controller::PoseBaseController::diff2D
geometry_msgs::Twist diff2D(const tf2::Transform &pose1, const tf2::Transform &pose2)
Definition: pose_base_controller.cpp:273
ros::Publisher
pose_base_controller::PoseBaseController::tolerance_rot_
double tolerance_rot_
Definition: pose_base_controller.h:156
pose_base_controller::PoseBaseController::base_frame_
std::string base_frame_
Definition: pose_base_controller.h:162
pose_base_controller::PoseBaseController::getRobotPose
tf2::Stamped< tf2::Transform > getRobotPose()
Definition: pose_base_controller.cpp:140
pose_base_controller::PoseBaseController::odomCallback
void odomCallback(const nav_msgs::Odometry::ConstPtr &msg)
Definition: pose_base_controller.cpp:114
pose_base_controller::PoseBaseController::headingDiff
double headingDiff(double pt_x, double pt_y, double x, double y, double heading)
Definition: pose_base_controller.cpp:124
pose_base_controller::PoseBaseController::PoseBaseController
PoseBaseController()
Definition: pose_base_controller.cpp:75
utils.h
ros.h
pose_base_controller::PoseBaseController::tolerance_trans_
double tolerance_trans_
Definition: pose_base_controller.h:156
pose_base_controller::PoseBaseController::in_place_trans_vel_
double in_place_trans_vel_
Definition: pose_base_controller.h:160
buffer.h
tf2::Stamped
simple_action_server.h
pose_base_controller::PoseBaseController::action_server_
MoveBaseActionServer action_server_
Definition: pose_base_controller.h:152
pose_base_controller::PoseBaseController::freq_
double freq_
Definition: pose_base_controller.h:157
tf2_ros::TransformListener
pose_base_controller::PoseBaseController::holonomic_
bool holonomic_
Definition: pose_base_controller.h:163
pose_base_controller::PoseBaseController::controlLoop
bool controlLoop(const move_base_msgs::MoveBaseGoal &current_goal)
Definition: pose_base_controller.cpp:214
pose_base_controller
Definition: pose_base_controller.h:55
pose_base_controller::PoseBaseController::execute
void execute(const move_base_msgs::MoveBaseGoalConstPtr &user_goal)
Definition: pose_base_controller.cpp:174
pose_base_controller::PoseBaseController::max_vel_th_
double max_vel_th_
Definition: pose_base_controller.h:158
pose_base_controller::PoseBaseController::tfl_
tf2_ros::TransformListener tfl_
Definition: pose_base_controller.h:154
pose_base_controller::PoseBaseController::goalToFixedFrame
move_base_msgs::MoveBaseGoal goalToFixedFrame(const move_base_msgs::MoveBaseGoal &goal)
Definition: pose_base_controller.cpp:153
pose_base_controller::PoseBaseController::min_in_place_vel_th_
double min_in_place_vel_th_
Definition: pose_base_controller.h:160
tf2::Transform
pose_base_controller::PoseBaseController::odom_sub_
ros::Subscriber odom_sub_
Definition: pose_base_controller.h:165
pose_base_controller::PoseBaseController::K_trans_
double K_trans_
Definition: pose_base_controller.h:156
tf2_ros::Buffer
pose_base_controller::PoseBaseController::odom_lock_
boost::mutex odom_lock_
Definition: pose_base_controller.h:164
pose_base_controller::PoseBaseController::fixed_frame_
std::string fixed_frame_
Definition: pose_base_controller.h:162
pose_base_controller::PoseBaseController::rot_stopped_velocity_
double rot_stopped_velocity_
Definition: pose_base_controller.h:167
pose_base_controller::PoseBaseController::sign
double sign(double n)
Definition: pose_base_controller.h:139
pose_base_controller::PoseBaseController::stopped
bool stopped()
Definition: pose_base_controller.cpp:201
transform_listener.h
pose_base_controller::PoseBaseController::~PoseBaseController
~PoseBaseController()
Definition: pose_base_controller.h:133
transform_datatypes.h
pose_base_controller::PoseBaseController::tolerance_timeout_
double tolerance_timeout_
Definition: pose_base_controller.h:157
pose_base_controller::PoseBaseController::MoveBaseActionServer
actionlib::SimpleActionServer< move_base_msgs::MoveBaseAction > MoveBaseActionServer
Definition: pose_base_controller.h:128
actionlib::SimpleActionServer< move_base_msgs::MoveBaseAction >
pose_base_controller::PoseBaseController::K_rot_
double K_rot_
Definition: pose_base_controller.h:156
pose_base_controller::PoseBaseController::vel_pub_
ros::Publisher vel_pub_
Definition: pose_base_controller.h:155
tf2_geometry_msgs.h
convert.h
pose_base_controller::PoseBaseController::tf_
tf2_ros::Buffer tf_
Definition: pose_base_controller.h:153
pose_base_controller::PoseBaseController::min_vel_lin_
double min_vel_lin_
Definition: pose_base_controller.h:159
pose_base_controller::PoseBaseController::min_vel_th_
double min_vel_th_
Definition: pose_base_controller.h:159
pose_base_controller::PoseBaseController::trans_stopped_velocity_
double trans_stopped_velocity_
Definition: pose_base_controller.h:167
pose_base_controller::PoseBaseController::max_vel_lin_
double max_vel_lin_
Definition: pose_base_controller.h:158
ros::Subscriber
pose_base_controller::PoseBaseController
Definition: pose_base_controller.h:91
pose_base_controller::PoseBaseController::transform_tolerance_
double transform_tolerance_
Definition: pose_base_controller.h:161


pose_base_controller
Author(s): Eitan Marder-Eppstein
autogenerated on Fri Aug 26 2022 02:17:49