Commit a9fc5f01 authored by jad's avatar jad

seq Tested

parent 658c5f59
# TESTING
-Testing disable activation (Done, Activation will be removed)
-Testing detecting doors using optical flow (Done, works very well !!)
-Testing the Turning to a specified angle (Done, it works)
# Semi-Autonomous Drone Pilot
This ROS package is for a semi-autonomous drone pilot for the Parrot Bebop 2 using image processing (OpenCV) and unsupervised machine learning (Clustering).
## Quick Intro
This project has 2 parts, the first one is some nodes to ensure the navigation of the drone in constant velocities on the X,Y and Z axis since the Twist command provided by ROS is not a velocity but an acceleration.
The Second part is built on the first one and it some nodes doing image processing and sending necessary data to the other nodes in order to navigate the drone in the middle of A hallway.
## NOTE:
The First part is totaly isolated from the second one and can be used on any Parrot Bebop Drone.
In this File , you can see how to use the first one, the second one is coming soon
This project has many parts,The first one is moving the drone at a constant velocity.
The Second part is built on the first one , is used move the drone inside a hallway.
The third part, is used to detect openned doors.
## Moving The Drone
## Use This Package
First Clone this repo in your catkin workspace
```
$ git clone https://gitlab.centralesupelec.fr/obeid_jad/dorne_project.git drone_project
......@@ -26,40 +17,81 @@ Build your workspace
```
$ catkin build
```
To use this feature you need to launch the VelLaunch.launch
## Moving Drone
To do this you need to launch the VelLaunch.launch
```
$ roslaunch drone_project VelLaunch.launch
```
First start with sending a reset command to this modules by sending any integer to the topics ```/reset_cmd_x```,```/reset_cmd_y``` and ```/reset_cmd_z```.
And then publish to ```/vel_in_x``` , ``` /vel_in_y``` and ```/vel_in_z``` the velocities you want the drone to move with.
(Recommanded)
The frequency of sending data to the drone is equal to 5Hz.
Wait for receiving the acknoledge from the drone , on the topics ```/ack_res_x``` , ```/ack_res_y``` and ```/ack_res_z```. Once the reset is done you will receive ```1``` on these 3 topics.
### Example Moving at constant Velocity:
The ``` move_tester_test.py ``` file is an example of moving with a constant velocity.
And then publish to ```/vel_in_x``` , ``` /vel_in_y``` and ```/vel_in_z``` the velocities you want the drone to move with.
## Using The Interface
To run the other parts of the project, you need to launch the file ```Sequencer.launch```.
```
$ roslaunch drone_project Sequencer.launch
```
You will get an interface, that will let you choose the mode you want, you can click on Doors, to find opened doors and pass through them, or Hallway to launch the autonomous navigation in the Hallways.
Note that the rate of sending data to the drone is equal to the fastest rate between the 3 ``` /vel_in ``` topics.
## Some Useful Nodes
### Example:
The ``` move_tester.py ``` file is an example of moving with a constant velocity.
The ``` turn_to_angle.py ``` file is an example of defining a specific angle and moving the drone to this angle.
### Activation and Deactivation
To activate or deactivate a node, you need to send an activation to the topic ```/activations```, The activation command is a ```<nodeName>_1``` to activate and ```<nodeName>_0``` to deactivate.
Note that sending ```reset``` will deactivate all nodes.
## Indoor navigation
### Hallways navigation
Soon ...
### Distance Estimation using camera
This project contains a node able to estimate distances of moving objects using dense optical flow with the "Gunnar Farneback" algorithm.
nodeName = checkDoors
To use this module you can just run the ```testDenseOpticalFlow.py``` node :
```
$ rosrun drone_project testDenseOpticalFlow.py
```
and to view the histogram showing distances, run the rqt_image_view and choose the topic ```/image_graph```
And to view the histogram showing distances, run the rqt_image_view and choose the topic ```/image_graph```
```
$ rqt_image_view
```
Whenever an opened door is detected, this node will publish ```1```, to the topic ```/door_det ```.
### Vanishing point detection
This project contains a node able to detect the vanishing point in a Hallway using DBSCAN clustering algorithm.
nodeName = detectVanish
To use this you need to run the ```image_proc.py``` node :
```
$ rosrun drone_project image_proc.py
```
This node will publish the x of this point to the topic ```/centroids```.
### Turn to a specified angle
This project contains a node able to turn the drone to a specific angle.
nodeName = turnAng
To use this you need to run the ```turnAng.py``` node :
```
$ rosrun drone_project turnAng.py
```
If you run this node directly, the drone will move to 90 degrees.
If not, publish the desired angle in degrees to the topic ```/ang_in```.
This node will print out in the terminal whenever an opened door is detected and it will specify where is the door on the image
\ No newline at end of file
......@@ -12,8 +12,8 @@ from std_msgs.msg import Float32
class XCommand(RegulatorClass):
def __init__(self):
#super(XCommand,self).__init__(0.7,0.03,0.6)
super(XCommand,self).__init__(0.8,0.0,0.7)
super(XCommand,self).__init__(0.7,0.03,0.6)
#super(XCommand,self).__init__(0.8,0.0,0.7)
self.deb = rospy.Publisher("/deb_x",Float32,queue_size=1)
def read_val(self,ros_data):
twist = ros_data.twist.twist
......
......@@ -24,7 +24,7 @@ from activation_class import NodeActivate
class image_convert(NodeActivate):
def __init__(self):
super(image_convert,self).__init__("detect_vanish")
super(image_convert,self).__init__("detectVanish")
self.pub = rospy.Publisher("/centroids", Float32, queue_size=1)
self.pubDiff = rospy.Publisher('/sDiffs',Float32,queue_size=1)
self.pubForBag = rospy.Publisher('/imgForBag/front/compressed', CompressedImage, queue_size=1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment