-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlee_position_controller_node.h
98 lines (75 loc) · 2.94 KB
/
lee_position_controller_node.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
* Copyright 2015 Fadri Furrer, ASL, ETH Zurich, Switzerland
* Copyright 2015 Michael Burri, ASL, ETH Zurich, Switzerland
* Copyright 2015 Mina Kamel, ASL, ETH Zurich, Switzerland
* Copyright 2015 Janosch Nikolic, ASL, ETH Zurich, Switzerland
* Copyright 2015 Markus Achtelik, ASL, ETH Zurich, Switzerland
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ROTORS_CONTROL_LEE_POSITION_CONTROLLER_NODE_H
#define ROTORS_CONTROL_LEE_POSITION_CONTROLLER_NODE_H
#include <boost/bind.hpp>
#include <Eigen/Eigen>
#include <stdio.h>
#include "std_msgs/Float64MultiArray.h"
#include "std_msgs/Float32MultiArray.h"
#include "std_msgs/Int32.h"
#include "std_msgs/Float32.h"
#include <geometry_msgs/PoseStamped.h>
#include <mav_msgs/Actuators.h>
#include <mav_msgs/AttitudeThrust.h>
#include <mav_msgs/eigen_mav_msgs.h>
#include <nav_msgs/Odometry.h>
#include <ros/callback_queue.h>
#include <ros/ros.h>
#include <trajectory_msgs/MultiDOFJointTrajectory.h>
#include "rotors_control/common.h"
#include "rotors_control/lee_position_controller.h"
namespace rotors_control {
class LeePositionControllerNode {
public:
LeePositionControllerNode(const ros::NodeHandle& nh, const ros::NodeHandle& private_nh);
~LeePositionControllerNode();
void InitializeParams();
void Publish();
private:
ros::NodeHandle nh_;
ros::NodeHandle private_nh_;
LeePositionController lee_position_controller_;
std::string namespace_;
// subscribers
ros::Subscriber cmd_trajectory_sub_;
ros::Subscriber cmd_multi_dof_joint_trajectory_sub_;
ros::Subscriber cmd_pose_sub_;
ros::Subscriber odometry_sub_;
ros::Subscriber motors_sub;
ros::Subscriber _nn_sub;
ros::Publisher _acceleration_thrust_pub;
ros::Publisher _motor_vel;
ros::Publisher motor_velocity_reference_pub_;
mav_msgs::EigenTrajectoryPointDeque commands_;
std::deque<ros::Duration> command_waiting_times_;
ros::Timer command_timer_;
void TimedCommandCallback(const ros::TimerEvent& e);
void MultiDofJointTrajectoryCallback(
const trajectory_msgs::MultiDOFJointTrajectoryConstPtr& trajectory_reference_msg);
void CommandPoseCallback(
const geometry_msgs::PoseStampedConstPtr& pose_msg);
void OdometryCallback(const nav_msgs::OdometryConstPtr& odometry_msg);
void Motorcallback(const std_msgs::Float64MultiArray actuators);
void NNcallback(const std_msgs::Float32 neural_net);
Eigen::Vector4d motor_vel;
double nn;
};
}
#endif // ROTORS_CONTROL_LEE_POSITION_CONTROLLER_NODE_H