5 #include <parsernode/parser.h>
6 #include <pluginlib/class_loader.h>
12 #include "uav_system_handler_config.pb.h"
22 template <
class LogicStateMachineT,
class EventManagerT>
31 : nh_uav_(
"~uav"), parser_loader_(
"parsernode",
"parsernode::Parser"),
33 parser_loader_.createUnmanagedInstance(config.uav_parser_type())),
34 uav_system_(*uav_hardware_, config.uav_system_config()),
35 common_handler_(config.base_config(), uav_system_),
36 uav_controller_timer_(
37 std::bind(&
UAVSystem::runActiveController, std::ref(uav_system_),
39 std::chrono::milliseconds(config.uav_controller_timer_duration())) {
41 uav_hardware_->initialize(nh_uav_);
45 uav_controller_timer_.
start();
58 parsernode::common::quaddata quad_data;
59 uav_hardware_->getquaddata(quad_data);
72 ros::NodeHandle nh_uav_;
73 pluginlib::ClassLoader<parsernode::Parser>
75 std::unique_ptr<parsernode::Parser> uav_hardware_;
bool isConnected()
Forward common handler connected function for testing is GUI is connected to this node or not...
Definition: uav_system_handler.h:69
void start()
Starts running the timer thread.
Definition: async_timer.cpp:16
parsernode::common::quaddata getUAVData()
Get UAV state.
Definition: uav_system_handler.h:57
Owns, initializes, and facilitates communication between different hardware/software components...
Definition: uav_system.h:21
void startTimers()
Start state machine internal event processing and status timer.
Definition: common_system_handler.h:70
Calls given function on a timer in its own thread.
Definition: async_timer.h:11
Owns all of the autonomous system components and is responsible for thread management. Also owns a common system handler object to handle creation of state machine and connecting it to GUI.
Definition: uav_system_handler.h:23
bool isConnected()
Checks if internal ROS topics are connected.
Definition: common_system_handler.h:62
UAVSystemHandler(UAVSystemHandlerConfig &config)
Constructor.
Definition: uav_system_handler.h:30
HardwareType
Type of hardware used by ControllerHardwareConnector. Enum ID must be contiguous. ...
Definition: base_controller_hardware_connector.h:11