Skip to content

Commit 6eaa00f

Browse files
committed
First release of DroneEmployee stack.
Added air traffic controller & planner. Added simple implementation of drone employee.
1 parent d302471 commit 6eaa00f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1773
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.pyc

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
1-
# drone_employee_ros
2-
DroneEmployee ROS stack
1+
# DroneEmployee ROS stack
2+
3+
This repository contains ROS packages for **DroneEmployee** project.
4+
5+
Repository structure:
6+
7+
* **drone_employee** - quadrotor behaviour
8+
* **small_atc** - small air traffic controller
9+
* **small_atc_msgs** - ATC common messages

drone_employee/CMakeLists.txt

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
cmake_minimum_required(VERSION 2.8.3)
2+
project(drone_employee)
3+
4+
## Find catkin macros and libraries
5+
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
6+
## is used, also find other catkin packages
7+
find_package(catkin REQUIRED COMPONENTS
8+
rospy
9+
mavros_msgs
10+
small_atc_msgs
11+
)
12+
13+
## System dependencies are found with CMake's conventions
14+
# find_package(Boost REQUIRED COMPONENTS system)
15+
16+
17+
## Uncomment this if the package has a setup.py. This macro ensures
18+
## modules and global scripts declared therein get installed
19+
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
20+
# catkin_python_setup()
21+
22+
################################################
23+
## Declare ROS messages, services and actions ##
24+
################################################
25+
26+
## To declare and build messages, services or actions from within this
27+
## package, follow these steps:
28+
## * Let MSG_DEP_SET be the set of packages whose message types you use in
29+
## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
30+
## * In the file package.xml:
31+
## * add a build_depend tag for "message_generation"
32+
## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET
33+
## * If MSG_DEP_SET isn't empty the following dependency has been pulled in
34+
## but can be declared for certainty nonetheless:
35+
## * add a run_depend tag for "message_runtime"
36+
## * In this file (CMakeLists.txt):
37+
## * add "message_generation" and every package in MSG_DEP_SET to
38+
## find_package(catkin REQUIRED COMPONENTS ...)
39+
## * add "message_runtime" and every package in MSG_DEP_SET to
40+
## catkin_package(CATKIN_DEPENDS ...)
41+
## * uncomment the add_*_files sections below as needed
42+
## and list every .msg/.srv/.action file to be processed
43+
## * uncomment the generate_messages entry below
44+
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)
45+
46+
################################################
47+
## Declare ROS dynamic reconfigure parameters ##
48+
################################################
49+
50+
## To declare and build dynamic reconfigure parameters within this
51+
## package, follow these steps:
52+
## * In the file package.xml:
53+
## * add a build_depend and a run_depend tag for "dynamic_reconfigure"
54+
## * In this file (CMakeLists.txt):
55+
## * add "dynamic_reconfigure" to
56+
## find_package(catkin REQUIRED COMPONENTS ...)
57+
## * uncomment the "generate_dynamic_reconfigure_options" section below
58+
## and list every .cfg file to be processed
59+
60+
## Generate dynamic reconfigure parameters in the 'cfg' folder
61+
# generate_dynamic_reconfigure_options(
62+
# cfg/DynReconf1.cfg
63+
# cfg/DynReconf2.cfg
64+
# )
65+
66+
###################################
67+
## catkin specific configuration ##
68+
###################################
69+
## The catkin_package macro generates cmake config files for your package
70+
## Declare things to be passed to dependent projects
71+
## INCLUDE_DIRS: uncomment this if you package contains header files
72+
## LIBRARIES: libraries you create in this project that dependent projects also need
73+
## CATKIN_DEPENDS: catkin_packages dependent projects also need
74+
## DEPENDS: system dependencies of this project that dependent projects also need
75+
catkin_package(
76+
# INCLUDE_DIRS include
77+
# LIBRARIES dron_employee_ros
78+
# CATKIN_DEPENDS std_msgs
79+
# DEPENDS system_lib
80+
CATKIN_DEPENDS message_runtime small_atc_msgs mavros_msgs
81+
)
82+
83+
###########
84+
## Build ##
85+
###########
86+
87+
## Specify additional locations of header files
88+
## Your package locations should be listed before other locations
89+
# include_directories(include)
90+
include_directories(
91+
${catkin_INCLUDE_DIRS}
92+
)
93+
94+
## Declare a C++ library
95+
# add_library(dron_employee_ros
96+
# src/${PROJECT_NAME}/dron_employee_ros.cpp
97+
# )
98+
99+
## Add cmake target dependencies of the library
100+
## as an example, code may need to be generated before libraries
101+
## either from message generation or dynamic reconfigure
102+
# add_dependencies(dron_employee_ros ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
103+
104+
## Declare a C++ executable
105+
# add_executable(dron_employee_ros_node src/dron_employee_ros_node.cpp)
106+
107+
## Add cmake target dependencies of the executable
108+
## same as for the library above
109+
# add_dependencies(dron_employee_ros_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
110+
111+
## Specify libraries to link a library or executable target against
112+
# target_link_libraries(dron_employee_ros_node
113+
# ${catkin_LIBRARIES}
114+
# )
115+
116+
#############
117+
## Install ##
118+
#############
119+
120+
# all install targets should use catkin DESTINATION variables
121+
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
122+
123+
## Mark executable scripts (Python etc.) for installation
124+
## in contrast to setup.py, you can choose the destination
125+
# install(PROGRAMS
126+
# scripts/my_python_script
127+
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
128+
# )
129+
130+
## Mark executables and/or libraries for installation
131+
# install(TARGETS dron_employee_ros dron_employee_ros_node
132+
# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
133+
# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
134+
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
135+
# )
136+
137+
## Mark cpp header files for installation
138+
# install(DIRECTORY include/${PROJECT_NAME}/
139+
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
140+
# FILES_MATCHING PATTERN "*.h"
141+
# PATTERN ".svn" EXCLUDE
142+
# )
143+
144+
#############
145+
## Testing ##
146+
#############
147+
148+
## Add gtest based cpp test target and link libraries
149+
# catkin_add_gtest(${PROJECT_NAME}-test test/test_dron_employee_ros.cpp)
150+
# if(TARGET ${PROJECT_NAME}-test)
151+
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
152+
# endif()
153+
154+
## Add folders to be run by python nosetests
155+
# catkin_add_nosetests(test)

