Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.

OUTPUT_DIRECTORY = doxygen
OUTPUT_DIRECTORY = docs

# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096
# sub-directories (in 2 levels) under the output directory of each output format
Expand Down
Binary file added Images/f710-gallery-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/img-bebop2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/tag_36h11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 RedwanNewaz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
131 changes: 122 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,137 @@
# Bebop2 Controller
@mainpage Parrot Bebop2 Drone with Joystick Controller README File


## Introduction

The Parrot Bebop 2 is a small, lightweight manufactured by Parrot, a French company specializing in consumer electronics. It is compact and lightweight, making it easy to transport and use on the go which makes it a popular choice
It's camera has a most impressive electronic image stabilization and with a top speed of 40 mph, this drone can really move. The Bebop 2 has a battery life of up to 25 minutes. <br>

This README file explains how to control the drone using a joystick and ROS drivers, add visual servoing capabilities, and scan for April Tags to find the drone's relative position.

-----------------------------------------

<img src="/Images/img-bebop2.jpg" alt="Parrot Bebop2 Drone" align="right" width="400" height="400">



## Quick Run

Connect your joystick to the computer.
Joystick buttons perform following operations:
**Hardware Setup**:
Connect your joystick to the computer. <br>


Before starting the program, the drone should be turned on and the computer connected to the drone WiFi.

> **Warning**
> It is strictly recommended to use protective equipments while testing the drone. <br>
If the drone needs to be shut down completely then we should flip the drone.


*Joystick buttons perform following operations*:

```angular2html
IDLE = 0, // setpoint can be freely moved with joystick. Sphere color blue
TAKEOFF = 1, // drone will takeoff from the ground
LAND = 2, //drone will land
ENGAGE = 3, // set current location as a set point (for hover). Sphere color yellow
CONTROL = 4 // start PID controller for the current (ENGAGE) setpoint. Sphere color cyan
IDLE = 0, // Setpoint can be freely moved with joystick. Sphere color blue

TAKEOFF = 1, // Drone will takeoff from the ground

LAND = 2, // Drone will land

ENGAGE = 3, // Set current location as a set point (for hover). Sphere color yellow

CONTROL = 4 // Start PID controller for the current (ENGAGE) setpoint. Sphere color cyan
```

Once control mode is enabled, setpoint can also be controlled using joystick axes.
Note that, only position controller is implemented.
Note that, only position controller is implemented from the analog sticks.
Orientation controller needs yaw angle which could be directly obtained from bebop odom.

------------------------------------------


## Software Setup:


