seed_r7_mover_controller.h
Go to the documentation of this file.
1 
3 #ifndef MOVER_CONTROLLER_H_
4 #define MOVER_CONTROLLER_H_
5 
6 #include <ros/ros.h>
7 #include <ros/callback_queue.h>
8 
9 #include <geometry_msgs/PoseStamped.h>
10 #include <geometry_msgs/Twist.h>
11 #include <nav_msgs/Odometry.h>
13 #include <geometry_msgs/PoseWithCovarianceStamped.h>
14 
15 // move_base
17 #include <move_base_msgs/MoveBaseAction.h>
18 
21 
22 #include "seed_r7_ros_controller/LedControl.h"
23 #include "seed_r7_ros_controller/SetInitialPose.h"
24 
25 #define MAX_ACC_X 1.0
26 #define MAX_ACC_Y 1.0
27 #define MAX_ACC_Z 3.0
28 
29 
30 namespace robot_hardware
31 {
32 
33 struct pose
34 {
35  float x;
36  float y;
37  float theta;
38 };
39 
41 {
42  public:
43  explicit MoverController(const ros::NodeHandle& _nh, robot_hardware::RobotHW *_in_hw);
44  ~MoverController();
45 
46  private:
47  void cmdVelCallback(const geometry_msgs::TwistConstPtr& _cmd_vel);
48  void safetyCheckCallback(const ros::TimerEvent& _event);
49  void calculateOdometry(const ros::TimerEvent& _event);
50  void velocityToWheel(double _linear_x, double _linear_y, double _angular_z, std::vector<int16_t>& _wheel_vel);
51  bool setInitialPoseCallback(seed_r7_ros_controller::SetInitialPose::Request& _req, seed_r7_ros_controller::SetInitialPose::Response& _res);
52  bool ledControlCallback(seed_r7_ros_controller::LedControl::Request& _req, seed_r7_ros_controller::LedControl::Response& _res);
53  void moveBaseStatusCallBack(const actionlib_msgs::GoalStatusArray::ConstPtr &status);
54 
56  ros::Publisher odom_pub_,initialpose_pub_;
57  ros::Time current_time_, last_time_, time_stamp_;
58  ros::Timer odom_timer_, safe_timer_;
61 
64 
65 /*
66  ros::SubscribeOptions base_ops_;
67  ros::CallbackQueue base_queue_;
68  ros::AsyncSpinner base_spinner_;
69 */
70 
71  double vx_, vy_, vth_, x_, y_, th_;
72  double ros_rate_, odom_rate_, safety_rate_, safety_duration_;
73  float k1_,k2_;
75  bool servo_on_;
76  std::vector<std::string> wheel_names_;
77  std::vector<int> aero_index_;
78 
79  boost::mutex base_mtx_;
81 
82  // move_base
84 
85 };
86 
87 //typedef std::shared_ptr<NoidMoverController> NoidMoverControllerPtr;
88 
89 }
90 
91 #endif
std::vector< std::string > wheel_names_
tf::TransformBroadcaster odom_broadcaster_
actionlib::SimpleActionClient< move_base_msgs::MoveBaseAction > * move_base_action_


seed_r7_ros_controller
Author(s): Yohei Kakiuchi
autogenerated on Sun Apr 18 2021 02:40:34