drone_employee/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Drone employee behaviour ROS package
2+
3+
## Draft of ROS interface
4+
5+
### Publish
6+
7+
* `/ready` :: **std_msgs/bool** - dron is ready to start
8+
* `/wifi` :: **drone_employee/Wireless** - WiFi ESSID and password for client connection
9+
* `/video` :: **std_msgs/string** - link to recorded video
10+
11+
### Subscribe
12+
13+
* `/target` :: **drone_employee/Target** - client position and roadmap
14+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<launch>
3+
<arg name="ident" default="1" />
4+
<arg name="fcu_url" default="udp://localhost:1455$(arg ident)@" />
5+
<arg name="gcs_url" default="" />
6+
<arg name="tgt_system" default="1" />
7+
<arg name="tgt_component" default="1" />
8+
<arg name="log_output" default="log" />
9+
10+
<group ns="dron_$(arg ident)">
11+
<include file="$(find mavros)/launch/node.launch">
12+
<arg name="pluginlists_yaml" value="$(find mavros)/launch/apm_pluginlists.yaml" />
13+
<arg name="config_yaml" value="$(find mavros)/launch/apm_config.yaml" />
14+
15+
<arg name="fcu_url" value="$(arg fcu_url)" />
16+
<arg name="gcs_url" value="$(arg gcs_url)" />
17+
<arg name="tgt_system" value="$(arg tgt_system)" />
18+
<arg name="tgt_component" value="$(arg tgt_component)" />
19+
<arg name="log_output" value="$(arg log_output)" />
20+
</include>
21+
22+
<include file="$(find drone_employee)/launch/controller.launch" />
23+
<include file="$(find rosbridge_server)/launch/rosbridge_websocket.launch">
24+
<arg name="port" value="909$(arg ident)"/>
25+
</include>
26+
</group>
27+
</launch>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<launch>
3+
<node name="state" pkg="drone_employee" type="state_publisher.py" />
4+
<node name="controller" pkg="drone_employee" type="quad_controller.py" />
5+
</launch>