-- **Installation of bebop_autonomy** from fork manually is required to send relative move commands to the drone. Check out [install bebop_autonomy from fork and build visp](http://wiki.ros.org/visp_ros/Tutorials/How%20to%20do%20visual%20servoing%20with%20Parrot%20Bebop%202%20drone%20and%20visp_ros). <br><br>
Bebop_autonomy is a ROS driver for Parrot Bebop 2.0 drones (quadrocopters), based on Parrot’s official ARDroneSDK3. You can check out [this source code](https://github.com/AutonomyLab/bebop_autonomy) for the driver is for more understanding.

---------------------------------------------


<img align="right" width="280" height="200" alt="Joystick Controller" src="/Images/f710-gallery-1.png">

## Operating the drone


The Parrot Bebop 2 Drone can be controlled from a PID Joystick Controller. The drone can be manuvered with the joytsick analog sticks.

The functions of the Four Action Buttons of the joystick is as follows:

// To be written down.

1. A ---> TAKE OFF (Green button)
2. B ---> LAND (Red Button)
3. X ---> IDLE (Blue Button)
4. Y ---> ENGAGE (Yellow Button)
5. L ---> CONTROL (Top Left Button)

---------------------------------------------

<img align="right" width="150" height="150" alt="AprilTag 36h11" src="/Images/tag_36h11.png">

## April Tags


AprilTag is a visual fiducial system, useful for a wide variety of tasks including augmented reality, robotics, and camera calibration.
Targets can be created from an ordinary printer, and the AprilTag detection software computes the precise 3D position, orientation, and identity of the tags relative to the camera. <br><br>

Using the built-in camera of the Parrot Bebop 2 Drone, it scans the tag and determines its relative postion from the tag. <br>


An April Tag from 36h11 family that will serve as target for the visual servoing (see [this page](https://visp-doc.inria.fr/doxygen/visp-daily/tutorial-franka-pbvs.html#franka_prereq_target) to print one).



---------------------------------------------

## Visualisation using Graphical Interface (RVIZ)

The Parrot Bebop 2 drone can be monitored and visualised using a graphical interface like rviz. <br>

**For RVIZ installtion** :-
```
sudo apt-get install ros-[ros-version]-rviz
```

For example:-
```
sudo apt-get install ros-noetic-rviz
```

To run rviz
```
rosrun rviz rviz

```

Check out http://wiki.ros.org/rviz/UserGuide for more information.

-----------------------------------------------

## Parameter Tuning

Refer to ``config/param.yaml`` file to read about tuning parameters.
Apriltags are used for landmarks and then
the drone position is estimated from those landmarks.
A complementary filter is implemented to compute state by combining multiple landmarks.

------------------------------------------------

## Steps to use the bebop2_controller Launch Files

1. **To use Dummy Filter** : ``` roslaunch bebop_controller bebop_frames_dummy.launch ```
2. **To use Complementary Filter** : ``` roslaunch bebop_controller bebop_complementary_filter.launch ```
3. **To run the apriltag_ros_continuous_node** : ``` roslaunch bebop2_controller apriltag.launch ```

Step 1. Press the A button on the Joystick Controller to take-off. <br>
Step 2. Press the left-bottom (LB) button to engage Controller. <br>
Step 3. Use the joystick axis to control the set-point
9 changes: 8 additions & 1 deletion airlib/control/LQR/LQR.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,16 @@
#define DEBUG(x) std::cout << x << std::endl

namespace bebop2 {

/**
* @brief The LQR is an optimal control regulator that better tracks a reference trajectory.
*
* It predicts future states of the drone at every time step in order to minimize a global criterion/cost function. By estimating future states
* based on past outputs, we are able to better regulate offset in tracking.
* The LQR algorithm is essentially an automated way of finding an appropriate state-feedback controller.
*/
class LQR {
public:
/// @brief A default constructor for LQR.
LQR();

private:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.6"/>
<meta name="generator" content="Doxygen 1.9.7"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>airlib: Class Members - Enumerator</title>
<title>airlib: airlib/localization/Sensors/ApriltagLandmarks.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
Expand All @@ -29,7 +29,7 @@
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.6 -->
<!-- Generated by Doxygen 1.9.7 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
Expand All @@ -46,7 +46,6 @@
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
Expand All @@ -68,18 +67,22 @@
</div>
</div>

<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_2ea520229c6ada27f137f02e0c0cfbe6.html">airlib</a></li><li class="navelem"><a class="el" href="dir_26bf0296f6dbe0e6ecc0a36a5bb208c2.html">localization</a></li><li class="navelem"><a class="el" href="dir_0b09c446dd7a9edef411ea7168ce1167.html">Sensors</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">ApriltagLandmarks.cpp File Reference</div></div>
</div><!--header-->
<div class="contents">
&#160;<ul>
<li>CONTROL&#160;:&#160;<a class="el" href="classbebop2_1_1_controller_base.html#a76352e69566212036f3d7207ce4b6cc0a9e134b87d5f808d52d03c5f982da417a">bebop2::ControllerBase</a></li>
<li>ENGAGE&#160;:&#160;<a class="el" href="classbebop2_1_1_controller_base.html#a76352e69566212036f3d7207ce4b6cc0aa78035010c11ea80cefb7f54823d5083">bebop2::ControllerBase</a></li>
<li>IDLE&#160;:&#160;<a class="el" href="classbebop2_1_1_controller_base.html#a76352e69566212036f3d7207ce4b6cc0a2eb4f2f58d711bb2fc7cf6443830e41b">bebop2::ControllerBase</a></li>
<li>LAND&#160;:&#160;<a class="el" href="classbebop2_1_1_controller_base.html#a76352e69566212036f3d7207ce4b6cc0a8b7d2a81407259ab3721dfc2e6827b97">bebop2::ControllerBase</a></li>
<li>TAKEOFF&#160;:&#160;<a class="el" href="classbebop2_1_1_controller_base.html#a76352e69566212036f3d7207ce4b6cc0a034f3ebd64c6dedc4232ea246cb82f0a">bebop2::ControllerBase</a></li>
</ul>
<div class="textblock"><code>#include &quot;<a class="el" href="ApriltagLandmarks_8h_source.html">airlib/localization/Sensors/ApriltagLandmarks.h</a>&quot;</code><br />
</div>
<p><a href="ApriltagLandmarks_8cpp_source.html">Go to the source code of this file.</a></p>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.7
</small></address>
</body>
</html>
Loading