hil_interface_node.h
Go to the documentation of this file.
1 /*
2  * Copyright 2016 Pavel Vechersky, ASL, ETH Zurich, Switzerland
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 #ifndef ROTORS_HIL_INTERFACE_NODE_H_
18 #define ROTORS_HIL_INTERFACE_NODE_H_
19 
20 #include <memory>
21 
23 
24 namespace rotors_hil {
25 // Default values
26 static constexpr bool kDefaultSensorLevelHil = true;
27 static constexpr double kDefaultHilFrequency = 100.0;
28 static constexpr double kDefaultBodyToSensorsRoll = M_PI;
29 static constexpr double kDefaultBodyToSensorsPitch = 0.0;
30 static constexpr double kDefaultBodyToSensorsYaw = 0.0;
31 static const std::string kDefaultMavlinkPubTopic = "mavlink/to";
32 static const std::string kDefaultHilControlsSubTopic = "mavros/hil_controls/hil_controls";
33 
35  public:
37  virtual ~HilInterfaceNode();
38 
40  void MainTask();
41 
44  void HilControlsCallback(const mavros_msgs::HilControlsConstPtr& hil_controls_msg);
45 
46  private:
49 
52 
55 
58 
61 
63  std::unique_ptr<HilInterface> hil_interface_;
64 };
65 }
66 
67 #endif // ROTORS_HIL_INTERFACE_NODE_H_
ros::Rate rate_
Object for spinning.
std::unique_ptr< HilInterface > hil_interface_
Pointer to the HIL interface object.
ros::Publisher actuators_pub_
ROS publisher for sending actuator commands.
void MainTask()
Main execution loop.
static constexpr double kDefaultBodyToSensorsRoll
static const std::string kDefaultMavlinkPubTopic
static constexpr bool kDefaultSensorLevelHil
static const std::string kDefaultHilControlsSubTopic
void HilControlsCallback(const mavros_msgs::HilControlsConstPtr &hil_controls_msg)
Callback for handling HilControls messages.
ros::Subscriber hil_controls_sub_
ROS subscriber for handling HilControls messages.
static constexpr double kDefaultBodyToSensorsYaw
static constexpr double kDefaultBodyToSensorsPitch
static constexpr double kDefaultHilFrequency
ros::NodeHandle nh_
ROS node handle.
ros::Publisher mavlink_pub_
ROS publisher for sending MAVLINK messages.


rotors_hil_interface
Author(s): Pavel Vechersky
autogenerated on Mon Feb 28 2022 23:39:15