drone_employee/msg/Target.msg

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Drone target information
2+
#
3+
# Message contains client position and roadmap.
4+
5+
# The client to tracking position
6+
SatFix client
7+
# Otherwise client isn't available for tracking use roadmap
8+
SatFix[] roadmap

drone_employee/msg/Wireless.msg

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Drone wireless parameters.
2+
#
3+
#
4+
5+
# Wireless ESSID parameter
6+
string essid
7+
# Wireless password
8+
string password

drone_employee/package.xml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?xml version="1.0"?>
2+
<package>
3+
<name>drone_employee</name>
4+
<version>0.1.0</version>
5+
<description>The DroneEmployee ROS package</description>
6+
7+
<!-- One maintainer tag required, multiple allowed, one person per tag -->
8+
<!-- Example: -->
9+
<!-- <maintainer email="jane.doe@example.com">Jane Doe</maintainer> -->
10+
<maintainer email="mail@akru.me">Alexander Krupenkin</maintainer>
11+
12+
13+
<!-- One license tag required, multiple allowed, one license per tag -->
14+
<!-- Commonly used license strings: -->
15+
<!-- BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->
16+
<license>GPLv3</license>
17+
18+
19+
<!-- Url tags are optional, but mutiple are allowed, one per tag -->
20+
<!-- Optional attribute type can be: website, bugtracker, or repository -->
21+
<!-- Example: -->
22+
<!-- <url type="website">http://wiki.ros.org/dron_employee_ros</url> -->
23+
24+
25+
<!-- Author tags are optional, mutiple are allowed, one per tag -->
26+
<!-- Authors do not have to be maintianers, but could be -->
27+
<!-- Example: -->
28+
<!-- <author email="jane.doe@example.com">Jane Doe</author> -->
29+
30+
31+
<!-- The *_depend tags are used to specify dependencies -->
32+
<!-- Dependencies can be catkin packages or system dependencies -->
33+
<!-- Examples: -->
34+
<!-- Use build_depend for packages you need at compile time: -->
35+
<!-- <build_depend>message_generation</build_depend> -->
36+
<!-- Use buildtool_depend for build tool packages: -->
37+
<!-- <buildtool_depend>catkin</buildtool_depend> -->
38+
<!-- Use run_depend for packages you need at runtime: -->
39+
<!-- <run_depend>message_runtime</run_depend> -->
40+
<!-- Use test_depend for packages you need only for testing: -->
41+
<!-- <test_depend>gtest</test_depend> -->
42+
<buildtool_depend>catkin</buildtool_depend>
43+
<build_depend>small_atc_msgs</build_depend>
44+
<build_depend>sensor_msgs</build_depend>
45+
<build_depend>mavros_msgs</build_depend>
46+
<build_depend>rospy</build_depend>
47+
<run_depend>message_runtime</run_depend>
48+
<run_depend>small_atc_msgs</run_depend>
49+
<run_depend>mavros_msgs</run_depend>
50+
<run_depend>rospy</run_depend>
51+
52+
53+
<!-- The export tag contains other, unspecified, tags -->
54+
<export>
55+
<!-- Other tools can request additional information be placed here -->
56+
57+
</export>
58+
</package>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from mavros_msgs.msg import Waypoint, CommandCode
2+
3+
def waypoint(lat, lon, alt, delay):
4+
w = Waypoint()
5+
w.frame = Waypoint.FRAME_GLOBAL
6+
w.command = CommandCode.NAV_WAYPOINT
7+
w.is_current = False
8+
w.autocontinue = True
9+
w.param1 = delay # Hold time in mession
10+
w.param2 = 2 # Position trashold in meters
11+
w.x_lat = lat
12+
w.y_long = lon
13+
w.z_alt = alt
14+
return w
15+
16+
def rtl():
17+
w = Waypoint()
18+
w.command = CommandCode.NAV_RETURN_TO_LAUNCH
19+
return w
20+
21+
def waypointWrap(pointList):
22+
wps = [waypoint(p.latitude, p.longitude, p.altitude, 10) for p in pointList]
23+
wps.append(rtl())
24+
return wps

0 commit comments

Comments
 (0)