Skip to content

A behaviour tree based flight control node. Specify the drone mission in an XML file, and start the node.

License

Notifications You must be signed in to change notification settings

slaghuis/flight_control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flight Control

A behaviour tree based flight control node referred to by the ROS2 navigation stack as a Waypoint Controller. The node uses a BehaviorTree.CPP library to specify the mission. Specify the drone mission in an XML file, and start the node.

The following behaviors have been implimented. Please note, thes behaviors all call services and actions from other nodes in this repo.

Simple Conditions

BatteryOK

Listens to battery status messages published by the flight controller to obtain the current battery voltage. Compares the voltage to that specified in a node parameter and returns true if the battery has more charge than the specified threshold.

Behavior tree Nodes

TakeoffDrone

Calls the Takeoff action server published by the drone_node, resulting in the drone flying to a set altitude. Tested: Flight ready

LandDrone

Calls the Land action server published by the drone_node, resulting in the drone landing at the current coordinates. Tested: Flight ready

TargetLandDrone

Calls the Land action server published by the lander_node, resulting in the drone landing on a set ArUco marker at the provided coordinates. Tested: No

MoveDrone

Calls the navigation server navigate to pose message to fly the drone avoiding obstacles along the way. Tested: Flight Ready

SaySomething

Prints a given message to the terminal. Great for debugging. Tested: Flight ready

GenerateFilename

Reads the current system date and time and generates a file name for use by the camera. The file name will be in the format YYMMDD_HHMM.jpg Tested: Flight ready

SavePicture

Saves the current image published by the camera node to camera/image to a file. Improvement: Add a second input to specify the path where the file must be saved. Tested: Flight ready

LoadMap

Calls the simple service of the map server to load a map, replacing the current map im memory. Improvement: Add a second input to specify the path where the file must) be saved. Tested: No

SaveMap

Saves the current map generated by the map server to disk. Improvement: Add a second input to specify the path where the file must be saved. Tested: Simulator ready

Installation

Clone this repo into the src directory of your ROS2 workspace. See the ros2 tutorial on how to create a workspace.

git clone https://github.com/slaghuis/flight_control.git

Back in the root of your ROS workspace, build and install the package.

colcon build --packages-select flight_control
. install/setup.bash
ros2 launch flight_control flight.launch.py

Code Status

This code has flown on a drone! The drone was controlled by a Pixhawk mini 4.0 controlled via a Raspberry Pi 4 4Gb companion computer via UART. This node instructed the navigation_lite stack, which in turn used the drone_mavsdk node to effect the movement.

About

A behaviour tree based flight control node. Specify the drone mission in an XML file, and start the node.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published